mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-29 03:26:38 +00:00 
			
		
		
		
	Revert "Revert "Use a child scene node for the accumulation root""
This reverts commit 376dfed15b.
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.
			
			
This commit is contained in:
		
							parent
							
								
									e6e7c69013
								
							
						
					
					
						commit
						fc7590694d
					
				
					 2 changed files with 3 additions and 4 deletions
				
			
		|  | @ -48,7 +48,7 @@ Animation::~Animation() | ||||||
| 
 | 
 | ||||||
| void Animation::createEntityList(Ogre::SceneNode *node, const std::string &model) | void Animation::createEntityList(Ogre::SceneNode *node, const std::string &model) | ||||||
| { | { | ||||||
|     mInsert = node; |     mInsert = node->createChildSceneNode(); | ||||||
|     assert(mInsert); |     assert(mInsert); | ||||||
| 
 | 
 | ||||||
|     mEntityList = NifOgre::Loader::createEntities(mInsert, model); |     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<bool>(data)) |             if(data.isEmpty() || !Ogre::any_cast<bool>(data)) | ||||||
|                 continue; |                 continue; | ||||||
| 
 | 
 | ||||||
|             mAccumRoot = skelinst->getRootBone(); |             mAccumRoot = mInsert; | ||||||
|             mAccumRoot->setManuallyControlled(true); |  | ||||||
|             mNonAccumRoot = skelinst->getBone(bone->getHandle()); |             mNonAccumRoot = skelinst->getBone(bone->getHandle()); | ||||||
| 
 | 
 | ||||||
|             mStartPosition = mNonAccumRoot->getInitialPosition(); |             mStartPosition = mNonAccumRoot->getInitialPosition(); | ||||||
|  |  | ||||||
|  | @ -22,7 +22,7 @@ protected: | ||||||
|     Ogre::SceneNode* mInsert; |     Ogre::SceneNode* mInsert; | ||||||
|     NifOgre::EntityList mEntityList; |     NifOgre::EntityList mEntityList; | ||||||
|     std::map<std::string,NifOgre::TextKeyMap> mTextKeys; |     std::map<std::string,NifOgre::TextKeyMap> mTextKeys; | ||||||
|     Ogre::Bone *mAccumRoot; |     Ogre::Node *mAccumRoot; | ||||||
|     Ogre::Bone *mNonAccumRoot; |     Ogre::Bone *mNonAccumRoot; | ||||||
|     Ogre::Vector3 mAccumulate; |     Ogre::Vector3 mAccumulate; | ||||||
|     Ogre::Vector3 mStartPosition; |     Ogre::Vector3 mStartPosition; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue