// A point is transformed to a child frame by reversing the position, then reversing the rotation // and then reversing scale. public static Vector3 InverseTransformPointLocal(this Transform A, Vector3 sibling_pt) { Vector3 position = sibling_pt - A.localPosition; position = Quaternion.Inverse(A.localRotation) * position; position = Vector3.Scale(position, Srt.ScaleInverse(A.localScale)); return(position); }
// Transform a sibling scale to be a child of a transform. public static Vector3 InverseTransformScaleLocal(this Transform A, Vector3 sibling_scale) { return(Vector3.Scale(Srt.ScaleInverse(A.localScale), sibling_scale)); }