logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SbRotation — class for representing a rotation

Description

       Object  that  stores a rotation. There are several ways to specify a rotation: quaternion (4 floats), 4x4
       rotation matrix, or axis and angle. All angles are in radians and all rotations are right-handed.

Inherits From

       SbRotation

Methods

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.

Name

       SbRotation — class for representing a rotation

Notes

       Rotations are stored internally as quaternions.

See Also

SbVec3f,SbMatrixSbRotation(3IV)()

Synopsis

#include<Inventor/SbLinear.h>

          Methods from class SbRotation:

                         SbRotation()SbRotation(constSbVec3f&axis,floatradians)SbRotation(constfloatv[4])SbRotation(floatq0,floatq1,floatq2,floatq3)SbRotation(constSbMatrix&m)SbRotation(constSbVec3f&rotateFrom,constSbVec3f&rotateTo)constfloat*getValue()constvoidgetValue(float&q0,float&q1,float&q2,float&q3)constSbRotation&setValue(floatq0,floatq1,floatq2,floatq3)voidgetValue(SbVec3f&axis,float&radians)constvoidgetValue(SbMatrix&matrix)constSbRotation&invert()SbRotationinverse()constSbRotation&setValue(constfloatq[4])SbRotation&setValue(constSbMatrix&m)SbRotation&setValue(constSbVec3f&axis,floatradians)SbRotation&setValue(constSbVec3f&rotateFrom,constSbVec3f&rotateTo)SbRotation&operator*=(constSbRotation&q)intoperator==(constSbRotation&q1,constSbRotation&q2)intoperator!=(constSbRotation&q1,constSbRotation&q2)SbBoolequals(constSbRotation&r,floattolerance)constSbRotationoperator*(constSbRotation&q1,constSbRotation&q2)voidmultVec(constSbVec3f&src,SbVec3f&dst)constvoidscaleAngle(floatscaleFactor)staticSbRotationslerp(constSbRotation&rot0,constSbRotation&rot1,floatt)staticSbRotationidentity()

See Also