mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 20:26:43 +00:00 
			
		
		
		
	fixed a bug in phyiscs update code
This commit is contained in:
		
							parent
							
								
									91ea36509d
								
							
						
					
					
						commit
						7b5d24c853
					
				
					 2 changed files with 12 additions and 8 deletions
				
			
		|  | @ -163,13 +163,17 @@ void MWScene::moveObject (const std::string& handle, const Ogre::Vector3& positi | |||
| { | ||||
|     rend.getScene()->getSceneNode(handle)->setPosition(position); | ||||
| 
 | ||||
| 	if(updatePhysics)//TODO: is it an actor?
 | ||||
| 	{ | ||||
| 		OEngine::Physic::RigidBody* body = eng->getRigidBody(handle); | ||||
| 		btTransform tr = body->getWorldTransform(); | ||||
| 		tr.setOrigin(btVector3(position.x,position.y,position.z)); | ||||
| 		body->setWorldTransform(tr); | ||||
| 	} | ||||
|     if(updatePhysics)//TODO: is it an actor?
 | ||||
|     { | ||||
|         if (OEngine::Physic::RigidBody* body = eng->getRigidBody(handle)) | ||||
|         { | ||||
|             // TODO very dirty hack to avoid crash during setup -> needs cleaning up to allow
 | ||||
|             // start positions others than 0, 0, 0
 | ||||
|             btTransform tr = body->getWorldTransform(); | ||||
|             tr.setOrigin(btVector3(position.x,position.y,position.z)); | ||||
|             body->setWorldTransform(tr); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| void MWScene::rotateObject (const std::string& handle, const Ogre::Quaternion& rotation) | ||||
|  |  | |||
|  | @ -18,7 +18,7 @@ namespace MWWorld | |||
| 
 | ||||
|     bool DoingPhysics::isDoingPhysics() | ||||
|     { | ||||
|         return sCounter>0 || sSuppress>0; | ||||
|         return sCounter>0 && sSuppress==0; | ||||
|     } | ||||
| 
 | ||||
|     SuppressDoingPhysics::SuppressDoingPhysics() | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue