Exemplo n.º 1
0
 public TransformExt(Spatial spatial)
 {
     position = Vector3.FromV3(spatial.GetTranslation());
     rotation = Quaternion.FromEulerRHS(Vector3.FromV3((spatial.GetRotationDegrees())));
     scale    = Vector3.FromV3(spatial.GetScale());
     posLHS   = new Vector3(position.x, position.y, -position.z);
     updateTransformMatrix();
 }
Exemplo n.º 2
0
            public static TransformExt FromTransform(Transform transform, Vector3 rotation)
            {
                TransformExt transformExt = new TransformExt();

                transformExt.worldMatrix = Matrix4x4.TransformToMatrix4x4(transform);
                transformExt.position    = Vector3.FromV3(transform.origin);
                transformExt.rotation    = Quaternion.FromEuler(rotation);
                transformExt.scale       = new Vector3(1, 1, 1);
                return(transformExt);
            }