OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
SceneUtil::RigGeometry Class Reference

Mesh skinning implementation. More...

#include <riggeometry.hpp>

Inheritance diagram for SceneUtil::RigGeometry:
Collaboration diagram for SceneUtil::RigGeometry:

Classes

struct  InfluenceMap
 

Public Member Functions

 RigGeometry ()
 
 RigGeometry (const RigGeometry &copy, const osg::CopyOp &copyop)
 
 META_Object (SceneUtil, RigGeometry) struct BoneInfluence
 
void setInfluenceMap (osg::ref_ptr< InfluenceMap > influenceMap)
 
void setSourceGeometry (osg::ref_ptr< osg::Geometry > sourceGeom)
 
osg::ref_ptr< osg::Geometry > getSourceGeometry ()
 
void update (osg::NodeVisitor *nv)
 
void updateBounds (osg::NodeVisitor *nv)
 

Private Types

typedef std::pair< Bone
*, osg::Matrixf > 
BoneBindMatrixPair
 
typedef std::pair
< BoneBindMatrixPair, float > 
BoneWeight
 
typedef std::vector< unsigned
short > 
VertexList
 
typedef std::map< std::vector
< BoneWeight >, VertexList
Bone2VertexMap
 
typedef std::map< Bone
*, osg::BoundingSpheref > 
BoneSphereMap
 

Private Member Functions

bool initFromParentSkeleton (osg::NodeVisitor *nv)
 
void updateGeomToSkelMatrix (const osg::NodePath &nodePath)
 

Private Attributes

osg::ref_ptr< osg::Geometry > mSourceGeometry
 
osg::ref_ptr< osg::Vec4Array > mSourceTangents
 
SkeletonmSkeleton
 
osg::NodePath mSkelToGeomPath
 
osg::Matrixf mGeomToSkelMatrix
 
osg::ref_ptr< InfluenceMapmInfluenceMap
 
Bone2VertexMap mBone2VertexMap
 
BoneSphereMap mBoneSphereMap
 
unsigned int mLastFrameNumber
 
bool mBoundsFirstFrame
 

Detailed Description

Mesh skinning implementation.

Note
A RigGeometry may be attached directly to a Skeleton, or somewhere below a Skeleton. Note though that the RigGeometry ignores any transforms below the Skeleton, so the attachment point is not that important.
To avoid race conditions, the rig geometry needs to be double buffered. This can be done using a FrameSwitch node that has two RigGeometry children. In the future we may want to consider implementing the double buffering inside RigGeometry.

Member Typedef Documentation

typedef std::map<std::vector<BoneWeight>, VertexList> SceneUtil::RigGeometry::Bone2VertexMap
private
typedef std::pair<Bone*, osg::Matrixf> SceneUtil::RigGeometry::BoneBindMatrixPair
private
typedef std::map<Bone*, osg::BoundingSpheref> SceneUtil::RigGeometry::BoneSphereMap
private
typedef std::pair<BoneBindMatrixPair, float> SceneUtil::RigGeometry::BoneWeight
private
typedef std::vector<unsigned short> SceneUtil::RigGeometry::VertexList
private

Constructor & Destructor Documentation

SceneUtil::RigGeometry::RigGeometry ( )
SceneUtil::RigGeometry::RigGeometry ( const RigGeometry copy,
const osg::CopyOp &  copyop 
)

Here is the call graph for this function:

Member Function Documentation

osg::ref_ptr< osg::Geometry > SceneUtil::RigGeometry::getSourceGeometry ( )

Here is the caller graph for this function:

bool SceneUtil::RigGeometry::initFromParentSkeleton ( osg::NodeVisitor *  nv)
private

Here is the caller graph for this function:

SceneUtil::RigGeometry::META_Object ( SceneUtil  ,
RigGeometry   
)
inline
void SceneUtil::RigGeometry::setInfluenceMap ( osg::ref_ptr< InfluenceMap influenceMap)
void SceneUtil::RigGeometry::setSourceGeometry ( osg::ref_ptr< osg::Geometry >  sourceGeom)

Initialize this geometry from the source geometry.

Note
The source geometry will not be modified.

Here is the call graph for this function:

Here is the caller graph for this function:

void SceneUtil::RigGeometry::update ( osg::NodeVisitor *  nv)

Here is the call graph for this function:

void SceneUtil::RigGeometry::updateBounds ( osg::NodeVisitor *  nv)

Here is the call graph for this function:

Here is the caller graph for this function:

void SceneUtil::RigGeometry::updateGeomToSkelMatrix ( const osg::NodePath &  nodePath)
private

Here is the caller graph for this function:

Member Data Documentation

Bone2VertexMap SceneUtil::RigGeometry::mBone2VertexMap
private
BoneSphereMap SceneUtil::RigGeometry::mBoneSphereMap
private
bool SceneUtil::RigGeometry::mBoundsFirstFrame
private
osg::Matrixf SceneUtil::RigGeometry::mGeomToSkelMatrix
private
osg::ref_ptr<InfluenceMap> SceneUtil::RigGeometry::mInfluenceMap
private
unsigned int SceneUtil::RigGeometry::mLastFrameNumber
private
Skeleton* SceneUtil::RigGeometry::mSkeleton
private
osg::NodePath SceneUtil::RigGeometry::mSkelToGeomPath
private
osg::ref_ptr<osg::Geometry> SceneUtil::RigGeometry::mSourceGeometry
private
osg::ref_ptr<osg::Vec4Array> SceneUtil::RigGeometry::mSourceTangents
private

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