Fixed bug 1900307 "Tracked objects don't stay centered." The fix was simple: the track orientation for the observer needed to be calculated *after* the universal position and orientation were updated.

ver1_6_1
Chris Laurel 2008-02-23 22:23:01 +00:00
parent 932d0479d7
commit 748c2d5408
1 changed files with 4 additions and 2 deletions

View File

@ -479,7 +479,11 @@ void Observer::update(double dt, double timeScale)
orientation += dt * dr;
orientation.normalize();
}
updateUniversal();
// Update orientation for tracking--must occur after updateUniversal(), as it
// relies on the universal position and orientation of the observer.
if (!trackObject.empty())
{
Vec3d up = Vec3d(0, 1, 0) * getOrientation().toMatrix3();
@ -489,8 +493,6 @@ void Observer::update(double dt, double timeScale)
Point3d(viewDir.x, viewDir.y, viewDir.z),
up));
}
updateUniversal();
}