MQuaternion

class MQuaternion(*args)

Bases: OpenMaya.MQuaternion

Override of the Maya API class of the same name to make the data within the class ‘picklable’

Methods Summary

asAxisAngle() Returns the rotation as a tuple containing an axis vector and an angle in radians about that axis.
asEulerRotation() Returns the rotation as an equivalent MEulerRotation.
asMatrix() Returns the rotation as an equivalent rotation matrix.
conjugate() Returns the conjugate of this quaternion (i.e.
exp() Returns a new quaternion containing the exponent of this one.
inverse() Returns a new quaternion containing the inverse of this one.
log() Returns a new quaternion containing the log of this one.
normal() Returns a new quaternion containing the normalized version of this one (i.e.
slerp(p, q, t, spin) Spherical interpolation of unit quaternions.
squad(p, a, b, q, t[, spin]) Interpolation along a cubic curve segment in quaternion space.
squadPt(q0, q1, q2) Returns a new quaternion representing an intermediate point (in quaternion space) which when used with squad() will produce a C1 continuous spline.

Methods Documentation

asAxisAngle()

Returns the rotation as a tuple containing an axis vector and an angle in radians about that axis.

asEulerRotation()

Returns the rotation as an equivalent MEulerRotation.

asMatrix()

Returns the rotation as an equivalent rotation matrix.

conjugate()

Returns the conjugate of this quaternion (i.e. x, y and z components negated).

exp()

Returns a new quaternion containing the exponent of this one.

inverse()

Returns a new quaternion containing the inverse of this one.

log()

Returns a new quaternion containing the log of this one.

normal()

Returns a new quaternion containing the normalized version of this one (i.e. scaled to unit length).

static slerp(p, q, t, spin)

Spherical interpolation of unit quaternions. Returns a quaternion along the shortest path (in quaternion space) between p and q, at interpolation value t. Thus a value of 0.0 will return p while a value of 1.0 will return q. spin gives the number of complete rotations about the axis which must occur when going from p to q.

static squad(p, a, b, q, t, spin=0)

Interpolation along a cubic curve segment in quaternion space. Returns a quaternion along the cubic curve segment which interpolates p and q, at interpolation value t. Thus a value of 0.0 will return p while a value of 1.0 will return q. The curve is C1 continuous with a and b as intermediate points. spins gives the number of complete rotations about the axis which must occur when going from p to q.

static squadPt(q0, q1, q2)

Returns a new quaternion representing an intermediate point (in quaternion space) which when used with squad() will produce a C1 continuous spline.

Previous topic

MPointArray

Next topic

MTime