 |
|
 |
 |
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CSegRemanenceShape Class ReferenceShape for the remanence of a segment (sword stroke ..).
More...
#include <seg_remanence_shape.h>
Inheritance diagram for NL3D::CSegRemanenceShape:
List of all members.
Public Methods |
| void | setMaterial (const CMaterial &mat) |
| | Set material. More...
|
| const CMaterial & | getMaterial () const |
| | Get material. More...
|
| void | setNumSlices (uint32 numSlices) |
| | Set the number of slices used to draw the remanence Should be >= 2. More...
|
| uint32 | getNumSlices () const |
| float | getSliceTime () const |
| void | setSliceTime (float sliceTime) |
| void | setNumCorners (uint numCorners) |
| | Set the number of corners. More...
|
| uint32 | getNumCorners () const |
| void | setCorner (uint corner, const NLMISC::CVector &value) |
| NLMISC::CVector | getCorner (uint corner) const |
| void | setBBox (const NLMISC::CAABBox &bbox) |
| | Set this shape bounding box NB: ideally the bbox should be computed per model, but practically, a fixed bbox suffice. More...
|
| void | setTextureShifting (bool on=true) |
| | Enable texture shifting on the u coordinates at the start of the animation, so that the texture will 'unroll' until it is completly visible NB this apply on all texture stages, and clamps the U coordinates. More...
|
| bool | getTextureShifting () const |
| | Test whether there is texture shifting at the start of the animation. More...
|
| virtual void | getAABBox (NLMISC::CAABBox &bbox) const |
| | from IShape. More...
|
| void | setAnimatedMaterial (const std::string &name) |
| | Force animated material. This can be called only once. More...
|
| CMaterialBase * | getAnimatedMaterial () const |
| | Get animated material or NULL if none. More...
|
| void | setRollupRatio (float ratio) |
| | When stop() is called, the fx doesn't disappear, it must rollup (a texture shifting is performed). More...
|
| float | getRollupRatio () const |
|
| | CSegRemanenceShape () |
| | default ctor : a seg from (0, 0, 0) to (0, 0, 1) A default bbox is set (from (-3, -3, -3) to (3, 3, 3)). More...
|
| | ~CSegRemanenceShape () |
| | CSegRemanenceShape (const CSegRemanenceShape &other) |
| CSegRemanenceShape & | operator= (const CSegRemanenceShape &other) |
| virtual void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
| | NLMISC_DECLARE_CLASS (CSegRemanenceShape) |
Protected Methods |
|
| virtual void | render (IDriver *drv, CTransformShape *trans, bool opaquePass) |
| | render() this shape in a driver, with the specified TransformShape information. More...
|
| virtual void | flushTextures (IDriver &driver) |
| | flush textures used by this shape. More...
|
| virtual CTransformShape * | createInstance (CScene &scene) |
| | create an instance of this shape. More...
|
| virtual float | getNumTriangles (float distance) |
| | get an approximation of the number of triangles this instance will render for a fixed distance. More...
|
Private Types |
| typedef std::vector< CVector > | TCornerVect |
Private Methods |
| void | setupVBnPB () |
| void | setupMaterial () |
| void | copyFromOther (const CSegRemanenceShape &other) |
Private Attributes |
| bool | _GeomTouched |
| bool | _MatTouched |
| bool | _TextureShifting |
| uint32 | _NumSlices |
| float | _SliceTime |
| float | _RollUpRatio |
| TCornerVect | _Corners |
| CMaterial | _Mat |
| CVertexBuffer | _VB |
| CPrimitiveBlock | _PB |
| NLMISC::CAABBox | _BBox |
| CMaterialBase * | _AnimatedMat |
Detailed Description
Shape for the remanence of a segment (sword stroke ..).
NB this doesn't support texture animation (used for enrolling)
-
Author:
-
Nicolas Vizerie , Nevrax France
-
Date:
-
2002
Definition at line 65 of file seg_remanence_shape.h.
Member Typedef Documentation
typedef std::vector<CVector> NL3D::CSegRemanenceShape::TCornerVect [private]
|
|
Constructor & Destructor Documentation
| NL3D::CSegRemanenceShape::CSegRemanenceShape |
( |
|
) |
|
|
|
|
default ctor : a seg from (0, 0, 0) to (0, 0, 1) A default bbox is set (from (-3, -3, -3) to (3, 3, 3)).
Definition at line 40 of file seg_remanence_shape.cpp.
References _BBox, NLMISC::CVector::Null, NLMISC::CAABBox::setCenter, NLMISC::CAABBox::setHalfSize, and setNumCorners. |
| NL3D::CSegRemanenceShape::~CSegRemanenceShape |
( |
|
) |
|
|
| NL3D::CSegRemanenceShape::CSegRemanenceShape |
( |
const CSegRemanenceShape & |
other |
) |
|
|
Member Function Documentation
| void NL3D::CSegRemanenceShape::copyFromOther |
( |
const CSegRemanenceShape & |
other |
) |
[private] |
|
|
|
Definition at line 270 of file seg_remanence_shape.cpp.
References _AnimatedMat, _BBox, _Corners, _GeomTouched, _Mat, _MatTouched, _NumSlices, _PB, _RollUpRatio, _SliceTime, _TextureShifting, and _VB.
Referenced by CSegRemanenceShape, and operator=. |
|
|
create an instance of this shape.
The instance may be a CTransformShape, or a specialized version of it. The default behavior is to createModel() a CTransformShape, and just assign to it the Shape. -
Parameters:
-
| scene |
the scene used to createModel(). |
-
Returns:
-
the specialized instance for this shape.
Reimplemented from NL3D::IShape.
Definition at line 139 of file seg_remanence_shape.cpp.
References _AnimatedMat, and _Mat. |
| void NL3D::CSegRemanenceShape::flushTextures |
( |
IDriver & |
driver |
) |
[protected, virtual] |
|
| virtual void NL3D::CSegRemanenceShape::getAABBox |
( |
NLMISC::CAABBox & |
bbox |
) |
const [inline, virtual] |
|
| CMaterialBase* NL3D::CSegRemanenceShape::getAnimatedMaterial |
( |
|
) |
const [inline] |
|
| const CMaterial& NL3D::CSegRemanenceShape::getMaterial |
( |
|
) |
const [inline] |
|
| uint32 NL3D::CSegRemanenceShape::getNumCorners |
( |
|
) |
const [inline] |
|
| uint32 NL3D::CSegRemanenceShape::getNumSlices |
( |
|
) |
const [inline] |
|
| float NL3D::CSegRemanenceShape::getNumTriangles |
( |
float |
distance |
) |
[protected, virtual] |
|
| float NL3D::CSegRemanenceShape::getRollupRatio |
( |
|
) |
const [inline] |
|
| float NL3D::CSegRemanenceShape::getSliceTime |
( |
|
) |
const [inline] |
|
| bool NL3D::CSegRemanenceShape::getTextureShifting |
( |
|
) |
const [inline] |
|
| NL3D::CSegRemanenceShape::NLMISC_DECLARE_CLASS |
( |
CSegRemanenceShape |
|
) |
|
|
| CSegRemanenceShape & NL3D::CSegRemanenceShape::operator= |
( |
const CSegRemanenceShape & |
other |
) |
|
|
| void NL3D::CSegRemanenceShape::render |
( |
IDriver * |
drv, |
|
|
CTransformShape * |
trans, |
|
|
bool |
opaquePass |
|
) |
[protected, virtual] |
|
| void NL3D::CSegRemanenceShape::setAnimatedMaterial |
( |
const std::string & |
name |
) |
|
|
|
|
Set this shape bounding box NB: ideally the bbox should be computed per model, but practically, a fixed bbox suffice.
Definition at line 198 of file seg_remanence_shape.cpp.
References _BBox. |
| void NL3D::CSegRemanenceShape::setMaterial |
( |
const CMaterial & |
mat |
) |
|
|
| void NL3D::CSegRemanenceShape::setNumCorners |
( |
uint |
numCorners |
) |
|
|
| void NL3D::CSegRemanenceShape::setNumSlices |
( |
uint32 |
numSlices |
) |
|
|
| void NL3D::CSegRemanenceShape::setRollupRatio |
( |
float |
ratio |
) |
|
|
|
|
When stop() is called, the fx doesn't disappear, it must rollup (a texture shifting is performed).
This set the speed of rollup. 1 means it takes sliceTime * numSlice to unroll 0.5 means it takes 2 * sliceTime * numSlice to unroll and so on NB ratio must be > 0
Definition at line 218 of file seg_remanence_shape.cpp.
References _RollUpRatio, and nlassert. |
| void NL3D::CSegRemanenceShape::setSliceTime |
( |
float |
sliceTime |
) |
|
|
| void NL3D::CSegRemanenceShape::setTextureShifting |
( |
bool |
on = true |
) |
|
|
|
|
Enable texture shifting on the u coordinates at the start of the animation, so that the texture will 'unroll' until it is completly visible NB this apply on all texture stages, and clamps the U coordinates.
NB the default is on
Definition at line 211 of file seg_remanence_shape.cpp.
References _MatTouched, and _TextureShifting. |
| void NL3D::CSegRemanenceShape::setupMaterial |
( |
|
) |
[private] |
|
| void NL3D::CSegRemanenceShape::setupVBnPB |
( |
|
) |
[private] |
|
Member Data Documentation
TCornerVect NL3D::CSegRemanenceShape::_Corners [private]
|
|
bool NL3D::CSegRemanenceShape::_GeomTouched [private]
|
|
CMaterial NL3D::CSegRemanenceShape::_Mat [private]
|
|
bool NL3D::CSegRemanenceShape::_MatTouched [private]
|
|
uint32 NL3D::CSegRemanenceShape::_NumSlices [private]
|
|
float NL3D::CSegRemanenceShape::_RollUpRatio [private]
|
|
float NL3D::CSegRemanenceShape::_SliceTime [private]
|
|
bool NL3D::CSegRemanenceShape::_TextureShifting [private]
|
|
The documentation for this class was generated from the following files:
|
 |