public void RotateOrbit(float headingDegrees, float pitchDegrees, float rollDegrees)
{
float heading = MathHelper.ToRadians(headingDegrees);
float pitch = MathHelper.ToRadians(pitchDegrees);
if (preferTargetYAxisOrbiting)
{
Quaternion rotation = Quaternion.Identity;
if (heading != 0.0f)
{
Quaternion.CreateFromAxisAngle(ref targetYAxis, heading, out rotation);
Quaternion.Concatenate(ref rotation, ref orientation, out orientation);
}
if (pitch != 0.0f)
{
Quaternion.CreateFromAxisAngle(ref WORLD_X_AXIS, pitch, out rotation);
Quaternion.Concatenate(ref orientation, ref rotation, out orientation);
}
}
else
{
float roll = MathHelper.ToRadians(rollDegrees);
Quaternion rotation = Quaternion.CreateFromYawPitchRoll(heading, pitch, roll);
Quaternion.Concatenate(ref orientation, ref rotation, out orientation);
}
}