Redefined orientation of location objects so that they inherit the orientation

of their parent bodies. Fixes unexpected behavior that occurred when a user
would sync orbit a location.
sensor-dev
Chris Laurel 2009-08-21 02:53:25 +00:00
parent 236fc1f251
commit 1ae7019dd7
1 changed files with 11 additions and 1 deletions

View File

@ -303,6 +303,11 @@ BodyFixedFrame::getOrientation(double tjd) const
return yrot180 * fixObject.body()->getEclipticToBodyFixed(tjd);
case Selection::Type_Star:
return yrot180 * fixObject.star()->getRotationModel()->orientationAtTime(tjd);
case Selection::Type_Location:
if (fixObject.location()->getParentBody())
return yrot180 * fixObject.location()->getParentBody()->getEclipticToBodyFixed(tjd);
else
return yrot180;
default:
return yrot180;
}
@ -318,7 +323,12 @@ BodyFixedFrame::getAngularVelocity(double tjd) const
return fixObject.body()->getAngularVelocity(tjd);
case Selection::Type_Star:
return fixObject.star()->getRotationModel()->angularVelocityAtTime(tjd);
default:
case Selection::Type_Location:
if (fixObject.location()->getParentBody())
return fixObject.location()->getParentBody()->getAngularVelocity(tjd);
else
return Vector3d::Zero();
default:
return Vector3d::Zero();
}
}