mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 01:26:39 +00:00 
			
		
		
		
	Use the anim source to find mAccumRoot (bug #6417)
This commit is contained in:
		
							parent
							
								
									6f5e0e7697
								
							
						
					
					
						commit
						fd58e5ba77
					
				
					 2 changed files with 27 additions and 9 deletions
				
			
		| 
						 | 
					@ -80,6 +80,7 @@
 | 
				
			||||||
    Bug #6386: Artifacts in water reflection due to imprecise screen-space coordinate computation
 | 
					    Bug #6386: Artifacts in water reflection due to imprecise screen-space coordinate computation
 | 
				
			||||||
    Bug #6396: Inputting certain Unicode characters triggers an assertion
 | 
					    Bug #6396: Inputting certain Unicode characters triggers an assertion
 | 
				
			||||||
    Bug #6416: Morphs are applied to the wrong target
 | 
					    Bug #6416: Morphs are applied to the wrong target
 | 
				
			||||||
 | 
					    Bug #6417: OpenMW doesn't always use the right node to accumulate movement
 | 
				
			||||||
    Bug #6429: Wyrmhaven: Can't add AI packages to player
 | 
					    Bug #6429: Wyrmhaven: Can't add AI packages to player
 | 
				
			||||||
    Feature #890: OpenMW-CS: Column filtering
 | 
					    Feature #890: OpenMW-CS: Column filtering
 | 
				
			||||||
    Feature #1465: "Reset" argument for AI functions
 | 
					    Feature #1465: "Reset" argument for AI functions
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -624,9 +624,8 @@ namespace MWRender
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const NodeMap& nodeMap = getNodeMap();
 | 
					        const NodeMap& nodeMap = getNodeMap();
 | 
				
			||||||
 | 
					        const auto& controllerMap = animsrc->mKeyframes->mKeyframeControllers;
 | 
				
			||||||
        for (SceneUtil::KeyframeHolder::KeyframeControllerMap::const_iterator it = animsrc->mKeyframes->mKeyframeControllers.begin();
 | 
					        for (SceneUtil::KeyframeHolder::KeyframeControllerMap::const_iterator it = controllerMap.begin(); it != controllerMap.end(); ++it)
 | 
				
			||||||
             it != animsrc->mKeyframes->mKeyframeControllers.end(); ++it)
 | 
					 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            std::string bonename = Misc::StringUtils::lowerCase(it->first);
 | 
					            std::string bonename = Misc::StringUtils::lowerCase(it->first);
 | 
				
			||||||
            NodeMap::const_iterator found = nodeMap.find(bonename);
 | 
					            NodeMap::const_iterator found = nodeMap.find(bonename);
 | 
				
			||||||
| 
						 | 
					@ -652,14 +651,32 @@ namespace MWRender
 | 
				
			||||||
        SceneUtil::AssignControllerSourcesVisitor assignVisitor(mAnimationTimePtr[0]);
 | 
					        SceneUtil::AssignControllerSourcesVisitor assignVisitor(mAnimationTimePtr[0]);
 | 
				
			||||||
        mObjectRoot->accept(assignVisitor);
 | 
					        mObjectRoot->accept(assignVisitor);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Determine the movement accumulation bone if necessary
 | 
				
			||||||
        if (!mAccumRoot)
 | 
					        if (!mAccumRoot)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            NodeMap::const_iterator found = nodeMap.find("bip01");
 | 
					            // Priority matters! bip01 is preferred.
 | 
				
			||||||
 | 
					            static const std::array<std::string, 2> accumRootNames =
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                "bip01",
 | 
				
			||||||
 | 
					                "root bone"
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					            NodeMap::const_iterator found = nodeMap.end();
 | 
				
			||||||
 | 
					            for (const std::string& name : accumRootNames)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                found = nodeMap.find(name);
 | 
				
			||||||
                if (found == nodeMap.end())
 | 
					                if (found == nodeMap.end())
 | 
				
			||||||
                found = nodeMap.find("root bone");
 | 
					                    continue;
 | 
				
			||||||
 | 
					                for (SceneUtil::KeyframeHolder::KeyframeControllerMap::const_iterator it = controllerMap.begin(); it != controllerMap.end(); ++it)
 | 
				
			||||||
            if (found != nodeMap.end())
 | 
					                {
 | 
				
			||||||
 | 
					                    if (Misc::StringUtils::lowerCase(it->first) == name)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
                        mAccumRoot = found->second;
 | 
					                        mAccumRoot = found->second;
 | 
				
			||||||
 | 
					                        break;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if (mAccumRoot)
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue