|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CPSConstraintMesh Class ReferenceThis class is for mesh that have very simple geometry.
More...
#include <ps_mesh.h>
Inheritance diagram for NL3D::CPSConstraintMesh:
List of all members.
[NOHEADER] |
enum | TTexAnimType { NoAnim = 0,
GlobalAnim,
Last
} |
| The type of animation that is used with meshs textures. More...
|
void | setTexAnimType (TTexAnimType type) |
| Set the type of texture animation to use. None is the default. Setting a new value discard the previous change. More...
|
TTexAnimType | getTexAnimType () const |
| Get the the type of texture animation. More...
|
Public Types |
Public Methods |
| CPSConstraintMesh () |
| ctor. More...
|
virtual | ~CPSConstraintMesh () |
void | setShape (const std::string &meshFileName) |
| Construct the mesh by using the given mesh shape file. More...
|
std::string | getShape (void) const |
| Get the shape used for those particles. (must use no morphing or an assertion is raised). More...
|
void | setShapes (const std::string *shapesNames, uint numShapes) |
| Setup the mesh for morphing use. More...
|
void | setShape (uint index, const std::string &shapeName) |
| Set a shape by its index. More...
|
const std::string & | getShape (uint index) const |
| Get a shape name by its index. More...
|
uint | getNumShapes () const |
| Get the number of shapes used. More...
|
void | getShapesNames (std::string *shapesNames) const |
| Retrieve the names of the shapes. More...
|
void | setMorphValue (float value) |
| Use a constant value for morphing. This discard any scheme for the morph value. The value must range from 0 to numberOfShapes. More...
|
float | getMorphValue () const |
| Get the value used for morphing. More...
|
void | setMorphScheme (CPSAttribMaker< float > *scheme) |
| Set a morphing scheme. The scheme is then owned by this object. More...
|
CPSAttribMaker< float > * | getMorphScheme () |
| Get the current morphing scheme or NULL if no one was set. More...
|
const CPSAttribMaker< float > * | getMorphScheme () const |
| Get the current morphing scheme or NULL if no one was set. Const version. More...
|
void | hintRotateTheSame (uint32 nbConfiguration, float minAngularVelocity=NLMISC::Pi, float maxAngularVelocity=NLMISC::Pi) |
| Tells that all meshs are turning in the same manner, and only have a rotationnal bias This is a lot faster then other method. More...
|
void | disableHintRotateTheSame (void) |
| disable the hint 'hintRotateTheSame' The previous set scheme for roation is used. More...
|
uint32 | checkHintRotateTheSame (float &min, float &max) const |
| check wether a call to hintRotateTheSame was performed. More...
|
virtual void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
| serialisation. Derivers must override this, and call their parent version. More...
|
| NLMISC_DECLARE_CLASS (CPSConstraintMesh) |
virtual bool | hasTransparentFaces (void) |
| return true if there are transparent faces in the object. More...
|
virtual bool | hasOpaqueFaces (void) |
| return true if there are Opaque faces in the object. More...
|
virtual uint32 | getMaxNumFaces (void) const |
| return the max number of faces needed for display. This is needed for LOD balancing. More...
|
void | forceStageModulationByColor (uint stage, bool force) |
| Force the n-th stage of all material to be modulated by the mesh color. More...
|
bool | isStageModulationForced (uint stage) const |
| Test if the i-th stage of all materials is forced to be modulated with the mesh color. More...
|
void | forceVertexColorLighting (bool force=true) |
| force all material to use vertex color lighting. More...
|
bool | isVertexColorLightingForced () const |
| test wether vertex color lighting is forced. More...
|
|
void | setGlobalTexAnim (uint stage, const CGlobalTexAnim &properties) |
| Set the properties of texture animation for a texture stage. Global animation should have been activated. More...
|
const CGlobalTexAnim & | getGlobalTexAnim (uint stage) const |
| Get the properties of texture animation.Global animation should have been activated. More...
|
void | forceGlobalAnimTimeResetOnNewElement (bool force=true) |
| Force the time counter for global anim to be reseted when a new mesh is created. More...
|
bool | isGlobalAnimTimeResetOnNewElementForced () const |
Static Public Methods |
void | initPrerotVB () |
| Setup the buffers used with prerotated meshs. Must be called during initialization. More...
|
Protected Types |
typedef std::vector< CRdrPass > | TRdrPassSet |
| A set of rendering pass. More...
|
typedef NLMISC::CSmartPtr<
IShape > | PShape |
typedef std::vector< std::string > | TShapeNameVect |
typedef std::vector< PShape > | TShapeVect |
typedef std::auto_ptr< CGlobalTexAnims > | PGlobalTexAnims |
Protected Methods |
virtual CPSLocated * | getColorOwner (void) |
| deriver must return their owner there. More...
|
virtual void | updateMatAndVbForColor (void) |
| Update the material and the vb and the like so that they match the color scheme. More...
|
virtual void | newElement (CPSLocated *emitterLocated, uint32 emitterIndex) |
| Generate a new element. More...
|
virtual void | deleteElement (uint32 index) |
| Delete an element by its index. More...
|
virtual void | step (TPSProcessPass pass, TAnimationTime ellapsedTime, TAnimationTime realEt) |
| process one pass for the particles. More...
|
void | draw (bool opaque, TAnimationTime ellapsedTime) |
| called by the system when particles must be drawn. More...
|
void | drawPreRotatedMeshs (bool opaque, TAnimationTime ellapsedTime) |
| draw for pre-rotated meshs. More...
|
void | releaseShapes () |
| release the shapes used by this particle. More...
|
void | computeColors (CVertexBuffer &outVB, const CVertexBuffer &inVB, uint startIndex, uint toProcess, uint32 srcStep) |
| Compute (optionnal) mesh colors. More...
|
virtual void | resize (uint32 size) |
| Resize the bindable attributes containers. More...
|
bool | update (void) |
| Build the mesh data, if the 'touch' flag is set. More...
|
CVertexBuffer & | makePrerotatedVb (const CVertexBuffer &inVB, TAnimationTime ellapsedTime) |
| make a vb for the prerotated mesh from a source vb. More...
|
void | restoreMaterials () |
void | CPSConstraintMesh::setupRenderPasses (float date, TRdrPassSet &rdrPasses, bool opaque) |
| Setup a set of rendering passes. More...
|
void | doRenderPasses (IDriver *driver, uint numObj, TRdrPassSet &rdrPasses, bool opaque) |
| Perform a set of rendering passes. The VB must have been activated in the driver before to call this. More...
|
void | fillIndexesInPrecompBasis (void) |
| fill _IndexInPrecompBasis with index in the range [0.. nb configurations[. More...
|
void | clean (void) |
virtual CPSLocated * | getSizeOwner (void) |
| deriver must return their owner there. More...
|
virtual CPSLocated * | getPlaneBasisOwner (void) |
| if this is false, constant size will be used instead of a scheme deriver must return their owner there. More...
|
Protected Attributes |
TShapeNameVect | _MeshShapeFileName |
TShapeVect | _Shapes |
uint | _NumFaces |
CShapeBank * | _ModelBank |
float | _MinAngularVelocity |
float | _MaxAngularVelocity |
std::vector< CPlaneBasisPair > | _PrecompBasis |
| a set of precomp basis, before and after transfomation in world space, used if the hint 'RotateTheSame' has been called. More...
|
std::vector< uint32 > | _IndexInPrecompBasis |
| this contain an index in _PrecompBasis for each particle. More...
|
uint8 | _ModulatedStages |
| A 'bitfield' to force some stage to be modulated with the primary color. More...
|
uint8 | _Touched: 1 |
uint8 | _HasTransparentFaces: 1 |
uint8 | _HasOpaqueFaces: 1 |
uint8 | _VertexColorLightingForced: 1 |
uint8 | _GlobalAnimationEnabled: 1 |
uint8 | _ReinitGlobalAnimTimeOnNewElement: 1 |
PGlobalTexAnims | _GlobalTexAnims |
float | _GlobalAnimDate |
|
float | _MorphValue |
CPSAttribMaker< float > * | _MorphScheme |
Static Protected Attributes |
CMeshDisplayShare | _MeshDisplayShare |
| manage vertex buffers and primitive blocks used for rendering. More...
|
CVertexBuffer | _PreRotatedMeshVB |
| vertex buffer used with prerotated meshs. More...
|
CVertexBuffer | _PreRotatedMeshVBWithNormal |
Private Methods |
| CPSConstraintMesh (const CPSConstraintMesh &) |
CPSConstraintMesh & | operator= (const CPSConstraintMesh &other) |
Friends |
class | CPSConstraintMeshHelper |
class | CMeshDisplayShare |
Detailed Description
This class is for mesh that have very simple geometry.
The constraint is that they can only have one matrix block. They got a hint for constant rotation scheme. With little meshs, this is the best to draw a maximum of them
Definition at line 163 of file ps_mesh.h.
Member Typedef Documentation
typedef std::auto_ptr<CGlobalTexAnims> NL3D::CPSConstraintMesh::PGlobalTexAnims [protected]
|
|
typedef std::vector<CRdrPass> NL3D::CPSConstraintMesh::TRdrPassSet [protected]
|
|
typedef std::vector<std::string> NL3D::CPSConstraintMesh::TShapeNameVect [protected]
|
|
typedef std::vector<PShape> NL3D::CPSConstraintMesh::TShapeVect [protected]
|
|
Member Enumeration Documentation
enum NL3D::CPSConstraintMesh::TTexAnimType
|
|
|
The type of animation that is used with meshs textures.
-
Enumeration values:
-
Definition at line 306 of file ps_mesh.h. |
Constructor & Destructor Documentation
NL3D::CPSConstraintMesh::CPSConstraintMesh |
( |
|
) |
|
|
NL3D::CPSConstraintMesh::~CPSConstraintMesh |
( |
|
) |
[virtual] |
|
NL3D::CPSConstraintMesh::CPSConstraintMesh |
( |
const CPSConstraintMesh & |
|
) |
[inline, private] |
|
Member Function Documentation
uint32 NL3D::CPSConstraintMesh::checkHintRotateTheSame |
( |
float & |
min, |
|
|
float & |
max |
|
) |
const [inline, virtual] |
|
void NL3D::CPSConstraintMesh::clean |
( |
void |
|
) |
[protected] |
|
void NL3D::CPSConstraintMesh::CPSConstraintMesh::setupRenderPasses |
( |
float |
date, |
|
|
TRdrPassSet & |
rdrPasses, |
|
|
bool |
opaque |
|
) |
[protected] |
|
|
Setup a set of rendering passes.
|
void NL3D::CPSConstraintMesh::deleteElement |
( |
uint32 |
index |
) |
[protected, virtual] |
|
void NL3D::CPSConstraintMesh::disableHintRotateTheSame |
( |
void |
|
) |
[inline, virtual] |
|
void NL3D::CPSConstraintMesh::doRenderPasses |
( |
IDriver * |
driver, |
|
|
uint |
numObj, |
|
|
TRdrPassSet & |
rdrPasses, |
|
|
bool |
opaque |
|
) |
[protected] |
|
void NL3D::CPSConstraintMesh::draw |
( |
bool |
opaque, |
|
|
TAnimationTime |
ellapsedTime |
|
) |
[protected] |
|
void NL3D::CPSConstraintMesh::drawPreRotatedMeshs |
( |
bool |
opaque, |
|
|
TAnimationTime |
ellapsedTime |
|
) |
[protected] |
|
|
draw for pre-rotated meshs.
|
void NL3D::CPSConstraintMesh::fillIndexesInPrecompBasis |
( |
void |
|
) |
[protected] |
|
void NL3D::CPSConstraintMesh::forceGlobalAnimTimeResetOnNewElement |
( |
bool |
force = true |
) |
[inline] |
|
void NL3D::CPSConstraintMesh::forceStageModulationByColor |
( |
uint |
stage, |
|
|
bool |
force |
|
) |
|
|
|
Force the n-th stage of all material to be modulated by the mesh color.
This allow to put colors on meshs that haven't got material that allow them. -
Parameters:
-
stage |
The stage the modulation applies on. Range from 0 to IDRV_MAT_MAXTEXTURES - 1. |
force |
True enable modulation, false disable it. |
Definition at line 1765 of file ps_mesh.cpp.
References _ModulatedStages, NL3D::IDRV_MAT_MAXTEXTURES, and nlassert. |
void NL3D::CPSConstraintMesh::forceVertexColorLighting |
( |
bool |
force = true |
) |
[inline] |
|
virtual CPSLocated* NL3D::CPSConstraintMesh::getColorOwner |
( |
void |
|
) |
[inline, protected, virtual] |
|
uint32 NL3D::CPSConstraintMesh::getMaxNumFaces |
( |
void |
|
) |
const [virtual] |
|
const CPSAttribMaker< float > * NL3D::CPSConstraintMesh::getMorphScheme |
( |
|
) |
const |
|
|
Get the current morphing scheme or NULL if no one was set. Const version.
Definition at line 1020 of file ps_mesh.cpp.
References _MorphScheme. |
float NL3D::CPSConstraintMesh::getMorphValue |
( |
|
) |
const |
|
uint NL3D::CPSConstraintMesh::getNumShapes |
( |
|
) |
const |
|
virtual CPSLocated* NL3D::CPSConstraintMesh::getPlaneBasisOwner |
( |
void |
|
) |
[inline, protected, virtual] |
|
const std::string & NL3D::CPSConstraintMesh::getShape |
( |
uint |
index |
) |
const |
|
std::string NL3D::CPSConstraintMesh::getShape |
( |
void |
|
) |
const [virtual] |
|
void NL3D::CPSConstraintMesh::getShapesNames |
( |
std::string * |
shapesNames |
) |
const |
|
|
Retrieve the names of the shapes.
-
Parameters:
-
shapesNames |
:A tab of shapes with enough spaces to store the names |
Definition at line 965 of file ps_mesh.cpp.
References _MeshShapeFileName. |
virtual CPSLocated* NL3D::CPSConstraintMesh::getSizeOwner |
( |
void |
|
) |
[inline, protected, virtual] |
|
bool NL3D::CPSConstraintMesh::hasOpaqueFaces |
( |
void |
|
) |
[virtual] |
|
bool NL3D::CPSConstraintMesh::hasTransparentFaces |
( |
void |
|
) |
[virtual] |
|
void NL3D::CPSConstraintMesh::hintRotateTheSame |
( |
uint32 |
nbConfiguration, |
|
|
float |
minAngularVelocity = NLMISC::Pi, |
|
|
float |
maxAngularVelocity = NLMISC::Pi |
|
) |
[virtual] |
|
|
Tells that all meshs are turning in the same manner, and only have a rotationnal bias This is a lot faster then other method.
Any previous set scheme for 3d rotation is kept. -
am: the number of rotation configuration we have. The more high it is, the slower it'll be
-
If this is too low, a lot of particles will have the same orientation If it is 0, then the hint is disabled. This can't be higher than ConstraintMeshMaxNumPrerotatedModels
-
Parameters:
-
minAngularVelocity |
: the maximum angular velocity for particle rotation |
maxAngularVelocity |
: the maximum angular velocity for particle rotation |
-
See also:
-
CPSRotated3dPlaneParticle
Implements NL3D::CPSHintParticleRotateTheSame.
Definition at line 1189 of file ps_mesh.cpp.
References _MaxAngularVelocity, _MinAngularVelocity, _PrecompBasis, NL3D::ConstraintMeshMaxNumPrerotatedModels, fillIndexesInPrecompBasis, NL3D::MakeRandomUnitVect, nlassert, and v.
Referenced by disableHintRotateTheSame. |
void NL3D::CPSConstraintMesh::initPrerotVB |
( |
|
) |
[static] |
|
bool NL3D::CPSConstraintMesh::isGlobalAnimTimeResetOnNewElementForced |
( |
|
) |
const [inline] |
|
bool NL3D::CPSConstraintMesh::isStageModulationForced |
( |
uint |
stage |
) |
const |
|
bool NL3D::CPSConstraintMesh::isVertexColorLightingForced |
( |
|
) |
const [inline] |
|
void NL3D::CPSConstraintMesh::newElement |
( |
CPSLocated * |
emitterLocated, |
|
|
uint32 |
emitterIndex |
|
) |
[protected, virtual] |
|
NL3D::CPSConstraintMesh::NLMISC_DECLARE_CLASS |
( |
CPSConstraintMesh |
|
) |
|
|
CPSConstraintMesh& NL3D::CPSConstraintMesh::operator= |
( |
const CPSConstraintMesh & |
other |
) |
[inline, private] |
|
void NL3D::CPSConstraintMesh::releaseShapes |
( |
|
) |
[protected] |
|
void NL3D::CPSConstraintMesh::resize |
( |
uint32 |
size |
) |
[protected, virtual] |
|
void NL3D::CPSConstraintMesh::restoreMaterials |
( |
|
) |
[protected] |
|
void NL3D::CPSConstraintMesh::setGlobalTexAnim |
( |
uint |
stage, |
|
|
const CGlobalTexAnim & |
properties |
|
) |
|
|
void NL3D::CPSConstraintMesh::setMorphScheme |
( |
CPSAttribMaker< float > * |
scheme |
) |
|
|
void NL3D::CPSConstraintMesh::setMorphValue |
( |
float |
value |
) |
|
|
|
Use a constant value for morphing. This discard any scheme for the morph value. The value must range from 0 to numberOfShapes.
Definition at line 991 of file ps_mesh.cpp.
References _MorphScheme, _MorphValue, and value. |
void NL3D::CPSConstraintMesh::setShape |
( |
uint |
index, |
|
|
const std::string & |
shapeName |
|
) |
|
|
void NL3D::CPSConstraintMesh::setShape |
( |
const std::string & |
meshFileName |
) |
[virtual] |
|
void NL3D::CPSConstraintMesh::setShapes |
( |
const std::string * |
shapesNames, |
|
|
uint |
numShapes |
|
) |
|
|
|
Setup the mesh for morphing use.
There are several restrictions :
- All meshs must have the same number of vertices
- All meshes must have the same vertex format If these conditions are not met, a 'dummy' mesh will be used instead. If there's only one mesh, no morphing is performed. NB : Morphing not supported with precomputed rotations. First mesh is used instead
-
Parameters:
-
shapesNames |
A tab of string containing the names of the shapes |
numShapes |
|
Definition at line 951 of file ps_mesh.cpp.
References _MeshShapeFileName, and _Touched. |
void NL3D::CPSConstraintMesh::setTexAnimType |
( |
TTexAnimType |
type |
) |
|
|
bool NL3D::CPSConstraintMesh::update |
( |
void |
|
) |
[protected] |
|
|
Build the mesh data, if the 'touch' flag is set.
-
Returns:
-
true if the mesh could be found and match the requirement
Definition at line 1044 of file ps_mesh.cpp.
References _GlobalAnimDate, _HasOpaqueFaces, _HasTransparentFaces, _MeshShapeFileName, _ModelBank, _NumFaces, NL3D::CPSLocatedBindable::_Owner, _Shapes, _Touched, NL3D::CheckForOpaqueAndTransparentFacesInMesh, clean, NL3D::ConstraintMeshMaxNumVerts, NL3D::DummyShapeName, NL3D::GetDummyShapeFromBank, NL3D::getMeshNumTri, hasOpaqueFaces, hasTransparentFaces, nlassert, nlwarning, NL3D::CPSParticle::notifyOwnerMaxNumFacesChanged, and releaseShapes.
Referenced by draw, hasOpaqueFaces, hasTransparentFaces, and restoreMaterials. |
void NL3D::CPSConstraintMesh::updateMatAndVbForColor |
( |
void |
|
) |
[protected, virtual] |
|
Friends And Related Function Documentation
friend class CMeshDisplayShare [friend]
|
|
friend class CPSConstraintMeshHelper [friend]
|
|
Member Data Documentation
uint8 NL3D::CPSConstraintMesh::_GlobalAnimationEnabled [protected]
|
|
float NL3D::CPSConstraintMesh::_GlobalAnimDate [protected]
|
|
uint8 NL3D::CPSConstraintMesh::_HasOpaqueFaces [protected]
|
|
uint8 NL3D::CPSConstraintMesh::_HasTransparentFaces [protected]
|
|
std::vector<uint32> NL3D::CPSConstraintMesh::_IndexInPrecompBasis [protected]
|
|
float NL3D::CPSConstraintMesh::_MaxAngularVelocity [protected]
|
|
|
manage vertex buffers and primitive blocks used for rendering.
Referenced by restoreMaterials. |
TShapeNameVect NL3D::CPSConstraintMesh::_MeshShapeFileName [protected]
|
|
float NL3D::CPSConstraintMesh::_MinAngularVelocity [protected]
|
|
CShapeBank* NL3D::CPSConstraintMesh::_ModelBank [protected]
|
|
uint8 NL3D::CPSConstraintMesh::_ModulatedStages [protected]
|
|
CPSAttribMaker<float>* NL3D::CPSConstraintMesh::_MorphScheme [protected]
|
|
float NL3D::CPSConstraintMesh::_MorphValue [protected]
|
|
uint NL3D::CPSConstraintMesh::_NumFaces [protected]
|
|
std::vector< CPlaneBasisPair > NL3D::CPSConstraintMesh::_PrecompBasis [protected]
|
|
CVertexBuffer NL3D::CPSConstraintMesh::_PreRotatedMeshVB [static, protected]
|
|
CVertexBuffer NL3D::CPSConstraintMesh::_PreRotatedMeshVBWithNormal [static, protected]
|
|
uint8 NL3D::CPSConstraintMesh::_ReinitGlobalAnimTimeOnNewElement [protected]
|
|
TShapeVect NL3D::CPSConstraintMesh::_Shapes [protected]
|
|
uint8 NL3D::CPSConstraintMesh::_Touched [protected]
|
|
uint8 NL3D::CPSConstraintMesh::_VertexColorLightingForced [protected]
|
|
The documentation for this class was generated from the following files:
|
|