mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 20:26:43 +00:00 
			
		
		
		
	Merge remote branch 'gus/collision' into collision
This commit is contained in:
		
						commit
						9946bb36f7
					
				
					 2 changed files with 10 additions and 5 deletions
				
			
		|  | @ -109,13 +109,13 @@ void MWScene::doPhysics (float duration, MWWorld::World& world, | |||
|             Ogre::Quaternion yawQuat = yawNode->getOrientation(); | ||||
|             Ogre::Quaternion pitchQuat = pitchNode->getOrientation(); | ||||
|             Ogre::Vector3 dir1(iter->second.x,iter->second.z,-iter->second.y); | ||||
|             dir = 0.01*(yawQuat*pitchQuat*dir1); | ||||
|             dir = 0.07*(yawQuat*pitchQuat*dir1); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             Ogre::Quaternion quat = yawNode->getOrientation(); | ||||
|             Ogre::Vector3 dir1(iter->second.x,iter->second.z,-iter->second.y); | ||||
|             dir = 0.01*(quat*dir1); | ||||
|             dir = 0.07*(quat*dir1); | ||||
|         } | ||||
| 
 | ||||
| 		//set the walk direction
 | ||||
|  | @ -163,7 +163,7 @@ void MWScene::moveObject (const std::string& handle, const Ogre::Vector3& positi | |||
| { | ||||
|     rend.getScene()->getSceneNode(handle)->setPosition(position); | ||||
| 
 | ||||
|     if(updatePhysics)//TODO: is it an actor?
 | ||||
|     if(updatePhysics)//TODO: is it an actor? Done?
 | ||||
|     { | ||||
|         if (OEngine::Physic::RigidBody* body = eng->getRigidBody(handle)) | ||||
|         { | ||||
|  | @ -173,6 +173,12 @@ void MWScene::moveObject (const std::string& handle, const Ogre::Vector3& positi | |||
|             tr.setOrigin(btVector3(position.x,position.y,position.z)); | ||||
|             body->setWorldTransform(tr); | ||||
|         } | ||||
|         if (OEngine::Physic::PhysicActor* act = eng->getCharacter(handle)) | ||||
|         { | ||||
|             // TODO very dirty hack to avoid crash during setup -> needs cleaning up to allow
 | ||||
|             // start positions others than 0, 0, 0
 | ||||
|             act->setPosition(btVector3(position.x,position.y,position.z)); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -309,11 +309,10 @@ namespace MWWorld | |||
|         bool adjustPlayerPos) | ||||
|     { | ||||
|         if (adjustPlayerPos) | ||||
|             mPlayer->setPos (position.pos[0], position.pos[1], position.pos[2], true); | ||||
|             mPlayer->setPos (position.pos[0], position.pos[1], position.pos[2], false); | ||||
| 
 | ||||
|         mPlayer->setCell (cell); | ||||
|         // TODO orientation
 | ||||
| 
 | ||||
|         mEnvironment.mMechanicsManager->addActor (mPlayer->getPlayer()); | ||||
|         mEnvironment.mMechanicsManager->watchActor (mPlayer->getPlayer()); | ||||
|     } | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue