|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CInstanceUser Class ReferenceUInstance implementation.
More...
#include <instance_user.h>
Inheritance diagram for NL3D::CInstanceUser:
List of all members.
Public Methods |
virtual void | getShapeAABBox (NLMISC::CAABBox &bbox) const |
| Get the untransformed AABBox of the mesh. More...
|
virtual void | setBlendShapeFactor (const std::string &blendShapeName, float factor, bool dynamic) |
| Set the blend shape factor for this instance blenShapeName is the name of the blendshape we want to set factor the blendshape percentage from 0.0 to 100.0 dynamic tells the optimizer if the blendshape have to change in real time. More...
|
virtual void | changeMRMDistanceSetup (float distanceFinest, float distanceMiddle, float distanceCoarsest) |
| Change MRM Distance setup. More...
|
virtual void | setShapeDistMax (float distMax) |
| Change Max Display distance. More...
|
virtual float | getShapeDistMax () const |
| see setShapeDistMax(). More...
|
virtual bool | canStartStop () |
| Test if there is a start/stop caps in the objects (some fxs such as remanence). More...
|
virtual void | start () |
virtual void | stop () |
virtual bool | isStarted () const |
virtual float | getDistMax () const |
virtual void | setDistMax (float distMax) |
virtual void | setCoarseMeshDist (float dist) |
virtual float | getCoarseMeshDist () const |
|
| CInstanceUser (CScene *scene, IModel *trans) |
| This model should have been created with Scene::createInstance(). More...
|
virtual | ~CInstanceUser () |
|
virtual uint | getNumMaterials () const |
| return number of materials this mesh instance use. More...
|
virtual UInstanceMaterial & | getMaterial (uint materialId) |
| return a local access on a material, to change its values. (NB: overwrited, if animated). More...
|
virtual void | selectTextureSet (uint id) |
| Select textures of material among several sets (if available) NB: if success and if getAsyncTextureMode()==true, then setAsyncTextureDirty(true) is called. More...
|
|
virtual void | enableAsyncTextureMode (bool enable) |
| if true, the instance is said in "AsyncTextureMode". More...
|
virtual bool | getAsyncTextureMode () const |
virtual void | startAsyncTextureLoading () |
| Start to load all textures in AsyncTextures array (if needed) NB: old setup is kept in Material => instance is still rendered with "coherent" textures, until new textures are ready no op if not in async texture mode. More...
|
virtual bool | isAsyncTextureReady () |
| return true if all the async textures of the instances are uploaded. More...
|
virtual void | setAsyncTextureDistance (float dist) |
| For Lod of texture, and load balancing, set the approximate distance of the instance to the camera. More...
|
virtual float | getAsyncTextureDistance () const |
virtual void | setAsyncTextureDirty (bool flag) |
| User is free to flag this state, to know if startAsyncTextureLoading() should be called. More...
|
virtual bool | isAsyncTextureDirty () const |
| see dirtAsyncTextureState(). More...
|
Public Attributes |
CTransformShape * | _Instance |
| This is the SAME pointer than _Transform, but correctly casted. More...
|
std::vector< CInstanceMaterialUser > | _Materials |
| This is a mirror of _Instance->Materials. More...
|
Detailed Description
UInstance implementation.
-
Author:
-
Lionel Berenguier , Nevrax France
-
Date:
-
2001
Definition at line 50 of file instance_user.h.
Constructor & Destructor Documentation
NL3D::CInstanceUser::CInstanceUser |
( |
CScene * |
scene, |
|
|
IModel * |
trans |
|
) |
|
|
virtual NL3D::CInstanceUser::~CInstanceUser |
( |
|
) |
[inline, virtual] |
|
Member Function Documentation
virtual bool NL3D::CInstanceUser::canStartStop |
( |
|
) |
[inline, virtual] |
|
void NL3D::CInstanceUser::changeMRMDistanceSetup |
( |
float |
distanceFinest, |
|
|
float |
distanceMiddle, |
|
|
float |
distanceCoarsest |
|
) |
[virtual] |
|
|
Change MRM Distance setup.
Only for mesh which support MRM. NB MeshMultiLod apply it only on Lod0 (if Lod0 is a MRM). NB: This apply to the shape direclty!! ie All instances using same shape will be affected NB: no-op if distanceFinest<0, distanceMiddle<=distanceFinest or if distanceCoarsest<=distanceMiddle. -
Parameters:
-
distanceFinest |
The MRM has its max faces when dist<=distanceFinest. |
distanceMiddle |
The MRM has 50% of its faces at dist==distanceMiddle. |
distanceCoarsest |
The MRM has faces/Divisor (ie near 0) when dist>=distanceCoarsest. |
Implements NL3D::UInstance.
Definition at line 83 of file instance_user.cpp. |
void NL3D::CInstanceUser::enableAsyncTextureMode |
( |
bool |
enable |
) |
[virtual] |
|
|
if true, the instance is said in "AsyncTextureMode".
Ie user must fill AsyncTextures field with name of the textures to load. At each startAsyncTextureLoading(), the system start to load async them. Then, isAsyncTextureReady() should be test each frame, to know if loading has completed. By default, AsyncTextureMode=false. When it swap from false to true, each texture file in Materials are replaced with "blank.tga", and true fileNames are copied into AsyncTextures. When it swap from true to false, the inverse is applied. NB: calling enableAsyncTextureMode(true) calls setAsyncTextureDirty(true)
Implements NL3D::UInstance.
Definition at line 129 of file instance_user.cpp.
References _Instance, and nlassert. |
float NL3D::CInstanceUser::getAsyncTextureDistance |
( |
|
) |
const [virtual] |
|
bool NL3D::CInstanceUser::getAsyncTextureMode |
( |
|
) |
const [virtual] |
|
float NL3D::CInstanceUser::getCoarseMeshDist |
( |
|
) |
const [virtual] |
|
virtual float NL3D::CInstanceUser::getDistMax |
( |
|
) |
const [inline, virtual] |
|
virtual uint NL3D::CInstanceUser::getNumMaterials |
( |
|
) |
const [inline, virtual] |
|
void NL3D::CInstanceUser::getShapeAABBox |
( |
NLMISC::CAABBox & |
bbox |
) |
const [virtual] |
|
float NL3D::CInstanceUser::getShapeDistMax |
( |
|
) |
const [virtual] |
|
bool NL3D::CInstanceUser::isAsyncTextureDirty |
( |
|
) |
const [virtual] |
|
bool NL3D::CInstanceUser::isAsyncTextureReady |
( |
|
) |
[virtual] |
|
|
return true if all the async textures of the instances are uploaded.
if was not ready before, this swap the upload textures into the rendered ones so they are rendered return always true if not in async texture mode, or if startAsyncTextureLoading() has not been called since last enableAsyncTextureMode(true)
Implements NL3D::UInstance.
Definition at line 153 of file instance_user.cpp.
References _Instance, and nlassert. |
virtual bool NL3D::CInstanceUser::isStarted |
( |
|
) |
const [inline, virtual] |
|
void NL3D::CInstanceUser::selectTextureSet |
( |
uint |
id |
) |
[virtual] |
|
void NL3D::CInstanceUser::setAsyncTextureDirty |
( |
bool |
flag |
) |
[virtual] |
|
void NL3D::CInstanceUser::setAsyncTextureDistance |
( |
float |
dist |
) |
[virtual] |
|
void NL3D::CInstanceUser::setBlendShapeFactor |
( |
const std::string & |
blendShapeName, |
|
|
float |
factor, |
|
|
bool |
dynamic |
|
) |
[virtual] |
|
|
Set the blend shape factor for this instance blenShapeName is the name of the blendshape we want to set factor the blendshape percentage from 0.0 to 100.0 dynamic tells the optimizer if the blendshape have to change in real time.
Reimplemented from NL3D::UInstance.
Definition at line 70 of file instance_user.cpp. |
void NL3D::CInstanceUser::setCoarseMeshDist |
( |
float |
dist |
) |
[virtual] |
|
virtual void NL3D::CInstanceUser::setDistMax |
( |
float |
distMax |
) |
[inline, virtual] |
|
void NL3D::CInstanceUser::setShapeDistMax |
( |
float |
distMax |
) |
[virtual] |
|
|
Change Max Display distance.
After this distance the shape won't be displayed. setting <0 means -1 and so means DistMax = infinite (default in meshs but multilod meshes). NB: This apply to the shape direclty!! ie All instances using same shape will be affected
Note: If the instance is skinned/sticked to a skeleton, this setup is not taken into account. But you can call USkeleton::setShapeDistMax() to have same effect.
Note (complex): All instances of the same shape which are freezeHRC()-ed and are linked to the QuadGridClipManager (ie not linked to a cluster) may not be updated corretcly. In other words, you should setup this value only at beginning of program, just after creating your instance (more exactly before UScene::render()), and all instances of the same shape should be setuped with same value (or don't call setShapeDistMax() for subsequent instances). If you don't do this, QuadGridClipManager may clip such instances nearer than they should
Implements NL3D::UInstance.
Definition at line 97 of file instance_user.cpp.
References _Instance. |
virtual void NL3D::CInstanceUser::start |
( |
|
) |
[inline, virtual] |
|
void NL3D::CInstanceUser::startAsyncTextureLoading |
( |
|
) |
[virtual] |
|
|
Start to load all textures in AsyncTextures array (if needed) NB: old setup is kept in Material => instance is still rendered with "coherent" textures, until new textures are ready no op if not in async texture mode.
Implements NL3D::UInstance.
Definition at line 145 of file instance_user.cpp.
References _Instance, and nlassert. |
virtual void NL3D::CInstanceUser::stop |
( |
void |
|
) |
[inline, virtual] |
|
Member Data Documentation
|
This is the SAME pointer than _Transform, but correctly casted.
Definition at line 54 of file instance_user.h.
Referenced by canStartStop, CInstanceUser, enableAsyncTextureMode, getAsyncTextureDistance, getAsyncTextureMode, getDistMax, getShapeAABBox, getShapeDistMax, isAsyncTextureDirty, isAsyncTextureReady, isStarted, setAsyncTextureDirty, setAsyncTextureDistance, setDistMax, setShapeDistMax, start, startAsyncTextureLoading, stop, and ~CInstanceUser. |
The documentation for this class was generated from the following files:
|
|