# 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::CTransform Class Reference

A basic node which provide an animatable matrix (ITransformable). More...

#include <transform.h>

Inheritance diagram for NL3D::CTransform:

NL3D::IModel NL3D::ITransformable NLMISC::CRefCount NL3D::IAnimatable NL3D::CCamera NL3D::CCluster NL3D::CCoarseMeshManager NL3D::CLandscapeModel NL3D::CPointLightModel NL3D::CTransformShape NL3D::CVegetableBlendLayerModel NL3D::CFlareModel NL3D::CMeshBaseInstance NL3D::CParticleSystemModel NL3D::CSegRemanence NL3D::CSkeletonModel NL3D::CWaterModel NL3D::CWaveMakerModel NL3D::CMeshInstance NL3D::CMeshMRMInstance NL3D::CMeshMultiLodInstance List of all members.

Skinning Behavior.

virtual bool isSkinnable () const
 Deriver must change this method if the model can be skinned. called rarely. More...

virtual void setApplySkin (bool state)
 Deriver must change this method if isSkinnable(). More...

virtual const std::vector<
sint32 > * 
getSkinBoneUsage () const
 Deriver must change this method if isSkinnable(). More...

virtual void renderSkin (float alphaMRM)
 Deriver must change this method if isSkinnable(). More...

virtual bool supportSkinGrouping () const
 Deriver may support SkinGrouping if isSkinnable(). More...

virtual sint renderSkinGroupGeom (float alphaMRM, uint remainingVertices, uint8 *dest)
 if supportSkinGrouping(), called to transform the VBuffer, and store it into dest. More...

virtual void renderSkinGroupPrimitives (uint baseVertex)
 if supportSkinGrouping(), called to render the primitives of the already skinned vertices (VB activated in the driver). More...

CSkeletonModel_FatherSkeletonModel
uint _FatherBoneId

[NOHEADER]

uint32 isNeedUpdateLighting () const
 non-zero if the object needs to updatelighting. More...

uint32 isNeedUpdateFrozenStaticLightSetup () const
 non-zero if the object has a FrozenStaticLightSetup not correclty updated. More...

CLightContribution _LightContribution
 The contribution of all lights. This enlarge the struct only of approx 15%. More...

CLightingManager::CQGItLightedModel _LightedModelIt
 each transform may be in a quadGird of lighted models (see CLightingManager). More...


State Flag mgt (boolean compression)

enum  TState {
  IsAnimDetailable = 0x0001, IsLoadBalancable = 0x0002, IsLightable = 0x0004, IsRenderable = 0x0008,
  IsTransparent = 0x0010, IsOpaque = 0x0020, QuadGridClipEnabled = 0x0040, IsUserLightable = 0x0080,
  IsFinalLightable = 0x0100, IsBigLightable = 0x0200, IsNeedUpdateLighting = 0x0400, IsNeedUpdateFrozenStaticLightSetup,
  IsSkeleton = 0x1000, IsSkinned = 0x2000, IsDeleteChannelMixer = 0x4000, IsForceAnimDetail = 0x8000,
  IsMeshBaseInstance = 0x10000
}
 State Flags. More...

void setStateFlag (uint32 mask, bool val)
 This is used to set Static or dynamic flags. val must take 0 or 1. More...

uint32 getStateFlag (uint32 mask) const
 return a non zero-value if state is set. More...

uint32 _StateFlags
 Flags for the General State of the Transform. They are both static or dynamic flags. More...


Public Methods

void setTransparency (bool v)
 Accessors for opacity/transparency Warning: if you call it on a Skin which is already binded to a skeleton, you should call CSkeletonModel::dirtSkinRenderLists(), else it won't takes effect. More...

void setOpacity (bool v)
uint32 isOpaque ()
uint32 isTransparent ()
void setOrderingLayer (uint layer)
 Set the current layer for this transform. More...

uint getOrderingLayer () const
 Get the ordering layer. More...

void hide ()
 Hide the object and his sons. More...

void show ()
 Show the objet and his sons. More...

void heritVisibility ()
 herit the visibility from his father. (default behavior). More...

CHrcTrav::TVisibility getVisibility ()
 Get the local visibility state. More...

CSkeletonModelgetSkeletonModel () const
 Get the skeleton model. Returnr NULL in normal mode. More...

void setChannelMixerOwnerShip (bool enable=true)
 This force gives this object ownership of the channel mixer it is registered to, so it will delete it when the dtor is called. More...

bool getChannelMixerOwnerShip () const
void freeze ()
 freeze the preceding position of the model. More...

void setDontUnfreezeChildren (bool val)
void freezeHRC ()
 freeze the HRC so the WorldMatrix computed at next render() will be kept for long, and the model won't either be tested in HRC (which is still expensive, even if the worldmatrix doesn't need to be recomputed). More...

void unfreezeHRC ()
 see freezeHRC(). More...

uint32 isQuadGridClipEnabled () const
 special feature for CQuadGridClipManager. More...

const CMatrix & getWorldMatrix ()
 Get the worldMatrix that is stored in the hrc observer. More...

bool getLastClippedState () const
 Get the Visible state that is stored in the clip observer. More...

void setClusterSystem (CInstanceGroup *pIG)
CInstanceGroupgetClusterSystem ()
void setLogicInfo (ILogicInfo *logicInfo)
 Set the LogicInfo for this transfrom, eg to retrieve statc light information, see ILogicInfo. More...

virtual void getAABBox (NLMISC::CAABBox &bbox) const
 Get the untransformed AABBox of the transform. More...

Derived from ITransformable.
virtual ITrackgetDefaultTrack (uint valueId)
 Default Track Values are identity (pos,pivot= 0, scale= 1, rots=0). More...

virtual void registerToChannelMixer (CChannelMixer *chanMixer, const std::string &prefix)
 register transform channels (in global anim mode). More...

void resetLighting ()
 reset lights which influence this models. More...

uint32 isLightable () const
 true if the model can be lighted (such as CMeshBaseInstance) Default behavior is false. More...

void setUserLightable (bool enable)
 Set the UserLightable flag. More...

bool getUserLightable () const
 Get the UserLightable flag. More...

void freezeStaticLightSetup (CPointLight *pointLight[NL3D_MAX_LIGHT_CONTRIBUTION], uint numPointLights, uint8 sunContribution, CPointLight *frozenAmbientlight)
 Freeze and set the Static Light Setup. More...

void unfreezeStaticLightSetup ()
 unFreeze the Static Light Setup. More...

uint32 isBigLightable () const
 non-zero if the lighting Manager must take into account the bbox of the transform. More...

void setLoadBalancingGroup (const std::string &group)
 Change the load Balancing group of a model. More...

const std::string & getLoadBalancingGroup () const
 Get the load Balancing group of a model. More...

Skinning Behavior.
uint32 isSkeleton () const
 return non-zero if I am a skeleton. if yes, static_cast<CSkeletonModel*> may be used. More...

uint32 isSkinned () const
 non-zero if the model is skinned onto a skeleton. More...

void setMeanColor (CRGBA color)
 set the Mean color of the transform. More...

CRGBA getMeanColor () const
 see setMeanColor(). More...

uint32 isAnimDetailable () const
 non-zero if the model is animDetailable (ie added to the animDetail list if visible). More...

uint32 isLoadBalancable () const
 non-zero if the model is loadBalancable (ie added to the loadBalancing list if visible). More...

uint32 isRenderable () const
 non-zero if the model is renderable (ie something may appear on screen). More...

uint32 isMeshBaseInstance () const
 non-zero if the CTransform can be casted to a CMeshBaseInstance. More...


Static Public Methods

void registerBasic ()
 Call at the begining of the program, to register the model, and the basic observers. More...


Protected Methods

 CTransform ()
 Constructor. More...

virtual ~CTransform ()
 Destructor. More...

virtual void update ()
 Implement the update method. More...

virtual void initModel ()
 Implement the initModel method. More...

CChannelMixergetChannelMixer () const
 get the channelMixer owned by the transform. More...

bool getShowWhenLODSticked () const
 Test if obj must be displayed when sticked to an object displayed as a LOD (example: sword in hand of a character displayed as a LOD state). More...

Model Feature initialisation.
void setIsLightable (bool val)
 Deriver must use this method with true to indicate the model support lighting. More...

void setIsRenderable (bool val)
 Deriver must use this method with true to indicate the model can be rendered. More...

void setIsBigLightable (bool val)
 Deriver must use this method with true to indicate the model is a big lightable. More...

void setIsSkeleton (bool val)
 For CSkeletonModel only. More...

void setIsForceAnimDetail (bool val)
 Deriver must use this method with true if the model must be AnimDetail-ed whatever registerToChannelMixer() has been called or not. More...

void setIsLoadbalancable (bool val)
 Deriver must use this method with true to indicate the model support loadBalancing. More...

void setIsMeshBaseInstance (bool val)
 For CMeshBaseInstance only. More...


Protected Attributes

CTransformHrcObs_HrcObs
CTransformClipObs_ClipObs
CTransformLightObs_LightObs

Private Types

enum  TDirty { TransformDirty = IModel::Last, Last }
 The Dirty states. More...

enum  TFreezeHRCState { FreezeHRCStateDisabled = 0, FreezeHRCStateRequest, FreezeHRCStateReady, FreezeHRCStateEnabled }

Private Methods

void foulTransform ()
void updateWorldMatrixFromFather ()
 For Skeleton Object Stick. More...


Static Private Methods

IModelcreator ()

Private Attributes

CHrcTrav::TVisibility Visibility
NLMISC::CRefPtr< CChannelMixer_ChannelMixer
uint64 _LastTransformableMatrixDate
CInstanceGroup_ClusterSystem
TFreezeHRCState _FreezeHRCState
uint8 _OrderingLayer
bool _ForceCLodSticked
ILogicInfo_LogicInfo
 See ILogicInfo. Used for lighting. default is NULL. More...

CRGBA _MeanColor
 see setMeanColor(). More...


Static Private Attributes

CTrackDefaultVector DefaultPos
CTrackDefaultVector DefaultPivot
CTrackDefaultVector DefaultRotEuler
CTrackDefaultQuat DefaultRotQuat
CTrackDefaultVector DefaultScale

Friends

class CTransformHrcObs
class CTransformClipObs
class CTransformLightObs
class CTransformAnimDetailObs
class CSkeletonModel
class CSkeletonModelAnimDetailObs
class CSkeletonModelRenderObs

Detailed Description

A basic node which provide an animatable matrix (ITransformable).

May be derived for each node who want to support such a scheme (CCamera, CLight, CInstance ... )

CTransform ALWAYS herit scale from fathers! (joints skeleton may not...) (nbyoyo: else, this breaks the touch system with observers).

CTransform Default tracks are identity (derived class may change this).

CTransform by default IS NOT RENDERABLE. ie never inserted in renderList. Deriver should call setIsRenderable(true) to make the model renderable

CTransform by default IS NOT ANIMDETAIL-able. ie never inserted in anim detail list. It is automatically inserted in anim detail list if registerToChannelMixer() is called. Deriver should call setIsForceAnimdetail(true) to make the model always anim-detail-ed

CTransform by default IS NOT LOADBALANCE-able. ie never inserted into list for LoadBlancing. Deriver should call setIsLoadbalancable(true) to support this traversal.

Author:
Lionel Berenguier , Nevrax France
Date:
2000

Definition at line 101 of file transform.h.


Member Enumeration Documentation

enum NL3D::CTransform::TDirty [private]
 

The Dirty states.

Derived models may add flags with similar enum. The first enum element must begin at CBaseClass::Last (where CBaseClass is the base class), so falg compatibility is maintained.

Enumeration values:
TransformDirty 
Last 

Reimplemented from NL3D::IModel.

Definition at line 331 of file transform.h.

enum NL3D::CTransform::TFreezeHRCState [private]
 

Enumeration values:
FreezeHRCStateDisabled 
FreezeHRCStateRequest 
FreezeHRCStateReady 
FreezeHRCStateEnabled 

Definition at line 486 of file transform.h.

enum NL3D::CTransform::TState [private]
 

State Flags.

Enumeration values:
IsAnimDetailable 
IsLoadBalancable 
IsLightable 
IsRenderable 
IsTransparent 
IsOpaque 
QuadGridClipEnabled 
IsUserLightable 
IsFinalLightable 
IsBigLightable 
IsNeedUpdateLighting 
IsNeedUpdateFrozenStaticLightSetup 
IsSkeleton 
IsSkinned 
IsDeleteChannelMixer 
IsForceAnimDetail 
IsMeshBaseInstance 

Definition at line 507 of file transform.h.


Constructor & Destructor Documentation

NL3D::CTransform::CTransform   [protected]
 

Constructor.

Definition at line 56 of file transform.cpp.

References _ClipObs, _ClusterSystem, _FatherSkeletonModel, _ForceCLodSticked, _FreezeHRCState, _HrcObs, _LastTransformableMatrixDate, _LightObs, _LogicInfo, _MeanColor, _OrderingLayer, _StateFlags, FreezeHRCStateDisabled, IsOpaque, IsUserLightable, Last, NLMISC::CBitSet::resize, NL3D::IModel::TouchObs, and Visibility.

Referenced by NL3D::CSkeletonModel::computeCLodVertexColors, creator, NL3D::CSkeletonModel::updateSkinRenderLists, and updateWorldMatrixFromFather.

NL3D::CTransform::~CTransform   [protected, virtual]
 

Destructor.

Definition at line 123 of file transform.cpp.

References _ChannelMixer, _FatherSkeletonModel, _LightedModelIt, _LightObs, getChannelMixerOwnerShip, isSkinned, nlstop, and resetLighting.


Member Function Documentation

IModel* NL3D::CTransform::creator   [inline, static, private]
 

Reimplemented in NL3D::CCamera.

Definition at line 460 of file transform.h.

References CTransform, and NL3D::IModel::IModel.

void NL3D::CTransform::foulTransform   [inline, private]
 

Definition at line 346 of file transform.h.

References TransformDirty.

Referenced by heritVisibility, hide, and show.

void NL3D::CTransform::freeze  
 

freeze the preceding position of the model.

Do not use, special code for cluster. This inform the scene that preceding position setuped by user is "frozen". ie at next render(), this object won't be added to the "object moving list" (usefull for cluster mgt). The "frozen" state is disabled (at render() time) if:

  • change in position (directly or indireclty, such as animation) is performed after the freeze().
  • the "frozen" state of a father is not enabled (or disabled by a change in position of him :) ).

Definition at line 288 of file transform.cpp.

References _HrcObs, and NL3D::IModel::validate.

void NL3D::CTransform::freezeHRC  
 

freeze the HRC so the WorldMatrix computed at next render() will be kept for long, and the model won't either be tested in HRC (which is still expensive, even if the worldmatrix doesn't need to be recomputed).

The model won't either be validated. It is suposed to not change at all. Also, if it is not a son of a CCluster, it may be accelerated during Cliping (with CQuadGridClipManager).

NB: the model won't be tested in HRC only if this model is a "root", ie HrcTrav->getFirstParent()==HrcTrav->getRoot(). calling freezeHRC() on a model in a hierarchy without calling it to the root of the hierarchy will result in that the model won't be validated, but still HRC traversed. To be simplier, you should freezeHRC() all the models of a hierarchy, from base root to leaves.

NB: if the hierarchy of this object must change, or if the object must moves, you must call unfreezeHRC() first, and you should do this for all the parents of this model.

Definition at line 320 of file transform.cpp.

References _FreezeHRCState, FreezeHRCStateDisabled, FreezeHRCStateRequest, QuadGridClipEnabled, and setStateFlag.

void NL3D::CTransform::freezeStaticLightSetup CPointLight   pointLight[NL3D_MAX_LIGHT_CONTRIBUTION],
uint    numPointLights,
uint8    sunContribution,
CPointLight   frozenAmbientlight
 

Freeze and set the Static Light Setup.

Called by CInstanceGroup::addToScene() NB: it calls resetLighting() first. NB: nlassert(numPointLights<=NL3D_MAX_LIGHT_CONTRIBUTION)

Definition at line 882 of file transform.cpp.

References _LightContribution, IsNeedUpdateFrozenStaticLightSetup, NL3D_MAX_LIGHT_CONTRIBUTION, nlassert, resetLighting, and setStateFlag.

void NL3D::CTransform::getAABBox NLMISC::CAABBox   bbox const [virtual]
 

Get the untransformed AABBox of the transform.

NULL (gtCenter()= 0, gtSize()==0) by default.

Reimplemented in NL3D::CParticleSystemModel.

Definition at line 420 of file transform.cpp.

References NLMISC::CAABBox::setCenter, and NLMISC::CAABBox::setHalfSize.

CChannelMixer* NL3D::CTransform::getChannelMixer   const [inline, protected]
 

get the channelMixer owned by the transform.

return result of a refPtr => may be NULL.

Definition at line 427 of file transform.h.

References _ChannelMixer.

Referenced by NL3D::CSkeletonModel::computeCurrentBBox, and NL3D::CSkeletonModel::updateBoneToCompute.

bool NL3D::CTransform::getChannelMixerOwnerShip   const [inline]
 

Definition at line 159 of file transform.h.

References getStateFlag, and IsDeleteChannelMixer.

Referenced by registerToChannelMixer, and ~CTransform.

CInstanceGroup* NL3D::CTransform::getClusterSystem   [inline]
 

Definition at line 212 of file transform.h.

References _ClusterSystem.

ITrack * NL3D::CTransform::getDefaultTrack uint    valueId [virtual]
 

Default Track Values are identity (pos,pivot= 0, scale= 1, rots=0).

Implements NL3D::ITransformable.

Reimplemented in NL3D::CCamera.

Definition at line 198 of file transform.cpp.

References DefaultPivot, DefaultPos, DefaultRotEuler, DefaultRotQuat, DefaultScale, nlstop, NL3D::ITransformable::PivotValue, NL3D::ITransformable::PosValue, NL3D::ITransformable::RotEulerValue, NL3D::ITransformable::RotQuatValue, and NL3D::ITransformable::ScaleValue.

bool NL3D::CTransform::getLastClippedState   const
 

Get the Visible state that is stored in the clip observer.

True if visible.

Definition at line 312 of file transform.cpp.

References _ClipObs.

Referenced by NL3D::CSkeletonModel::computeRenderedBBox.

const std::string & NL3D::CTransform::getLoadBalancingGroup   const
 

Get the load Balancing group of a model.

see setLoadBalancingGroup().

Definition at line 443 of file transform.cpp.

References NL3D::IModel::getObs, NL3D::LoadBalancingTravId, and nlassert.

CRGBA NL3D::CTransform::getMeanColor   const [inline]
 

see setMeanColor().

Definition at line 313 of file transform.h.

References _MeanColor.

uint NL3D::CTransform::getOrderingLayer   const [inline]
 

Get the ordering layer.

Definition at line 130 of file transform.h.

References _OrderingLayer.

bool NL3D::CTransform::getShowWhenLODSticked   const [inline, protected]
 

Test if obj must be displayed when sticked to an object displayed as a LOD (example: sword in hand of a character displayed as a LOD state).

Definition at line 458 of file transform.h.

References _ForceCLodSticked.

CSkeletonModel* NL3D::CTransform::getSkeletonModel   const [inline]
 

Get the skeleton model. Returnr NULL in normal mode.

Definition at line 141 of file transform.h.

References _FatherSkeletonModel, and CSkeletonModel.

virtual const std::vector<sint32>* NL3D::CTransform::getSkinBoneUsage   const [inline, protected, virtual]
 

Deriver must change this method if isSkinnable().

It return the list of bone (correct skeleton index) used by the skins (NB: without the parents of the bone). default is to return NULL.

Reimplemented in NL3D::CMeshInstance.

Definition at line 377 of file transform.h.

uint32 NL3D::CTransform::getStateFlag uint32    mask const [inline, private]
 

return a non zero-value if state is set.

Definition at line 549 of file transform.h.

References _StateFlags.

Referenced by getChannelMixerOwnerShip, getUserLightable, isAnimDetailable, isBigLightable, isLightable, isLoadBalancable, isMeshBaseInstance, isNeedUpdateFrozenStaticLightSetup, isNeedUpdateLighting, isOpaque, isQuadGridClipEnabled, isRenderable, isTransparent, registerToChannelMixer, setIsForceAnimDetail, setIsLightable, and setUserLightable.

bool NL3D::CTransform::getUserLightable   const [inline]
 

Get the UserLightable flag.

Definition at line 239 of file transform.h.

References getStateFlag, and IsUserLightable.

CHrcTrav::TVisibility NL3D::CTransform::getVisibility   [inline]
 

Get the local visibility state.

Definition at line 139 of file transform.h.

References Visibility.

Referenced by NL3D::CMeshMRMInstance::renderSkin, and NL3D::CMeshInstance::renderSkin.

const CMatrix & NL3D::CTransform::getWorldMatrix  
 

Get the worldMatrix that is stored in the hrc observer.

Reimplemented in NL3D::CParticleSystemModel.

Definition at line 306 of file transform.cpp.

References _HrcObs.

void NL3D::CTransform::heritVisibility  
 

herit the visibility from his father. (default behavior).

Definition at line 180 of file transform.cpp.

References foulTransform, and Visibility.

void NL3D::CTransform::hide  
 

Hide the object and his sons.

Definition at line 160 of file transform.cpp.

References foulTransform, and Visibility.

void NL3D::CTransform::initModel   [protected, virtual]
 

Implement the initModel method.

Reimplemented from NL3D::IModel.

Reimplemented in NL3D::CLandscapeModel.

Definition at line 112 of file transform.cpp.

References _ClipObs, _HrcObs, _LightObs, NL3D::ClipTravId, CTransformClipObs, CTransformHrcObs, CTransformLightObs, NL3D::IModel::getObs, NL3D::HrcTravId, and NL3D::LightTravId.

uint32 NL3D::CTransform::isAnimDetailable   const [inline]
 

non-zero if the model is animDetailable (ie added to the animDetail list if visible).

Definition at line 316 of file transform.h.

References getStateFlag, and IsAnimDetailable.

uint32 NL3D::CTransform::isBigLightable   const [inline]
 

non-zero if the lighting Manager must take into account the bbox of the transform.

Default behavior is false. Deriver must call setIsBigLightable() at initialisation to change it.

Definition at line 257 of file transform.h.

References getStateFlag, and IsBigLightable.

uint32 NL3D::CTransform::isLightable   const [inline]
 

true if the model can be lighted (such as CMeshBaseInstance) Default behavior is false.

Deriver must use setIsLightable(true) method if the instance can be lighted.

Returns:
0 if getUserLightable() is false, or if the model can't be lighted at all. else return a non-zero value

Definition at line 229 of file transform.h.

References getStateFlag, and IsFinalLightable.

Referenced by unfreezeHRC, and update.

uint32 NL3D::CTransform::isLoadBalancable   const [inline]
 

non-zero if the model is loadBalancable (ie added to the loadBalancing list if visible).

Definition at line 318 of file transform.h.

References getStateFlag, and IsLoadBalancable.

uint32 NL3D::CTransform::isMeshBaseInstance   const [inline]
 

non-zero if the CTransform can be casted to a CMeshBaseInstance.

Definition at line 323 of file transform.h.

References getStateFlag, and IsMeshBaseInstance.

uint32 NL3D::CTransform::isNeedUpdateFrozenStaticLightSetup   const [inline, protected]
 

non-zero if the object has a FrozenStaticLightSetup not correclty updated.

Definition at line 417 of file transform.h.

References getStateFlag, and IsNeedUpdateFrozenStaticLightSetup.

uint32 NL3D::CTransform::isNeedUpdateLighting   const [inline, protected]
 

non-zero if the object needs to updatelighting.

Definition at line 415 of file transform.h.

References getStateFlag, and IsNeedUpdateLighting.

Referenced by resetLighting.

uint32 NL3D::CTransform::isOpaque   [inline]
 

Definition at line 116 of file transform.h.

References getStateFlag, and IsOpaque.

uint32 NL3D::CTransform::isQuadGridClipEnabled   const [inline]
 

special feature for CQuadGridClipManager.

return a non-zero value if true

Definition at line 197 of file transform.h.

References getStateFlag, and QuadGridClipEnabled.

uint32 NL3D::CTransform::isRenderable   const [inline]
 

non-zero if the model is renderable (ie something may appear on screen).

Definition at line 320 of file transform.h.

References getStateFlag, and IsRenderable.

uint32 NL3D::CTransform::isSkeleton   const [inline]
 

return non-zero if I am a skeleton. if yes, static_cast<CSkeletonModel*> may be used.

Definition at line 297 of file transform.h.

virtual bool NL3D::CTransform::isSkinnable   const [inline, protected, virtual]
 

Deriver must change this method if the model can be skinned. called rarely.

Reimplemented in NL3D::CMeshInstance.

Definition at line 367 of file transform.h.

uint32 NL3D::CTransform::isSkinned   const [inline]
 

non-zero if the model is skinned onto a skeleton.

Definition at line 299 of file transform.h.

Referenced by registerToChannelMixer, setIsForceAnimDetail, updateWorldMatrixFromFather, and ~CTransform.

uint32 NL3D::CTransform::isTransparent   [inline]
 

Definition at line 117 of file transform.h.

References getStateFlag, and IsTransparent.

void NL3D::CTransform::registerBasic   [static]
 

Call at the begining of the program, to register the model, and the basic observers.

Reimplemented in NL3D::CCamera.

Definition at line 44 of file transform.cpp.

References NL3D::AnimDetailTravId, NL3D::ClipTravId, NL3D::HrcTravId, NL3D::LightTravId, NL3D::RenderTravId, and NL3D::TransformId.

void NL3D::CTransform::registerToChannelMixer CChannelMixer   chanMixer,
const std::string &    prefix
[virtual]
 

register transform channels (in global anim mode).

See also:
setChannelMixerOwnerShip

Implements NL3D::ITransformable.

Reimplemented in NL3D::CCamera.

Definition at line 221 of file transform.cpp.

References _ChannelMixer, _FatherSkeletonModel, NL3D::IAnimatable::addValue, getChannelMixerOwnerShip, getStateFlag, IsAnimDetailable, IsForceAnimDetail, isSkinned, nlassert, NL3D::ITransformable::OwnerBit, NL3D::ITransformable::PivotValue, NL3D::ITransformable::PosValue, NL3D::ITransformable::RotEulerValue, NL3D::ITransformable::RotQuatValue, NL3D::ITransformable::ScaleValue, setChannelMixerOwnerShip, and setStateFlag.

virtual void NL3D::CTransform::renderSkin float    alphaMRM [inline, protected, virtual]
 

Deriver must change this method if isSkinnable().

It renders the skin with current ctx of the skeletonModel SkeletonModel has already setuped the Light and the modelMatrix in the driver. If the skin is a MRM, it is the skeleton which drives the MRM level with alphaMRM: [0,1] default is nop

Reimplemented in NL3D::CMeshInstance.

Definition at line 383 of file transform.h.

virtual sint NL3D::CTransform::renderSkinGroupGeom float    alphaMRM,
uint    remainingVertices,
uint8   dest
[inline, protected, virtual]
 

if supportSkinGrouping(), called to transform the VBuffer, and store it into dest.

Returns:
number of vertices added to the VBuffer, or -1 if > reaminingVertices

Reimplemented in NL3D::CMeshMRMInstance.

Definition at line 394 of file transform.h.

virtual void NL3D::CTransform::renderSkinGroupPrimitives uint    baseVertex [inline, protected, virtual]
 

if supportSkinGrouping(), called to render the primitives of the already skinned vertices (VB activated in the driver).

Parameters:
baseVertex  value to add to each PBlock index.

Reimplemented in NL3D::CMeshMRMInstance.

Definition at line 398 of file transform.h.

void NL3D::CTransform::resetLighting  
 

reset lights which influence this models.

NB: the model is removed from all lights's list (except FrozenStaticLightSetup). Called by light rendering.

NB: the model is NOT removed from LightingManager (with eraseStaticLightedModel()).

Definition at line 842 of file transform.cpp.

References _LightContribution, IsNeedUpdateLighting, isNeedUpdateLighting, NL3D_MAX_LIGHT_CONTRIBUTION, and setStateFlag.

Referenced by freezeStaticLightSetup, unfreezeStaticLightSetup, and ~CTransform.

void NL3D::CTransform::setApplySkin bool    state [protected, virtual]
 

Deriver must change this method if isSkinnable().

called by CSkeletonModel::bindSkin() NB: _FatherSkeletonModel is valid when setApplySkin() is called The default behavior must be called: it sets the flag so isSkinned() return the good thing

Reimplemented in NL3D::CMeshInstance.

Definition at line 506 of file transform.cpp.

References IsSkinned, and setStateFlag.

void NL3D::CTransform::setChannelMixerOwnerShip bool    enable = true [inline]
 

This force gives this object ownership of the channel mixer it is registered to, so it will delete it when the dtor is called.

It should be called AFTER this object has been registered to a channel mixer, because a new registration will broke the ownership. This is useful for automatic animations, when there's no owner of the channel mixer that could delete it.

Definition at line 158 of file transform.h.

References IsDeleteChannelMixer, and setStateFlag.

Referenced by registerToChannelMixer.

void NL3D::CTransform::setClusterSystem CInstanceGroup   pIG [inline]
 

Definition at line 211 of file transform.h.

References _ClusterSystem.

void NL3D::CTransform::setDontUnfreezeChildren bool    val
 

Definition at line 299 of file transform.cpp.

References _HrcObs.

void NL3D::CTransform::setIsBigLightable bool    val [protected]
 

Deriver must use this method with true to indicate the model is a big lightable.

Definition at line 495 of file transform.cpp.

References IsBigLightable, and setStateFlag.

void NL3D::CTransform::setIsForceAnimDetail bool    val [protected]
 

Deriver must use this method with true if the model must be AnimDetail-ed whatever registerToChannelMixer() has been called or not.

Definition at line 512 of file transform.cpp.

References _ChannelMixer, _FatherSkeletonModel, getStateFlag, IsAnimDetailable, IsForceAnimDetail, isSkinned, nlassert, and setStateFlag.

void NL3D::CTransform::setIsLightable bool    val [protected]
 

Deriver must use this method with true to indicate the model support lighting.

Definition at line 473 of file transform.cpp.

References getStateFlag, IsFinalLightable, IsLightable, IsUserLightable, and setStateFlag.

void NL3D::CTransform::setIsLoadbalancable bool    val [protected]
 

Deriver must use this method with true to indicate the model support loadBalancing.

Definition at line 527 of file transform.cpp.

References IsLoadBalancable, and setStateFlag.

void NL3D::CTransform::setIsMeshBaseInstance bool    val [inline, protected]
 

For CMeshBaseInstance only.

Definition at line 453 of file transform.h.

References IsMeshBaseInstance, and setStateFlag.

void NL3D::CTransform::setIsRenderable bool    val [protected]
 

Deriver must use this method with true to indicate the model can be rendered.

"can be rendered" means if object has to be inserted in RenderTrav list. eg: a mesh must be inserted in a render list, but not a light, or a NULL transform. The default is false.

Definition at line 489 of file transform.cpp.

References IsRenderable, and setStateFlag.

void NL3D::CTransform::setIsSkeleton bool    val [protected]
 

For CSkeletonModel only.

Definition at line 500 of file transform.cpp.

References IsSkeleton, and setStateFlag.

void NL3D::CTransform::setLoadBalancingGroup const std::string &    group
 

Change the load Balancing group of a model.

Every models are in a special LoadBalancingGroup. NB: the group is created if did not exist. NB: if models are skinned, it is their Skeleton which drive the group

By default, models lies in the "Default" group, but Skeletons for skinning and ParticlesSystems which are in "Skin" and "Fx" group respectively. The "Default" group is special because it is not balanced (ie models are only degraded from their distance to camera)

Definition at line 428 of file transform.cpp.

References NL3D::IModel::getObs, NL3D::LoadBalancingTravId, and nlassert.

void NL3D::CTransform::setLogicInfo ILogicInfo   logicInfo [inline]
 

Set the LogicInfo for this transfrom, eg to retrieve statc light information, see ILogicInfo.

Ptr is kept in CTransfrom, so should call setLogicInfo(NULL) before to clean up.

Definition at line 265 of file transform.h.

References _LogicInfo.

void NL3D::CTransform::setMeanColor CRGBA    color
 

set the Mean color of the transform.

The mean color can be used for many purpose, such as drawing objects if the textures are not loaded. It is used also for Lod Character. Default color is (255,255,255)

Definition at line 455 of file transform.cpp.

References _FatherSkeletonModel, and _MeanColor.

void NL3D::CTransform::setOpacity bool    v [inline]
 

Definition at line 114 of file transform.h.

References IsOpaque, setStateFlag, and v.

Referenced by NL3D::CCoarseMeshManager::CCoarseMeshManager, NL3D::CFlareModel::CFlareModel, NL3D::CParticleSystemModel::CParticleSystemModel, NL3D::CSkeletonModel::CSkeletonModel, NL3D::CVegetableBlendLayerModel::CVegetableBlendLayerModel, NL3D::CWaterModel::CWaterModel, NL3D::CSegRemanence::updateOpacityFromShape, and NL3D::CParticleSystemModel::updateOpacityInfos.

void NL3D::CTransform::setOrderingLayer uint    layer [inline]
 

Set the current layer for this transform.

Typically, this is used to sort transparent objects. Isn't used with solid objects. For now : Layer 0 is for underwater Layer 1 is for water surfaces Layer 2 is for object above water

Definition at line 127 of file transform.h.

References _OrderingLayer.

Referenced by NL3D::CWaterModel::CWaterModel.

void NL3D::CTransform::setStateFlag uint32    mask,
bool    val
[inline, private]
 

This is used to set Static or dynamic flags. val must take 0 or 1.

Definition at line 540 of file transform.h.

References _StateFlags.

Referenced by freezeHRC, freezeStaticLightSetup, registerToChannelMixer, resetLighting, setApplySkin, setChannelMixerOwnerShip, setIsBigLightable, setIsForceAnimDetail, setIsLightable, setIsLoadbalancable, setIsMeshBaseInstance, setIsRenderable, setIsSkeleton, setOpacity, setTransparency, setUserLightable, unfreezeHRC, and unfreezeStaticLightSetup.

void NL3D::CTransform::setTransparency bool    v [inline]
 

Accessors for opacity/transparency Warning: if you call it on a Skin which is already binded to a skeleton, you should call CSkeletonModel::dirtSkinRenderLists(), else it won't takes effect.

Definition at line 113 of file transform.h.

References IsTransparent, setStateFlag, and v.

Referenced by NL3D::CCoarseMeshManager::CCoarseMeshManager, NL3D::CFlareModel::CFlareModel, NL3D::CParticleSystemModel::CParticleSystemModel, NL3D::CSkeletonModel::CSkeletonModel, NL3D::CVegetableBlendLayerModel::CVegetableBlendLayerModel, NL3D::CWaterModel::CWaterModel, NL3D::CSegRemanence::updateOpacityFromShape, NL3D::CParticleSystemModel::updateOpacityInfos, and NL3D::CSkeletonModel::updateSkinRenderLists.

void NL3D::CTransform::setUserLightable bool    enable
 

Set the UserLightable flag.

if false, isLightable() will always return false. Doing this, user can disable lighting on a model which may be interesting for speed. Default behavior is UserLightable==true.

Definition at line 480 of file transform.cpp.

References getStateFlag, IsFinalLightable, IsLightable, IsUserLightable, and setStateFlag.

void NL3D::CTransform::show  
 

Show the objet and his sons.

Definition at line 170 of file transform.cpp.

References foulTransform, and Visibility.

virtual bool NL3D::CTransform::supportSkinGrouping   const [inline, protected, virtual]
 

Deriver may support SkinGrouping if isSkinnable().

It renders the skin with current ctx of the skeletonModel, but torn in 2 pass: fillVB,a nd renderPrimitives Deriver may check NL3D_MESH_SKIN_MANAGER_VERTEXFORMAT and NL3D_MESH_SKIN_MANAGER_MAXVERTICES

Reimplemented in NL3D::CMeshMRMInstance.

Definition at line 390 of file transform.h.

void NL3D::CTransform::unfreezeHRC  
 

see freezeHRC().

Definition at line 332 of file transform.cpp.

References _FreezeHRCState, _HrcObs, _LightedModelIt, _LightObs, FreezeHRCStateDisabled, isLightable, NL3D::IModel::linkToValidateList, QuadGridClipEnabled, and setStateFlag.

void NL3D::CTransform::unfreezeStaticLightSetup  
 

unFreeze the Static Light Setup.

Must be called if static pointLights are deleted. NB: it calls resetLighting() first. NB: do not need to call it if pointLights and this transform are deleted at same time.

Definition at line 915 of file transform.cpp.

References _LightContribution, IsNeedUpdateFrozenStaticLightSetup, resetLighting, and setStateFlag.

void NL3D::CTransform::update   [protected, virtual]
 

Implement the update method.

Reimplemented from NL3D::IModel.

Reimplemented in NL3D::CCamera.

Definition at line 367 of file transform.cpp.

References _FreezeHRCState, _HrcObs, _LastTransformableMatrixDate, _LightedModelIt, _LightObs, NL3D::IModel::foul, isLightable, TransformDirty, and NL3D::IModel::unlinkFromValidateList.

void NL3D::CTransform::updateWorldMatrixFromFather   [private]
 

For Skeleton Object Stick.

update the wolrd matrix. no-op if skinned. use standard father WorldMatrix if !_FatherSkeletonModel else get the correct boneId WorldMatrix from _FatherSkeletonModel

Definition at line 255 of file transform.cpp.

References _FatherBoneId, _FatherSkeletonModel, _HrcObs, CTransform, and isSkinned.


Friends And Related Function Documentation

friend class CSkeletonModel [friend]
 

Definition at line 465 of file transform.h.

Referenced by getSkeletonModel.

friend class CSkeletonModelAnimDetailObs [friend]
 

Reimplemented in NL3D::CSkeletonModel.

Definition at line 466 of file transform.h.

friend class CSkeletonModelRenderObs [friend]
 

Reimplemented in NL3D::CSkeletonModel.

Definition at line 467 of file transform.h.

friend class CTransformAnimDetailObs [friend]
 

Definition at line 464 of file transform.h.

friend class CTransformClipObs [friend]
 

Reimplemented in NL3D::CSkeletonModel.

Definition at line 462 of file transform.h.

Referenced by initModel.

friend class CTransformHrcObs [friend]
 

Definition at line 461 of file transform.h.

Referenced by initModel.

friend class CTransformLightObs [friend]
 

Definition at line 463 of file transform.h.

Referenced by initModel.


Member Data Documentation

NLMISC::CRefPtr<CChannelMixer> NL3D::CTransform::_ChannelMixer [private]
 

Definition at line 478 of file transform.h.

Referenced by getChannelMixer, registerToChannelMixer, setIsForceAnimDetail, and ~CTransform.

CTransformClipObs* NL3D::CTransform::_ClipObs [protected]
 

Definition at line 560 of file transform.h.

Referenced by CTransform, getLastClippedState, initModel, NL3D::CSkeletonModel::isClipVisible, and NL3D::CPointLightModel::isClipVisible.

CInstanceGroup* NL3D::CTransform::_ClusterSystem [private]
 

Definition at line 483 of file transform.h.

Referenced by CTransform, getClusterSystem, and setClusterSystem.

uint NL3D::CTransform::_FatherBoneId [protected]
 

Definition at line 404 of file transform.h.

Referenced by updateWorldMatrixFromFather.

CSkeletonModel* NL3D::CTransform::_FatherSkeletonModel [protected]
 

Definition at line 402 of file transform.h.

Referenced by CTransform, getSkeletonModel, NL3D::CMeshMRMInstance::getSkinBoneUsage, NL3D::CMeshInstance::getSkinBoneUsage, registerToChannelMixer, NL3D::CMeshMRMInstance::setApplySkin, NL3D::CMeshInstance::setApplySkin, setIsForceAnimDetail, setMeanColor, updateWorldMatrixFromFather, NL3D::CMeshInstance::~CMeshInstance, NL3D::CMeshMRMInstance::~CMeshMRMInstance, NL3D::CParticleSystemModel::~CParticleSystemModel, NL3D::CSegRemanence::~CSegRemanence, and ~CTransform.

bool NL3D::CTransform::_ForceCLodSticked [private]
 

Definition at line 492 of file transform.h.

Referenced by CTransform, and getShowWhenLODSticked.

TFreezeHRCState NL3D::CTransform::_FreezeHRCState [private]
 

Definition at line 487 of file transform.h.

Referenced by CTransform, freezeHRC, unfreezeHRC, and update.

CTransformHrcObs* NL3D::CTransform::_HrcObs [protected]
 

Reimplemented in NL3D::CVegetableBlendLayerModel.

Definition at line 558 of file transform.h.

Referenced by NL3D::CSkeletonModel::computeDisplayLodCharacterPriority, CTransform, freeze, NL3D::CPointLightModel::getHrcObs, getWorldMatrix, initModel, NL3D::CPointLightModel::isHrcVisible, NL3D::CSegRemanence::render, setDontUnfreezeChildren, unfreezeHRC, update, and updateWorldMatrixFromFather.

uint64 NL3D::CTransform::_LastTransformableMatrixDate [private]
 

Definition at line 481 of file transform.h.

Referenced by CTransform, and update.

CLightContribution NL3D::CTransform::_LightContribution [protected]
 

The contribution of all lights. This enlarge the struct only of approx 15%.

Definition at line 412 of file transform.h.

Referenced by freezeStaticLightSetup, NL3D::CTransformShape::getLightContribution, NL3D::CMeshMultiLodInstance::getLightContribution, NL3D::CSkeletonModel::getSkeletonLightContribution, resetLighting, and unfreezeStaticLightSetup.

CLightingManager::CQGItLightedModel NL3D::CTransform::_LightedModelIt [protected]
 

each transform may be in a quadGird of lighted models (see CLightingManager).

Definition at line 420 of file transform.h.

Referenced by unfreezeHRC, update, and ~CTransform.

CTransformLightObs* NL3D::CTransform::_LightObs [protected]
 

Definition at line 562 of file transform.h.

Referenced by CTransform, initModel, unfreezeHRC, update, and ~CTransform.

ILogicInfo* NL3D::CTransform::_LogicInfo [private]
 

See ILogicInfo. Used for lighting. default is NULL.

Definition at line 496 of file transform.h.

Referenced by CTransform, and setLogicInfo.

CRGBA NL3D::CTransform::_MeanColor [private]
 

see setMeanColor().

Definition at line 500 of file transform.h.

Referenced by CTransform, getMeanColor, and setMeanColor.

uint8 NL3D::CTransform::_OrderingLayer [private]
 

Definition at line 489 of file transform.h.

Referenced by CTransform, getOrderingLayer, and setOrderingLayer.

uint32 NL3D::CTransform::_StateFlags [private]
 

Flags for the General State of the Transform. They are both static or dynamic flags.

Definition at line 537 of file transform.h.

Referenced by CTransform, getStateFlag, and setStateFlag.

CTrackDefaultVector NL3D::CTransform::DefaultPivot [static, private]
 

Referenced by getDefaultTrack.

CTrackDefaultVector NL3D::CTransform::DefaultPos [static, private]
 

Referenced by getDefaultTrack.

CTrackDefaultVector NL3D::CTransform::DefaultRotEuler [static, private]
 

Referenced by getDefaultTrack.

CTrackDefaultQuat NL3D::CTransform::DefaultRotQuat [static, private]
 

Referenced by getDefaultTrack.

CTrackDefaultVector NL3D::CTransform::DefaultScale [static, private]
 

Referenced by getDefaultTrack.

CHrcTrav::TVisibility NL3D::CTransform::Visibility [private]
 

Definition at line 338 of file transform.h.

Referenced by CTransform, getVisibility, heritVisibility, hide, and show.


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