PosAndRotExtensionsInverseTransformPosAndRot Method |
Namespace: KSPDev.Extensions
public static PosAndRot InverseTransformPosAndRot( this Transform node, PosAndRot posAndRot )
public static void ToLocal() { var parent = new GameObject(); parent.transform.position = Vector3.one; parent.transform.rotation = Quaternion.LookRotation(Vector3.up); var pr = new PosAndRot(Vector3.one, new Vector3(90, 0, 0)); Debug.LogFormat("Local: {0}", parent.transform.InverseTransformPosAndRot(pr)); Debug.LogFormat("World: {0}", pr); }