From e7aa03f1bf9ebb2353fd8cce2aa64c48004e5999 Mon Sep 17 00:00:00 2001 From: Benau Date: Fri, 28 Sep 2018 23:33:51 +0800 Subject: [PATCH] Try an up-to-date current frame bone-child attachment in legacy pipeline --- lib/irrlicht/include/ISceneNode.h | 14 ++++++++++++++ .../source/Irrlicht/CAnimatedMeshSceneNode.cpp | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/lib/irrlicht/include/ISceneNode.h b/lib/irrlicht/include/ISceneNode.h index 212581d3b..a4a9b4497 100644 --- a/lib/irrlicht/include/ISceneNode.h +++ b/lib/irrlicht/include/ISceneNode.h @@ -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; diff --git a/lib/irrlicht/source/Irrlicht/CAnimatedMeshSceneNode.cpp b/lib/irrlicht/source/Irrlicht/CAnimatedMeshSceneNode.cpp index 2d617ca66..1be1e14d6 100644 --- a/lib/irrlicht/source/Irrlicht/CAnimatedMeshSceneNode.cpp +++ b/lib/irrlicht/source/Irrlicht/CAnimatedMeshSceneNode.cpp @@ -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;nrecursiveUpdateAbsolutePosition(); }