Conjugate() public static method

Computes the conjugate of the quaternion.
public static Conjugate ( quaternion ) : Quaternion
quaternion Quaternion to conjugate.
return Quaternion
Ejemplo n.º 1
0
        ///<summary>
        /// Transforms a position by a rigid transform's inverse.
        ///</summary>
        ///<param name="position">Position to transform.</param>
        ///<param name="transform">Transform to invert and apply.</param>
        ///<param name="result">Transformed position.</param>
        public static void TransformByInverse(ref Vector3 position, ref RigidTransform transform, out Vector3 result)
        {
            Quaternion orientation;
            Vector3    intermediate;

            Vector3.Subtract(ref position, ref transform.Position, out intermediate);
            Quaternion.Conjugate(ref transform.Orientation, out orientation);
            Vector3.Transform(ref intermediate, ref orientation, out result);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Inverts a rigid transform.
 /// </summary>
 /// <param name="transform">Transform to invert.</param>
 /// <param name="inverse">Inverse of the transform.</param>
 public static void Invert(ref RigidTransform transform, out RigidTransform inverse)
 {
     Quaternion.Conjugate(ref transform.Orientation, out inverse.Orientation);
     Vector3.Transform(ref transform.Position, ref inverse.Orientation, out inverse.Position);
     Vector3.Negate(ref inverse.Position, out inverse.Position);
 }