SbRotation()SbRotation(constSbVec3f&axis,floatradians)SbRotation(constfloatv[4])SbRotation(floatq0,floatq1,floatq2,floatq3)SbRotation(constSbMatrix&m)SbRotation(constSbVec3f&rotateFrom,constSbVec3f&rotateTo)
Constructors for rotation. The axis/radians constructor creates a rotation of angle radians about the
given axis. The constructors that take four floats create a quaternion from those floats (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.
constfloat*getValue()const
Returns pointer to array of 4 components defining quaternion.
voidgetValue(float&q0,float&q1,float&q2,float&q3)const
Returns 4 individual components of rotation quaternion.
SbRotation&setValue(floatq0,floatq1,floatq2,floatq3)
Sets value of rotation from 4 individual components of a quaternion.
voidgetValue(SbVec3f&axis,float&radians)const
Returns corresponding 3D rotation axis vector and angle in radians.
voidgetValue(SbMatrix&matrix)const
Returns corresponding 4x4 rotation matrix.
SbRotation&invert()
Changes a rotation to be its inverse.
SbRotationinverse()const
Returns the inverse of a rotation.
SbRotation&setValue(constfloatq[4])
Sets value of rotation from array of 4 components of a quaternion.
SbRotation&setValue(constSbMatrix&m)
Sets value of rotation from a rotation matrix.
SbRotation&setValue(constSbVec3f&axis,floatradians)
Sets value of vector from 3D rotation axis vector and angle in radians.
SbRotation&setValue(constSbVec3f&rotateFrom,constSbVec3f&rotateTo)
Sets rotation to rotate one direction vector to another. The rotateFrom and rotateTo arguments are
normalized before the rotation is calculated.
SbRotation&operator*=(constSbRotation&q)
Multiplies by another rotation; results in product of rotations.
intoperator==(constSbRotation&q1,constSbRotation&q2)intoperator!=(constSbRotation&q1,constSbRotation&q2)
Equality comparison operators.
SbBoolequals(constSbRotation&r,floattolerance)const
Equality comparison within given tolerance — the square of the length of the maximum distance between
the two quaternion vectors.
SbRotationoperator*(constSbRotation&q1,constSbRotation&q2)
Multiplication of two rotations; results in product of rotations.
voidmultVec(constSbVec3f&src,SbVec3f&dst)const
Multiplies the given vector by the matrix of this rotation.
voidscaleAngle(floatscaleFactor)
Keep the axis the same. Multiply the angle of rotation by the amount scaleFactor.
staticSbRotationslerp(constSbRotation&rot0,constSbRotation&rot1,floatt)
Spherical linear interpolation: as t goes from 0 to 1, returned value goes from rot0 to rot1.
staticSbRotationidentity()
Returns a null rotation.