class MEulerRotation

Jump to documentation

Euler Rotation Math. (OpenMaya) (OpenMaya.py)

public members:

enum RotationOrder
kXYZ
kYZX
kZXY
kXZY
kYXZ
kZYX
MEulerRotation ()
MEulerRotation (const MEulerRotation &src)
MEulerRotation (const MVector &v, RotationOrder ord = kXYZ )
MEulerRotation (double xx, double yy, double zz, RotationOrder ord = kXYZ )
~MEulerRotation ()
MEulerRotation & operator= (const MEulerRotation &src)
MEulerRotation & operator= (const MQuaternion &q)
MEulerRotation & operator= (const MMatrix &m)
MEulerRotation & operator= (const MVector &v)
MEulerRotation & setValue (const MVector &v, RotationOrder ord = kXYZ )
MEulerRotation & setValue (double xx, double yy, double zz, RotationOrder ord = kXYZ )
MQuaternion asQuaternion () const
MMatrix asMatrix () const
MVector asVector () const
double operator[] (unsigned int i) const
MEulerRotation operator+ (const MEulerRotation &other) const
MEulerRotation & operator+= (const MEulerRotation &other)
MEulerRotation operator- (const MEulerRotation &other) const
MEulerRotation & operator-= (const MEulerRotation &other)
MEulerRotation operator- () const
MEulerRotation operator* (const MEulerRotation &other) const
MEulerRotation operator* (const MQuaternion &other) const
MEulerRotation operator* (double other) const
MEulerRotation & operator*= (const MEulerRotation &other)
MEulerRotation & operator*= (const MQuaternion &other)
MEulerRotation & operator*= (double other)
bool operator== (const MEulerRotation &other) const
bool operator!= (const MEulerRotation &other) const
bool isEquivalent (const MEulerRotation &other, double tolerance = kEulerRotationEpsilon) const
bool isZero (double tolerance = kEulerRotationEpsilon) const
MEulerRotation & incrementalRotateBy (const MVector &axis, double angle)
MEulerRotation inverse () const
MEulerRotation & invertIt ()
MEulerRotation reorder ( RotationOrder ord) const
MEulerRotation & reorderIt ( RotationOrder ord)
MEulerRotation bound () const
MEulerRotation & boundIt (const MEulerRotation &src)
MEulerRotation & boundIt ()
MEulerRotation alternateSolution () const
MEulerRotation & setToAlternateSolution (const MEulerRotation &src)
MEulerRotation & setToAlternateSolution ()
MEulerRotation closestSolution (const MEulerRotation &dst) const
MEulerRotation & setToClosestSolution (const MEulerRotation &src, const MEulerRotation &dst)
MEulerRotation & setToClosestSolution (const MEulerRotation &dst)
MEulerRotation closestCut (const MEulerRotation &dst) const
MEulerRotation & setToClosestCut (const MEulerRotation &src, const MEulerRotation &dst)
MEulerRotation & setToClosestCut (const MEulerRotation &dst)
static MEulerRotation decompose (const MMatrix &matrix, RotationOrder ord)
double & operator[] (unsigned int i)
NO SCRIPT SUPPORT
static MEulerRotation bound (const MEulerRotation &src)
NO SCRIPT SUPPORT
static MEulerRotation alternateSolution (const MEulerRotation &src)
NO SCRIPT SUPPORT
static MEulerRotation closestSolution (const MEulerRotation &src, const MEulerRotation &dst)
NO SCRIPT SUPPORT
static MEulerRotation closestCut (const MEulerRotation &src, const MEulerRotation &dst)
NO SCRIPT SUPPORT
friend MEulerRotation operator* (double scale, const MEulerRotation &other)
NO SCRIPT SUPPORT
friend std::ostream &operator<< (std::ostream &os, const MEulerRotation &rotation)
NO SCRIPT SUPPORT
static const MEulerRotation identity
The euler rotation identity. The rotation order is XYZ.
double x
The x component of the euler rotation in radians
double y
The y component of the euler rotation in radians
double z
The z component of the euler rotation in radians
RotationOrder order
The rotation order of the euler rotation

Documentation

This class provides methods for working with euler rotations.
Description

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.

Functions

MEulerRotation:: MEulerRotation ()

Description

The default class constructor. The rotation order is set to XYZ.

MEulerRotation:: MEulerRotation (const MEulerRotation &src)

Description

The copy constructor. Creates a new euler rotation and initializes it to the same values as the given euler rotation.

Arguments

  • src the euler rotation to copy

