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. More...
 
 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. More...
 
const double * getValue () const
 Returns pointer to array of 4 components defining quaternion. More...
 
void getValue (double &q0, double &q1, double &q2, double &q3) const
 Returns 4 individual components of rotation quaternion. More...
 
void getValue (SbVec3d &axis, double &radians) const
 Returns corresponding 3D rotation axis vector and angle in radians. More...
 
void getValue (SbMatrixd &matrix) const
 Returns corresponding 4x4 rotation matrix. More...
 
SbMatrixd getMatrix () const
 Returns corresponding 4x4 rotation matrix. More...
 
SbVec3d getAxis () const
 Returns corresponding 3D rotation axis vector. More...
 
double getAngle () const
 Returns corresponding angle in radians. More...
 
SbRotationdinvert ()
 Changes a rotation to be its inverse. More...
 
SbRotationd inverse () const
 Returns the inverse of a rotation. More...
 
SbRotationdsetValue (const double q[4])
 Sets value of rotation from array of 4 components of a quaternion. More...
 
SbRotationdsetValue (double q0, double q1, double q2, double q3)
 Sets value of rotation from 4 individual components of a quaternion. More...
 
SbRotationdsetValue (const SbMatrixd &m)
 Sets value of rotation from a rotation matrix. More...
 
SbRotationdsetValue (const SbVec3d &axis, double radians)
 Sets value of vector from 3D rotation axis vector and angle in radians. More...
 
SbRotationdsetValue (const SbVec3d &rotateFrom, const SbVec3d &rotateTo)
 Sets rotation to rotate one direction vector to another. More...
 
SbRotationdoperator*= (const SbRotationd &q)
 Multiplies by another rotation; results in product of rotations. More...
 
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. More...
 
void multVec (const SbVec3d &src, SbVec3d &dst) const
 Multiplies the given vector by the matrix of this rotation. More...
 
SbVec3d transformPoint (const SbVec3d &src) const
 Multiplies the given vector by the matrix of this rotation. More...
 
void scaleAngle (double scaleFactor)
 Keep the axis the same. More...
 

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. More...
 
static SbRotationd identity ()
 Returns a null rotation. More...
 

Friends

INVENTOR_API bool operator== (const SbRotationd &q1, const SbRotationd &q2)
 Equality comparison operator. More...
 
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. More...
 

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

Definition at line 471 of file SbLineard.h.

◆ 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.

Member Function Documentation

◆ equals()

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

◆ getAngle()

double SbRotationd::getAngle ( ) const
inline

Definition at line 524 of file SbLineard.h.

◆ getAxis()

SbVec3d SbRotationd::getAxis ( ) const
inline

Definition at line 522 of file SbLineard.h.

◆ getMatrix()

SbMatrixd SbRotationd::getMatrix ( ) const

◆ getValue() [1/4]

const double* SbRotationd::getValue ( ) const
inline

Definition at line 505 of file SbLineard.h.

◆ 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.

◆ inverse()

SbRotationd SbRotationd::inverse ( ) const
inline

Definition at line 530 of file SbLineard.h.

References invert().

◆ invert()

SbRotationd& SbRotationd::invert ( )

Referenced by inverse().

◆ multVec()

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

◆ operator*=()

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

◆ 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)

◆ setValue() [3/5]

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

◆ setValue() [4/5]

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

◆ setValue() [5/5]

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

◆ slerp()

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

◆ transformPoint()

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

Definition at line 567 of file SbLineard.h.

Friends And Related Function Documentation

◆ operator!=

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

Definition at line 593 of file SbLineard.h.

◆ operator*

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

◆ operator==

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

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