Fixed the Flight and Drive manipulators to work with the updated Matrix::rotate

code.
This commit is contained in:
Robert Osfield 2001-10-14 09:57:33 +00:00
parent 3ecaf3cd6c
commit 72dc08cd9a
2 changed files with 4 additions and 4 deletions

View File

@ -405,7 +405,7 @@ bool DriveManipulator::calcMovement()
float dx = _ga_t0->getX()-mx; float dx = _ga_t0->getX()-mx;
float yaw = inDegrees(dx*0.1f*dt); float yaw = -inDegrees(dx*0.1f*dt);
osg::Matrix mat; osg::Matrix mat;
mat.makeTrans(-center.x(),-center.y(),-center.z()); mat.makeTrans(-center.x(),-center.y(),-center.z());

View File

@ -201,8 +201,8 @@ bool FlightManipulator::calcMovement()
osg::Vec3 sv = _camera->getSideVector(); osg::Vec3 sv = _camera->getSideVector();
osg::Vec3 lv = _camera->getLookVector(); osg::Vec3 lv = _camera->getLookVector();
float pitch = inDegrees(-dy*0.15f*dt); float pitch = inDegrees(dy*0.15f*dt);
float roll = inDegrees(-dx*0.1f*dt); float roll = inDegrees(dx*0.1f*dt);
osg::Matrix mat; osg::Matrix mat;
mat.makeTrans(-center); mat.makeTrans(-center);
@ -211,7 +211,7 @@ bool FlightManipulator::calcMovement()
if (_yawMode==YAW_AUTOMATICALLY_WHEN_BANKED) if (_yawMode==YAW_AUTOMATICALLY_WHEN_BANKED)
{ {
float bank = asinf(sv.z()); float bank = asinf(sv.z());
float yaw = inRadians(-bank)*dt; float yaw = inRadians(bank)*dt;
mat *= Matrix::rotate(yaw,0.0f,0.0f,1.0f); mat *= Matrix::rotate(yaw,0.0f,0.0f,1.0f);
} }