OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Member Functions | Public Attributes | 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)
 
void setInfluenceMap (osg::ref_ptr< InfluenceMap > influenceMap)
 
void setRigTransforms (osg::Matrixf &transform)
 
void setSourceGeometry (osg::ref_ptr< osg::Geometry > sourceGeom)
 
osg::ref_ptr< osg::Geometry > getSourceGeometry ()
 
virtual void accept (osg::NodeVisitor &nv)
 
virtual bool supports (const osg::PrimitiveFunctor &) const
 
virtual void accept (osg::PrimitiveFunctor &) const
 

Public Attributes

META_Object(SceneUtil,
RigGeometry) virtual void
compileGLObjects(osg
osg::BoundingSpheref 
mBoundSphere
 
std::map< unsigned short, float > mWeights
 

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

void cull (osg::NodeVisitor *nv)
 
void updateBounds (osg::NodeVisitor *nv)
 
osg::Geometry * getGeometry (unsigned int frame) const
 
bool initFromParentSkeleton (osg::NodeVisitor *nv)
 
void updateGeomToSkelMatrix (const osg::NodePath &nodePath)
 

Private Attributes

osg::ref_ptr< osg::Geometry > mGeometry [2]
 
osg::ref_ptr< osg::Geometry > mSourceGeometry
 
osg::ref_ptr< const
osg::Vec4Array > 
mSourceTangents
 
SkeletonmSkeleton
 
osg::ref_ptr< osg::RefMatrix > mGeomToSkelMatrix
 
osg::ref_ptr< InfluenceMapmInfluenceMap
 
osg::Matrixf mRigTransforms
 
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.
The internal Geometry used for rendering is double buffered, this allows updates to be done in a thread safe way while not compromising rendering performance. This is crucial when using osg's default threading model of DrawThreadPerContext.

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

void SceneUtil::RigGeometry::accept ( osg::NodeVisitor &  nv)
virtual

Here is the call graph for this function:

void SceneUtil::RigGeometry::accept ( osg::PrimitiveFunctor &  func) const
virtual

Here is the call graph for this function:

void SceneUtil::RigGeometry::cull ( osg::NodeVisitor *  nv)
private

Here is the call graph for this function:

Here is the caller graph for this function:

osg::Geometry * SceneUtil::RigGeometry::getGeometry ( unsigned int  frame) const
private

Here is the caller graph for this function:

osg::ref_ptr< osg::Geometry > SceneUtil::RigGeometry::getSourceGeometry ( )
bool SceneUtil::RigGeometry::initFromParentSkeleton ( osg::NodeVisitor *  nv)
private

Here is the caller graph for this function:

void SceneUtil::RigGeometry::setInfluenceMap ( osg::ref_ptr< InfluenceMap influenceMap)
void SceneUtil::RigGeometry::setRigTransforms ( osg::Matrixf &  transform)
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:

virtual bool SceneUtil::RigGeometry::supports ( const osg::PrimitiveFunctor &  ) const
inlinevirtual
void SceneUtil::RigGeometry::updateBounds ( osg::NodeVisitor *  nv)
private

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
META_Object (SceneUtil, RigGeometry) virtual void compileGLObjects(osg osg::BoundingSpheref SceneUtil::RigGeometry::mBoundSphere
osg::ref_ptr<osg::Geometry> SceneUtil::RigGeometry::mGeometry[2]
private
osg::ref_ptr<osg::RefMatrix> SceneUtil::RigGeometry::mGeomToSkelMatrix
private
osg::ref_ptr<InfluenceMap> SceneUtil::RigGeometry::mInfluenceMap
private
unsigned int SceneUtil::RigGeometry::mLastFrameNumber
private
osg::Matrixf SceneUtil::RigGeometry::mRigTransforms
private
Skeleton* SceneUtil::RigGeometry::mSkeleton
private
osg::ref_ptr<osg::Geometry> SceneUtil::RigGeometry::mSourceGeometry
private
osg::ref_ptr<const osg::Vec4Array> SceneUtil::RigGeometry::mSourceTangents
private
std::map<unsigned short, float> SceneUtil::RigGeometry::mWeights

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