Added new TerrainManipulator to osgGA, and new callback for getting the

CoordinateFrame for a given X,Y,Z location.
This commit is contained in:
Robert Osfield
2004-05-06 11:01:16 +00:00
parent 1a09763515
commit 47dd0ece28
12 changed files with 740 additions and 61 deletions

View File

@@ -257,6 +257,7 @@ bool FlightManipulator::calcMovement()
float dx = _ga_t0->getXnormalized();
float dy = _ga_t0->getYnormalized();
osg::CoordinateFrame cf=getCoordinateFrame(_eye.x(), _eye.y(), _eye.z());
osg::Matrixd rotation_matrix;
rotation_matrix.makeRotate(_rotation);
@@ -283,13 +284,13 @@ bool FlightManipulator::calcMovement()
if (_yawMode==YAW_AUTOMATICALLY_WHEN_BANKED)
{
//float bank = asinf(sv.z());
float bank = asinf(sv *getUpVector());
float bank = asinf(sv *getUpVector(cf));
float yaw = inRadians(bank)*dt;
osg::Quat yaw_rotate;
//yaw_rotate.makeRotate(yaw,0.0f,0.0f,1.0f);
yaw_rotate.makeRotate(yaw,getUpVector());
yaw_rotate.makeRotate(yaw,getUpVector(cf));
delta_rotate = delta_rotate*yaw_rotate;