#include <MEulerRotation.h>
This class provides methods for working with euler angle rotations. Euler angles are described by rotations in radians around the x, y, and z axes, and the order in which those rotations occur.
MEulerRotation::MEulerRotation | ( | ) |
The default class constructor. The rotation order is set to XYZ.
MEulerRotation::MEulerRotation | ( | const MEulerRotation & | src | ) |
The copy constructor. Creates a new euler rotation and initializes it to the same values as the given euler rotation.
[in] | src | the euler rotation to copy |
MEulerRotation::MEulerRotation | ( | const MVector & | v, | |
MEulerRotation::RotationOrder | ord = kXYZ | |||
) |
Class constructor. Construct an euler rotation from a vector with the given rotation order.
[in] | v | vector from which to set the x, y, and z rotation components |
[in] | ord | the rotation order; the default rotation order is XYZ |
MEulerRotation::MEulerRotation | ( | double | xx, | |
double | yy, | |||
double | zz, | |||
MEulerRotation::RotationOrder | ord = kXYZ | |||
) |
Class constructor. Initializes the euler rotation with the explicit x, y, z, and rotation order values provided as arguments.
[in] | xx | the x component of the euler rotation |
[in] | yy | the y component of the euler rotation |
[in] | zz | the z component of the euler rotation |
[in] | ord | the rotation order of the euler rotation; the default rotation order is XYZ |
MEulerRotation::~MEulerRotation | ( | ) |
Class destructor.
MEulerRotation & MEulerRotation::operator= | ( | const MEulerRotation & | src | ) |
The assignment operator.
[in] | src | the source euler rotation |
MEulerRotation & MEulerRotation::operator= | ( | const MQuaternion & | q | ) |
The assignment operator.
[in] | q | the source quaternion |
MEulerRotation & MEulerRotation::operator= | ( | const MMatrix & | m | ) |
Convert the given 4X4 homogeneous rotation matrix to a euler rotation.
[in] | m | the matrix to be converted to a euler rotation |
MEulerRotation & MEulerRotation::operator= | ( | const MVector & | v | ) |
The assignment operator.
[in] | v | the source vector from which the x, y, and z rotation components are set |
MEulerRotation & MEulerRotation::setValue | ( | const MVector & | v, | |
MEulerRotation::RotationOrder | ord = kXYZ | |||
) |
Sets the euler rotation to the values contained in the vector and with the specified rotation order.
[in] | v | vector from which to set the x, y, and z rotation components |
[in] | ord | the rotation order; the default rotation order is XYZ |
MEulerRotation & MEulerRotation::setValue | ( | double | xx, | |
double | yy, | |||
double | zz, | |||
MEulerRotation::RotationOrder | ord = kXYZ | |||
) |
Sets the euler rotation to the x, y, and z rotation components with the specified rotation order.
[in] | xx | the x component of the rotation |
[in] | yy | the y component of the rotation |
[in] | zz | the z component of the rotation |
[in] | ord | the rotation order; the default rotation order is XYZ |
MQuaternion MEulerRotation::asQuaternion | ( | ) | const |
Converts an euler rotation to a quaternion.
MMatrix MEulerRotation::asMatrix | ( | ) | const |
Converts an euler rotation to a rotation matrix.
MVector MEulerRotation::asVector | ( | ) | const |
Converts an euler rotation to a vector. The rotation order component is dropped.
double MEulerRotation::operator[] | ( | unsigned int | i | ) | const |
The index operator. If its argument is 0 it will return the x component of the euler rotation. If its argument is 1 it will return the y component of the euler rotation. If its argument is 2 it will return the z component of the euler rotation.
[in] | i | value indicating which component to return |
MEulerRotation MEulerRotation::operator+ | ( | const MEulerRotation & | other | ) | const |
The euler rotation addition operator.
[in] | other | the euler rotation to be added to this euler rotation |
MEulerRotation & MEulerRotation::operator+= | ( | const MEulerRotation & | other | ) |
The in place euler rotation addition operator.
[in] | other | the euler rotation to be added with this euler rotation |
MEulerRotation MEulerRotation::operator- | ( | const MEulerRotation & | other | ) | const |
The euler rotation subtraction operator.
[in] | other | the euler rotation to be subtracted from this euler rotation |
MEulerRotation & MEulerRotation::operator-= | ( | const MEulerRotation & | other | ) |
The in place euler rotation subtraction operator.
[in] | other | the euler rotation to be subtracted from this euler rotation |
MEulerRotation MEulerRotation::operator- | ( | ) | const |
The unary minus operator. Negates the value of each of the x, y, and z components of the euler rotation. The order remains the same.
MEulerRotation MEulerRotation::operator* | ( | const MEulerRotation & | other | ) | const |
The euler rotation multiplication operator.
[in] | other | the euler rotation to be multiplied with this euler rotation |
MEulerRotation MEulerRotation::operator* | ( | const MQuaternion & | other | ) | const |
This quaternion multiplication operator.
[in] | other | the quaternion to be multiplied with this euler rotation |
MEulerRotation MEulerRotation::operator* | ( | double | other | ) | const |
This scalar multiplication operator.
[in] | other | the scalar value to be multiplied with this euler rotation |
MEulerRotation & MEulerRotation::operator*= | ( | const MEulerRotation & | other | ) |
The in place euler rotation multiplication operator.
[in] | other | the euler rotation to be multiplied with this euler rotation |
MEulerRotation & MEulerRotation::operator*= | ( | const MQuaternion & | other | ) |
The in place quaternion multiplication operator.
[in] | other | the quaternion to be multiplied with this euler rotation |
MEulerRotation & MEulerRotation::operator*= | ( | double | other | ) |
The in place scalar multiplication operator.
[in] | other | the double to be multiplied with this euler rotation |
bool MEulerRotation::operator== | ( | const MEulerRotation & | other | ) | const |
The euler rotation equality operator.
[in] | other | the euler rotation to be compared with this euler rotation |
bool MEulerRotation::operator!= | ( | const MEulerRotation & | other | ) | const |
The euler rotation inequality operator.
[in] | other | the euler rotation to be compared with this euler rotation |
bool MEulerRotation::isEquivalent | ( | const MEulerRotation & | other, | |
double | tolerance = 1.0e-10 | |||
) | const |
This method returns true if this euler rotation is equivalent, within some given tolerance, to the other euler rotation.
'tolerance' defaults to kEulerRotationEpsilon which is 1.0e-10
[in] | other | the euler rotation to be compared with this euler rotation |
[in] | tolerance | the amount of variation allowed for equivalency |
bool MEulerRotation::isZero | ( | double | tolerance = 1.0e-10 |
) | const |
This method returns true if this euler rotation is zero, within some given tolerance.
'tolerance' defaults to kEulerRotationEpsilon which is 1.0e-10
[in] | tolerance | the amount of variation allowed for equivalency to zero |
MEulerRotation & MEulerRotation::incrementalRotateBy | ( | const MVector & | axis, | |
double | angle | |||
) |
Perform an incremental rotation by the specified axis and angle. The rotation is broken down and performed in smaller steps so that the angles update properly.
[in] | axis | the axis to rotate around |
[in] | angle | the angle by which to rotate around the axis |
MEulerRotation MEulerRotation::inverse | ( | ) | const |
Returns the inverse of this euler rotation. The rotation order will be reversed.
MEulerRotation & MEulerRotation::invertIt | ( | ) |
Performs an in place inversion of this euler rotation. The rotation order will be reversed.
MEulerRotation MEulerRotation::reorder | ( | MEulerRotation::RotationOrder | ord | ) | const |
Returns the reordering of this euler rotation, such that the euler rotation will have the specified rotation order.
[in] | ord | the new rotation order of the euler rotation |
MEulerRotation & MEulerRotation::reorderIt | ( | MEulerRotation::RotationOrder | ord | ) |
Performs an in place reordering of this euler rotation, such that the euler rotation will have the specified rotation order.
[in] | ord | the new rotation order of the euler rotation |
MEulerRotation MEulerRotation::bound | ( | ) | const |
Returns the result of bounding this rotation to be within +/- PI. Bounding a rotation to be within +/- PI is defined to be the result of offsetting the rotation by +/- 2nPI (term by term) such that the offset is within +/- PI.
MEulerRotation & MEulerRotation::boundIt | ( | const MEulerRotation & | src | ) |
Sets this euler rotation to be the input rotation that has been bound to be within +/- PI. Bounding a rotation to be within +/- PI is defined to be the result of offsetting the rotation by +/- 2nPI (term by term) such that the offset is within +/- PI.
[in] | src | the input rotation that will be bound |
MEulerRotation & MEulerRotation::boundIt | ( | ) |
Bounds this rotation to be within +/- PI. Bounding a rotation to be within +/- PI is defined to be the result of offsetting the rotation by +/- 2nPI (term by term) such that the offset is within +/- PI.
MEulerRotation MEulerRotation::alternateSolution | ( | ) | const |
Returns an alternate solution to this rotation. The resulting rotation will be bound between +/- PI, and the rotation order will remain unchanged.
MEulerRotation & MEulerRotation::setToAlternateSolution | ( | const MEulerRotation & | src | ) |
Sets this euler rotation to an alternate solution of the input rotation. The resulting rotation will be bound between +/- PI, and the rotation order will remain unchanged.
[in] | src | the rotation to compute an alternate solution to |
MEulerRotation & MEulerRotation::setToAlternateSolution | ( | ) |
Sets this euler rotation to an alternate solution of this rotation. The resulting rotation will be bound between +/- PI, and the rotation order will remain unchanged.
MEulerRotation MEulerRotation::closestSolution | ( | const MEulerRotation & | dst | ) | const |
Returns the euler rotation that is the closest solution to the "dst" euler rotation.
[in] | dst | the euler rotation to which the solution should be closest |
MEulerRotation & MEulerRotation::setToClosestSolution | ( | const MEulerRotation & | src, | |
const MEulerRotation & | dst | |||
) |
Sets this euler rotation to the euler rotation that is the closest solution of the "src" euler rotation to the "dst" euler rotation.
[in] | src | the euler rotation whose closest solution will be calculated |
[in] | dst | the euler rotation to which the solution should be closest |
MEulerRotation & MEulerRotation::setToClosestSolution | ( | const MEulerRotation & | dst | ) |
Sets this euler rotation to the euler rotation that is the closest solution to the "dst" euler rotation.
[in] | dst | the euler rotation to which the solution should be closest |
MEulerRotation MEulerRotation::closestCut | ( | const MEulerRotation & | dst | ) | const |
Returns the closest cut of this rotation to "dst". The closest cut of rotation A to rotation B is defined to be the rotation that is +/- 2nPI to rotation A (term by term) and within +/- PI to rotation B.
[in] | dst | the range of the closest cut |
MEulerRotation & MEulerRotation::setToClosestCut | ( | const MEulerRotation & | src, | |
const MEulerRotation & | dst | |||
) |
Sets this rotation to be the closest cut of "src" to "dst". The closest cut of rotation A to rotation B is defined to be the rotation that is +/- 2nPI to rotation A (term by term) and within +/- PI to rotation B.
[in] | src | the euler rotation whose terms will be offset by +/- 2nPI |
[in] | dst | the range of the closest cut |
MEulerRotation & MEulerRotation::setToClosestCut | ( | const MEulerRotation & | dst | ) |
Sets this rotation to be the closest cut to "dst". The closest cut of rotation A to rotation B is defined to be the rotation that is +/- 2nPI to rotation A (term by term) and within +/- PI to rotation B.
[in] | dst | the range of the closest cut |
MEulerRotation MEulerRotation::decompose | ( | const MMatrix & | matrix, | |
MEulerRotation::RotationOrder | ord | |||
) | [static] |
Decompose a rotation matrix into the desired euler angles with the specified order.
[in] | matrix | the matrix that will be decomposed into an euler rotation with the specified order |
[in] | ord | the order which the euler rotation will have |
double & MEulerRotation::operator[] | ( | unsigned int | i | ) |
NO SCRIPT SUPPORT.
The index operator. If its argument is 0 it will return the x component of the euler rotation. If its argument is 1 it will return the y component of the euler rotation. If its argument is 2 it will return the z component of the euler rotation.
[in] | i | value indicating which component to return |
MEulerRotation MEulerRotation::bound | ( | const MEulerRotation & | src | ) | [static] |
NO SCRIPT SUPPORT.
Returns the euler rotation that bounds the input rotation to be within +/- PI. Bounding a rotation to be within +/- PI is defined to be the result of offsetting the rotation by +/- 2nPI (term by term) such that the offset is within +/- PI.
[in] | src | the input rotation |
MEulerRotation MEulerRotation::alternateSolution | ( | const MEulerRotation & | src | ) | [static] |
NO SCRIPT SUPPORT.
Returns the euler rotation that is an alternate solution of the input rotation. The resulting rotation will be bound between +/- PI, and the rotation order will remain unchanged.
[in] | src | the rotation to compute an alternate solution to |
MEulerRotation MEulerRotation::closestSolution | ( | const MEulerRotation & | src, | |
const MEulerRotation & | dst | |||
) | [static] |
NO SCRIPT SUPPORT.
Returns the euler rotation that is the closest solution of the "src" euler rotation to the "dst" euler rotation.
[in] | src | the euler rotation whose closest solution will be calculated |
[in] | dst | the euler rotation to which the solution should be closest |
MEulerRotation MEulerRotation::closestCut | ( | const MEulerRotation & | src, | |
const MEulerRotation & | dst | |||
) | [static] |
NO SCRIPT SUPPORT.
Returns the euler rotation that is the closest cut of "src" to "dst". The closest cut of rotation A to rotation B is defined to be the rotation that is +/- 2nPI to rotation A (term by term) and within +/- PI to rotation B.
[in] | src | the euler rotation whose terms will be offset by +/- 2nPI |
[in] | dst | the range of the closest cut |
OPENMAYA_EXPORT MEulerRotation operator* | ( | double | scale, | |
const MEulerRotation & | other | |||
) | [friend] |
NO SCRIPT SUPPORT.
The multiplication operator that allows the scale to preceed the euler rotation.
[in] | scale | the amount by which the euler rotation should be scaled |
[in] | other | the euler rotation to which the scale should be applied |
OPENMAYA_EXPORT std::ostream& operator<< | ( | std::ostream & | os, | |
const MEulerRotation & | rotation | |||
) | [friend] |
NO SCRIPT SUPPORT.
Print the contents of the given euler rotation on the given ostream. The format used is [order: order, x: x, y: y, z: z], where x, y, and z are in degrees.
[in] | os | the ostream to print to |
[in] | rotation | the euler rotation to be printed x |
Autodesk® Maya® 2009 © 1997-2008 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |