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); }
static public Vector3 UnpackPosition(ref HalfVector4 position) { Vector4 unpacked = position.ToVector4(); return(unpacked.W * new Vector3(unpacked.X, unpacked.Y, unpacked.Z)); }
static public Vector3 UnpackPosition(ref HalfVector4 position) { Vector4 unpacked = position.ToVector4(); return unpacked.W * new Vector3(unpacked.X, unpacked.Y, unpacked.Z); }
public static Vector3 Xyz(this HalfVector4 vec3) { return(vec3.ToVector4().Xyz()); }