Skip the Update traversal for inactive skeletons

c++11
scrawl 10 years ago
parent ca21e9ecb1
commit 43f9c7f295

@ -133,6 +133,13 @@ bool Skeleton::getActive() const
return mActive;
}
void Skeleton::traverse(osg::NodeVisitor& nv)
{
if (!mActive && nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR && mLastFrameNumber != 0)
return;
osg::Group::traverse(nv);
}
Bone::Bone()
: mNode(NULL)
{

@ -53,6 +53,8 @@ namespace SceneUtil
bool getActive() const;
void traverse(osg::NodeVisitor& nv);
private:
// The root bone is not a "real" bone, it has no corresponding node in the scene graph.
// As far as the scene graph goes we support multiple root bones.

Loading…
Cancel
Save