mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-09 20:17:54 +03:00
fix camera bug
This commit is contained in:
parent
86ded891d9
commit
33f22fd68b
1 changed files with 11 additions and 9 deletions
|
@ -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.
|
//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 quat = sceneNode->getChildIterator().getNext()->getOrientation();
|
||||||
Ogre::Quaternion quat2;
|
//Ogre::Quaternion quat2;
|
||||||
Ogre::Matrix3 mat;
|
//Ogre::Matrix3::
|
||||||
quat.ToRotationMatrix(mat);
|
//Ogre::Matrix3 mat;
|
||||||
Ogre::Radian x,y,z;
|
//quat.ToRotationMatrix(mat);
|
||||||
mat.ToEulerAnglesXYZ(x,y,z);
|
//Ogre::Radian x,y,z;
|
||||||
mat.FromEulerAnglesXYZ(x,z,y);
|
//mat.ToEulerAnglesXYZ(x,y,z);
|
||||||
Ogre::Vector3 dir = mat*iter->second;*/
|
//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:
|
//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;
|
//std::cout << "duration " << duration << std::endl;
|
||||||
eng->stepSimulation(duration);
|
eng->stepSimulation(duration);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue