Changeset 10561 for OpenSceneGraph/trunk/include/osgAnimation/Bone
- Timestamp:
- 08/31/09 11:40:56 (4 years ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/include/osgAnimation/Bone (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgAnimation/Bone
r10558 r10561 57 57 void setDefaultUpdateCallback(const std::string& name = ""); 58 58 59 struct BoneMapVisitor : public osg::NodeVisitor60 {61 BoneMap _map;62 BoneMapVisitor(): osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {}63 64 META_NodeVisitor("osgAnimation","BoneMapVisitor")65 66 void apply(osg::Node&) { return; }67 void apply(osg::Transform& node)68 {69 Bone* bone = dynamic_cast<Bone*>(&node);70 if (bone)71 {72 _map[bone->getName()] = bone;73 traverse(node);74 }75 }76 };77 78 59 class OSGANIMATION_EXPORT UpdateBone : public AnimationUpdateCallback <osg::NodeCallback> 79 60 { … … 132 113 const osg::Vec3& getTranslation() const { return _position;} 133 114 const osg::Quat& getRotation() const { return _rotation;} 115 const osg::Vec3& getScale() const { return _scale;} 116 134 117 osg::Matrix getMatrixInBoneSpace() const { return (osg::Matrix(getRotation())) * osg::Matrix::translate(getTranslation()) * _bindInBoneSpace;} 135 118 const osg::Matrix& getBindMatrixInBoneSpace() const { return _bindInBoneSpace; }
