public static void ApplyRotation(float angle, KRPC.Utils.Tuple<float,float,float> axis, KRPCSpaceCenter.Services.Vessel vessel = null) { Vessel internalVessel = vessel == null ? FlightGlobals.ActiveVessel : vessel.InternalVessel; var axisVector = new Vector3 (axis.Item1, axis.Item2, axis.Item3).normalized; var rotation = internalVessel.transform.rotation * Quaternion.AngleAxis (angle, axisVector); internalVessel.SetRotation (rotation); }
public static void ClearRotation(KRPCSpaceCenter.Services.Vessel vessel = null) { Vessel internalVessel = vessel == null ? FlightGlobals.ActiveVessel : vessel.InternalVessel; internalVessel.GoOnRails (); internalVessel.SetRotation (ZeroRotation); }