Found bug & got possible fix:
Celestia isn't updating the journey.from & journey.to positions when changing frames of reference. You start with Universal frame (due to cancel { }), and finish using Ecliptical (follow), but the positions are still those needed for universal frame, sending you 206 au away. The same bug has following effect:
Select Earth
goto Earth: Press g
Select other planet (say mars).
follow Mars: press f, while still travelling to earth
celestia will go to mars instead of earth (you may notice a sudden jump when changing frame-of-reference to mars).
Possible fix:
Replace Observer::setFrame by:
Code: Select all
void Observer::setFrame(const FrameOfReference& _frame)
{
RigidTransform transform = frame.toUniversal(situation, getTime());
RigidTransform from, to;
if (observerMode == Travelling)
{
from = frame.toUniversal(RigidTransform(journey.from, journey.initialOrientation), getTime());
to = frame.toUniversal(RigidTransform(journey.to, journey.finalOrientation), getTime());
}
frame = _frame;
situation = frame.fromUniversal(transform, getTime());
if (observerMode == Travelling)
{
from = frame.fromUniversal(from, getTime());
journey.from = from.translation;
journey.initialOrientation = Quatf((float) from.rotation.w,
(float) from.rotation.x,
(float) from.rotation.y,
(float) from.rotation.z);
to = frame.fromUniversal(to, getTime());
journey.to = to.translation;
journey.finalOrientation = Quatf((float) to.rotation.w,
(float) to.rotation.x,
(float) to.rotation.y,
(float) to.rotation.z);
}
}
Don, can you add this to the bugracker, until chris (or anybody else who knows more about this) says it's ok? I think it is, but don't want to mess around with this code without being sure
Harald