public static void InvertRigid(ref AffineTransform transform, out AffineTransform inverse) { Matrix3x3.Transpose(ref transform.LinearTransform, out inverse.LinearTransform); Matrix3x3.Transform(ref transform.Translation, ref inverse.LinearTransform, out inverse.Translation); inverse.Translation = -inverse.Translation; }
public static void Transform(ref Vector3 position, ref AffineTransform transform, out Vector3 transformed) { Matrix3x3.Transform(ref position, ref transform.LinearTransform, out transformed); transformed += transform.Translation; }
public static void Multiply(ref AffineTransform a, ref AffineTransform b, out AffineTransform transform) { Vector3 translation; Matrix3x3.Transform(ref a.Translation, ref b.LinearTransform, out translation); transform.Translation = b.Translation + translation; Matrix3x3.Multiply(ref a.LinearTransform, ref b.LinearTransform, out transform.LinearTransform); }