diff --git a/components/sceneutil/skeleton.cpp b/components/sceneutil/skeleton.cpp index 96941126b..5c2af4397 100644 --- a/components/sceneutil/skeleton.cpp +++ b/components/sceneutil/skeleton.cpp @@ -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) { diff --git a/components/sceneutil/skeleton.hpp b/components/sceneutil/skeleton.hpp index 1987fd4e8..d4418fa27 100644 --- a/components/sceneutil/skeleton.hpp +++ b/components/sceneutil/skeleton.hpp @@ -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.