# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::UInstance Class Reference

Game interface for manipulating Objects, animations etc... More...

#include <u_instance.h>

Inheritance diagram for NL3D::UInstance:

NL3D::UTransform NL3D::UTransformable NL3D::CInstanceUser NL3D::UParticleSystemInstance NL3D::CWaterInstanceUser NL3D::CParticleSystemInstanceUser List of all members.

Public Methods

virtual void getShapeAABBox (NLMISC::CAABBox &bbox) const=0
 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)=0
 Change MRM Distance setup. More...

virtual void setShapeDistMax (float distMax)=0
 Change Max Display distance. More...

virtual float getShapeDistMax () const=0
 see setShapeDistMax(). More...

virtual bool canStartStop ()=0
 Test if there is a start/stop caps in the objects (some fxs such as remanence). More...

virtual void start ()=0
virtual void stop ()=0
virtual bool isStarted () const=0
virtual float getDistMax () const=0
virtual void setDistMax (float distMax)=0
virtual void setCoarseMeshDist (float dist)=0
virtual float getCoarseMeshDist () const=0
Material access.
virtual uint getNumMaterials () const=0
 return number of materials this mesh instance use. More...

virtual UInstanceMaterialgetMaterial (uint materialId)=0
 return a local access on a material, to change its values. (NB: overwrited, if animated). More...

virtual void selectTextureSet (uint id)=0
 Select textures of material among several sets (if available) NB: if success and if getAsyncTextureMode()==true, then setAsyncTextureDirty(true) is called. More...

Async Texture Loading
virtual void enableAsyncTextureMode (bool enable)=0
 if true, the instance is said in "AsyncTextureMode". More...

virtual bool getAsyncTextureMode () const=0
virtual void startAsyncTextureLoading ()=0
 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 ()=0
 return true if all the async textures of the instances are uploaded. More...

virtual void setAsyncTextureDistance (float dist)=0
 For Lod of texture, and load balancing, set the approximate distance of the instance to the camera. More...

virtual float getAsyncTextureDistance () const=0
virtual void setAsyncTextureDirty (bool flag)=0
 User is free to flag this state, to know if startAsyncTextureLoading() should be called. More...

virtual bool isAsyncTextureDirty () const=0
 see dirtAsyncTextureState(). More...


Protected Methods

Object
 UInstance ()
virtual ~UInstance ()

Detailed Description

Game interface for manipulating Objects, animations etc...

Author:
Lionel Berenguier , Nevrax France
Date:
2001

Definition at line 48 of file u_instance.h.


Constructor & Destructor Documentation

NL3D::UInstance::UInstance   [inline, protected]
 

Definition at line 54 of file u_instance.h.

virtual NL3D::UInstance::~UInstance   [inline, protected, virtual]
 

Definition at line 55 of file u_instance.h.


Member Function Documentation

virtual bool NL3D::UInstance::canStartStop   [pure virtual]
 

Test if there is a start/stop caps in the objects (some fxs such as remanence).

Implemented in NL3D::CInstanceUser.

virtual void NL3D::UInstance::changeMRMDistanceSetup float    distanceFinest,
float    distanceMiddle,
float    distanceCoarsest
[pure 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.

Implemented in NL3D::CInstanceUser.

virtual void NL3D::UInstance::enableAsyncTextureMode bool    enable [pure 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)

Implemented in NL3D::CInstanceUser.

virtual float NL3D::UInstance::getAsyncTextureDistance   const [pure virtual]
 

See also:
setAsyncTextureDistance()

Implemented in NL3D::CInstanceUser.

virtual bool NL3D::UInstance::getAsyncTextureMode   const [pure virtual]
 

Implemented in NL3D::CInstanceUser.

virtual float NL3D::UInstance::getCoarseMeshDist   const [pure virtual]
 

Implemented in NL3D::CInstanceUser.

virtual float NL3D::UInstance::getDistMax   const [pure virtual]
 

Implemented in NL3D::CInstanceUser.

virtual UInstanceMaterial& NL3D::UInstance::getMaterial uint    materialId [pure virtual]
 

return a local access on a material, to change its values. (NB: overwrited, if animated).

Implemented in NL3D::CInstanceUser.

virtual uint NL3D::UInstance::getNumMaterials   const [pure virtual]
 

return number of materials this mesh instance use.

Implemented in NL3D::CInstanceUser.

virtual void NL3D::UInstance::getShapeAABBox NLMISC::CAABBox   bbox const [pure virtual]
 

Get the untransformed AABBox of the mesh.

NULL (gtSize()==0) if no mesh.

Implemented in NL3D::CInstanceUser.

virtual float NL3D::UInstance::getShapeDistMax   const [pure virtual]
 

see setShapeDistMax().

Implemented in NL3D::CInstanceUser.

virtual bool NL3D::UInstance::isAsyncTextureDirty   const [pure virtual]
 

see dirtAsyncTextureState().

Implemented in NL3D::CInstanceUser.

virtual bool NL3D::UInstance::isAsyncTextureReady   [pure 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)

Implemented in NL3D::CInstanceUser.

virtual bool NL3D::UInstance::isStarted   const [pure virtual]
 

Implemented in NL3D::CInstanceUser.

virtual void NL3D::UInstance::selectTextureSet uint    id [pure virtual]
 

Select textures of material among several sets (if available) NB: if success and if getAsyncTextureMode()==true, then setAsyncTextureDirty(true) is called.

Implemented in NL3D::CInstanceUser.

virtual void NL3D::UInstance::setAsyncTextureDirty bool    flag [pure virtual]
 

User is free to flag this state, to know if startAsyncTextureLoading() should be called.

Internal system don't use this flag. Default is false

Implemented in NL3D::CInstanceUser.

virtual void NL3D::UInstance::setAsyncTextureDistance float    dist [pure virtual]
 

For Lod of texture, and load balancing, set the approximate distance of the instance to the camera.

Implemented in NL3D::CInstanceUser.

virtual void NL3D::UInstance::setBlendShapeFactor const std::string &    blendShapeName,
float    factor,
bool    dynamic
[inline, 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 in NL3D::CInstanceUser.

Definition at line 71 of file u_instance.h.

virtual void NL3D::UInstance::setCoarseMeshDist float    dist [pure virtual]
 

Implemented in NL3D::CInstanceUser.

virtual void NL3D::UInstance::setDistMax float    distMax [pure virtual]
 

Implemented in NL3D::CInstanceUser.

virtual void NL3D::UInstance::setShapeDistMax float    distMax [pure 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

Implemented in NL3D::CInstanceUser.

virtual void NL3D::UInstance::start   [pure virtual]
 

Implemented in NL3D::CInstanceUser.

virtual void NL3D::UInstance::startAsyncTextureLoading   [pure 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.

Implemented in NL3D::CInstanceUser.

virtual void NL3D::UInstance::stop   [pure virtual]
 

Implemented in NL3D::CInstanceUser.


The documentation for this class was generated from the following file: