Ejemplo n.º 1
0
 public static void Multiply(ref RigidTransform3 rigidTransform, ref AffineTransform3 affineTransform, out AffineTransform3 result)
 {
     Matrix3.FromQuaternion(ref rigidTransform.Orientation, out result.Transform);
     Matrix3.Multiply(ref result.Transform, ref affineTransform.Transform, out result.Transform);
     Vector3.Transform(ref rigidTransform.Position, ref affineTransform.Transform, out result.Translation);
     result.Translation +=  affineTransform.Translation;
 }
Ejemplo n.º 2
0
 public Vector3 Transform(AffineTransform3 transform)
 {
     return this.Transform(transform.Transform) + transform.Translation;
 }
Ejemplo n.º 3
0
 public static void Transform(ref Vector3 vector, ref AffineTransform3 transform, out Vector3 result)
 {
     Vector3.Transform(ref vector, ref transform.Transform, out result);
     result += transform.Translation;
 }
Ejemplo n.º 4
0
        public static void FromAffineTransform(ref AffineTransform3 transform, out Matrix4 result)
        {
            result.X.X = transform.Transform.X.X;
            result.X.Y = transform.Transform.X.Y;
            result.X.Z = transform.Transform.X.Z;
            result.X.W = transform.Translation.X;

            result.Y.X = transform.Transform.Y.X;
            result.Y.Y = transform.Transform.Y.Y;
            result.Y.Z = transform.Transform.Y.Z;
            result.Y.W = transform.Translation.Y;

            result.Z.X = transform.Transform.Z.X;
            result.Z.Y = transform.Transform.Z.Y;
            result.Z.Z = transform.Transform.Z.Z;
            result.Z.W = transform.Translation.Z;

            result.W.X = 0;
            result.W.Y = 0;
            result.W.Z = 0;
            result.W.W = 1;
        }
Ejemplo n.º 5
0
 public static Matrix4 FromAffineTransform(AffineTransform3 transform)
 {
     return new Matrix4
     (
         new Vector4(transform.Transform.X, transform.Translation.X),
         new Vector4(transform.Transform.Y, transform.Translation.Y),
         new Vector4(transform.Transform.Z, transform.Translation.Z),
         new Vector4(0, 0, 0, 1)
     );
 }
Ejemplo n.º 6
0
 public static void Transform(ref Vector3 vector, ref AffineTransform3 transform, out Vector3 result)
 {
     Vector3.Transform(ref vector, ref transform.Transform, out result);
     result += transform.Translation;
 }
Ejemplo n.º 7
0
 public Vector3 Transform(AffineTransform3 transform)
 {
     return(this.Transform(transform.Transform) + transform.Translation);
 }
Ejemplo n.º 8
0
 public static void Invert(ref AffineTransform3 transform, out AffineTransform3 result)
 {
     Matrix3.Invert(ref transform.Transform, out result.Transform);
     Vector3.Transform(ref transform.Translation, ref result.Transform, out result.Translation);
     result.Translation = -result.Translation;
 }
Ejemplo n.º 9
0
 public static void FromRigidTransform(ref RigidTransform3 transform, out AffineTransform3 result)
 {
     result.Translation = transform.Position;
     Matrix3.FromQuaternion(ref transform.Orientation, out result.Transform);
 }