SbDPRotation(3)

πŸ“¦
version 4.0.10 Β· 4 versions
, in fedora 43, fedora 44

πŸ’– 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 β€” rotate src, drop the result in dst.
  • 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.

t should 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