Try an up-to-date current frame bone-child attachment in legacy pipeline

This commit is contained in:
Benau 2018-09-28 23:33:51 +08:00
parent d61b74fdd4
commit e7aa03f1bf
2 changed files with 18 additions and 0 deletions

View File

@ -133,6 +133,20 @@ namespace scene
}
}
virtual void recursiveUpdateAbsolutePosition()
{
if (IsVisible)
{
// update absolute position
updateAbsolutePosition();
// perform the post render process on all children
ISceneNodeList::Iterator it = Children.begin();
for (; it != Children.end(); ++it)
(*it)->recursiveUpdateAbsolutePosition();
}
}
//! Renders the node.
virtual void render() = 0;

View File

@ -249,6 +249,10 @@ void CAnimatedMeshSceneNode::OnAnimate(u32 timeMs)
LastTimeMs = timeMs;
IAnimatedMeshSceneNode::OnAnimate(timeMs);
// For up-to-date current frame bone-child attachment
for (u32 n=0;n<JointChildSceneNodes.size();++n)
JointChildSceneNodes[n]->recursiveUpdateAbsolutePosition();
}