From fc7590694d11a1e6281fa203102ef1e0074d645a Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 2 Feb 2013 05:43:37 -0800 Subject: [PATCH] Revert "Revert "Use a child scene node for the accumulation root"" This reverts commit 376dfed15ba01cee8d24d122dfafc797a86fd303. I was wrong. It's needed at least for NPCs since they're attaching multiple animated skeletons to an object, and they all need to be offset correctly. Would be nice to use a Node, Bone, or TagPoint instead of a hefty SceneNode, though. --- apps/openmw/mwrender/animation.cpp | 5 ++--- apps/openmw/mwrender/animation.hpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index b63de2f166..b811040676 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -48,7 +48,7 @@ Animation::~Animation() void Animation::createEntityList(Ogre::SceneNode *node, const std::string &model) { - mInsert = node; + mInsert = node->createChildSceneNode(); assert(mInsert); mEntityList = NifOgre::Loader::createEntities(mInsert, model); @@ -76,8 +76,7 @@ void Animation::createEntityList(Ogre::SceneNode *node, const std::string &model if(data.isEmpty() || !Ogre::any_cast(data)) continue; - mAccumRoot = skelinst->getRootBone(); - mAccumRoot->setManuallyControlled(true); + mAccumRoot = mInsert; mNonAccumRoot = skelinst->getBone(bone->getHandle()); mStartPosition = mNonAccumRoot->getInitialPosition(); diff --git a/apps/openmw/mwrender/animation.hpp b/apps/openmw/mwrender/animation.hpp index 60e524d280..165a6525c3 100644 --- a/apps/openmw/mwrender/animation.hpp +++ b/apps/openmw/mwrender/animation.hpp @@ -22,7 +22,7 @@ protected: Ogre::SceneNode* mInsert; NifOgre::EntityList mEntityList; std::map mTextKeys; - Ogre::Bone *mAccumRoot; + Ogre::Node *mAccumRoot; Ogre::Bone *mNonAccumRoot; Ogre::Vector3 mAccumulate; Ogre::Vector3 mStartPosition;