예제 #1
0
        /// <summary>
        /// Subtracts a rotation from another rotation and returns the
        /// results.
        /// </summary>
        public static EulerRotation operator -(EulerRotation rot1, EulerRotation rot2)
        {
            EulerRotation newRotation = new EulerRotation(0.0, 0.0, 0.0);

            newRotation.X = Math.Abs( rot1.X - rot2.X );
            newRotation.Y = Math.Abs( rot1.Y - rot2.Y );
            newRotation.Z = Math.Abs( rot1.Z - rot2.Z );

            return newRotation;
        }
예제 #2
0
		/// <summary>
		/// Rotates the matrix by the given amount.
		/// </summary>
		public void Rotate(EulerRotation rot)
		{
			Matrix4D res = this * rot;
			values = res.values;
		}
예제 #3
0
        /// <summary>
        /// Adds two rotations together.
        /// </summary>
        public static EulerRotation operator +(EulerRotation rot1, EulerRotation rot2)
        {
            if(rot1 == null)
                if(rot2 == null)
                    return null;
                else
                    return rot2;

               		if(rot2 == null)
                return rot1;

            EulerRotation newRotation = new EulerRotation(0.0, 0.0, 0.0);

            newRotation.X = ( (rot1.X + rot2.X) % 360 );
            newRotation.Y = ( (rot1.Y + rot2.Y) % 360 );
            newRotation.Z = ( (rot1.Z + rot2.Z) % 360 );

            return newRotation;
        }