Open Inventor Reference
SbRotationd Class 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.
 
SbRotationdinvert ()
 Changes a rotation to be its inverse.
 
SbRotationd inverse () const
 Returns the inverse of a rotation.
 
SbRotationdsetValue (const double q[4])
 Sets value of rotation from array of 4 components of a quaternion.
 
SbRotationdsetValue (double q0, double q1, double q2, double q3)
 Sets value of rotation from 4 individual components of a quaternion.
 
SbRotationdsetValue (const SbMatrixd &m)
 Sets value of rotation from a rotation matrix.
 
SbRotationdsetValue (const SbVec3d &axis, double radians)
 Sets value of vector from 3D rotation axis vector and angle in radians.
 
SbRotationdsetValue (const SbVec3d &rotateFrom, const SbVec3d &rotateTo)
 Sets rotation to rotate one direction vector to another.
 
SbRotationdoperator*= (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.
 

Detailed Description

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. {}

NOTES

Rotations are stored internally as quaternions.

See Also
SbVec3f, SbMatrix, SbVec3d, SbMatrix, SbMatrixd, SbRotation

Definition at line 467 of file SbLineard.h.

Constructor & Destructor Documentation

◆ SbRotationd() [1/6]

SbRotationd::SbRotationd ( )
inline

◆ SbRotationd() [2/6]

SbRotationd::SbRotationd ( const double v[4])
inline

◆ SbRotationd() [3/6]

SbRotationd::SbRotationd ( double q0,
double q1,
double q2,
double q3 )
inline

◆ SbRotationd() [4/6]

SbRotationd::SbRotationd ( const SbMatrixd & m)
inline

◆ SbRotationd() [5/6]

SbRotationd::SbRotationd ( const SbVec3d & axis,
double radians )
inline

◆ SbRotationd() [6/6]

SbRotationd::SbRotationd ( const SbVec3d & rotateFrom,
const SbVec3d & rotateTo )
inline

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.

References setValue().

Member Function Documentation

◆ equals()

bool SbRotationd::equals ( const SbRotationd & r,
double tolerance ) const

References SbRotationd().

◆ getAngle()

double SbRotationd::getAngle ( ) const
inline

Definition at line 524 of file SbLineard.h.

References getValue().

◆ getAxis()

SbVec3d SbRotationd::getAxis ( ) const
inline

Definition at line 522 of file SbLineard.h.

References getValue().

◆ getMatrix()

SbMatrixd SbRotationd::getMatrix ( ) const

◆ getValue() [1/4]

const double * SbRotationd::getValue ( ) const
inline

Definition at line 505 of file SbLineard.h.

Referenced by getAngle(), and getAxis().

◆ getValue() [2/4]

void SbRotationd::getValue ( double & q0,
double & q1,
double & q2,
double & q3 ) const

◆ getValue() [3/4]

void SbRotationd::getValue ( SbMatrixd & matrix) const

◆ getValue() [4/4]

void SbRotationd::getValue ( SbVec3d & axis,
double & radians ) const

◆ identity()

static SbRotationd SbRotationd::identity ( )
inlinestatic

Definition at line 579 of file SbLineard.h.

References SbRotationd().

◆ inverse()

SbRotationd SbRotationd::inverse ( ) const
inline

Definition at line 530 of file SbLineard.h.

References invert(), and SbRotationd().

◆ invert()

SbRotationd & SbRotationd::invert ( )

References SbRotationd().

Referenced by inverse().

◆ multVec()

void SbRotationd::multVec ( const SbVec3d & src,
SbVec3d & dst ) const

Referenced by transformPoint().

◆ operator*=()

SbRotationd & SbRotationd::operator*= ( const SbRotationd & q)

References SbRotationd().

◆ scaleAngle()

void SbRotationd::scaleAngle ( double scaleFactor)

Multiply the angle of rotation by the amount scaleFactor.

◆ setValue() [1/5]

SbRotationd & SbRotationd::setValue ( const double q[4])

◆ setValue() [2/5]

SbRotationd & SbRotationd::setValue ( const SbMatrixd & m)

References SbRotationd().

◆ setValue() [3/5]

SbRotationd & SbRotationd::setValue ( const SbVec3d & axis,
double radians )

References SbRotationd().

◆ setValue() [4/5]

SbRotationd & SbRotationd::setValue ( const SbVec3d & rotateFrom,
const SbVec3d & rotateTo )

References SbRotationd().

◆ setValue() [5/5]

SbRotationd & SbRotationd::setValue ( double q0,
double q1,
double q2,
double q3 )

References SbRotationd().

◆ slerp()

static SbRotationd SbRotationd::slerp ( const SbRotationd & rot0,
const SbRotationd & rot1,
double t )
static

References SbRotationd().

◆ transformPoint()

SbVec3d SbRotationd::transformPoint ( const SbVec3d & src) const
inline

Definition at line 567 of file SbLineard.h.

References multVec().

Friends And Related Symbol Documentation

◆ operator!=

INVENTOR_API bool operator!= ( const SbRotationd & q1,
const SbRotationd & q2 )
friend

Definition at line 593 of file SbLineard.h.

References INVENTOR_API, and SbRotationd().

◆ operator*

INVENTOR_API SbRotationd operator* ( const SbRotationd & q1,
const SbRotationd & q2 )
friend

References INVENTOR_API, and SbRotationd().

◆ operator==

INVENTOR_API bool operator== ( const SbRotationd & q1,
const SbRotationd & q2 )
friend

References INVENTOR_API, and SbRotationd().


The documentation for this class was generated from the following file: