forked from mirror/openmw-tes3mp
Speed up ControllerVisitor by skipping sub graphs that have no ChildrenRequiringUpdateTraversal()
This commit is contained in:
parent
c58fc6d276
commit
a76d693627
2 changed files with 35 additions and 31 deletions
|
@ -770,12 +770,14 @@ bool NpcAnimation::addOrReplaceIndividualPart(ESM::PartReferenceType type, int g
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
osg::Node* node = mObjectParts[type]->getNode();
|
||||||
|
if (node->getNumChildrenRequiringUpdateTraversal() > 0)
|
||||||
|
{
|
||||||
boost::shared_ptr<SceneUtil::ControllerSource> src;
|
boost::shared_ptr<SceneUtil::ControllerSource> src;
|
||||||
if (type == ESM::PRT_Head)
|
if (type == ESM::PRT_Head)
|
||||||
{
|
{
|
||||||
src = mHeadAnimationTime;
|
src = mHeadAnimationTime;
|
||||||
|
|
||||||
osg::Node* node = mObjectParts[type]->getNode();
|
|
||||||
if (node->getUserDataContainer())
|
if (node->getUserDataContainer())
|
||||||
{
|
{
|
||||||
for (unsigned int i=0; i<node->getUserDataContainer()->getNumUserObjects(); ++i)
|
for (unsigned int i=0; i<node->getUserDataContainer()->getNumUserObjects(); ++i)
|
||||||
|
@ -806,7 +808,8 @@ bool NpcAnimation::addOrReplaceIndividualPart(ESM::PartReferenceType type, int g
|
||||||
src.reset(new NullAnimationTime);
|
src.reset(new NullAnimationTime);
|
||||||
|
|
||||||
SceneUtil::AssignControllerSourcesVisitor assignVisitor(src);
|
SceneUtil::AssignControllerSourcesVisitor assignVisitor(src);
|
||||||
mObjectParts[type]->getNode()->accept(assignVisitor);
|
node->accept(assignVisitor);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,6 +81,7 @@ namespace SceneUtil
|
||||||
callback = callback->getNestedCallback();
|
callback = callback->getNestedCallback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (node.getNumChildrenRequiringUpdateTraversal() > 0)
|
||||||
traverse(node);
|
traverse(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue