mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-14 01:19:59 +00:00
fix camera bug
This commit is contained in:
parent
86ded891d9
commit
33f22fd68b
@ -126,18 +126,20 @@ void MWScene::doPhysics (float duration, MWWorld::World& world,
|
||||
|
||||
//first adjust the rotation of the object, which is not handled by the physic engine i believe.
|
||||
|
||||
/*Ogre::SceneNode *sceneNode = rend.getScene()->getSceneNode (iter->first);
|
||||
Ogre::SceneNode *sceneNode = rend.getScene()->getSceneNode (iter->first);
|
||||
Ogre::Quaternion quat = sceneNode->getChildIterator().getNext()->getOrientation();
|
||||
Ogre::Quaternion quat2;
|
||||
Ogre::Matrix3 mat;
|
||||
quat.ToRotationMatrix(mat);
|
||||
Ogre::Radian x,y,z;
|
||||
mat.ToEulerAnglesXYZ(x,y,z);
|
||||
mat.FromEulerAnglesXYZ(x,z,y);
|
||||
Ogre::Vector3 dir = mat*iter->second;*/
|
||||
//Ogre::Quaternion quat2;
|
||||
//Ogre::Matrix3::
|
||||
//Ogre::Matrix3 mat;
|
||||
//quat.ToRotationMatrix(mat);
|
||||
//Ogre::Radian x,y,z;
|
||||
//mat.ToEulerAnglesXYZ(x,y,z);
|
||||
//mat.FromEulerAnglesXYZ(Ogre::Radian(0),z,Ogre::Radian(0));
|
||||
Ogre::Vector3 dir1(iter->second.x,iter->second.z,-iter->second.y);
|
||||
Ogre::Vector3 dir = quat*dir1;
|
||||
|
||||
//the add the movement:
|
||||
act->setWalkDirection(btVector3(iter->second.x,iter->second.y,iter->second.z)*duration);
|
||||
act->setWalkDirection(btVector3(dir.x,-dir.z,dir.y)*duration);
|
||||
}
|
||||
//std::cout << "duration " << duration << std::endl;
|
||||
eng->stepSimulation(duration);
|
||||
|
Loading…
x
Reference in New Issue
Block a user