mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-30 02:56:44 +00:00 
			
		
		
		
	Add a method to update an Animation's Ptr object
This commit is contained in:
		
							parent
							
								
									a2eaec7878
								
							
						
					
					
						commit
						d208422ca7
					
				
					 3 changed files with 8 additions and 1 deletions
				
			
		|  | @ -169,6 +169,7 @@ void Actors::updateObjectCell(const MWWorld::Ptr &ptr) | ||||||
|     { |     { | ||||||
|         Animation *anim = iter->second; |         Animation *anim = iter->second; | ||||||
|         mAllActors.erase(iter); |         mAllActors.erase(iter); | ||||||
|  |         anim->updatePtr(ptr); | ||||||
|         mAllActors[ptr] = anim; |         mAllActors[ptr] = anim; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -169,6 +169,11 @@ void Animation::setLooping(bool loop) | ||||||
|     mLooping = loop; |     mLooping = loop; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void Animation::updatePtr(const MWWorld::Ptr &ptr) | ||||||
|  | { | ||||||
|  |     mPtr = ptr; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| void Animation::calcAnimVelocity() | void Animation::calcAnimVelocity() | ||||||
| { | { | ||||||
|  |  | ||||||
|  | @ -49,7 +49,6 @@ protected: | ||||||
|      * bone names) are positioned identically. */ |      * bone names) are positioned identically. */ | ||||||
|     void updateSkeletonInstance(const Ogre::SkeletonInstance *skelsrc, Ogre::SkeletonInstance *skel); |     void updateSkeletonInstance(const Ogre::SkeletonInstance *skelsrc, Ogre::SkeletonInstance *skel); | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|     /* Updates the animation to the specified time, and returns the movement
 |     /* Updates the animation to the specified time, and returns the movement
 | ||||||
|      * vector since the last update or reset. */ |      * vector since the last update or reset. */ | ||||||
|     Ogre::Vector3 updatePosition(float time); |     Ogre::Vector3 updatePosition(float time); | ||||||
|  | @ -78,6 +77,8 @@ public: | ||||||
| 
 | 
 | ||||||
|     void setController(MWMechanics::CharacterController *controller); |     void setController(MWMechanics::CharacterController *controller); | ||||||
| 
 | 
 | ||||||
|  |     void updatePtr(const MWWorld::Ptr &ptr); | ||||||
|  | 
 | ||||||
|     bool hasAnimation(const std::string &anim); |     bool hasAnimation(const std::string &anim); | ||||||
| 
 | 
 | ||||||
|     // Specifies the axis' to accumulate on. Non-accumulated axis will just
 |     // Specifies the axis' to accumulate on. Non-accumulated axis will just
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue