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

Something which can be transformed in 3D space / animated. More...

#include <transformable.h>

Inheritance diagram for NL3D::ITransformable:

NL3D::IAnimatable NL3D::CBone NL3D::CTransform 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.

Herited from IAnimatable

enum  TAnimValues {
  OwnerBit = IAnimatable::AnimValueLast, PosValue, RotEulerValue, RotQuatValue,
  ScaleValue, PivotValue, AnimValueLast
}
 Added values. More...

virtual IAnimatedValuegetValue (uint valueId)
 From IAnimatable. More...

virtual const char * getValueName (uint valueId) const
 From IAnimatable. More...

virtual ITrackgetDefaultTrack (uint valueId)=0
 From IAnimatable. Deriver must implement this. More...

virtual void registerToChannelMixer (CChannelMixer *chanMixer, const std::string &prefix)=0
 From IAnimatable. Deriver must implement this (channels may be detail-ed or not). More...


Public Types

enum  TTransformMode { DirectMatrix = 0, RotEuler, RotQuat, TransformModeCount }

Public Methods

 ITransformable ()
 Constructor. By default, RotQuat mode. More...

virtual ~ITransformable ()
const CMatrix & getMatrix () const
 Get the matrix, compute her if necessary (work in all modes). More...

bool compareMatrixDate (uint64 callerDate) const
 Tells if the LocalMatrix is newer than what caller except. More...

uint64 getMatrixDate () const
 return the last date of computed matrix. More...

Transform Mode.
void setTransformMode (TTransformMode mode, CMatrix::TRotOrder ro=CMatrix::ZXY)
 Change the transform mode. Components or matrix are not reseted. More...

Matrix operations.
void setPos (const CVector &pos)
 Work only in Rot* mode(nlassert). More...

void setPos (float x, float y, float z)
 Work only in Rot* mode(nlassert). More...

void setRotEuler (const CVector &rot)
 Work only in RotEuler mode(nlassert). More...

void setRotEuler (float rotX, float rotY, float rotZ)
 Work only in RotEuler mode(nlassert). More...

void setRotQuat (const CQuat &quat)
 Work only in RotQuat mode (nlassert). More...

void setScale (const CVector &scale)
 Work only in Rot* mode (nlassert). More...

void setScale (float scaleX, float scaleY, float scaleZ)
 Work only in Rot* mode (nlassert). More...

void setScale (float scale)
 Work only in Rot* mode (nlassert). More...

void setPivot (const CVector &pivot)
 Work only in Rot* mode (nlassert). More...

void setPivot (float x, float y, float z)
 Work only in Rot* mode (nlassert). More...

void setMatrix (const CMatrix &mat)
 Work only in DirecTMatrix mode (nlassert). More...

Matrix Get operations.
TTransformMode getTransformMode ()
 get the current transform mode. More...

CMatrix::TRotOrder getRotOrder ()
 get the current rotorder (information vlaid only when RotEuler mode). More...

void getPos (CVector &pos)
 Work only in Rot* mode(nlassert). More...

void getRotEuler (CVector &rot)
 Work only in RotEuler mode(nlassert). More...

void getRotQuat (CQuat &quat)
 Work only in RotQuat mode (nlassert). More...

void getScale (CVector &scale)
 Work only in Rot* mode (nlassert). More...

void getPivot (CVector &pivot)
 Work only in Rot* mode (nlassert). More...

CVector getPos ()
 Work only in Rot* mode(nlassert). More...

CVector getRotEuler ()
 Work only in RotEuler mode(nlassert). More...

CQuat getRotQuat ()
 Work only in RotQuat mode (nlassert). More...

CVector getScale ()
 Work only in Rot* mode (nlassert). More...

CVector getPivot ()
 Work only in Rot* mode (nlassert). More...

Misc
void lookAt (const CVector &eye, const CVector &target, float roll=0.f)
 Setup Matrix by the lookAt method. More...


Static Public Methods

const char * getPosValueName ()
const char * getRotEulerValueName ()
const char * getRotQuatValueName ()
const char * getScaleValueName ()
const char * getPivotValueName ()

Private Methods

void clearTransformFlags () const
void updateMatrix () const
bool needCompute () const
 Tells if the matrix needs to be computed, ie, if data are modified. More...


Private Attributes

CMatrix _LocalMatrix
TTransformMode _Mode
CMatrix::TRotOrder _RotOrder
uint64 _LocalMatrixDate
CAnimatedValueVector _Pos
CAnimatedValueVector _RotEuler
CAnimatedValueQuat _RotQuat
CAnimatedValueVector _Scale
CAnimatedValueVector _Pivot

Detailed Description

Something which can be transformed in 3D space / animated.

By default Transformmode is RotQuat.

Author:
Lionel Berenguier , Nevrax France
Date:
2001

Definition at line 54 of file transformable.h.


Member Enumeration Documentation

enum NL3D::ITransformable::TAnimValues
 

Added values.

Enumeration values:
OwnerBit 
PosValue 
RotEulerValue 
RotQuatValue 
ScaleValue 
PivotValue 
AnimValueLast 

Reimplemented from NL3D::IAnimatable.

Reimplemented in NL3D::CCamera.

Definition at line 280 of file transformable.h.

enum NL3D::ITransformable::TTransformMode
 

Enumeration values:
DirectMatrix 
RotEuler 
RotQuat 
TransformModeCount 

Definition at line 58 of file transformable.h.

Referenced by getTransformMode, and setTransformMode.


Constructor & Destructor Documentation

NL3D::ITransformable::ITransformable  
 

Constructor. By default, RotQuat mode.

Definition at line 37 of file transformable.cpp.

References _LocalMatrixDate, _Mode, _Pivot, _Pos, _RotEuler, _RotQuat, _Scale, AnimValueLast, and RotQuat.

Referenced by clearTransformFlags.

virtual NL3D::ITransformable::~ITransformable   [inline, virtual]
 

Definition at line 72 of file transformable.h.


Member Function Documentation

void NL3D::ITransformable::clearTransformFlags   const [private]
 

Definition at line 124 of file transformable.cpp.

References ITransformable, OwnerBit, PivotValue, PosValue, RotEulerValue, RotQuatValue, and ScaleValue.

Referenced by updateMatrix.

bool NL3D::ITransformable::compareMatrixDate uint64    callerDate const [inline]
 

Tells if the LocalMatrix is newer than what caller except.

This return true either if the matrix components (pos/rot etc...) are touched, or if matrix is newer than caller date.

Definition at line 82 of file transformable.h.

References _LocalMatrixDate, and needCompute.

virtual ITrack* NL3D::ITransformable::getDefaultTrack uint    valueId [pure virtual]
 

From IAnimatable. Deriver must implement this.

Implements NL3D::IAnimatable.

Implemented in NL3D::CBone.

const CMatrix& NL3D::ITransformable::getMatrix   const [inline]
 

Get the matrix, compute her if necessary (work in all modes).

Definition at line 76 of file transformable.h.

References _LocalMatrix, and updateMatrix.

Referenced by NL3D::CParticleSystemModel::checkAgainstPyramid, NL3D::CBone::compute, and NL3D::CCloudScape::render.

uint64 NL3D::ITransformable::getMatrixDate   const [inline]
 

return the last date of computed matrix.

updateMatrix() if necessary.

Definition at line 90 of file transformable.h.

References _LocalMatrixDate, and updateMatrix.

CVector NL3D::ITransformable::getPivot   [inline]
 

Work only in Rot* mode (nlassert).

Definition at line 255 of file transformable.h.

References _Mode, _Pivot, nlassert, RotEuler, and RotQuat.

void NL3D::ITransformable::getPivot CVector &    pivot [inline]
 

Work only in Rot* mode (nlassert).

Definition at line 224 of file transformable.h.

References _Mode, _Pivot, nlassert, RotEuler, and RotQuat.

const char * NL3D::ITransformable::getPivotValueName   [static]
 

Definition at line 117 of file transformable.cpp.

Referenced by getValueName.

CVector NL3D::ITransformable::getPos void    [inline]
 

Work only in Rot* mode(nlassert).

Definition at line 231 of file transformable.h.

References _Mode, _Pos, nlassert, RotEuler, and RotQuat.

Referenced by NL3D::CBone::compute, NL3D::CWaterModel::getAttenuatedHeight, and NL3D::CWaterModel::getHeight.

void NL3D::ITransformable::getPos CVector &    pos [inline]
 

Work only in Rot* mode(nlassert).

Definition at line 200 of file transformable.h.

References _Mode, _Pos, nlassert, RotEuler, and RotQuat.

const char * NL3D::ITransformable::getPosValueName   [static]
 

Definition at line 97 of file transformable.cpp.

Referenced by getValueName.

CVector NL3D::ITransformable::getRotEuler   [inline]
 

Work only in RotEuler mode(nlassert).

Definition at line 237 of file transformable.h.

References _Mode, _RotEuler, nlassert, and RotEuler.

void NL3D::ITransformable::getRotEuler CVector &    rot [inline]
 

Work only in RotEuler mode(nlassert).

Definition at line 206 of file transformable.h.

References _Mode, _RotEuler, nlassert, and RotEuler.

const char * NL3D::ITransformable::getRotEulerValueName   [static]
 

Definition at line 102 of file transformable.cpp.

Referenced by getValueName.

CMatrix::TRotOrder NL3D::ITransformable::getRotOrder   [inline]
 

get the current rotorder (information vlaid only when RotEuler mode).

Definition at line 194 of file transformable.h.

References _RotOrder.

CQuat NL3D::ITransformable::getRotQuat   [inline]
 

Work only in RotQuat mode (nlassert).

Definition at line 243 of file transformable.h.

References _Mode, _RotQuat, nlassert, and RotQuat.

void NL3D::ITransformable::getRotQuat CQuat &    quat [inline]
 

Work only in RotQuat mode (nlassert).

Definition at line 212 of file transformable.h.

References _Mode, _RotQuat, nlassert, and RotQuat.

const char * NL3D::ITransformable::getRotQuatValueName   [static]
 

Definition at line 107 of file transformable.cpp.

Referenced by getValueName.

CVector NL3D::ITransformable::getScale void    [inline]
 

Work only in Rot* mode (nlassert).

Definition at line 249 of file transformable.h.

References _Mode, _Scale, nlassert, RotEuler, and RotQuat.

void NL3D::ITransformable::getScale CVector &    scale [inline]
 

Work only in Rot* mode (nlassert).

Definition at line 218 of file transformable.h.

References _Mode, _Scale, nlassert, RotEuler, and RotQuat.

const char * NL3D::ITransformable::getScaleValueName   [static]
 

Definition at line 112 of file transformable.cpp.

Referenced by getValueName.

TTransformMode NL3D::ITransformable::getTransformMode   [inline]
 

get the current transform mode.

Definition at line 189 of file transformable.h.

References _Mode, and TTransformMode.

Referenced by NL3D::CBone::compute.

IAnimatedValue * NL3D::ITransformable::getValue uint    valueId [virtual]
 

From IAnimatable.

Implements NL3D::IAnimatable.

Reimplemented in NL3D::CCamera.

Definition at line 58 of file transformable.cpp.

References _Pivot, _Pos, _RotEuler, _RotQuat, _Scale, nlstop, PivotValue, PosValue, RotEulerValue, RotQuatValue, and ScaleValue.

const char * NL3D::ITransformable::getValueName uint    valueId const [virtual]
 

From IAnimatable.

Implements NL3D::IAnimatable.

Reimplemented in NL3D::CCamera.

Definition at line 77 of file transformable.cpp.

References getPivotValueName, getPosValueName, getRotEulerValueName, getRotQuatValueName, getScaleValueName, nlstop, PivotValue, PosValue, RotEulerValue, RotQuatValue, and ScaleValue.

void NL3D::ITransformable::lookAt const CVector &    eye,
const CVector &    target,
float    roll = 0.f
 

Setup Matrix by the lookAt method.

Work only in DirectMatrix mode and RotQuat mode (not euler...).

Parameters:
eye  is the coordinate of the object.
target  is the point the object look at.
roll  is the roll angle in radian along the object's Y axis.

Definition at line 169 of file transformable.cpp.

References _Mode, DirectMatrix, nlassert, RotQuat, setMatrix, setPivot, setPos, setRotQuat, and setScale.

bool NL3D::ITransformable::needCompute   const [inline, private]
 

Tells if the matrix needs to be computed, ie, if data are modified.

Definition at line 334 of file transformable.h.

References _Mode, DirectMatrix, NL3D::IAnimatable::isTouched, and OwnerBit.

Referenced by compareMatrixDate, and updateMatrix.

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

From IAnimatable. Deriver must implement this (channels may be detail-ed or not).

Implements NL3D::IAnimatable.

Implemented in NL3D::CBone.

void NL3D::ITransformable::setMatrix const CMatrix &    mat [inline]
 

Work only in DirecTMatrix mode (nlassert).

Definition at line 174 of file transformable.h.

References _LocalMatrix, _LocalMatrixDate, _Mode, DirectMatrix, and nlassert.

Referenced by lookAt.

void NL3D::ITransformable::setPivot float    x,
float    y,
float    z
[inline]
 

Work only in Rot* mode (nlassert).

Definition at line 169 of file transformable.h.

References setPivot, x, y, and z.

void NL3D::ITransformable::setPivot const CVector &    pivot [inline]
 

Work only in Rot* mode (nlassert).

Definition at line 162 of file transformable.h.

References _Mode, _Pivot, nlassert, OwnerBit, PivotValue, RotEuler, RotQuat, and NL3D::IAnimatable::touch.

Referenced by lookAt, and setPivot.

void NL3D::ITransformable::setPos float    x,
float    y,
float    z
[inline]
 

Work only in Rot* mode(nlassert).

Definition at line 121 of file transformable.h.

References setPos, x, y, and z.

void NL3D::ITransformable::setPos const CVector &    pos [inline]
 

Work only in Rot* mode(nlassert).

Definition at line 114 of file transformable.h.

References _Mode, _Pos, nlassert, OwnerBit, PosValue, RotEuler, RotQuat, and NL3D::IAnimatable::touch.

Referenced by lookAt, and setPos.

void NL3D::ITransformable::setRotEuler float    rotX,
float    rotY,
float    rotZ
[inline]
 

Work only in RotEuler mode(nlassert).

Definition at line 133 of file transformable.h.

References setRotEuler.

void NL3D::ITransformable::setRotEuler const CVector &    rot [inline]
 

Work only in RotEuler mode(nlassert).

Definition at line 126 of file transformable.h.

References _Mode, _RotEuler, nlassert, OwnerBit, RotEuler, RotEulerValue, and NL3D::IAnimatable::touch.

Referenced by setRotEuler.

void NL3D::ITransformable::setRotQuat const CQuat &    quat [inline]
 

Work only in RotQuat mode (nlassert).

Definition at line 138 of file transformable.h.

References _Mode, _RotQuat, nlassert, OwnerBit, RotQuat, RotQuatValue, and NL3D::IAnimatable::touch.

Referenced by lookAt, and NL3D::CCamera::update.

void NL3D::ITransformable::setScale float    scale [inline]
 

Work only in Rot* mode (nlassert).

Definition at line 157 of file transformable.h.

References setScale.

void NL3D::ITransformable::setScale float    scaleX,
float    scaleY,
float    scaleZ
[inline]
 

Work only in Rot* mode (nlassert).

Definition at line 152 of file transformable.h.

References setScale.

void NL3D::ITransformable::setScale const CVector &    scale [inline]
 

Work only in Rot* mode (nlassert).

Definition at line 145 of file transformable.h.

References _Mode, _Scale, nlassert, OwnerBit, RotEuler, RotQuat, ScaleValue, and NL3D::IAnimatable::touch.

Referenced by lookAt, and setScale.

void NL3D::ITransformable::setTransformMode TTransformMode    mode,
CMatrix::TRotOrder    ro = CMatrix::ZXY
[inline]
 

Change the transform mode. Components or matrix are not reseted.

Definition at line 100 of file transformable.h.

References _Mode, _RotOrder, OwnerBit, PosValue, NL3D::IAnimatable::touch, and TTransformMode.

Referenced by NL3D::CCamera::enableTargetAnimation.

void NL3D::ITransformable::updateMatrix   const [private]
 

Definition at line 141 of file transformable.cpp.

References _LocalMatrix, _LocalMatrixDate, _Mode, _Pivot, _Pos, _RotEuler, _RotOrder, _RotQuat, _Scale, clearTransformFlags, needCompute, and RotEuler.

Referenced by getMatrix, and getMatrixDate.


Member Data Documentation

CMatrix NL3D::ITransformable::_LocalMatrix [private]
 

Definition at line 315 of file transformable.h.

Referenced by getMatrix, setMatrix, and updateMatrix.

uint64 NL3D::ITransformable::_LocalMatrixDate [private]
 

Definition at line 318 of file transformable.h.

Referenced by compareMatrixDate, getMatrixDate, ITransformable, setMatrix, and updateMatrix.

TTransformMode NL3D::ITransformable::_Mode [private]
 

Definition at line 316 of file transformable.h.

Referenced by getPivot, getPos, getRotEuler, getRotQuat, getScale, getTransformMode, ITransformable, lookAt, needCompute, setMatrix, setPivot, setPos, setRotEuler, setRotQuat, setScale, setTransformMode, and updateMatrix.

CAnimatedValueVector NL3D::ITransformable::_Pivot [private]
 

Definition at line 325 of file transformable.h.

Referenced by getPivot, getValue, ITransformable, setPivot, and updateMatrix.

CAnimatedValueVector NL3D::ITransformable::_Pos [private]
 

Definition at line 321 of file transformable.h.

Referenced by getPos, getValue, ITransformable, setPos, and updateMatrix.

CAnimatedValueVector NL3D::ITransformable::_RotEuler [private]
 

Definition at line 322 of file transformable.h.

Referenced by getRotEuler, getValue, ITransformable, setRotEuler, and updateMatrix.

CMatrix::TRotOrder NL3D::ITransformable::_RotOrder [private]
 

Definition at line 317 of file transformable.h.

Referenced by getRotOrder, setTransformMode, and updateMatrix.

CAnimatedValueQuat NL3D::ITransformable::_RotQuat [private]
 

Definition at line 323 of file transformable.h.

Referenced by getRotQuat, getValue, ITransformable, setRotQuat, and updateMatrix.

CAnimatedValueVector NL3D::ITransformable::_Scale [private]
 

Definition at line 324 of file transformable.h.

Referenced by getScale, getValue, ITransformable, setScale, and updateMatrix.


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