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 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.º 3
0
        public Vector3 TransformInversed(RigidTransform3 transform)
        {
            Vector3 result = this - transform.Position;

            Quaternion.Conjugate(ref transform.Orientation, out transform.Orientation);
            Vector3.Transform(ref this, ref transform.Orientation, out result);
            return(result);
        }
Ejemplo n.º 4
0
 public AffineTransform3 Multiply(ref RigidTransform3 transform)
 {
     AffineTransform3 result;
     Matrix3.FromQuaternion(ref transform.Orientation, out result.Transform);
     Matrix3.Multiply(ref result.Transform, ref Transform, out result.Transform);
     Vector3.Transform(ref transform.Position, ref Transform, out result.Translation);
     result.Translation += Translation;
     return result;
 }
Ejemplo n.º 5
0
        public AffineTransform3 Multiply(ref RigidTransform3 transform)
        {
            AffineTransform3 result;

            Matrix3.FromQuaternion(ref transform.Orientation, out result.Transform);
            Matrix3.Multiply(ref result.Transform, ref Transform, out result.Transform);
            Vector3.Transform(ref transform.Position, ref Transform, out result.Translation);
            result.Translation += Translation;
            return(result);
        }
Ejemplo n.º 6
0
 public static void FromRigidTransform(ref RigidTransform3 transform, out AffineTransform3 result)
 {
     result.Translation = transform.Position;
     Matrix3.FromQuaternion(ref transform.Orientation, out result.Transform);
 }
Ejemplo n.º 7
0
 public static void Transform(ref RigidTransform3 transform1, ref RigidTransform3 transform2, out RigidTransform3 result)
 {
     Vector3.Transform(ref transform1.Position, ref transform2.Orientation, out result.Position);
     result.Position += transform2.Position;
     Quaternion.Concatenate(ref transform1.Orientation, ref transform2.Orientation, out result.Orientation);
 }
Ejemplo n.º 8
0
 public Vector3 Transform(RigidTransform3 transform)
 {
     return this.Transform(transform.Orientation) + transform.Position;
 }
Ejemplo n.º 9
0
 public static void Transform(ref Vector3 vector, ref RigidTransform3 transform, out Vector3 result)
 {
     Vector3.Transform(ref vector, ref transform.Orientation, out result);
     result += transform.Position;
 }
Ejemplo n.º 10
0
        public static void FromRigidTransform(ref RigidTransform3 transform, out Matrix4 result)
        {
            var qMat = Matrix3.FromQuaternion(transform.Orientation);

            Core.Matrix4.FromAffineTransform(ref qMat, ref transform.Position, out result);
        }
Ejemplo n.º 11
0
 public static Matrix4 FromRigidTransform(RigidTransform3 transform)
 {
     return(Matrix4.FromAffineTransform(Matrix3.FromQuaternion(transform.Orientation), transform.Position));
 }
Ejemplo n.º 12
0
 public static void TransformInversed(ref Vector3 vector, ref RigidTransform3 transform, out Vector3 result)
 {
     result = vector - transform.Position;
     Quaternion.Conjugate(ref transform.Orientation, out transform.Orientation);
     Vector3.Transform(ref vector, ref transform.Orientation, out result);
 }
Ejemplo n.º 13
0
 public static void Transform(ref Vector3 vector, ref RigidTransform3 transform, out Vector3 result)
 {
     Vector3.Transform(ref vector, ref transform.Orientation, out result);
     result += transform.Position;
 }
Ejemplo n.º 14
0
 public Vector3 Transform(RigidTransform3 transform)
 {
     return(this.Transform(transform.Orientation) + transform.Position);
 }
Ejemplo n.º 15
0
 public static void Invert(ref RigidTransform3 transform, out RigidTransform3 result)
 {
     Quaternion.Conjugate(ref transform.Orientation, out result.Orientation);
     Vector3.Transform(ref transform.Position, ref result.Orientation, out result.Position);
     result.Position = -result.Position;
 }
Ejemplo n.º 16
0
 public static Matrix4 FromRigidTransform(RigidTransform3 transform)
 {
     return Matrix4.FromAffineTransform(Matrix3.FromQuaternion(transform.Orientation), transform.Position);
 }
Ejemplo n.º 17
0
 public static void Transform(ref RigidTransform3 transform1, ref RigidTransform3 transform2, out RigidTransform3 result)
 {
     Vector3.Transform(ref transform1.Position, ref transform2.Orientation, out result.Position);
     result.Position += transform2.Position;
     Quaternion.Concatenate(ref transform1.Orientation, ref transform2.Orientation, out result.Orientation);
 }
Ejemplo n.º 18
0
 public static void FromRigidTransform(ref RigidTransform3 transform, out Matrix4 result)
 {
     var qMat = Matrix3.FromQuaternion(transform.Orientation);
     Core.Matrix4.FromAffineTransform(ref qMat, ref transform.Position, out result);
 }
Ejemplo n.º 19
0
 public static void TransformInversed(ref Vector3 vector, ref RigidTransform3 transform, out Vector3 result)
 {
     result = vector - transform.Position;
     Quaternion.Conjugate(ref transform.Orientation, out transform.Orientation);
     Vector3.Transform(ref vector, ref transform.Orientation, out result);
 }
Ejemplo n.º 20
0
 public static void Invert(ref RigidTransform3 transform, out RigidTransform3 result)
 {
     Quaternion.Conjugate(ref transform.Orientation, out result.Orientation);
     Vector3.Transform(ref transform.Position, ref result.Orientation, out result.Position);
     result.Position = -result.Position;
 }
Ejemplo n.º 21
0
 public Vector3 TransformInversed(RigidTransform3 transform)
 {
     Vector3 result = this - transform.Position;
     Quaternion.Conjugate(ref transform.Orientation, out transform.Orientation);
     Vector3.Transform(ref this, ref transform.Orientation, out result);
     return result;
 }
Ejemplo n.º 22
0
 public static void FromRigidTransform(ref RigidTransform3 transform, out AffineTransform3 result)
 {
     result.Translation = transform.Position;
     Matrix3.FromQuaternion(ref transform.Orientation, out result.Transform);
 }