Exemplo n.º 1
0
        public void ToMatrix(out Matrix result)
        {
            var q = Quaternion.FromVector4(Orientation.ToVector4());

            Matrix.CreateFromQuaternion(ref q, out result);
            result.Translation = Position;
        }
            public MatrixD GetWorldMatrix()
            {
                Vector4    oriV4 = Orientation.ToVector4();
                Quaternion quat  = new Quaternion(oriV4.X, oriV4.Y, oriV4.Z, oriV4.W);

                quat.Normalize();
                Matrix m = Matrix.CreateFromQuaternion(quat);

                m.Translation = Position;

                return(m);
            }
Exemplo n.º 3
0
        static public Vector3 UnpackPosition(ref HalfVector4 position)
        {
            Vector4 unpacked = position.ToVector4();

            return(unpacked.W * new Vector3(unpacked.X, unpacked.Y, unpacked.Z));
        }
Exemplo n.º 4
0
 static public Vector3 UnpackPosition(ref HalfVector4 position)
 {
     Vector4 unpacked = position.ToVector4();
     return unpacked.W * new Vector3(unpacked.X, unpacked.Y, unpacked.Z);
 }
Exemplo n.º 5
0
 public static Vector3 Xyz(this HalfVector4 vec3)
 {
     return(vec3.ToVector4().Xyz());
 }