Example #1
0
        /// <summary>
        /// Rotates the given Position and Orientation around the Pivot Point, changing the Position and Orientation
        /// </summary>
        /// <param name="sRotationMatrix">The Rotation to apply to the object</param>
        /// <param name="sPivotPoint">The Point to rotate the object around</param>
        /// <param name="srPosition">The Position of the object (to be modified)</param>
        /// <param name="srOrientation">The Orientation of the object (to be modified)</param>
        public static void RotatePositionAndOrientation(Matrix sRotationMatrix, Vector3 sPivotPoint, ref Vector3 srPosition, ref Quaternion srOrientation)
        {
            // Rotate the Orientation about it's center to change its Orientation
            srOrientation = Orientation3D.Rotate(sRotationMatrix, srOrientation);

            // Rotate the Position around the specified Pivot Point
            srPosition = PivotPoint3D.RotatePosition(sRotationMatrix, sPivotPoint, srPosition);
        }
Example #2
0
        /// <summary>
        /// Rotates the object about its center, changing its Orientation, as well as around the
        /// Pivot Point, changing its Position
        /// </summary>
        /// <param name="sRotationMatrix">The Rotation to apply to the object, rotating it
        /// around the Pivot Point</param>
        public void RotatePositionAndOrientation(Matrix sRotationMatrix)
        {
            // If we have a handle to the Orientation
            if (mcOrientationData != null)
            {
                // Rotate the Orientation about it's center to change its Orientation
                mcOrientationData.Rotate(sRotationMatrix);
            }

            // Rotate the Position around the specified Pivot Point
            RotatePosition(sRotationMatrix);
        }
Example #3
0
 /// <summary>
 /// Rotates the object about its center, changing its Orientation.
 /// </summary>
 /// <param name="sRotationMatrix">The Rotation to apply to the object.</param>
 public void Rotate(Matrix sRotationMatrix)
 {
     // Rotate the object about it's center to change its Orientation.
     Orientation = Orientation3D.Rotate(sRotationMatrix, Orientation);
 }