Open Inventor Reference
|
Class for representing a rotation with double values. More...
#include <Inventor/SbLineard.h>
Public Member Functions | |
SbRotationd () | |
Default constructor, initialized to identity. | |
SbRotationd (const double v[4]) | |
SbRotationd (double q0, double q1, double q2, double q3) | |
SbRotationd (const SbMatrixd &m) | |
SbRotationd (const SbVec3d &axis, double radians) | |
SbRotationd (const SbVec3d &rotateFrom, const SbVec3d &rotateTo) | |
Constructors for rotation. | |
const double * | getValue () const |
Returns pointer to array of 4 components defining quaternion. | |
void | getValue (double &q0, double &q1, double &q2, double &q3) const |
Returns 4 individual components of rotation quaternion. | |
void | getValue (SbVec3d &axis, double &radians) const |
Returns corresponding 3D rotation axis vector and angle in radians. | |
void | getValue (SbMatrixd &matrix) const |
Returns corresponding 4x4 rotation matrix. | |
SbMatrixd | getMatrix () const |
Returns corresponding 4x4 rotation matrix. | |
SbVec3d | getAxis () const |
Returns corresponding 3D rotation axis vector. | |
double | getAngle () const |
Returns corresponding angle in radians. | |
SbRotationd & | invert () |
Changes a rotation to be its inverse. | |
SbRotationd | inverse () const |
Returns the inverse of a rotation. | |
SbRotationd & | setValue (const double q[4]) |
Sets value of rotation from array of 4 components of a quaternion. | |
SbRotationd & | setValue (double q0, double q1, double q2, double q3) |
Sets value of rotation from 4 individual components of a quaternion. | |
SbRotationd & | setValue (const SbMatrixd &m) |
Sets value of rotation from a rotation matrix. | |
SbRotationd & | setValue (const SbVec3d &axis, double radians) |
Sets value of vector from 3D rotation axis vector and angle in radians. | |
SbRotationd & | setValue (const SbVec3d &rotateFrom, const SbVec3d &rotateTo) |
Sets rotation to rotate one direction vector to another. | |
SbRotationd & | operator*= (const SbRotationd &q) |
Multiplies by another rotation; results in product of rotations. | |
bool | equals (const SbRotationd &r, double tolerance) const |
Equality comparison within given tolerance em the square of the length of the maximum distance between the two quaternion vectors. | |
void | multVec (const SbVec3d &src, SbVec3d &dst) const |
Multiplies the given vector by the matrix of this rotation. | |
SbVec3d | transformPoint (const SbVec3d &src) const |
Multiplies the given vector by the matrix of this rotation. | |
void | scaleAngle (double scaleFactor) |
Keep the axis the same. | |
Static Public Member Functions | |
static SbRotationd | slerp (const SbRotationd &rot0, const SbRotationd &rot1, double t) |
Spherical linear interpolation: as t goes from 0 to 1, returned value goes from rot0 to rot1 . | |
static SbRotationd | identity () |
Returns a null rotation. | |
Friends | |
INVENTOR_API bool | operator== (const SbRotationd &q1, const SbRotationd &q2) |
Equality comparison operator. | |
INVENTOR_API bool | operator!= (const SbRotationd &q1, const SbRotationd &q2) |
INVENTOR_API SbRotationd | operator* (const SbRotationd &q1, const SbRotationd &q2) |
Multiplication of two rotations; results in product of rotations. | |
Object that stores a rotation. There are several ways to specify a rotation: quaternion (4 doubles), 4x4 rotation matrix, or axis and angle. All angles are in radians and all rotations are right-handed. {}
Rotations are stored internally as quaternions.
Definition at line 467 of file SbLineard.h.
|
inline |
Definition at line 471 of file SbLineard.h.
|
inline |
Definition at line 477 of file SbLineard.h.
|
inline |
Definition at line 481 of file SbLineard.h.
|
inline |
Definition at line 485 of file SbLineard.h.
|
inline |
Definition at line 489 of file SbLineard.h.
The axis/radians constructor creates a rotation of angle radians about the given axis. The constructors that take four doubles create a quaternion from those doubles (careful, this differs from the four numbers in an axis/radian definition). Matrix constructor requires a valid rotation matrix. The rotateFrom/To constructor defines rotation that rotates from one vector into another. The rotateFrom
and rotateTo
vectors are normalized by the constructor before calculating the rotation.
Definition at line 501 of file SbLineard.h.
bool SbRotationd::equals | ( | const SbRotationd & | r, |
double | tolerance | ||
) | const |
|
inline |
Definition at line 524 of file SbLineard.h.
|
inline |
Definition at line 522 of file SbLineard.h.
SbMatrixd SbRotationd::getMatrix | ( | ) | const |
|
inline |
Definition at line 505 of file SbLineard.h.
void SbRotationd::getValue | ( | double & | q0, |
double & | q1, | ||
double & | q2, | ||
double & | q3 | ||
) | const |
void SbRotationd::getValue | ( | SbMatrixd & | matrix | ) | const |
void SbRotationd::getValue | ( | SbVec3d & | axis, |
double & | radians | ||
) | const |
|
inlinestatic |
Definition at line 579 of file SbLineard.h.
|
inline |
Definition at line 530 of file SbLineard.h.
References invert().
SbRotationd & SbRotationd::invert | ( | ) |
Referenced by inverse().
SbRotationd & SbRotationd::operator*= | ( | const SbRotationd & | q | ) |
void SbRotationd::scaleAngle | ( | double | scaleFactor | ) |
Multiply the angle of rotation by the amount scaleFactor
.
SbRotationd & SbRotationd::setValue | ( | const double | q[4] | ) |
SbRotationd & SbRotationd::setValue | ( | const SbMatrixd & | m | ) |
SbRotationd & SbRotationd::setValue | ( | const SbVec3d & | axis, |
double | radians | ||
) |
SbRotationd & SbRotationd::setValue | ( | const SbVec3d & | rotateFrom, |
const SbVec3d & | rotateTo | ||
) |
SbRotationd & SbRotationd::setValue | ( | double | q0, |
double | q1, | ||
double | q2, | ||
double | q3 | ||
) |
|
static |
Definition at line 567 of file SbLineard.h.
|
friend |
Definition at line 593 of file SbLineard.h.
|
friend |
|
friend |