MEulerRotation:: MEulerRotation (const MVector &v, MEulerRotation::RotationOrder ord)

Description

Class constructor. Construct an euler rotation from a vector with the given rotation order.

Arguments

  • v vector from which to set the x, y, and z rotation components
  • ord the rotation order; the default rotation order is XYZ

MEulerRotation:: MEulerRotation (double xx, double yy, double zz, MEulerRotation::RotationOrder ord)

Description

Class constructor. Initializes the euler rotation with the explicit x, y, z, and rotation order values provided as arguments.

Arguments

  • xx the x component of the euler rotation
  • yy the y component of the euler rotation
  • zz the z component of the euler rotation
  • ord the rotation order of the euler rotation; the default rotation order is XYZ

MEulerRotation:: ~MEulerRotation ()

Description

Class destructor.

MEulerRotation &MEulerRotation:: operator= (const MEulerRotation &src)

Description

The assignment operator.

Arguments

  • src the source euler rotation

Return Value

  • a reference to the euler rotation that has been assigned to the source euler rotation

MEulerRotation &MEulerRotation:: operator= (const MQuaternion &q)

Description

The assignment operator.

Arguments

  • q the source quaternion

Return Value

  • a reference to the euler rotation that has been assigned to the quaternion

MEulerRotation &MEulerRotation:: operator= (const MMatrix &m)

Description

Convert the given 4X4 homogeneous rotation matrix to a euler rotation.

Arguments

  • m the matrix to be converted to a euler rotation

Return Value

  • a reference to the euler rotation that has been converted from the rotation matrix

MEulerRotation &MEulerRotation:: operator= (const MVector &v)

Description

The assignment operator.

Arguments

  • v the source vector from which the x, y, and z rotation components are set

Return Value

  • a reference to the euler rotation that has been assigned to the source vector

MEulerRotation &MEulerRotation:: setValue (const MVector &v, MEulerRotation::RotationOrder ord)

Description

Sets the euler rotation to the values contained in the vector and with the specified rotation order.

Arguments

  • v vector from which to set the x, y, and z rotation components
  • ord the rotation order; the default rotation order is XYZ

Return Value

  • a reference to the euler rotation whose value has been set

MEulerRotation &MEulerRotation:: setValue (double xx, double yy, double zz, MEulerRotation::RotationOrder ord)

Description

Sets the euler rotation to the x, y, and z rotation components with the specified rotation order.

Arguments

  • xx the x component of the rotation
  • yy the y component of the rotation
  • zz the z component of the rotation
  • ord the rotation order; the default rotation order is XYZ

Return Value

  • a reference to the euler rotation whose value has been set

MQuaternion MEulerRotation:: asQuaternion () const

Description

Converts an euler rotation to a quaternion.

Return Value

  • the quaternion that has been casted from the euler rotation

MMatrix MEulerRotation:: asMatrix () const

Description

Converts an euler rotation to a rotation matrix.

Return Value

  • the rotation matrix that has been casted from the euler rotation

MVector MEulerRotation:: asVector () const

Description

Converts an euler rotation to a vector. The rotation order component is dropped.

Return Value

  • the vector that has been casted from the euler rotation

double &MEulerRotation:: operator[] (unsigned int i)

Description

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.

Arguments

  • i value indicating which component to return

Return Value

  • a reference to the component of the euler rotation corresponding to the index

double MEulerRotation:: operator[] (unsigned int i) const

Description

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.

Arguments

  • i value indicating which component to return

Return Value

  • the component of the euler rotation corresponding to the index

MEulerRotation MEulerRotation:: operator+ (const MEulerRotation &other) const

Description

The euler rotation addition operator.

Arguments

  • other the euler rotation to be added to this euler rotation

Return Value

  • the sum of the two euler rotations

MEulerRotation &MEulerRotation:: operator+= (const MEulerRotation &other)

Description

The in place euler rotation addition operator.

Arguments

  • other the euler rotation to be added with this euler rotation

Return Value

  • a reference the euler rotation which has been added to the other euler rotation

MEulerRotation MEulerRotation:: operator- (const MEulerRotation &other) const

Description

The euler rotation subtraction operator.

Arguments

  • other the euler rotation to be subtracted from this euler rotation

Return Value

  • the euler rotation that results from the subtraction

MEulerRotation &MEulerRotation:: operator-= (const MEulerRotation &other)

Description

The in place euler rotation subtraction operator.

Arguments

  • other the euler rotation to be subtracted from this euler rotation

Return Value

  • a reference the euler rotation which has had the other euler rotation subtracted from it

MEulerRotation MEulerRotation:: operator- () const

Description

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.

Return Value

  • euler rotation that results from the negation

MEulerRotation MEulerRotation:: operator* (const MEulerRotation &other) const

Description

The euler rotation multiplication operator.

Arguments

  • other the euler rotation to be multiplied with this euler rotation

Return Value

  • the product of the two euler rotations

MEulerRotation MEulerRotation:: operator* (const MQuaternion &other) const

Description

This quaternion multiplication operator.

Arguments

  • other the quaternion to be multiplied with this euler rotation

Return Value

  • the product of the euler rotation and the quaternion

MEulerRotation MEulerRotation:: operator* (double other) const

Description

This scalar multiplication operator.

Arguments

  • other the scalar value to be multiplied with this euler rotation

Return Value

  • the product of the euler rotation and the scalar value

MEulerRotation operator* (double scale, const MEulerRotation &other)

Description

The multiplication operator that allows the scale to preceed the euler rotation.

Arguments

  • scale the amount by which the euler rotation should be scaled
  • other the euler rotation to which the scale should be applied

Return Value

  • euler rotation that is the result of scaling the other euler rotation

MEulerRotation &MEulerRotation:: operator*= (const MEulerRotation &other)

Description

The in place euler rotation multiplication operator.

Arguments

  • other the euler rotation to be multiplied with this euler rotation

Return Value

  • a reference to the euler rotation which has been multiplied with the other euler rotation

MEulerRotation &MEulerRotation:: operator*= (const MQuaternion &other)

Description

The in place quaternion multiplication operator.

Arguments

  • other the quaternion to be multiplied with this euler rotation

Return Value

  • a reference to the euler rotation which has been multiplied with the quaternion

MEulerRotation &MEulerRotation:: operator*= (double other)

Description

The in place scalar multiplication operator.

Arguments

  • other the double to be multiplied with this euler rotation

Return Value

  • a reference to the euler rotation which has been multiplied with the double

bool MEulerRotation:: operator== (const MEulerRotation &other) const

Description

The euler rotation equality operator.

Arguments

  • other the euler rotation to be compared with this euler rotation

Return Value

  • true the euler rotations are identical
  • false the euler rotations are not identical

bool MEulerRotation:: operator!= (const MEulerRotation &other) const

Description

The euler rotation inequality operator.

Arguments

  • other the euler rotation to be compared with this euler rotation

Return Value

  • true the euler rotations are not identical
  • false the euler rotations are identical

bool MEulerRotation:: isEquivalent (const MEulerRotation &other, double tolerance) const

Description

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

Arguments

  • other the euler rotation to be compared with this euler rotation
  • tolerance the amount of variation allowed for equivalency

Return Value

  • true the euler rotations are equivalent
  • false the euler rotations are not equivalent

bool MEulerRotation:: isZero (double tolerance) const

Description

This method returns true if this euler rotation is zero, within some given tolerance.

'tolerance' defaults to kEulerRotationEpsilon which is 1.0e-10

Arguments

  • tolerance the amount of variation allowed for equivalency to zero

Return Value

  • true the rotation is zero
  • false the rotation is not zero

MEulerRotation &MEulerRotation:: incrementalRotateBy (const MVector &axis, double angle)

Description

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.

Arguments

  • axis the axis to rotate around
  • angle the angle by which to rotate around the axis

Return Value

  • a reference to the euler rotation that has been incrementally rotated

MEulerRotation MEulerRotation:: inverse () const

Description

Returns the inverse of this euler rotation. The rotation order will be reversed.

Return Value

  • euler rotation that is the inverse of this euler rotation

MEulerRotation &MEulerRotation:: invertIt ()

Description

Performs an in place inversion of this euler rotation. The rotation order will be reversed.

Return Value

  • a reference to the euler rotation that has been inverted

MEulerRotation MEulerRotation:: reorder ( MEulerRotation::RotationOrder ord) const

Description

Returns the reordering of this euler rotation, such that the euler rotation will have the specified rotation order.

Arguments

  • ord the new rotation order of the euler rotation

Return Value

  • euler rotation that is the reordering of this euler rotation

MEulerRotation &MEulerRotation:: reorderIt ( MEulerRotation::RotationOrder ord)

Description

Performs an in place reordering of this euler rotation, such that the euler rotation will have the specified rotation order.

Arguments

  • ord the new rotation order of the euler rotation

Return Value

  • a reference to the euler rotation that has been reordered

MEulerRotation MEulerRotation:: bound (const MEulerRotation &src)

Description

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.

Arguments

  • src the input rotation

Return Value

  • the euler rotation that bounds the input rotation

MEulerRotation MEulerRotation:: bound () const

Description

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.

Return Value

  • the euler rotation that results from bounding this euler rotation

MEulerRotation &MEulerRotation:: boundIt (const MEulerRotation &src)

Description

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.

Arguments

  • src the input rotation that will be bound

Return Value

  • a reference to the euler rotation that has been set to the bound input rotation

MEulerRotation &MEulerRotation:: boundIt ()

Description

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.

Return Value

  • a reference to the euler rotation that has been bound

MEulerRotation MEulerRotation:: alternateSolution (const MEulerRotation &src)

Description

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.

Arguments

  • src the rotation to compute an alternate solution to

Return Value

  • the alternate solution to the input rotation

MEulerRotation MEulerRotation:: alternateSolution () const

Description

Returns an alternate solution to this rotation. The resulting rotation will be bound between +/- PI, and the rotation order will remain unchanged.

Return Value

  • an alternate solution to this rotation

MEulerRotation &MEulerRotation:: setToAlternateSolution ( const MEulerRotation &src)

Description

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.

Arguments

  • src the rotation to compute an alternate solution to

Return Value

  • a reference to the euler rotation that has been set to an alternate solution

MEulerRotation &MEulerRotation:: setToAlternateSolution ()

Description

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.

Return Value

  • a reference to the euler rotation that has been set to an alternate solution

MEulerRotation MEulerRotation:: closestSolution ( const MEulerRotation &src, const MEulerRotation &dst)

Description

Returns the euler rotation that is the closest solution of the "src" euler rotation to the "dst" euler rotation.

Arguments

  • src the euler rotation whose closest solution will be calculated
  • dst the euler rotation to which the solution should be closest

Return Value

  • the closest solution of "src" to "dst"

MEulerRotation MEulerRotation:: closestSolution (const MEulerRotation &dst) const

Description

Returns the euler rotation that is the closest solution to the "dst" euler rotation.

Arguments

  • dst the euler rotation to which the solution should be closest

Return Value

  • the closest solution to the "dst" rotation

MEulerRotation &MEulerRotation:: setToClosestSolution ( const MEulerRotation &src, const MEulerRotation &dst)

Description

Sets this euler rotation to the euler rotation that is the closest solution of the "src" euler rotation to the "dst" euler rotation.

Arguments

  • src the euler rotation whose closest solution will be calculated
  • dst the euler rotation to which the solution should be closest

Return Value

  • a reference to the euler rotation that has been set to the closest solution

MEulerRotation &MEulerRotation:: setToClosestSolution ( const MEulerRotation &dst)

Description

Sets this euler rotation to the euler rotation that is the closest solution to the "dst" euler rotation.

Arguments

  • dst the euler rotation to which the solution should be closest

Return Value

  • a reference to the euler rotation that has been set to the closest solution

MEulerRotation MEulerRotation:: closestCut (const MEulerRotation &src, const MEulerRotation &dst)

Description

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.

Arguments

  • src the euler rotation whose terms will be offset by +/- 2nPI
  • dst the range of the closest cut

Return Value

  • the closest cut of "src" to "dst"

MEulerRotation MEulerRotation:: closestCut (const MEulerRotation &dst) const

Description

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.

Arguments

  • dst the range of the closest cut

Return Value

  • the closest cut of this rotation

MEulerRotation &MEulerRotation:: setToClosestCut (const MEulerRotation &src, const MEulerRotation &dst)

Description

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.

Arguments

  • src the euler rotation whose terms will be offset by +/- 2nPI
  • dst the range of the closest cut

Return Value

  • a reference to the euler rotation that has been set to the closest cut

MEulerRotation &MEulerRotation:: setToClosestCut (const MEulerRotation &dst)

Description

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.

Arguments

  • dst the range of the closest cut

Return Value

  • a reference to the euler rotation that has been set to the closest cut

MEulerRotation MEulerRotation:: decompose (const MMatrix &matrix, MEulerRotation::RotationOrder ord)

Description

Decompose a rotation matrix into the desired euler angles with the specified order.

Arguments

  • matrix the matrix that will be decomposed into an euler rotation with the specified order
  • ord the order which the euler rotation will have

Return Value

  • the euler rotation that has been decomposed from the rotation matrix

std::ostream & operator<< (std::ostream &os, const MEulerRotation &rotation)

Description

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.

Arguments

  • os the ostream to print to
  • rotation the euler rotation to be printed

Return Value

The ostream reference, os, provided as the first parameter.

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright