SbDPRotation(3)
π SbDPRotation β NAME π
okay so SbDPRotation is literally the class that represents a rotation in 3D space, and it does it with double precision data. that's the whole vibe. rotating things, but β¨preciselyβ¨.
πΈ SYNOPSIS πΈ
#include <Inventor/SbDPRotation.h>
π Public Member Functions π
SbDPRotation (void)β the no-args one.SbDPRotation (const SbVec3d &axis, const double radians)β you hand it an axis and an angle.SbDPRotation (const double q[4])β build it from four quaternion numbers in an array.SbDPRotation (const double q0, const double q1, const double q2, const double q3)β same thing but as four separate values, no array needed.SbDPRotation (const SbDPMatrix &m)β feed it a matrix, get a rotation.SbDPRotation (const SbVec3d &rotateFrom, const SbVec3d &rotateTo)β the tiniest rotation that swings one vector onto another.const double * getValue (void) constβ pointer to the quaternion array, pls.void getValue (double &q0, double &q1, double &q2, double &q3) constβ the four components, out through your refs.SbDPRotation & setValue (const double q0, const double q1, const double q2, const double q3)β set it with four values.void getValue (SbVec3d &axis, double &radians) constβ gimme the axis and the angle.void getValue (SbDPMatrix &matrix) constβ gimme the matrix version.SbDPRotation & invert (void)β flip it, in place, returns this.SbDPRotation inverse (void) constβ flip it, but as a brand new object, no touchy the original.SbDPRotation & setValue (const double q[4])β set from the array.SbDPRotation & setValue (const SbDPMatrix &m)β set from a matrix.SbDPRotation & setValue (const SbVec3d &axis, const double radians)β set from axis + angle.SbDPRotation & setValue (const SbVec3d &rotateFrom, const SbVec3d &rotateTo)β set it to that minimal fromβto rotation.SbBool equals (const SbDPRotation &r, double tolerance) constβ are these the same, within tolerance?void multVec (const SbVec3d &src, SbVec3d &dst) constβ rotatesrc, drop the result indst.void scaleAngle (const double scaleFactor)β stretch/squish the rotation angle by scaleFactor.void print (FILE *fp) constβ dump the state out to a file stream.SbDPRotation & operator*= (const SbDPRotation &q)β multiply the quaternions.SbDPRotation & operator*= (const double s)β multiply by a scalar.
β¨ Static Public Member Functions β¨
static SbDPRotation slerp (const SbDPRotation &rot0, const SbDPRotation &rot1, double t)β smooth glide between two rotations.static SbDPRotation identity (void)β the identity rotation, the "i did nothing" rotation.
π¦ Detailed Description π¦
So SbDPRotation represents a rotation in 3D space using double precision data. bestie that's the whole job description.
It's used extensively all over the Coin library, so like⦠everywhere. iconic behavior.
Internally it stores everything as a quaternion, because speed and storage said so, but you can absolutely ask it for axis-and-angle values and set them that way too, for convenience. it's giving "have it your way" π
See also
SbDPMatrix
π Constructor & Destructor Documentation π
SbDPRotation::SbDPRotation (void )
The default constructor just initializes a valid rotation. That's it. The actual value is unspecified, and you should not depend on it. fr fr do not peek at it and assume anything π«Ά
SbDPRotation::SbDPRotation (const SbVec3d & axis, const double radians)
Builds a fresh SbDPRotation initialized with the given axis-of-rotation and rotation angle. classic.
SbDPRotation::SbDPRotation (const double q[4])
Builds a fresh SbDPRotation initialized with the given quaternion components.
The array must be ordered exactly like this:
q[0] = x, q[1] = y, q[2] = z and q[3] = w
where the quaternion is specified by:
q = w + xi + yj + zk
lowkey the w is hiding at the END of the array. do not get got by that. π
SbDPRotation::SbDPRotation (const double q0, const double q1, const double q2, const double q3)
Builds a fresh SbDPRotation initialized with the given quaternion components. (yes, four loose doubles instead of an array, chef's choice π)
SbDPRotation::SbDPRotation (const SbDPMatrix & m)
Builds a fresh SbDPRotation initialized with the given rotation matrix.
SbDPRotation::SbDPRotation (const SbVec3d & rotateFrom, const SbVec3d & rotateTo)
Constructs a rotation which is the minimum rotation necessary to make vector rotateFrom point in the direction of vector rotateTo. least effort, maximum slay. π
π Member Function Documentation π
const double * SbDPRotation::getValue (void ) const
Returns a pointer to an array with the rotation expressed as four quaternion values.
See also
setValue().
void SbDPRotation::getValue (double & q0, double & q1, double & q2, double & q3) const
Returns the four quaternion components representing the rotation. yes, all four, into your refs. π«Ά
See also
setValue().
SbDPRotation & SbDPRotation::setValue (const double q0, const double q1, const double q2, const double q3)
Sets the rotation.
See also
getValue().
void SbDPRotation::getValue (SbVec3d & axis, double & radians) const
Returns the rotation in the form of an axis-of-rotation and a rotation angle.
See also
setValue().
void SbDPRotation::getValue (SbDPMatrix & matrix) const
Returns this rotation in the form of a matrix.
See also
setValue().
SbDPRotation & SbDPRotation::invert (void )
Inverts the rotation. Returns a reference to self. so it edits in place and hands itself back, main character energy π
See also
inverse()
SbDPRotation SbDPRotation::inverse (void ) const
Non-destructively inverses the rotation and returns the result. your original stays untouched, we respect her. πΈ
See also
invert()
SbDPRotation & SbDPRotation::setValue (const double q[4])
Resets the rotation by the four quaternions in the array.
See also
getValue().
SbDPRotation & SbDPRotation::setValue (const SbDPMatrix & m)
Sets the rotation from the components of the given matrix. Returns a reference to self.
See also
getValue().
SbDPRotation & SbDPRotation::setValue (const SbVec3d & axis, const double radians)
Resets the rotation with the given axis-of-rotation and rotation angle. Returns a reference to self.
β οΈ make sure axis is not the null vector when you call this method. seriously. not the null vector.
See also
getValue().
SbDPRotation & SbDPRotation::setValue (const SbVec3d & rotateFrom, const SbVec3d & rotateTo)
Constructs a rotation which is the minimum rotation necessary to make vector rotateFrom point in the direction of vector rotateTo.
Returns a reference to self.
See also
getValue().
SbBool SbDPRotation::equals (const SbDPRotation & r, double tolerance) const
Checks the internal quaternion representation vectors for equality within the given tolerance. close enough counts, but only tolerance-close. π
void SbDPRotation::multVec (const SbVec3d & src, SbVec3d & dst) const
Rotates the src vector and puts the result in dst.
void SbDPRotation::scaleAngle (const double scaleFactor)
Scales the angle of rotation by scaleFactor. bigger angle, smaller angle, your call bestie.
SbDPRotation slerp (const SbDPRotation & rot0, const SbDPRotation & rot1, double t) [static]
Interpolates along the shortest path between the two rotation positions (from rot0 to rot1).
Returns the SbDPRotation which will rotate rot0 the given part t of the spherical distance towards rot1, where t=0 will yield rot0 and t=1 will yield rot1.
tshould be in the interval[0, 1]. stay in range or else π
SbDPRotation SbDPRotation::identity (void ) [static]
Returns an identity rotation. the "no notes, no changes" rotation. β
void SbDPRotation::print (FILE * fp) const
Dumps the state of this object to the fp file stream. Only works in debug version of library, method does nothing in an optimized build. so if you're getting silenceβ¦ that's why, ngl. π
SbDPRotation & SbDPRotation::operator*= (const SbDPRotation & q)
Multiplies the quaternions.
note that order is important when combining quaternions with the multiplication operator. do not just swap them around thinking it's cute, because it is NOT the same result. π₯
SbDPRotation & SbDPRotation::operator*= (const double s)
Multiplies components of quaternion with scalar value s. Returns a reference to self.
π§ Author π§
Generated automatically by Doxygen for Coin from the source code. (not a human, just a very diligent robot β¨)
and that's the whole page, bestie!! this was SbDPRotation(3) from the Coin manual, Version 4.0.10, dated Thu Jun 25 2026 00:00:00 π go forth and rotate responsibly, ily, periodt ππ¦π
π¦ where this page comes from
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms