Ejemplo n.º 1
0
 public static void FromMatrix(Matrix4x4 transformation, out Vector3 forward, out Vector3 side, out Vector3 up, out Vector3 position)
 {
     position = transformation.Translation;
     side     = MatrixHelpers.Right(ref transformation);
     up       = MatrixHelpers.Up(ref transformation);
     forward  = MatrixHelpers.Backward(ref transformation);
 }
Ejemplo n.º 2
0
        public static Matrix4x4 ToMatrix(Vector3 forward, Vector3 side, Vector3 up, Vector3 position)
        {
            Matrix4x4 m = Matrix4x4.Identity;

            m.Translation = position;
            MatrixHelpers.Right(ref m, ref side);
            MatrixHelpers.Up(ref m, ref up);
            MatrixHelpers.Right(ref m, ref forward);

            return(m);
        }