.TH "SbDPRotation" 3 "Tue Dec 26 2023 17:59:22" "Version 4.0.2" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SbDPRotation \- The \fBSbDPRotation\fP class represents a rotation in 3D space using double precision data\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBSbDPRotation\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBSbDPRotation\fP (\fBconst\fP \fBSbVec3d\fP &axis, \fBconst\fP double \fBradians\fP)" .br .ti -1c .RI "\fBSbDPRotation\fP (\fBconst\fP double q[4])" .br .ti -1c .RI "\fBSbDPRotation\fP (\fBconst\fP double \fBq0\fP, \fBconst\fP double \fBq1\fP, \fBconst\fP double \fBq2\fP, \fBconst\fP double \fBq3\fP)" .br .ti -1c .RI "\fBSbDPRotation\fP (\fBconst\fP \fBSbDPMatrix\fP &\fBm\fP)" .br .ti -1c .RI "\fBSbDPRotation\fP (\fBconst\fP \fBSbVec3d\fP &\fBrotateFrom\fP, \fBconst\fP \fBSbVec3d\fP &\fBrotateTo\fP)" .br .ti -1c .RI "\fBconst\fP double * \fBgetValue\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBgetValue\fP (double &\fBq0\fP, double &\fBq1\fP, double &\fBq2\fP, double &\fBq3\fP) \fBconst\fP" .br .ti -1c .RI "\fBSbDPRotation\fP & \fBsetValue\fP (\fBconst\fP double \fBq0\fP, \fBconst\fP double \fBq1\fP, \fBconst\fP double \fBq2\fP, \fBconst\fP double \fBq3\fP)" .br .ti -1c .RI "\fBvoid\fP \fBgetValue\fP (\fBSbVec3d\fP &axis, double &\fBradians\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBgetValue\fP (\fBSbDPMatrix\fP &matrix) \fBconst\fP" .br .ti -1c .RI "\fBSbDPRotation\fP & \fBinvert\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBSbDPRotation\fP \fBinverse\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBSbDPRotation\fP & \fBsetValue\fP (\fBconst\fP double q[4])" .br .ti -1c .RI "\fBSbDPRotation\fP & \fBsetValue\fP (\fBconst\fP \fBSbDPMatrix\fP &\fBm\fP)" .br .ti -1c .RI "\fBSbDPRotation\fP & \fBsetValue\fP (\fBconst\fP \fBSbVec3d\fP &axis, \fBconst\fP double \fBradians\fP)" .br .ti -1c .RI "\fBSbDPRotation\fP & \fBsetValue\fP (\fBconst\fP \fBSbVec3d\fP &\fBrotateFrom\fP, \fBconst\fP \fBSbVec3d\fP &\fBrotateTo\fP)" .br .ti -1c .RI "SbBool \fBequals\fP (\fBconst\fP \fBSbDPRotation\fP &r, double tolerance) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBmultVec\fP (\fBconst\fP \fBSbVec3d\fP &src, \fBSbVec3d\fP &\fBdst\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBscaleAngle\fP (\fBconst\fP double scaleFactor)" .br .ti -1c .RI "\fBvoid\fP \fBprint\fP (\fBFILE\fP *fp) \fBconst\fP" .br .ti -1c .RI "\fBSbDPRotation\fP & \fBoperator*=\fP (\fBconst\fP \fBSbDPRotation\fP &q)" .br .ti -1c .RI "\fBSbDPRotation\fP & \fBoperator*=\fP (\fBconst\fP double s)" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "\fBstatic\fP \fBSbDPRotation\fP \fBslerp\fP (\fBconst\fP \fBSbDPRotation\fP &\fBrot0\fP, \fBconst\fP \fBSbDPRotation\fP &\fBrot1\fP, double t)" .br .ti -1c .RI "\fBstatic\fP \fBSbDPRotation\fP \fBidentity\fP (\fBvoid\fP)" .br .in -1c .SS "Related Symbols" (Note that these are not member symbols\&.) .in +1c .ti -1c .RI "int \fBoperator==\fP (\fBconst\fP \fBSbDPRotation\fP &\fBq1\fP, \fBconst\fP \fBSbDPRotation\fP &\fBq2\fP)" .br .ti -1c .RI "int \fBoperator!=\fP (\fBconst\fP \fBSbDPRotation\fP &\fBq1\fP, \fBconst\fP \fBSbDPRotation\fP &\fBq2\fP)" .br .ti -1c .RI "\fBSbDPRotation\fP \fBoperator*\fP (\fBconst\fP \fBSbDPRotation\fP &\fBq1\fP, \fBconst\fP \fBSbDPRotation\fP &\fBq2\fP)" .br .ti -1c .RI "\fBSbDPRotation\fP \fBslerp\fP (\fBconst\fP \fBSbDPRotation\fP &\fBrot0\fP, \fBconst\fP \fBSbDPRotation\fP &\fBrot1\fP, double t)" .br .in -1c .SH "Detailed Description" .PP The \fBSbDPRotation\fP class represents a rotation in 3D space using double precision data\&. \fBSbDPRotation\fP is used extensively throughout the Coin library\&. .PP An \fBSbDPRotation\fP is stored internally as a quaternion for speed and storage reasons, but inquiries can be done to get and set axis and angle values for convenience\&. .PP \fBSee also\fP .RS 4 \fBSbDPMatrix\fP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "SbDPRotation::SbDPRotation (\fBvoid\fP)" The default constructor just initializes a valid rotation\&. The actual value is unspecified, and you should not depend on it\&. .SS "SbDPRotation::SbDPRotation (\fBconst\fP \fBSbVec3d\fP & axis, \fBconst\fP double radians)" Construct a new \fBSbDPRotation\fP object initialized with the given axis-of-rotation and rotation angle\&. .SS "SbDPRotation::SbDPRotation (\fBconst\fP double q[4])" Construct a new \fBSbDPRotation\fP object initialized with the given quaternion components\&. .PP The array must be ordered as follows: .PP q[0] = x, q[1] = y, q[2] = z and q[3] = w, where the quaternion is specified by q = w + xi + yj + zk\&. .SS "SbDPRotation::SbDPRotation (\fBconst\fP double q0, \fBconst\fP double q1, \fBconst\fP double q2, \fBconst\fP double q3)" Construct a new \fBSbDPRotation\fP object initialized with the given quaternion components\&. .SS "SbDPRotation::SbDPRotation (\fBconst\fP \fBSbDPMatrix\fP & m)" Construct a new \fBSbDPRotation\fP object initialized with the given rotation matrix\&. .SS "SbDPRotation::SbDPRotation (\fBconst\fP \fBSbVec3d\fP & rotateFrom, \fBconst\fP \fBSbVec3d\fP & rotateTo)" Construct a rotation which is the minimum rotation necessary to make vector \fIrotateFrom\fP point in the direction of vector \fIrotateTo\fP\&. .SH "Member Function Documentation" .PP .SS "\fBconst\fP double * SbDPRotation::getValue (\fBvoid\fP) const" Return pointer to an array with the rotation expressed as four quaternion values\&. .PP \fBSee also\fP .RS 4 \fBsetValue()\fP\&. .RE .PP .SS "\fBvoid\fP SbDPRotation::getValue (double & q0, double & q1, double & q2, double & q3) const" Return the four quaternion components representing the rotation\&. .PP \fBSee also\fP .RS 4 \fBsetValue()\fP\&. .RE .PP .SS "\fBSbDPRotation\fP & SbDPRotation::setValue (\fBconst\fP double q0, \fBconst\fP double q1, \fBconst\fP double q2, \fBconst\fP double q3)" Set the rotation\&. .PP \fBSee also\fP .RS 4 \fBgetValue()\fP\&. .RE .PP .SS "\fBvoid\fP SbDPRotation::getValue (\fBSbVec3d\fP & axis, double & radians) const" Return the rotation in the form of an axis-of-rotation and a rotation angle\&. .PP \fBSee also\fP .RS 4 \fBsetValue()\fP\&. .RE .PP .SS "\fBvoid\fP SbDPRotation::getValue (\fBSbDPMatrix\fP & matrix) const" Return this rotation in the form of a matrix\&. .PP \fBSee also\fP .RS 4 \fBsetValue()\fP\&. .RE .PP .SS "\fBSbDPRotation\fP & SbDPRotation::invert (\fBvoid\fP)" Invert the rotation\&. Returns reference to self\&. .PP \fBSee also\fP .RS 4 \fBinverse()\fP .RE .PP .SS "\fBSbDPRotation\fP SbDPRotation::inverse (\fBvoid\fP) const" Non-destructively inverses the rotation and returns the result\&. .PP \fBSee also\fP .RS 4 \fBinvert()\fP .RE .PP .SS "\fBSbDPRotation\fP & SbDPRotation::setValue (\fBconst\fP double q[4])" Reset the rotation by the four quaternions in the array\&. .PP \fBSee also\fP .RS 4 \fBgetValue()\fP\&. .RE .PP .SS "\fBSbDPRotation\fP & SbDPRotation::setValue (\fBconst\fP \fBSbDPMatrix\fP & m)" Set the rotation from the components of the given matrix\&. Returns reference to self\&. .PP \fBSee also\fP .RS 4 \fBgetValue()\fP\&. .RE .PP .SS "\fBSbDPRotation\fP & SbDPRotation::setValue (\fBconst\fP \fBSbVec3d\fP & axis, \fBconst\fP double radians)" Reset rotation with the given axis-of-rotation and rotation angle\&. Returns reference to self\&. .PP Make sure \fIaxis\fP is not the null vector when calling this method\&. .PP \fBSee also\fP .RS 4 \fBgetValue()\fP\&. .RE .PP .SS "\fBSbDPRotation\fP & SbDPRotation::setValue (\fBconst\fP \fBSbVec3d\fP & rotateFrom, \fBconst\fP \fBSbVec3d\fP & rotateTo)" Construct a rotation which is the minimum rotation necessary to make vector \fIrotateFrom\fP point in the direction of vector \fIrotateTo\fP\&. .PP Returns reference to self\&. .PP \fBSee also\fP .RS 4 \fBgetValue()\fP\&. .RE .PP .SS "SbBool SbDPRotation::equals (\fBconst\fP \fBSbDPRotation\fP & r, double tolerance) const" Check the internal quaternion representation vectors for equality within the given tolerance\&. .SS "\fBvoid\fP SbDPRotation::multVec (\fBconst\fP \fBSbVec3d\fP & src, \fBSbVec3d\fP & dst) const" Rotate the \fIsrc\fP vector and put the result in \fIdst\fP\&. .SS "\fBvoid\fP SbDPRotation::scaleAngle (\fBconst\fP double scaleFactor)" Scale the angle of rotation by \fIscaleFactor\fP\&. .SS "\fBSbDPRotation\fP slerp (\fBconst\fP \fBSbDPRotation\fP & rot0, \fBconst\fP \fBSbDPRotation\fP & rot1, double t)\fC [static]\fP" Interpolates along the shortest path between the two rotation positions (from \fIrot0\fP to \fIrot1\fP)\&. .PP Returns the \fBSbDPRotation\fP which will rotate \fIrot0\fP the given part \fIt\fP of the spherical distance towards \fIrot1\fP, where \fIt=0\fP will yield \fIrot0\fP and \fIt=1\fP will yield \fIrot1\fP\&. .PP \fIt\fP should be in the interval [0, 1]\&. .SS "\fBSbDPRotation\fP SbDPRotation::identity (\fBvoid\fP)\fC [static]\fP" Returns an identity rotation\&. .SS "\fBvoid\fP SbDPRotation::print (\fBFILE\fP * fp) const" Dump the state of this object to the \fIfp\fP file stream\&. Only works in debug version of library, method does nothing in an optimized build\&. .SS "\fBSbDPRotation\fP & SbDPRotation::operator*= (\fBconst\fP \fBSbDPRotation\fP & q)" Multiplies the quaternions\&. .PP Note that order is important when combining quaternions with the multiplication operator\&. .SS "\fBSbDPRotation\fP & SbDPRotation::operator*= (\fBconst\fP double s)" Multiplies components of quaternion with scalar value \fIs\fP\&. Returns reference to self\&. .SH "Friends And Related Symbol Documentation" .PP .SS "int \fBoperator\fP== (\fBconst\fP \fBSbDPRotation\fP & q1, \fBconst\fP \fBSbDPRotation\fP & q2)\fC [related]\fP" Check if the two rotations are equal\&. .PP \fBSee also\fP .RS 4 \fBequals()\fP\&. .RE .PP .SS "int operator!= (\fBconst\fP \fBSbDPRotation\fP & q1, \fBconst\fP \fBSbDPRotation\fP & q2)\fC [related]\fP" Check if the two rotations are not equal\&. .PP \fBSee also\fP .RS 4 \fBequals()\fP\&. .RE .PP .SS "\fBSbDPRotation\fP \fBoperator\fP* (\fBconst\fP \fBSbDPRotation\fP & q1, \fBconst\fP \fBSbDPRotation\fP & q2)\fC [related]\fP" Multiplies the two rotations and returns the result\&. .PP Note that order is important when combining quaternions with the multiplication operator\&. .SS "\fBSbDPRotation\fP slerp (\fBconst\fP \fBSbDPRotation\fP & rot0, \fBconst\fP \fBSbDPRotation\fP & rot1, double t)\fC [related]\fP" Interpolates along the shortest path between the two rotation positions (from \fIrot0\fP to \fIrot1\fP)\&. .PP Returns the \fBSbDPRotation\fP which will rotate \fIrot0\fP the given part \fIt\fP of the spherical distance towards \fIrot1\fP, where \fIt=0\fP will yield \fIrot0\fP and \fIt=1\fP will yield \fIrot1\fP\&. .PP \fIt\fP should be in the interval [0, 1]\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.