|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CSkeletonModel Class ReferenceA Skeleton model, instance of CSkeletonShape.
More...
#include <skeleton_model.h>
Inheritance diagram for NL3D::CSkeletonModel:
List of all members.
IAnimatable Interface (registering only IAnimatable sons (bones)). |
enum | TAnimValues { OwnerBit = CTransformShape::AnimValueLast,
AnimValueLast
} |
| Added values. More...
|
virtual void | registerToChannelMixer (CChannelMixer *chanMixer, const std::string &prefix) |
| register transform channels (in global anim mode). More...
|
Skin/BoneUsage Accessor. Called by CMeshInstance only. |
enum | TBoneUsageType { UsageNormal,
UsageForced,
UsageCLodForced
} |
void | incBoneUsage (uint i, TBoneUsageType boneUsageType) |
| increment the refCount of the ith bone. More...
|
void | decBoneUsage (uint i, TBoneUsageType boneUsageType) |
| decrement the refCount of the ith bone. set forced to the same param passed when incBoneUsage(). More...
|
void | flagBoneAndParents (uint32 boneId, std::vector< bool > &boneUsage) const |
| This method update boneUsage (must be of size of Bones). More...
|
Bone Usage. |
void | initBoneUsages () |
| called by CSkeletonShape::createInstance(). init the vector. More...
|
void | incForcedBoneUsageAndParents (uint i, bool forceCLod) |
| increment the refCount of the ith bone and its parents. for stickObjects. More...
|
void | decForcedBoneUsageAndParents (uint i, bool forceCLod) |
| increment the refCount of the ith bone and its parents. for stickObjects. More...
|
void | updateBoneToCompute () |
| According to Usage, ForedUsage and current skeleton Lod, update MustCompute and ValidBoneSkinMatrix. More...
|
std::vector< CBoneUsage > | _BoneUsage |
| The list of BoneUsage. Updated by Meshes, stickObject(), and lod changes. More...
|
std::vector< CBoneCompute > | _BoneToCompute |
| List of bones to compute. More...
|
bool | _BoneToComputeDirty |
| Flag set if the MRSkeleton lod change, or if a new bone Usage change (only if was 0 or become 0). More...
|
uint | _CurLod |
| The current lod activated for this skeleton. More...
|
float | _CurLodInterp |
| The current lod Interpolation Value for this skeleton. More...
|
float | _LodInterpMultiplier |
| For lod interpolation. Inverse of distance. If 0, disable interpolation. More...
|
CLod / Character Lod |
const CLightContribution & | getSkeletonLightContribution () |
void | computeCLodVertexColors (CLodCharacterManager *mngr) |
| recompute _CLodVertexColors, ignoring _CLodVertexColorDirty. More...
|
bool | _DisplayedAsLodCharacter |
| True if the skeleton model and his skins have to be displayed with a CLodCharacterShape, instead of the std way This state is modified early during the HRC Traversal. More...
|
float | _LodCharacterDistance |
| see setLodCharacterDistance. More...
|
float | _OOLodCharacterDistance |
CLodCharacterInstance | _CLodInstance |
| The Lod instance. -1 by default. More...
|
bool | _CLodVertexColorDirty |
| dirt when a bindSkin/stickObject/detachSkeletonSon is called dirt when a transform mean color is changed. More...
|
Public Types |
Public Methods |
bool | isClipVisible () const |
| tells if the skeleton has been clipped in the clip traversal. More...
|
void | updateSkinRenderLists () |
|
bool | bindSkin (CTransform *mi) |
| bind a skin to the skeleton. More...
|
void | stickObject (CTransform *mi, uint boneId) |
| parent a CTransform to a bone of the skeleton. More...
|
void | stickObjectEx (CTransform *mi, uint boneId, bool forceCLod) |
| same method as stickObject(), but if you set forceCLod as true, then this object will be visible even if the skeleton father is in CLod state (ie displayed with a CLodCharacterShape) NB: if "mi" is a skeleton model, forceCLod is considerer true, whatever the value passed in. More...
|
void | detachSkeletonSon (CTransform *mi) |
| unparent a CTransform from a bone of the skeleton, or unbind a skin. More...
|
void | dirtSkinRenderLists () |
| Force the skeletonModel to recompute at next render which skins to render, at wich pass. More...
|
|
sint32 | getBoneIdByName (const std::string &name) const |
| return, from skeleton shape, the BoneIdByName. -1 if not here. More...
|
bool | isBoneComputed (uint boneId) const |
| Tell if a bone has been computed in the last frame or not. false if boneId is invalid. More...
|
uint | getNumBoneComputed () const |
| return the number of bones currently animated/computed (because of bindSkin()/stickObject() / Lod system). More...
|
void | setInterpolationDistance (float dist) |
| change the Lod Bone interpolation distance (in meters). More...
|
float | getInterpolationDistance () const |
| see setInterpolationDistance(). More...
|
const NLMISC::CMatrix & | getActiveBoneSkinMatrix (uint boneId) const |
| if Bones[boneId] is "Computed" (usage/lod), return Bones[boneId].getBoneSkinMatrix() else return parent ones (recurs, but precomputed). More...
|
void | computeAllBones (const CMatrix &modelWorldMatrix) |
| Tool function, especially for animation bake. More...
|
bool | computeRenderedBBox (NLMISC::CAABBox &bbox) |
| Retrieve the current approx BBox around the skeleton, computed in the last CSene::render(). More...
|
bool | computeCurrentBBox (NLMISC::CAABBox &bbox, bool forceCompute=false) |
| same as computeRenderedBBox() but force animation and compute of all bones => don't need render(), but slower. More...
|
|
void | setLodCharacterShape (sint shapeId) |
| Change the Character Lod shape Id. set -1 if want to disable the feature (default). More...
|
sint | getLodCharacterShape () const |
| see setLodCharacterShape. More...
|
void | setLodCharacterAnimId (uint animId) |
| Change/get the Character Lod anim setup. More...
|
uint | getLodCharacterAnimId () const |
void | setLodCharacterAnimTime (TGlobalAnimationTime time) |
TGlobalAnimationTime | getLodCharacterAnimTime () const |
void | setLodCharacterWrapMode (bool wrapMode) |
| tells if the animation must loop or clamp. More...
|
bool | getLodCharacterWrapMode () const |
bool | isDisplayedAsLodCharacter () const |
| True if the skeleton model and his skins are to be displayed with a CLodCharacterShape, instead of the std way This state is modified early during the HRC Traversal. More...
|
void | setLodCharacterDistance (float dist) |
| This is the distance at which the skeleton use a CLodCharacterShape to display himself if 0, never display the skeleton as a CLodCharacterShape. More...
|
float | getLodCharacterDistance () const |
| see setLodCharacterDistance. 0 if disabled. More...
|
float | computeDisplayLodCharacterPriority () const |
| Called in ClipTrav pass. More...
|
void | setDisplayLodCharacterFlag (bool displayCLod) |
| Called in ClipTrav pass. More...
|
void | dirtLodVertexColor () |
| Called by CTransform::setMeanColor(). More...
|
void | computeLodTexture () |
| Call it when you want the system to recompute the Lod texture NB: Lod texturing is possible only in conjunction with AsyncTextureManager. More...
|
|
virtual float | getNumTriangles (float distance) |
| Special version for skins. More...
|
void | changeMRMDistanceSetup (float distanceFinest, float distanceMiddle, float distanceCoarsest) |
| Special version for skins. More...
|
void | resetDefaultMRMDistanceSetup () |
| Reset the Default MRM setup: follow MAX skin setup (ie the finer). More...
|
Static Public Methods |
void | registerBasic () |
| Call at the begining of the program, to register the model, and the basic observers. More...
|
Public Attributes |
std::vector< CBone > | Bones |
| The list of CBone, created from the CSkeletonShape. More...
|
Protected Methods |
| CSkeletonModel () |
| Constructor. More...
|
virtual | ~CSkeletonModel () |
| Destructor. More...
|
virtual void | initModel () |
| Build link to traversals. More...
|
Private Types |
typedef std::set< CTransform * > | TTransformSet |
| skins/sticked objects. More...
|
typedef TTransformSet::iterator | ItTransformSet |
typedef NLMISC::CObjectVector<
CTransform *, false > | TTransformArray |
Private Methods |
void | buildDefaultLevelDetail () |
Static Private Methods |
IModel * | creator () |
Private Attributes |
std::list< CSkeletonModel
* >::iterator | _ItSkeletonInScene |
TTransformSet | _Skins |
| The skins. More...
|
TTransformSet | _StickedObjects |
| The StickedObjects. More...
|
bool | _SkinToRenderDirty |
bool | _DefaultMRMSetup |
TTransformArray | _OpaqueSkins |
TTransformArray | _TransparentSkins |
TTransformArray | _AnimDetailSkins |
CMRMLevelDetail | _LevelDetail |
CHrcTrav * | HrcTrav |
CClipTrav * | ClipTrav |
Friends |
class | CSkeletonShape |
class | CSkeletonModelAnimDetailObs |
class | CSkeletonModelRenderObs |
class | CTransformClipObs |
Detailed Description
A Skeleton model, instance of CSkeletonShape.
Skeletons sons are added with bindSkin(), stickObject(). They are removed auto at dtor.
-
Author:
-
Lionel Berenguier , Nevrax France
-
Date:
-
2001
Definition at line 64 of file skeleton_model.h.
Member Typedef Documentation
typedef TTransformSet::iterator NL3D::CSkeletonModel::ItTransformSet [private]
|
|
typedef std::set<CTransform*> NL3D::CSkeletonModel::TTransformSet [private]
|
|
Member Enumeration Documentation
enum NL3D::CSkeletonModel::TAnimValues
|
|
enum NL3D::CSkeletonModel::TBoneUsageType
|
|
|
-
Enumeration values:
-
UsageNormal |
|
UsageForced |
|
UsageCLodForced |
|
Definition at line 135 of file skeleton_model.h. |
Constructor & Destructor Documentation
NL3D::CSkeletonModel::CSkeletonModel |
( |
|
) |
[protected] |
|
|
Constructor.
Definition at line 78 of file skeleton_model.cpp.
References _CLodVertexColorDirty, _DefaultMRMSetup, _DisplayedAsLodCharacter, _LodCharacterDistance, _OOLodCharacterDistance, _SkinToRenderDirty, AnimValueLast, buildDefaultLevelDetail, ClipTrav, HrcTrav, NL3D::CTransform::setOpacity, and NL3D::CTransform::setTransparency.
Referenced by creator. |
NL3D::CSkeletonModel::~CSkeletonModel |
( |
|
) |
[protected, virtual] |
|
Member Function Documentation
bool NL3D::CSkeletonModel::bindSkin |
( |
CTransform * |
mi |
) |
|
|
|
bind a skin to the skeleton.
NB: ~CTransform() calls detachSkeletonSon(). NB: nlassert() if there is too many skins/sticked objects on this skeleton (more than 255). NB: an object can't be skinned and sticked at same time :) NB: replaced if already here. NB: when a skin is binded, the command hide(), show(), ... have no effect on it, until it is detachSkeletonSon()-ed NB: For Skins, all Hrc/Clip/ValidateList link is done here -
Returns:
-
false if mi is not skinnable, true otherwise
Definition at line 393 of file skeleton_model.cpp.
References _Skins, ClipTrav, dirtLodVertexColor, dirtSkinRenderLists, HrcTrav, NL3D::IModel::IModel, and nlassert. |
void NL3D::CSkeletonModel::buildDefaultLevelDetail |
( |
|
) |
[private] |
|
void NL3D::CSkeletonModel::changeMRMDistanceSetup |
( |
float |
distanceFinest, |
|
|
float |
distanceMiddle, |
|
|
float |
distanceCoarsest |
|
) |
|
|
|
Special version for skins.
NB: skins never follow their original MRM distance setup, but follow this skeleton MRM setup. Default is to follow the MAX of all skins binded (ie the finer). NB: Unlike CMeshBaseInstance::changeMRMDistanceSetup(), this setup applies to the SkeletonModel, not the shape. 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. |
Definition at line 1404 of file skeleton_model.cpp.
References _DefaultMRMSetup, and _LevelDetail. |
void NL3D::CSkeletonModel::computeAllBones |
( |
const CMatrix & |
modelWorldMatrix |
) |
|
|
|
Tool function, especially for animation bake.
It updates all bones (independent of bone usage, and lod interpolation), and take a user skeleton worldMatrix as input. NB: no detail animation is performed here, just the compute of bone hierarchy.
Definition at line 685 of file skeleton_model.cpp.
References Bones.
Referenced by computeCurrentBBox. |
bool NL3D::CSkeletonModel::computeCurrentBBox |
( |
NLMISC::CAABBox & |
bbox, |
|
|
bool |
forceCompute = false |
|
) |
|
|
|
same as computeRenderedBBox() but force animation and compute of all bones => don't need render(), but slower.
for all used bones, extend the bbox with their pos -
Parameters:
-
bbox |
return the bbox of the skinned skeleton, local to the skeleton. If the skeleton is not skinned/sticked at all, bbox is not modified. |
forceCompute |
force evalution even if not skinned |
-
Returns:
-
true if the bbox is computed, false otherwise.
Definition at line 1476 of file skeleton_model.cpp.
References _BoneUsage, Bones, computeAllBones, and NL3D::CTransform::getChannelMixer. |
float NL3D::CSkeletonModel::computeDisplayLodCharacterPriority |
( |
|
) |
const |
|
void NL3D::CSkeletonModel::computeLodTexture |
( |
|
) |
|
|
|
Call it when you want the system to recompute the Lod texture NB: Lod texturing is possible only in conjunction with AsyncTextureManager.
Hence, instances skinned to the skeleton should be in AsyncTextureMode. For best result, you should wait that each of these instances are isAsyncTextureReady() (texture loaded)
Definition at line 744 of file skeleton_model.cpp.
References _CLodInstance, _Skins, ItTransformSet, min, and nlassert. |
|
Retrieve the current approx BBox around the skeleton, computed in the last CSene::render().
for all computed bones, extend the bbox with their pos -
Parameters:
-
bbox |
return the bbox of the skinned skeleton, local to the skeleton. If the skeleton was clipped, the bbox is not modified. |
-
Returns:
-
true if the bbox is computed, false otherwise.
Definition at line 1435 of file skeleton_model.cpp.
References Bones, NL3D::CTransform::getLastClippedState, and isBoneComputed. |
IModel* NL3D::CSkeletonModel::creator |
( |
|
) |
[inline, static, private] |
|
void NL3D::CSkeletonModel::decForcedBoneUsageAndParents |
( |
uint |
i, |
|
|
bool |
forceCLod |
|
) |
[private] |
|
void NL3D::CSkeletonModel::detachSkeletonSon |
( |
CTransform * |
mi |
) |
|
|
|
unparent a CTransform from a bone of the skeleton, or unbind a skin.
No-op if not a son of this skeleton NB: mi is made son of Root in Traversals Hrc, and change are made at render() for ClipTrav. NB: For Skins, all Hrc/Clip/ValidateList link is done here
Definition at line 478 of file skeleton_model.cpp.
References _Skins, _StickedObjects, ClipTrav, decForcedBoneUsageAndParents, dirtLodVertexColor, dirtSkinRenderLists, HrcTrav, and nlassert.
Referenced by ~CSkeletonModel. |
void NL3D::CSkeletonModel::dirtLodVertexColor |
( |
|
) |
[inline] |
|
void NL3D::CSkeletonModel::dirtSkinRenderLists |
( |
|
) |
[inline] |
|
void NL3D::CSkeletonModel::flagBoneAndParents |
( |
uint32 |
boneId, |
|
|
std::vector< bool > & |
boneUsage |
|
) |
const |
|
|
This method update boneUsage (must be of size of Bones).
It's flag boneUsage[boneId] to true, and all parents of boneId.
Definition at line 236 of file skeleton_model.cpp.
References Bones, and nlassert. |
|
if Bones[boneId] is "Computed" (usage/lod), return Bones[boneId].getBoneSkinMatrix() else return parent ones (recurs, but precomputed).
Definition at line 383 of file skeleton_model.cpp.
References _BoneUsage, and Bones. |
sint32 NL3D::CSkeletonModel::getBoneIdByName |
( |
const std::string & |
name |
) |
const |
|
float NL3D::CSkeletonModel::getInterpolationDistance |
( |
|
) |
const |
|
uint NL3D::CSkeletonModel::getLodCharacterAnimId |
( |
|
) |
const [inline] |
|
float NL3D::CSkeletonModel::getLodCharacterDistance |
( |
|
) |
const [inline] |
|
sint NL3D::CSkeletonModel::getLodCharacterShape |
( |
|
) |
const [inline] |
|
bool NL3D::CSkeletonModel::getLodCharacterWrapMode |
( |
|
) |
const [inline] |
|
uint NL3D::CSkeletonModel::getNumBoneComputed |
( |
|
) |
const [inline] |
|
float NL3D::CSkeletonModel::getNumTriangles |
( |
float |
distance |
) |
[virtual] |
|
const CLightContribution& NL3D::CSkeletonModel::getSkeletonLightContribution |
( |
|
) |
[inline, private] |
|
void NL3D::CSkeletonModel::incForcedBoneUsageAndParents |
( |
uint |
i, |
|
|
bool |
forceCLod |
|
) |
[private] |
|
void NL3D::CSkeletonModel::initBoneUsages |
( |
|
) |
[private] |
|
void NL3D::CSkeletonModel::initModel |
( |
|
) |
[protected, virtual] |
|
bool NL3D::CSkeletonModel::isBoneComputed |
( |
uint |
boneId |
) |
const |
|
bool NL3D::CSkeletonModel::isClipVisible |
( |
|
) |
const [inline] |
|
bool NL3D::CSkeletonModel::isDisplayedAsLodCharacter |
( |
|
) |
const [inline] |
|
void NL3D::CSkeletonModel::registerBasic |
( |
|
) |
[static] |
|
void NL3D::CSkeletonModel::registerToChannelMixer |
( |
CChannelMixer * |
chanMixer, |
|
|
const std::string & |
prefix |
|
) |
[virtual] |
|
void NL3D::CSkeletonModel::resetDefaultMRMDistanceSetup |
( |
|
) |
|
|
void NL3D::CSkeletonModel::setDisplayLodCharacterFlag |
( |
bool |
displayCLod |
) |
|
|
void NL3D::CSkeletonModel::setInterpolationDistance |
( |
float |
dist |
) |
|
|
|
change the Lod Bone interpolation distance (in meters).
If 0, interpolation is disabled. The smaller this value is, the more Lod skeleton system will "pop". Default is 0.5 meters.
Definition at line 544 of file skeleton_model.cpp.
References _LodInterpMultiplier. |
void NL3D::CSkeletonModel::setLodCharacterAnimId |
( |
uint |
animId |
) |
|
|
void NL3D::CSkeletonModel::setLodCharacterDistance |
( |
float |
dist |
) |
|
|
void NL3D::CSkeletonModel::setLodCharacterShape |
( |
sint |
shapeId |
) |
|
|
void NL3D::CSkeletonModel::setLodCharacterWrapMode |
( |
bool |
wrapMode |
) |
|
|
void NL3D::CSkeletonModel::stickObject |
( |
CTransform * |
mi, |
|
|
uint |
boneId |
|
) |
|
|
|
parent a CTransform to a bone of the skeleton.
NB: ~CTransform() calls detachSkeletonSon(). NB: nlassert() if there is too many skins/sticked objects on this skeleton (more than 255). NB: an object can't be skinned and sticked at same time :) NB: replaced if already here. NB: mi is made son of skeleton model in Traversals Hrc, and change are made at render() for ClipTrav.
Definition at line 441 of file skeleton_model.cpp.
References stickObjectEx. |
void NL3D::CSkeletonModel::stickObjectEx |
( |
CTransform * |
mi, |
|
|
uint |
boneId, |
|
|
bool |
forceCLod |
|
) |
|
|
void NL3D::CSkeletonModel::updateBoneToCompute |
( |
|
) |
[private] |
|
|
According to Usage, ForedUsage and current skeleton Lod, update MustCompute and ValidBoneSkinMatrix.
Definition at line 279 of file skeleton_model.cpp.
References _BoneToCompute, _BoneToComputeDirty, _BoneUsage, _CurLod, _LodInterpMultiplier, Bones, CSkeletonShape, NL3D::CTransform::getChannelMixer, isDisplayedAsLodCharacter, and NL3D::CTransformShape::Shape. |
void NL3D::CSkeletonModel::updateSkinRenderLists |
( |
|
) |
|
|
|
Definition at line 1010 of file skeleton_model.cpp.
References _AnimDetailSkins, _LevelDetail, _OpaqueSkins, _Skins, _SkinToRenderDirty, _TransparentSkins, buildDefaultLevelDetail, NLMISC::CObjectVector< CTransform *, false >::clear, NL3D::CTransform::CTransform, NL3D::CTransformShape::CTransformShape, ItTransformSet, nlassert, NLMISC::CObjectVector< CTransform *, false >::resize, and NL3D::CTransform::setTransparency. |
Friends And Related Function Documentation
friend class CSkeletonModelAnimDetailObs [friend]
|
|
friend class CSkeletonModelRenderObs [friend]
|
|
friend class CSkeletonShape [friend]
|
|
friend class CTransformClipObs [friend]
|
|
Member Data Documentation
std::vector<CBoneCompute> NL3D::CSkeletonModel::_BoneToCompute [private]
|
|
bool NL3D::CSkeletonModel::_BoneToComputeDirty [private]
|
|
std::vector<CBoneUsage> NL3D::CSkeletonModel::_BoneUsage [private]
|
|
|
The Lod instance. -1 by default.
Definition at line 416 of file skeleton_model.h.
Referenced by computeCLodVertexColors, computeDisplayLodCharacterPriority, computeLodTexture, getLodCharacterAnimId, getLodCharacterAnimTime, getLodCharacterShape, getLodCharacterWrapMode, setDisplayLodCharacterFlag, setLodCharacterAnimId, setLodCharacterAnimTime, setLodCharacterShape, and setLodCharacterWrapMode. |
bool NL3D::CSkeletonModel::_CLodVertexColorDirty [private]
|
|
uint NL3D::CSkeletonModel::_CurLod [private]
|
|
float NL3D::CSkeletonModel::_CurLodInterp [private]
|
|
bool NL3D::CSkeletonModel::_DefaultMRMSetup [private]
|
|
bool NL3D::CSkeletonModel::_DisplayedAsLodCharacter [private]
|
|
std::list<CSkeletonModel*>::iterator NL3D::CSkeletonModel::_ItSkeletonInScene [private]
|
|
float NL3D::CSkeletonModel::_LodCharacterDistance [private]
|
|
float NL3D::CSkeletonModel::_LodInterpMultiplier [private]
|
|
float NL3D::CSkeletonModel::_OOLodCharacterDistance [private]
|
|
bool NL3D::CSkeletonModel::_SkinToRenderDirty [private]
|
|
std::vector<CBone> NL3D::CSkeletonModel::Bones
|
|
|
The list of CBone, created from the CSkeletonShape.
They are odered in depth-first order.
Definition at line 75 of file skeleton_model.h.
Referenced by computeAllBones, computeCLodVertexColors, computeCurrentBBox, computeRenderedBBox, decForcedBoneUsageAndParents, flagBoneAndParents, getActiveBoneSkinMatrix, incForcedBoneUsageAndParents, initBoneUsages, registerToChannelMixer, and updateBoneToCompute. |
CClipTrav* NL3D::CSkeletonModel::ClipTrav [private]
|
|
CHrcTrav* NL3D::CSkeletonModel::HrcTrav [private]
|
|
The documentation for this class was generated from the following files:
|
|