mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-22 09:23:54 +00:00
Some cleanup
This commit is contained in:
parent
b494533bb2
commit
0066ef9b54
1 changed files with 8 additions and 32 deletions
|
@ -140,8 +140,6 @@ namespace MWWorld
|
|||
iter!=actors.end(); ++iter)
|
||||
{
|
||||
OEngine::Physic::PhysicActor* act = mEngine->getCharacter(iter->first);
|
||||
//if(iter->first == "player")
|
||||
// std::cout << "This is player\n";
|
||||
//dirty stuff to get the camera orientation. Must be changed!
|
||||
|
||||
Ogre::SceneNode *sceneNode = mRender.getScene()->getSceneNode (iter->first);
|
||||
|
@ -151,46 +149,28 @@ namespace MWWorld
|
|||
Ogre::Quaternion yawQuat = yawNode->getOrientation();
|
||||
Ogre::Quaternion pitchQuat = pitchNode->getOrientation();
|
||||
|
||||
// unused
|
||||
//Ogre::Quaternion both = yawQuat * pitchQuat;
|
||||
|
||||
|
||||
playerphysics->ps.viewangles.x = pitchQuat.getPitch().valueDegrees();
|
||||
playerphysics->ps.viewangles.z = 0;
|
||||
|
||||
playerphysics->ps.viewangles.y = yawQuat.getYaw().valueDegrees() *-1 + 90;
|
||||
|
||||
if(mFreeFly)
|
||||
{
|
||||
Ogre::Vector3 dir1(iter->second.x,iter->second.z,-iter->second.y);
|
||||
|
||||
pm_ref.rightmove = -dir1.x;
|
||||
pm_ref.forwardmove = dir1.z;
|
||||
pm_ref.upmove = dir1.y;
|
||||
|
||||
|
||||
//std::cout << "Current angle" << yawQuat.getYaw().valueDegrees() - 90<< "\n";
|
||||
//playerphysics->ps.viewangles.x = pitchQuat.getPitch().valueDegrees();
|
||||
//std::cout << "Pitch: " << yawQuat.getPitch() << "Yaw:" << yawQuat.getYaw() << "Roll: " << yawQuat.getRoll() << "\n";
|
||||
dir = 0.07*(yawQuat*pitchQuat*dir1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Ogre::Quaternion quat = yawNode->getOrientation();
|
||||
Ogre::Vector3 dir1(iter->second.x,iter->second.z,-iter->second.y);
|
||||
|
||||
pm_ref.rightmove = -dir1.x;
|
||||
pm_ref.forwardmove = dir1.z;
|
||||
pm_ref.upmove = dir1.y;
|
||||
pm_ref.rightmove = -iter->second.x;
|
||||
pm_ref.forwardmove = -iter->second.y;
|
||||
pm_ref.upmove = iter->second.z;
|
||||
|
||||
|
||||
|
||||
dir = 0.025*(quat*dir1);
|
||||
}
|
||||
|
||||
|
||||
//set the walk direction
|
||||
act->setWalkDirection(btVector3(dir.x,-dir.z,dir.y));
|
||||
}
|
||||
|
||||
|
||||
|
||||
mEngine->stepSimulation(dt);
|
||||
}
|
||||
|
||||
|
@ -208,10 +188,6 @@ namespace MWWorld
|
|||
if(it->first == "player"){
|
||||
|
||||
coord = playerphysics->ps.origin;
|
||||
//std::cout << "ZCoord: " << coord.z << "\n";
|
||||
//std::cout << "Coord" << coord << "\n";
|
||||
//coord = Ogre::Vector3(coord.x, coord.z, coord.y); //x, z, -y
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue