void UpdateTarget() { var phr = new Vector3d(targetPitch, targetHeading, double.IsNaN(targetRoll) ? 0 : targetRoll); targetRotation = GeometryExtensions.QuaternionFromPitchHeadingRoll(phr); targetDirection = targetRotation * Vector3.up; }
void UpdateTarget() { var phr = new Vector3d(targetPitch, targetHeading, double.IsNaN(targetRoll) ? 0 : targetRoll); targetRotation = GeometryExtensions.QuaternionFromPitchHeadingRoll(phr); targetRotation = vessel.SurfaceReferenceFrame.Rotation * targetRotation; targetRotation = ReferenceFrame.Rotation.Inverse() * targetRotation; targetDirection = targetRotation * Vector3.up; }
public void TargetPitchAndHeading(float pitch, float heading) { var rotation = GeometryExtensions.QuaternionFromPitchHeadingRoll(new Vector3(pitch, heading, 0)); targetDirection = rotation * Vector3.up; }