SbDPRotation(3)
π« NAME π«
bestie. gather round. SbDPRotation is the class that represents a rotation in 3D space. that's it, that's the whole vibe. rotations. in 3D. iconic. π
πΈ SYNOPSIS πΈ
okay so first things first, you gotta pull it in:
#include <Inventor/SbLinear.h>
π Public Member Functions
SbDPRotation(void)SbDPRotation(const SbVec3d &axis, const double radians)SbDPRotation(const double q[4])SbDPRotation(const double q0, const double q1, const double q2, const double q3)SbDPRotation(const SbDPMatrix &m)SbDPRotation(const SbVec3d &rotateFrom, const SbVec3d &rotateTo)const double * getValue(void) constvoid getValue(double &q0, double &q1, double &q2, double &q3) constSbDPRotation & setValue(const double q0, const double q1, const double q2, const double q3)void getValue(SbVec3d &axis, double &radians) constvoid getValue(SbDPMatrix &matrix) constSbDPRotation & invert(void)SbDPRotation inverse(void) constSbDPRotation & setValue(const double q[4])SbDPRotation & setValue(const SbDPMatrix &m)SbDPRotation & setValue(const SbVec3d &axis, const double radians)SbDPRotation & setValue(const SbVec3d &rotateFrom, const SbVec3d &rotateTo)SbDPRotation & operator*=(const SbDPRotation &q)SbDPRotation & operator*=(const double s)SbBool equals(const SbDPRotation &r, const double tolerance) constvoid multVec(const SbVec3d &src, SbVec3d &dst) constvoid scaleAngle(const double scaleFactor)void print(FILE *fp) const
π¦ Static Public Member Functions
static SbDPRotation slerp(const SbDPRotation &rot0, const SbDPRotation &rot1, double t)static SbDPRotation identity(void)
π Detailed Description π
The SbDPRotation class represents a rotation in 3D space. say it back.
SbDPRotation is used extensively throughout the Coin library. everywhere. she's booked and busy fr fr.
An SbDPRotation is stored internally as a quaternion for speed and storage reasons (efficient queen π
), but inquiries can be done to get and set axis and angle values for convenience. best of both worlds, no cap.
See also: SbDPMatrix
π Constructor & Destructor Documentation π
π SbDPRotation::SbDPRotation(void)
The default constructor just initializes a valid rotation. The actual value is unspecified, and you should not depend on it. like, she exists, she's valid, but do not ask her what she is. mystery is the point. π
π§ SbDPRotation::SbDPRotation(const SbVec3d &axis, const double radians)
Construct a new SbDPRotation object initialized with the given axis-of-rotation and rotation angle. classic combo, never misses. β¨
β SbDPRotation::SbDPRotation(const double q[4])
Construct a new SbDPRotation object initialized with the given quaternion components.
The array must be ordered as follows:
q[0] = x, q[1] = y, q[2] = z and q[3] = w
where the quaternion is specified by q=w+xi+yj+zk.
order matters bestie, do NOT shuffle these around, i'm begging π«Ά
π SbDPRotation::SbDPRotation(const double q0, const double q1, const double q2, const double q3)
Construct a new SbDPRotation object initialized with the given quaternion components. same energy, just spread out as four separate args instead of an array. π
πΈ SbDPRotation::SbDPRotation(const SbDPMatrix &m)
Construct a new SbDPRotation object initialized with the given rotation matrix. matrix in, rotation out. glow up. β¨
π¦ SbDPRotation::SbDPRotation(const SbVec3d &rotateFrom, const SbVec3d &rotateTo)
Construct a rotation which is the minimum rotation necessary to make vector rotateFrom point in the direction of vector rotateTo. shortest path behavior, she does not do extra work. periodt. π
π Member Function Documentation π
π const double * SbDPRotation::getValue(void) const
Return pointer to an array with the rotation expressed as four quaternion values. pointing at the goods. π
See also: setValue().
π void SbDPRotation::getValue(double &q0, double &q1, double &q2, double &q3) const
Return the four quaternion components representing the rotation. four out-params, zero mystery. β¨
See also: setValue().
π SbDPRotation & SbDPRotation::setValue(const double q0, const double q1, const double q2, const double q3)
Set the rotation. that's the whole job. π―
See also: getValue().
π void SbDPRotation::getValue(SbVec3d &axis, double &radians) const
Return the rotation in the form of an axis-of-rotation and a rotation angle. the human-readable serve. π
See also: setValue().
π void SbDPRotation::getValue(SbDPMatrix &matrix) const
Return this rotation in the form of a matrix. π§
See also: setValue().
π SbDPRotation & SbDPRotation::invert(void)
Invert the rotation. Returns reference to self. she flips herself. in place. destructive behavior but make it fashion. π
See also: inverse()
π SbDPRotation SbDPRotation::inverse(void) const
Non-destructively inverses the rotation and returns the result. the polite version β original stays untouched, you get a fresh flipped copy. π«Ά
See also: invert()
π SbDPRotation & SbDPRotation::setValue(const double q[4])
Reset the rotation by the four quaternions in the array. π
See also: getValue().
π SbDPRotation & SbDPRotation::setValue(const SbDPMatrix &m)
Set the rotation from the components of the given matrix. Returns reference to self. π§β‘οΈπ
See also: getValue().
π SbDPRotation & SbDPRotation::setValue(const SbVec3d &axis, const double radians)
Reset rotation with the given axis-of-rotation and rotation angle. Returns reference to self.
β οΈ Make sure axis is not the null vector when calling this method. no null vectors bestie, that's the rule, i don't make the rules, actually i do, it's in the original, so. π«
See also: getValue().
π SbDPRotation & SbDPRotation::setValue(const SbVec3d &rotateFrom, const SbVec3d &rotateTo)
Construct a rotation which is the minimum rotation necessary to make vector rotateFrom point in the direction of vector rotateTo.
Returns reference to self.
See also: getValue().
π SbDPRotation & SbDPRotation::operator*=(const SbDPRotation &q)
Multiplies the quaternions.
β οΈ Note that order is important when combining quaternions with the multiplication operator. don't come crying to me when you swap them and everything spins the wrong way π
π SbDPRotation & SbDPRotation::operator*=(const double s)
Multiplies components of quaternion with scalar value s. Returns reference to self. scaling the whole thing, no drama. β¨
π SbBool SbDPRotation::equals(const SbDPRotation &r, const double tolerance) const
Check the internal quaternion representation vectors for equality within the given tolerance. approximately equal is still equal, we're not doing exact float math here. π
π void SbDPRotation::multVec(const SbVec3d &src, SbVec3d &dst) const
Rotate the src vector and put the result in dst. πβ‘οΈπ
π void SbDPRotation::scaleAngle(const double scaleFactor)
Scale the angle of rotation by scaleFactor. bigger or smaller, her choice. πΈ
π 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].
keeptbetween 0 and 1 bestie, stay in your lane, the lane is[0, 1]π£οΈ
π SbDPRotation SbDPRotation::identity(void) [static]
Returns an identity rotation. the "i did nothing and i'm proud of it" rotation. she's the blueprint. β
π void SbDPRotation::print(FILE *fp) const
Dump the state of this object to the file stream. Only works in debug version of library, method does nothing in an optimized compile.
so if you're wondering why nothing printed... it's not you. it's the optimized build. she's silent. π
βοΈ Author βοΈ
Generated automatically by Doxygen for Coin from the source code. (yes bestie, a robot wrote this. slay.)
and that's the whole page!! go forth and rotate responsibly. mwah. π
this was SbDPRotation, page 3 of the manual, from Coin β Version 3.1.3 π¦β¨
π¦ where this page comes from
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms