mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-03 23:56:43 +00:00 
			
		
		
		
	Don't add RotateController to an uncontrolled node
This commit is contained in:
		
							parent
							
								
									8791063110
								
							
						
					
					
						commit
						87871d7d54
					
				
					 1 changed files with 18 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -1353,12 +1353,27 @@ namespace MWRender
 | 
			
		|||
            if (found != getNodeMap().end())
 | 
			
		||||
            {
 | 
			
		||||
                osg::MatrixTransform* node = found->second;
 | 
			
		||||
 | 
			
		||||
                bool foundKeyframeCtrl = false;
 | 
			
		||||
                osg::Callback* cb = node->getUpdateCallback();
 | 
			
		||||
                while (cb)
 | 
			
		||||
                {
 | 
			
		||||
                    if (dynamic_cast<NifOsg::KeyframeController*>(cb))
 | 
			
		||||
                    {
 | 
			
		||||
                        foundKeyframeCtrl = true;
 | 
			
		||||
                        break;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                if (foundKeyframeCtrl)
 | 
			
		||||
                {
 | 
			
		||||
                    mHeadController = new RotateController(mObjectRoot.get());
 | 
			
		||||
                    node->addUpdateCallback(mHeadController);
 | 
			
		||||
                    mActiveControllers.insert(std::make_pair(node, mHeadController));
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void Animation::setHeadPitch(float pitchRadians)
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue