#include <bone.h>
Inheritance diagram for NL3D::CBone:
Nevrax France
Definition at line 96 of file bone.h.
Herited from IAnimatable | |
enum | TAnimValues { OwnerBit = IAnimatable::AnimValueLast, PosValue, RotEulerValue, RotQuatValue, ScaleValue, PivotValue, AnimValueLast } |
Added values. More... | |
virtual IAnimatedValue * | getValue (uint valueId) |
From IAnimatable. | |
virtual const char * | getValueName (uint valueId) const |
From IAnimatable. | |
Public Types | |
enum | TTransformMode { DirectMatrix = 0, RotEuler, RotQuat, TransformModeCount } |
Public Member Functions | |
CBone (CBoneBase *boneBase) | |
bool | compareMatrixDate (uint64 callerDate) const |
void | compute (CBone *parent, const CMatrix &rootMatrix, CSkeletonModel *skeletonForAnimCtrl) |
void | forceAnimate (CChannelMixer &chanMixer) |
CBoneBase & | getBoneBase () const |
retrieve the boneBase | |
const std::string & | getBoneName () const |
retrieve the boneName from BoneBase. | |
const CMatrix & | getBoneSkinMatrix () const |
retrieve the BoneSkinMatrix computed in compute(). | |
sint32 | getFatherId () const |
retrieve the fatherId from BoneBase. | |
const CMatrix & | getLocalSkeletonMatrix () const |
retrieve the matrix local to the skeleton, computed in compute(). | |
const CMatrix & | getMatrix () const |
Get the matrix, compute her if necessary (work in all modes). | |
uint64 | getMatrixDate () const |
const CMatrix & | getWorldMatrix () const |
retrieve the WorldMatrix computed in compute(). | |
void | interpolateBoneSkinMatrix (const CMatrix &otherMatrix, float interp) |
void | lodEnableChannels (CChannelMixer *chanMixer, bool enable) |
enable the channels (lodEnable) associated to this bone in the channelMixer. | |
Herited from ITransformable | |
virtual ITrack * | getDefaultTrack (uint valueId) |
retrive the default trak from skeleton shape. | |
virtual void | registerToChannelMixer (CChannelMixer *chanMixer, const std::string &prefix) |
register the ITransformable channels as detailled channels. | |
Static Public Member Functions | |
const char * | getPivotValueName () |
const char * | getPosValueName () |
const char * | getRotEulerValueName () |
const char * | getRotQuatValueName () |
const char * | getScaleValueName () |
Data Fields | |
IAnimCtrl * | _AnimCtrl |
NLMISC::CBSphere | _MaxSphere |
Protected Member Functions | |
sint | addValue (CChannelMixer *chanMixer, uint valueId, uint ownerValueId, const std::string &prefix, bool detail) |
void | clearFlag (uint valueId) |
This method clear a bit in the bitset. | |
void | setFlag (uint valueId) |
This method set a bit in the bitset. | |
Private Attributes | |
NLMISC::CRefPtr< CBoneBase > | _BoneBase |
CMatrix | _BoneSkinMatrix |
CMatrix | _LocalSkeletonMatrix |
sint | _PivotChannelId |
sint | _PosChannelId |
sint | _RotEulerChannelId |
sint | _RotQuatChannelId |
sint | _ScaleChannelId |
CMatrix | _WorldMatrix |
|
Added values.
Reimplemented from NL3D::IAnimatable. Reimplemented in NL3D::CCamera, NL3D::CMeshBaseInstance, NL3D::CParticleSystemModel, NL3D::CSegRemanence, and NL3D::CSkeletonModel. Definition at line 280 of file transformable.h.
00281 { 00282 OwnerBit= IAnimatable::AnimValueLast, 00283 PosValue, 00284 RotEulerValue, 00285 RotQuatValue, 00286 ScaleValue, 00287 PivotValue, 00288 AnimValueLast 00289 }; |
|
Definition at line 58 of file transformable.h. Referenced by NL3D::ITransformable::getTransformMode().
00059 { 00060 DirectMatrix=0, // DirectMatrixMode. 00061 RotEuler, // Matrix is computed from sperated composantes, with euler rotation. 00062 RotQuat, // Matrix is computed from sperated composantes, with quat rotation (default). 00063 00064 TransformModeCount 00065 }; |
|
Constructor. build a bone from a CBoneBase*. By defautl, a bone is in RotQuat transform mode. This ctor:
Definition at line 93 of file bone.cpp. References _AnimCtrl, _BoneBase, _PivotChannelId, _PosChannelId, _RotEulerChannelId, _RotQuatChannelId, _ScaleChannelId, NL3D::CAnimatedValueQuat, NL3D::CAnimatedValueVector, and nlassert.
00094 { 00095 nlassert(boneBase); 00096 _BoneBase= boneBase; 00097 00098 // IAnimatable. 00099 IAnimatable::resize(AnimValueLast); 00100 00101 ITransformable::setTransformMode(ITransformable::RotQuat); 00102 ITransformable::setPos( ((CAnimatedValueVector&)_BoneBase->DefaultPos.getValue()).Value ); 00103 ITransformable::setRotQuat( ((CAnimatedValueQuat&)_BoneBase->DefaultRotQuat.getValue()).Value ); 00104 ITransformable::setScale( ((CAnimatedValueVector&)_BoneBase->DefaultScale.getValue()).Value ); 00105 ITransformable::setPivot( ((CAnimatedValueVector&)_BoneBase->DefaultPivot.getValue()).Value ); 00106 00107 // By default, the bone is not binded to a channelMixer. 00108 _PosChannelId= -1; 00109 _RotEulerChannelId= -1; 00110 _RotQuatChannelId= -1; 00111 _ScaleChannelId= -1; 00112 _PivotChannelId= -1; 00113 00114 // No animCtrl by default 00115 _AnimCtrl= NULL; 00116 } |
|
This is a tool function which add a given value to a channel.
Definition at line 37 of file animatable.cpp. References NL3D::CChannelMixer::addChannel(), NL3D::IAnimatable::getDefaultTrack(), NL3D::IAnimatable::getValue(), NL3D::IAnimatable::getValueName(), nlassert, sint, and uint. Referenced by NL3D::CTransform::registerToChannelMixer(), NL3D::CParticleSystemModel::registerToChannelMixer(), NL3D::CCamera::registerToChannelMixer(), registerToChannelMixer(), NL3D::CAnimatedMorph::registerToChannelMixer(), NL3D::CAnimatedMaterial::registerToChannelMixer(), and NL3D::CAnimatedLightmap::registerToChannelMixer().
00038 { 00039 nlassert(chanMixer); 00040 return chanMixer->addChannel(prefix+getValueName(valueId), this, getValue(valueId), getDefaultTrack(valueId), valueId, ownerValueId, detail); 00041 } |
|
This method clear a bit in the bitset.
Definition at line 233 of file animatable.h. References NL3D::IAnimatable::_BitSet, and uint. Referenced by NL3D::ITransformable::clearTransformFlags(), NL3D::CParticleSystemModel::doAnimate(), and NL3D::CAnimatedMaterial::update().
00234 { 00235 _BitSet&= ~(1<<valueId); 00236 } |
|
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 NL3D::ITransformable::_LocalMatrixDate, NL3D::ITransformable::needCompute(), and uint64. Referenced by NL3D::CWaterModel::updateDiffuseMapMatrix().
00083 { 00084 return callerDate<_LocalMatrixDate || needCompute(); 00085 } |
|
Compute the LocalSkeletonMatrix, the WorldMatrix, and the BoneSkinMatrix (for skinning). NB: the result localSkeletonMatrix depends on BoneBase::UnheritScale.
Definition at line 155 of file bone.cpp. References _AnimCtrl, _BoneBase, _BoneSkinMatrix, _LocalSkeletonMatrix, _WorldMatrix, NL3D::IAnimCtrl::execute(), NL3D::ITransformable::getMatrix(), NLMISC::CMatrix::getPos(), NL3D::ITransformable::getScale(), nlassert, NLMISC::CMatrix::setMulMatrixNoProj(), NLMISC::CMatrix::setPos(), NLMISC::CMatrix::setScale(), NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z. Referenced by NL3D::CTargetAnimCtrl::execute(), NL3D::CSkeletonModel::forceComputeBone(), and NL3D::CSkeletonModel::traverseAnimDetail().
00156 { 00157 // compute is called typically 800 time per frame. 00158 #ifdef NL_DEBUG 00159 nlassert(_BoneBase); 00160 #endif 00161 00162 // get/compute our local matrix 00163 const CMatrix &localMatrix= getMatrix(); 00164 00165 // Compute LocalSkeletonMatrix. 00166 // Root case? 00167 if(!parent) 00168 { 00169 _LocalSkeletonMatrix= localMatrix; 00170 } 00171 // Else, son case, take world matrix from parent. 00172 else 00173 { 00174 // UnheritScale case. 00175 if(_BoneBase->UnheritScale) 00176 { 00177 CMatrix invScaleComp; 00178 CVector fatherScale; 00179 CVector trans; 00180 00181 /* Optim note: 00182 the scale is rarely ==1, so don't optimize case where it may be. 00183 */ 00184 00185 // retrieve our translation 00186 localMatrix.getPos(trans); 00187 // retrieve scale from our father. 00188 parent->getScale(fatherScale); 00189 // inverse this scale. 00190 fatherScale.x= 1.0f / fatherScale.x; 00191 fatherScale.y= 1.0f / fatherScale.y; 00192 fatherScale.z= 1.0f / fatherScale.z; 00193 00194 // Compute InverseScale compensation: 00195 // with UnheritScale, formula per bone should be T*Sf-1*P*R*S*P-1. 00196 // But getMatrix() return T*P*R*S*P-1. 00197 // So we must compute T*Sf-1*T-1, in order to get wanted result. 00198 invScaleComp.setScale(fatherScale); 00199 // Faster compute of the translation part: just "trans + fatherScale MUL -trans" where MUL is comp mul 00200 trans.x-= fatherScale.x * trans.x; 00201 trans.y-= fatherScale.y * trans.y; 00202 trans.z-= fatherScale.z * trans.z; 00203 invScaleComp.setPos(trans); 00204 00205 00206 // And finally, we got ParentWM * T*Sf-1*P*R*S*P-1. 00207 // Do: _LocalSkeletonMatrix= parent->_LocalSkeletonMatrix * invScaleComp * localMatrix 00208 static CMatrix tmp; 00209 tmp.setMulMatrixNoProj( parent->_LocalSkeletonMatrix, invScaleComp ); 00210 _LocalSkeletonMatrix.setMulMatrixNoProj( tmp, localMatrix ); 00211 } 00212 // Normal case. 00213 else 00214 { 00215 // Do: _LocalSkeletonMatrix= parent->_LocalSkeletonMatrix * localMatrix 00216 _LocalSkeletonMatrix.setMulMatrixNoProj( parent->_LocalSkeletonMatrix, localMatrix ); 00217 } 00218 } 00219 00220 // Compute WorldMatrix. Do: _WorldMatrix= rootMatrix * _LocalSkeletonMatrix 00221 _WorldMatrix.setMulMatrixNoProj( rootMatrix, _LocalSkeletonMatrix ); 00222 00223 // Compute BoneSkinMatrix. Do: _BoneSkinMatrix= _LocalSkeletonMatrix * _BoneBase->InvBindPos 00224 _BoneSkinMatrix.setMulMatrixNoProj( _LocalSkeletonMatrix, _BoneBase->InvBindPos ); 00225 00226 // When compute is done, do extra user ctrl? 00227 if(_AnimCtrl && skeletonForAnimCtrl) 00228 _AnimCtrl->execute(skeletonForAnimCtrl, this); 00229 } |
|
Force to eval the animation of that bone Useful when a bone position is needed, and if the father skeleton has been clipped (and thus not detail-animated)
Definition at line 194 of file bone.h. References _PivotChannelId, _PosChannelId, _RotEulerChannelId, _RotQuatChannelId, _ScaleChannelId, NL3D::CChannelMixer::evalChannels(), and sint.
00195 { 00196 sint ids[] = 00197 { 00198 _PosChannelId, 00199 _RotEulerChannelId, 00200 _RotQuatChannelId, 00201 _ScaleChannelId, 00202 _PivotChannelId 00203 }; 00204 chanMixer.evalChannels(ids, sizeof(ids) / sizeof(ids[0])); 00205 } |
|
retrieve the boneBase
Definition at line 114 of file bone.h. References _BoneBase, and nlassert. Referenced by NL3D::CTargetAnimCtrl::execute(), and NL3D::CTargetAnimCtrl::getCurrentLSRotationFromBone().
|
|
retrieve the boneName from BoneBase.
Definition at line 110 of file bone.h. References _BoneBase, and nlassert.
|
|
retrieve the BoneSkinMatrix computed in compute().
Definition at line 150 of file bone.h. References _BoneSkinMatrix. Referenced by NL3D::CSkeletonModel::traverseAnimDetail().
00150 {return _BoneSkinMatrix;} |
|
retrive the default trak from skeleton shape.
Implements NL3D::ITransformable. Definition at line 119 of file bone.cpp. References _BoneBase, nlassert, nlstop, and uint.
00120 { 00121 nlassert(_BoneBase); 00122 00123 // what value ? 00124 switch (valueId) 00125 { 00126 case PosValue: return &_BoneBase->DefaultPos; 00127 case RotEulerValue: return &_BoneBase->DefaultRotEuler; 00128 case RotQuatValue: return &_BoneBase->DefaultRotQuat; 00129 case ScaleValue: return &_BoneBase->DefaultScale; 00130 case PivotValue: return &_BoneBase->DefaultPivot; 00131 } 00132 00133 // No, only ITrnasformable values! 00134 nlstop; 00135 // Deriver note: else call BaseClass::getDefaultTrack(valueId); 00136 00137 return NULL; 00138 } |
|
retrieve the fatherId from BoneBase.
Definition at line 112 of file bone.h. References _BoneBase, nlassert, and sint32. Referenced by NL3D::CTargetAnimCtrl::execute(), and NL3D::CSkeletonModel::forceComputeBone().
|
|
retrieve the matrix local to the skeleton, computed in compute().
Definition at line 144 of file bone.h. References _LocalSkeletonMatrix. Referenced by NL3D::CTargetAnimCtrl::execute(), and NL3D::CTargetAnimCtrl::getCurrentLSRotationFromBone().
00144 {return _LocalSkeletonMatrix;} |
|
Get the matrix, compute her if necessary (work in all modes).
Definition at line 76 of file transformable.h. References NL3D::ITransformable::updateMatrix(). Referenced by NL3D::CInstanceGroup::addToSceneWhenAllShapesLoaded(), NL3D::CCamera::buildCameraPyramid(), compute(), NL3D::CWaterShape::createInstance(), NL3D::CWaterModel::getAttenuatedHeight(), NL3D::CTransformableUser::getMatrix(), NL3D::CCloudScape::render(), NL3D::CMeshMultiLod::renderCoarseMesh(), and NL3D::CTransform::update().
00076 {updateMatrix(); return _LocalMatrix;} |
|
return the last date of computed matrix. updateMatrix() if necessary. Definition at line 90 of file transformable.h. References NL3D::ITransformable::_LocalMatrixDate, uint64, and NL3D::ITransformable::updateMatrix(). Referenced by NL3D::CWaterModel::updateDiffuseMapMatrix().
00091 { 00092 updateMatrix(); 00093 return _LocalMatrixDate; 00094 } |
|
Work only in Rot* mode (nlassert).
Definition at line 255 of file transformable.h. References NL3D::ITransformable::_Pivot, nlassert, NL3D::ITransformable::RotEuler, NL3D::ITransformable::RotQuat, and NL3D::CAnimatedValueBlendable< T >::Value.
00256 { 00257 nlassert(_Mode==RotEuler || _Mode==RotQuat); 00258 return _Pivot.Value; 00259 } |
|
Work only in Rot* mode (nlassert).
Definition at line 224 of file transformable.h. References NL3D::ITransformable::_Pivot, nlassert, NL3D::ITransformable::RotEuler, NL3D::ITransformable::RotQuat, and NL3D::CAnimatedValueBlendable< T >::Value. Referenced by NL3D::CTransformableUser::getPivot().
00225 { 00226 nlassert(_Mode==RotEuler || _Mode==RotQuat); 00227 pivot= _Pivot.Value; 00228 } |
|
Definition at line 117 of file transformable.cpp. Referenced by NL3D::ITransformable::getValueName().
00118 { 00119 return "pivot"; 00120 } |
|
Work only in Rot* mode(nlassert).
Definition at line 231 of file transformable.h. References nlassert, NL3D::ITransformable::RotEuler, NL3D::ITransformable::RotQuat, and NL3D::CAnimatedValueBlendable< T >::Value. Referenced by NL3D::CSkeletonModel::generateShadowMap(), NL3D::CWaterModel::getHeight(), NL3D::CSkeletonModel::renderIntoSkeletonShadowMap(), NL3D::CMeshInstance::renderIntoSkeletonShadowMap(), and NL3D::CPointLightModel::traverseLight().
00232 { 00233 nlassert(_Mode==RotEuler || _Mode==RotQuat); 00234 return _Pos.Value; 00235 } |
|
Work only in Rot* mode(nlassert).
Definition at line 200 of file transformable.h. References nlassert, NL3D::ITransformable::RotEuler, NL3D::ITransformable::RotQuat, and NL3D::CAnimatedValueBlendable< T >::Value. Referenced by NL3D::CTransformableUser::getPos(), NL3D::CInstanceGroup::getPos(), and NL3D::CPSLight::step().
00201 { 00202 nlassert(_Mode==RotEuler || _Mode==RotQuat); 00203 pos= _Pos.Value; 00204 } |
|
Definition at line 97 of file transformable.cpp. Referenced by NL3D::ITransformable::getValueName().
00098 { 00099 return "pos"; 00100 } |
|
Work only in RotEuler mode(nlassert).
Definition at line 237 of file transformable.h. References NL3D::ITransformable::_RotEuler, nlassert, NL3D::ITransformable::RotEuler, and NL3D::CAnimatedValueBlendable< T >::Value.
00238 { 00239 nlassert(_Mode==RotEuler); 00240 return _RotEuler.Value; 00241 } |
|
Work only in RotEuler mode(nlassert).
Definition at line 206 of file transformable.h. References NL3D::ITransformable::_RotEuler, nlassert, NL3D::ITransformable::RotEuler, and NL3D::CAnimatedValueBlendable< T >::Value. Referenced by NL3D::CTransformableUser::getRotEuler().
00207 { 00208 nlassert(_Mode==RotEuler); 00209 rot= _RotEuler.Value; 00210 } |
|
Definition at line 102 of file transformable.cpp. Referenced by NL3D::ITransformable::getValueName().
00103 { 00104 return "roteuler"; 00105 } |
|
get the current rotorder (information vlaid only when RotEuler mode).
Definition at line 194 of file transformable.h. References NL3D::ITransformable::_RotOrder. Referenced by NL3D::CTransformableUser::getRotOrder().
00195 {
00196 return _RotOrder;
00197 }
|
|
Work only in RotQuat mode (nlassert).
Definition at line 243 of file transformable.h. References NL3D::ITransformable::_RotQuat, nlassert, NL3D::ITransformable::RotQuat, and NL3D::CAnimatedValueBlendable< T >::Value.
00244 { 00245 nlassert(_Mode==RotQuat); 00246 return _RotQuat.Value; 00247 } |
|
Work only in RotQuat mode (nlassert).
Definition at line 212 of file transformable.h. References NL3D::ITransformable::_RotQuat, nlassert, NL3D::ITransformable::RotQuat, and NL3D::CAnimatedValueBlendable< T >::Value. Referenced by NL3D::CTransformableUser::getRotQuat(), and NL3D::CInstanceGroup::getRotQuat().
00213 { 00214 nlassert(_Mode==RotQuat); 00215 quat= _RotQuat.Value; 00216 } |
|
Definition at line 107 of file transformable.cpp. Referenced by NL3D::ITransformable::getValueName().
00108 { 00109 return "rotquat"; 00110 } |
|
Work only in Rot* mode (nlassert).
Definition at line 249 of file transformable.h. References nlassert, NL3D::ITransformable::RotEuler, NL3D::ITransformable::RotQuat, and NL3D::CAnimatedValueBlendable< T >::Value.
00250 { 00251 nlassert(_Mode==RotEuler || _Mode==RotQuat); 00252 return _Scale.Value; 00253 } |
|
Work only in Rot* mode (nlassert).
Definition at line 218 of file transformable.h. References nlassert, NL3D::ITransformable::RotEuler, NL3D::ITransformable::RotQuat, and NL3D::CAnimatedValueBlendable< T >::Value. Referenced by compute(), and NL3D::CTransformableUser::getScale().
00219 { 00220 nlassert(_Mode==RotEuler || _Mode==RotQuat); 00221 scale= _Scale.Value; 00222 } |
|
Definition at line 112 of file transformable.cpp. Referenced by NL3D::ITransformable::getValueName().
00113 { 00114 return "scale"; 00115 } |
|
get the current transform mode.
Definition at line 189 of file transformable.h. References NL3D::ITransformable::TTransformMode. Referenced by NL3D::CTargetAnimCtrl::execute(), and NL3D::CTransformableUser::getTransformMode().
00190 {
00191 return _Mode;
00192 }
|
|
From IAnimatable.
Implements NL3D::IAnimatable. Reimplemented in NL3D::CCamera, and NL3D::CParticleSystemModel. Definition at line 58 of file transformable.cpp. References NL3D::ITransformable::_Pivot, NL3D::ITransformable::_RotEuler, NL3D::ITransformable::_RotQuat, nlstop, NL3D::ITransformable::PivotValue, NL3D::ITransformable::PosValue, NL3D::ITransformable::RotEulerValue, NL3D::ITransformable::RotQuatValue, NL3D::ITransformable::ScaleValue, and uint.
00059 { 00060 // what value ? 00061 switch (valueId) 00062 { 00063 case PosValue: return &_Pos; 00064 case RotEulerValue: return &_RotEuler; 00065 case RotQuatValue: return &_RotQuat; 00066 case ScaleValue: return &_Scale; 00067 case PivotValue: return &_Pivot; 00068 } 00069 00070 // No, only ITrnasformable values! 00071 nlstop; 00072 // Deriver note: else call BaseClass::getValue(valueId); 00073 00074 return NULL; 00075 } |
|
|
retrieve the WorldMatrix computed in compute().
Definition at line 147 of file bone.h. References _WorldMatrix. Referenced by NL3D::CSkeletonModel::computeWorldBBoxForShadow(), NL3D::CTargetAnimCtrl::execute(), and NL3D::CSkeletonModel::forceComputeBone().
00147 {return _WorldMatrix;} |
|
Interpolate the current result of _BoneSkinMatrix fith otherMatrix. when interp==0.f, _BoneSkinMatrix= otherMatrix. NB: the interpolation is made on per-vector basis => bad matrix interpolation. Definition at line 233 of file bone.cpp. References _BoneSkinMatrix, NLMISC::CMatrix::getI(), NLMISC::CMatrix::getJ(), NLMISC::CMatrix::getK(), NLMISC::CMatrix::getPos(), NLMISC::CMatrix::setPos(), and NLMISC::CMatrix::setRot(). Referenced by NL3D::CSkeletonModel::traverseAnimDetail().
00234 { 00235 CMatrix &curMatrix= _BoneSkinMatrix; 00236 00237 // interpolate rot/scale. Just interpolate basis vectors 00238 CVector fatherI= otherMatrix.getI(); 00239 CVector curI= curMatrix.getI(); 00240 curI= fatherI*(1-interp) + curI*interp; 00241 CVector fatherJ= otherMatrix.getJ(); 00242 CVector curJ= curMatrix.getJ(); 00243 curJ= fatherJ*(1-interp) + curJ*interp; 00244 CVector fatherK= otherMatrix.getK(); 00245 CVector curK= curMatrix.getK(); 00246 curK= fatherK*(1-interp) + curK*interp; 00247 // replace rotation 00248 curMatrix.setRot(curI, curJ, curK); 00249 00250 // interpolate pos 00251 CVector fatherPos= otherMatrix.getPos(); 00252 CVector curPos= curMatrix.getPos(); 00253 curPos= fatherPos*(1-interp) + curPos*interp; 00254 curMatrix.setPos(curPos); 00255 } |
|
Return non 0 int if the value as been touched else 0.
Definition at line 184 of file animatable.h. References NL3D::IAnimatable::_BitSet, uint, and uint32. Referenced by NL3D::CParticleSystemModel::doAnimate(), NL3D::ITransformable::needCompute(), NL3D::IAnimatable::propagateTouch(), and NL3D::CAnimatedMaterial::update().
00185 {
00186 return _BitSet&(1<<valueId);
00187 }
|
|
enable the channels (lodEnable) associated to this bone in the channelMixer.
Definition at line 259 of file bone.cpp. References _PivotChannelId, _PosChannelId, _RotEulerChannelId, _RotQuatChannelId, _ScaleChannelId, NL3D::CChannelMixer::lodEnableChannel(), and nlassert.
00260 { 00261 nlassert(chanMixer); 00262 00263 // Lod Enable channels if they are correclty registered to the channelMixer. 00264 if( _PosChannelId>=0 ) 00265 chanMixer->lodEnableChannel(_PosChannelId, enable); 00266 if( _RotEulerChannelId>=0 ) 00267 chanMixer->lodEnableChannel(_RotEulerChannelId, enable); 00268 if( _RotQuatChannelId>=0 ) 00269 chanMixer->lodEnableChannel(_RotQuatChannelId, enable); 00270 if( _ScaleChannelId>=0 ) 00271 chanMixer->lodEnableChannel(_ScaleChannelId, enable); 00272 if( _PivotChannelId>=0 ) 00273 chanMixer->lodEnableChannel(_PivotChannelId, enable); 00274 00275 } |
|
Setup Matrix by the lookAt method. Work only in DirectMatrix mode and RotQuat mode (not euler...).
Definition at line 169 of file transformable.cpp. References NL3D::ITransformable::DirectMatrix, NLMISC::CMatrix::getPos(), NLMISC::CMatrix::getRot(), NLMISC::CMatrix::identity(), nlassert, NLMISC::CVector::normalize(), NLMISC::CMatrix::rotateY(), NL3D::ITransformable::RotQuat, NL3D::ITransformable::setMatrix(), NL3D::ITransformable::setPivot(), NL3D::ITransformable::setPos(), NLMISC::CMatrix::setPos(), NLMISC::CMatrix::setRot(), NL3D::ITransformable::setRotQuat(), and NL3D::ITransformable::setScale(). Referenced by NL3D::CTransformableUser::lookAt(), and NL3D::CCamera::update().
00170 { 00171 nlassert(_Mode==RotQuat || _Mode==DirectMatrix); 00172 00173 // Roll matrix 00174 CMatrix rollMT; 00175 rollMT.identity(); 00176 if (roll!=0.f) 00177 rollMT.rotateY (roll); 00178 00179 // Make the target base 00180 CVector j=target; 00181 j-=eye; 00182 j.normalize(); 00183 CVector i=j^CVector (0,0,1.f); 00184 CVector k=i^j; 00185 k.normalize(); 00186 i=j^k; 00187 i.normalize(); 00188 00189 // Make the target matrix 00190 CMatrix targetMT; 00191 targetMT.identity(); 00192 targetMT.setRot (i, j, k); 00193 targetMT.setPos (eye); 00194 00195 // Compose matrix 00196 targetMT*=rollMT; 00197 00198 // Set the matrix 00199 if(_Mode==DirectMatrix) 00200 setMatrix (targetMT); 00201 else 00202 { 00203 // transfrom to quaternion mode. 00204 setScale(CVector(1,1,1)); 00205 setPivot(CVector::Null); 00206 setPos(targetMT.getPos()); 00207 setRotQuat(targetMT.getRot()); 00208 } 00209 } |
|
register the ITransformable channels as detailled channels.
Implements NL3D::ITransformable. Definition at line 141 of file bone.cpp. References _PivotChannelId, _PosChannelId, _RotEulerChannelId, _RotQuatChannelId, _ScaleChannelId, and NL3D::IAnimatable::addValue().
00142 { 00143 // For CBone, channels are detailled. 00144 // Bkup each channelId (for disable). 00145 _PosChannelId= addValue(chanMixer, PosValue, OwnerBit, prefix, true); 00146 _RotEulerChannelId= addValue(chanMixer, RotEulerValue, OwnerBit, prefix, true); 00147 _RotQuatChannelId= addValue(chanMixer, RotQuatValue, OwnerBit, prefix, true); 00148 _ScaleChannelId= addValue(chanMixer, ScaleValue, OwnerBit, prefix, true); 00149 _PivotChannelId= addValue(chanMixer, PivotValue, OwnerBit, prefix, true); 00150 00151 // Deriver note: if necessary, call BaseClass::registerToChannelMixer(chanMixer, prefix); 00152 } |
|
Change value count, bit are set to 0
Definition at line 195 of file animatable.h. References count, nlassert, and uint.
00196 { 00197 // with the "uint32 _BitSet" implementation, juste check the size is correct 00198 nlassert(count<=32); 00199 } |
|
Say which (if any) IAnimatable owns this one. This is important for Touch propagation. By this system, Fathers and ancestors know if they must check their sons (isTouched() return true).
Definition at line 153 of file animatable.h. References NL3D::IAnimatable::_Father, NL3D::IAnimatable::_FatherOwnerBit, NL3D::IAnimatable::propagateTouch(), and uint. Referenced by NL3D::CMeshBase::instanciateMeshBase(), and NL3D::CSegRemanence::setAnimatedMaterial().
00154 { 00155 _Father= father; _FatherOwnerBit= fatherOwnerBit; 00156 00157 // propagate the touch to the fathers. 00158 propagateTouch(); 00159 } |
|
This method set a bit in the bitset.
Definition at line 239 of file animatable.h. References NL3D::IAnimatable::_BitSet, and uint. Referenced by NL3D::IAnimatable::propagateTouch(), and NL3D::IAnimatable::touch().
00240 { 00241 _BitSet|= (1<<valueId); 00242 } |
|
Work only in DirecTMatrix mode (nlassert).
Definition at line 174 of file transformable.h. References NL3D::ITransformable::_LocalMatrixDate, NL3D::ITransformable::DirectMatrix, and nlassert. Referenced by NL3D::ITransformable::lookAt(), and NL3D::CTransformableUser::setMatrix().
00175 { 00176 nlassert(_Mode==DirectMatrix); 00177 _LocalMatrix= mat; 00178 // The matrix has changed. 00179 _LocalMatrixDate++; 00180 } |
|
Work only in Rot* mode (nlassert).
Definition at line 169 of file transformable.h. References NL3D::ITransformable::setPivot(), x, y, and z.
00170 { 00171 setPivot(CVector(x, y, z)); 00172 } |
|
Work only in Rot* mode (nlassert).
Definition at line 162 of file transformable.h. References NL3D::ITransformable::_Pivot, nlassert, NL3D::ITransformable::PivotValue, NL3D::ITransformable::RotEuler, NL3D::ITransformable::RotQuat, NL3D::IAnimatable::touch(), and NL3D::CAnimatedValueBlendable< T >::Value. Referenced by NL3D::ITransformable::lookAt(), NL3D::CTransformableUser::setPivot(), and NL3D::ITransformable::setPivot().
|
|
Work only in Rot* mode(nlassert).
Definition at line 121 of file transformable.h. References NL3D::ITransformable::setPos(), x, y, and z.
00122 { 00123 setPos(CVector(x,y,z)); 00124 } |
|
Work only in Rot* mode(nlassert).
Definition at line 114 of file transformable.h. References nlassert, NL3D::ITransformable::PosValue, NL3D::ITransformable::RotEuler, NL3D::ITransformable::RotQuat, NL3D::IAnimatable::touch(), and NL3D::CAnimatedValueBlendable< T >::Value. Referenced by NL3D::CCamera::build(), NL3D::ITransformable::lookAt(), NL3D::CTransformableUser::setPos(), NL3D::ITransformable::setPos(), NL3D::CInstanceGroup::setPos(), and NL3D::CPSLight::step().
|
|
Work only in RotEuler mode(nlassert).
Definition at line 133 of file transformable.h. References NL3D::ITransformable::setRotEuler().
00134 { 00135 setRotEuler(CVector(rotX, rotY, rotZ)); 00136 } |
|
Work only in RotEuler mode(nlassert).
Definition at line 126 of file transformable.h. References NL3D::ITransformable::_RotEuler, nlassert, NL3D::ITransformable::RotEuler, NL3D::ITransformable::RotEulerValue, NL3D::IAnimatable::touch(), and NL3D::CAnimatedValueBlendable< T >::Value. Referenced by NL3D::CTransformableUser::setRotEuler(), and NL3D::ITransformable::setRotEuler().
|
|
Work only in RotQuat mode (nlassert).
Definition at line 138 of file transformable.h. References NL3D::ITransformable::_RotQuat, nlassert, NL3D::ITransformable::RotQuat, NL3D::ITransformable::RotQuatValue, NL3D::IAnimatable::touch(), and NL3D::CAnimatedValueBlendable< T >::Value. Referenced by NL3D::CTargetAnimCtrl::execute(), NL3D::ITransformable::lookAt(), NL3D::CTransformableUser::setRotQuat(), and NL3D::CInstanceGroup::setRotQuat().
|
|
Work only in Rot* mode (nlassert).
Definition at line 157 of file transformable.h. References NL3D::ITransformable::setScale().
00158 { 00159 setScale(CVector(scale, scale, scale)); 00160 } |
|
Work only in Rot* mode (nlassert).
Definition at line 152 of file transformable.h. References NL3D::ITransformable::setScale().
00153 { 00154 setScale(CVector(scaleX, scaleY, scaleZ)); 00155 } |
|
Work only in Rot* mode (nlassert).
Definition at line 145 of file transformable.h. References nlassert, NL3D::ITransformable::RotEuler, NL3D::ITransformable::RotQuat, NL3D::ITransformable::ScaleValue, NL3D::IAnimatable::touch(), and NL3D::CAnimatedValueBlendable< T >::Value. Referenced by NL3D::ITransformable::lookAt(), NL3D::CTransformableUser::setScale(), and NL3D::ITransformable::setScale().
|
|
Change the transform mode. Components or matrix are not reseted.
Definition at line 100 of file transformable.h. References NL3D::ITransformable::_RotOrder, NL3D::ITransformable::PosValue, and NL3D::IAnimatable::touch(). Referenced by NL3D::CCamera::build(), NL3D::CCamera::enableTargetAnimation(), NL3D::CPSMesh::newElement(), NL3D::CTransformableUser::setTransformMode(), and NL3D::CPSMesh::updatePos().
00101 { 00102 _Mode= mode; 00103 _RotOrder= ro; 00104 // just for information. 00105 touch(PosValue, OwnerBit); 00106 } |
|
|
Definition at line 166 of file bone.h. Referenced by CBone(), compute(), and NL3D::CSkeletonModel::setBoneAnimCtrl(). |
|
Definition at line 173 of file bone.h. Referenced by CBone(), compute(), getBoneBase(), getBoneName(), getDefaultTrack(), and getFatherId(). |
|
Definition at line 180 of file bone.h. Referenced by compute(), getBoneSkinMatrix(), and interpolateBoneSkinMatrix(). |
|
Definition at line 176 of file bone.h. Referenced by compute(), and getLocalSkeletonMatrix(). |
|
Definition at line 169 of file bone.h. Referenced by NL3D::CSkeletonModel::computeWorldBBoxForShadow(). |
|
Definition at line 187 of file bone.h. Referenced by CBone(), forceAnimate(), lodEnableChannels(), and registerToChannelMixer(). |
|
Definition at line 183 of file bone.h. Referenced by CBone(), forceAnimate(), lodEnableChannels(), and registerToChannelMixer(). |
|
Definition at line 184 of file bone.h. Referenced by CBone(), forceAnimate(), lodEnableChannels(), and registerToChannelMixer(). |
|
Definition at line 185 of file bone.h. Referenced by CBone(), forceAnimate(), lodEnableChannels(), and registerToChannelMixer(). |
|
Definition at line 186 of file bone.h. Referenced by CBone(), forceAnimate(), lodEnableChannels(), and registerToChannelMixer(). |
|
Definition at line 178 of file bone.h. Referenced by compute(), and getWorldMatrix(). |