SbDPMatrix(3)
π SbDPMatrix π
okay bestie, so this is SbDPMatrix(3) from the Coin library β literally the blueprint for a 4x4 matrix made of double-precision numbers. it's giving math but make it fashion. β¨
β¨ NAME β¨
SbDPMatrix β the SbDPMatrix class is a 4x4 dimensional representation of a double-precision matrix. that's it, that's the girl. π
πΈ SYNOPSIS πΈ
#include <Inventor/SbDPMatrix.h>
π Public Member Functions
SbDPMatrix (void)
SbDPMatrix (const double a11, const double a12, const double a13, const
double a14, const double a21, const double a22, const double a23,
const double a24, const double a31, const double a32, const double
a33, const double a34, const double a41, const double a42, const
double a43, const double a44)
SbDPMatrix (const SbDPMat &matrix)
SbDPMatrix (const SbDPMat *matrix)
SbDPMatrix (const SbMatrix &matrix)
~SbDPMatrix (void)
void setValue (const SbDPMat &m)
void setValue (const SbMatrix &m)
void setValue (const double *pMat)
const SbDPMat & getValue (void) const
void makeIdentity (void)
void setRotate (const SbDPRotation &q)
SbDPMatrix inverse (void) const
double det3 (int r1, int r2, int r3, int c1, int c2, int c3) const
double det3 (void) const
double det4 (void) const
SbBool equals (const SbDPMatrix &m, double tolerance) const
void getValue (SbDPMat &m) const
void setScale (const double s)
void setScale (const SbVec3d &s)
void setTranslate (const SbVec3d &t)
void setTransform (const SbVec3d &t, const SbDPRotation &r, const
SbVec3d &s)
void setTransform (const SbVec3d &t, const SbDPRotation &r, const
SbVec3d &s, const SbDPRotation &so)
void setTransform (const SbVec3d &translation, const SbDPRotation
&rotation, const SbVec3d &scaleFactor, const SbDPRotation
&scaleOrientation, const SbVec3d ¢er)
void getTransform (SbVec3d &t, SbDPRotation &r, SbVec3d &s, SbDPRotation
&so) const
void getTransform (SbVec3d &translation, SbDPRotation &rotation, SbVec3d
&scaleFactor, SbDPRotation &scaleOrientation, const SbVec3d ¢er)
const
SbBool factor (SbDPMatrix &r, SbVec3d &s, SbDPMatrix &u, SbVec3d &t,
SbDPMatrix &proj)
SbBool LUDecomposition (int index[4], double &d)
void LUBackSubstitution (int index[4], double b[4]) const
SbDPMatrix transpose (void) const
SbDPMatrix & multRight (const SbDPMatrix &m)
SbDPMatrix & multLeft (const SbDPMatrix &m)
void multMatrixVec (const SbVec3d &src, SbVec3d &dst) const
void multVecMatrix (const SbVec3d &src, SbVec3d &dst) const
void multDirMatrix (const SbVec3d &src, SbVec3d &dst) const
void multLineMatrix (const SbDPLine &src, SbDPLine &dst) const
void multVecMatrix (const SbVec4d &src, SbVec4d &dst) const
void print (FILE *fp) const
operator double * (void)
operator SbDPMat & (void)
double * operator[] (int i)
const double * operator[] (int i) const
SbDPMatrix & operator= (const SbDPMat &m)
SbDPMatrix & operator= (const SbDPMatrix &m)
SbDPMatrix & operator= (const SbDPRotation &q)
SbDPMatrix & operator*= (const SbDPMatrix &m)
β Static Public Member Functions
static SbDPMatrix identity (void)
π¦ Detailed Description π¦
the SbDPMatrix class is a 4x4 dimensional representation of a double-precision matrix. no cap. π
this class is like the SbMatrix class, but it uses double-precision floating-point values for its elements. so like, same energy, but with more precision. if you want the full class documentation, go check out SbMatrix β this one's basically her more precise sister. π«Ά
- Since β Coin 2.0. she's been iconic since forever.
π Constructor & Destructor Documentation π
SbDPMatrix::SbDPMatrix (void )
the default constructor does nothing. bestie the matrix will be uninitialized β like, no thoughts, head empty. π don't come for me, that's literally what the docs say.
SbDPMatrix::SbDPMatrix (const double a11, const double a12, const double a13, const double a14, const double a21, const double a22, const double a23, const double a24, const double a31, const double a32, const double a33, const double a34, const double a41, const double a42, const double a43, const double a44)
constructs a matrix instance with the given initial elements. all 16 of them. you feed her the numbers, she becomes the numbers. β¨
SbDPMatrix::SbDPMatrix (const SbDPMat & matrixref)
constructs a matrix instance with the initial elements from the matrix argument. she's copying her bestie's whole look. π
SbDPMatrix::SbDPMatrix (const SbDPMat * matrixptr)
this constructor is courtesy of the Microsoft Visual C++ compiler. iykyk. π
SbDPMatrix::SbDPMatrix (const SbMatrix & matrixref)
this constructor converts a single-precision matrix to a double-precision matrix. glow-up complete. π
SbDPMatrix::~SbDPMatrix (void )
default destructor does nothing. she leaves the party without saying bye. π
void SbDPMatrix::setValue (const SbDPMatrix::setValue (const SbDPMat & m)
Copies the elements from m straight into the matrix. That's it, that's the whole job bestie π
- See also:
getValue().
void SbDPMatrix::setValue (const SbMatrix & m)
Same deal, different flavor β copies the elements from m into the matrix. Yes it takes an SbMatrix, no we're not gonna overthink it π¦
- See also:
getValue().
void SbDPMatrix::setValue (const double * m)
Yep, another one. Copies the elements from m into the matrix, this time from a raw double *. Iconic overload behavior, lowkey.
- See also:
getValue().
const SbDPMat & SbDPMatrix::getValue (void ) const
Hands you back a pointer to the 2 dimensional double array holding the matrix elements. It's giving "here's my whole soul, in array form" π«Ά
- See also:
setValue().
void SbDPMatrix::makeIdentity (void )
Sets the matrix to be the identity matrix. The glow-up where every matrix wants to end up.
- See also:
identity().
void SbDPMatrix::setRotate (const SbDPRotation & q)
Sets the matrix to be a rotation matrix with the given rotation q. Spin era β¨
- See also:
setTranslate(),setScale().
SbDPMatrix SbDPMatrix::inverse (void ) const
Returns a new matrix which is the inverse matrix of this one. Not an in-place thing, a whole new baby.
β οΈ Bestie, listen. You are the one responsible for checking that this is a valid operation to execute, by first making sure the result of SbDPMatrix::det4() is not equal to zero. Do not skip the vibe check. Do not pass go.
double SbDPMatrix::det3 (int r1, int r2, int r3, int c1, int c2, int c3) const
Returns the determinant of the 3x3 submatrix specified by the row and column indices. Pick your rows, pick your columns, get a number π«
double SbDPMatrix::det3 (void ) const
Returns the determinant of the upper left 3x3 submatrix. Same energy, no arguments needed.
double SbDPMatrix::det4 (void ) const
Returns the determinant of the whole entire matrix. The big one π
SbBool SbDPMatrix::equals (const SbDPMatrix & m, double tolerance) const
Checks if the m matrix is equal to this one, within the given tolerance value. The tolerance gets applied in the comparison on a component by component basis β so no, it's not just one big fuzzy blanket, it's per-element.
void SbDPMatrix::getValue (SbDPMat & m) const
Returns the matrix components inside the SbDPMat structure. Fill-in-the-blank style, except the blank is your struct.
- See also:
setValue().
SbDPMatrix SbDPMatrix::identity (void ) [static]
Returns the identity matrix. Static, so you don't even need an instance to get one. Self-sufficient queen π
- See also:
makeIdentity().
void SbDPMatrix::setScale (const double s)
Sets the matrix to be a pure scaling matrix. Scale factors are specified by s β one number, uniform glow-up.
- See also:
setRotate(),setTranslate().
void SbDPMatrix::setScale (const SbVec3d & s)
Sets the matrix to be a pure scaling matrix. Scale factors in x, y and z are specified by the s vector. Stretch in all directions, no cap.
- See also:
setRotate(),setTranslate().
void SbDPMatrix::setTranslate (const SbVec3d & t)
Makes this matrix into a pure translation matrix β no scale, no rotation components, just movement β with the given vector t as the translation. It's giving "we're just here to slide" π¦
- See also:
setRotate(),setScale().
void SbDPMatrix::setTransform (const SbVec3d & t, const SbDPRotation & r, const SbVec3d & s)
Sets translation, rotation and scaling all at once. The resulting matrix gets calculated like this:
M = S * R * T
where S, R and T is scaling, rotation and translation matrices.
- See also:
setTranslate(),setRotate(),setScale()andgetTransform().
void SbDPMatrix::setTransform (const SbVec3d & t, const SbDPRotation & r, const SbVec3d & s, const SbDPRotation & so)
Sets translation, rotation and scaling all at once, but with a specified scale orientation. The resulting matrix gets calculated like this:
M = Ro^-1 * S * Ro * R * T
where Ro is the scale orientation, and S, R and T is scaling, rotation and translation.
- See also:
setTranslate(),setRotate(),setScale()andgetTransform().
void SbDPMatrix::setTransform (const SbVec3d & translation, const SbDPRotation & rotation, const SbVec3d & scaleFactor, const SbDPRotation & scaleOrientation, const SbVec3d & center)
Sets translation, rotation and scaling all at once with a specified scale orientation and a center point. The resulting matrix gets calculated like this:
M = -Tc * Ro^-1 * S * Ro * R * T * Tc
where Tc is the center point, Ro the scale orientation, S, R and T is scaling, rotation and translation.
- See also:
setTranslate(),setRotate(),setScale()andgetTransform().
void SbDPMatrix::getTransform (SbVec3d & t, SbDPRotation & r, SbVec3d & s, SbDPRotation & so) const
Factors the matrix back into its translation, rotation, scale and scale orientation components. Reverse engineering the whole lewk, fr fr.
- See also:
factor()
void SbDPMatrix::getTransform (SbVec3d & translation, SbDPRotation & rotation, SbVec3d & scaleFactor, SbDPRotation & scaleOrientation, const SbVec3d & center) const
Factors the matrix back into its translation, rotation, scaleFactor and scaleorientation components. Will eliminate the center variable from the matrix β so that center is gone-gone after this.
- See also:
factor()
SbBool SbDPMatrix::factor (SbDPMatrix & r, SbVec3d & s, SbDPMatrix & u, SbVec3d & t, SbDPMatrix & proj)
π This function is not implemented in Coin. It simply does not exist in practice. Do not come for me, I'm just the messenger.
- See also:
getTransform()
SbBool SbDPMatrix::LUDecomposition (int index[4], double & d)
This function produces a permuted LU decomposition of the matrix. It uses the common single-row-pivoting strategy.
FALSE is returned if the matrix is singular β which it never is, because of small adjustment values inserted if a singularity is found (as Open Inventor does too). So like, it says it can happen, and then says it never happens. We love consistency π
The parity argument is always set to 1.0 or -1.0. Don't really know what it's for, so it's not checked for correctness. (The source code said that, not me. Honesty is the vibe.)
The index[] argument returns the permutation that was done on the matrix to LU-decompose it. index[i] is the row that row i was swapped with at step i in the decomposition, so index[] is not the actual permutation of the row indexes! Careful bestie, it's a trap π
π BUGS: The function does not produce results that are numerically identical with those produced by Open Inventor for the same matrices, because the pivoting strategy in OI was never fully understood.
- See also:
SbDPMatrix::LUBackSubstitution
void SbDPMatrix::LUBackSubstitution (int index[4], double b[4]) const
This function does a solve on the "Ax = b" system, given that the matrix is LU-decomposed in advance. First, a forward substitution is done on the lower system (Ly = b), and then a backwards substitution is done on the upper triangular system (Ux = y). Two steps, one slay β¨
The index[] argument is the one returned from SbDPMatrix::LUDecomposition(), so see that function for an explanation.
The b[] argument must contain the b vector in "Ax = b" when calling the function. After the function has solved the system, the b[] vector contains the x vector. It literally transforms in place, main character energy.
π BUGS: As is done by Open Inventor, unsolvablexvalues will not returnNaNbut0. So if your math is broken, you get a sneaky zero instead of a loud scream. π
SbDPMatrix SbDPMatrix::transpose (void ) const
Returns the transpose of this matrix. Flip it and reverse it π¦
SbDPMatrix & SbDPMatrix::multRight (const SbDPMatrix & m)
Lets this matrix be right-multiplied by m. Returns a reference to self.
- See also:
multLeft()
SbDPMatrix & SbDPMatrix::multLeft (const SbDPMatrix & m)
Lets this matrix be left-multiplied by m. Returns a reference to self.
- See also:
multRight()
void SbDPMatrix::multMatrixVec (const SbVec3d & src, SbVec3d & dst) const
Multiplies the src vector with this matrix and returns the result in dst. Multiplication is done with the vector on the right side of the expression, i.e. dst = M * src.
- See also:
multVecMatrix(),multDirMatrix()andmultLineMatrix().
void SbDPMatrix::multVecMatrix (const SbVec3d & src, SbVec3d & dst) const
Multiplies the src vector with this matrix and returns the result in dst. Multiplication is done with the vector on the left side of the expression, i.e. dst = src * M.
It is safe to let src and dst be the same SbVec3d instance. Same object? Fine. No drama π«Ά
- See also:
multMatrixVec(),multDirMatrix()andmultLineMatrix().
void SbDPMatrix::multDirMatrix (const SbVec3d & src, SbVec3d & dst) const
Multiplies src by the matrix. src is assumed to be a direction vector, and the translation components of the matrix are therefore ignored. Directions don't move, they just point, periodt.
Multiplication is done with the vector on the left side of the expression, i.e. dst = src * M.
- See also:
multVecMatrix(),multMatrixVec()andmultLineMatrix().
void SbDPMatrix::multLineMatrix (const SbDPLine & src, SbDPLine & dst) const
Multiplies the line point with the full matrix, and multiplies the line direction with the matrix without the translation components. Two different treatments for two different parts of the same line. It's giving split personality but make it math π
- See also:
multVecMatrix(),multMatrixVec()andmultDirMatrix().
void SbDPMatrix::multVecMatrix (const SbVec4d & src, SbVec4d & dst) const
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. That's it, that's the whole note πΈ
void SbDPMatrix::print (FILE * fp) const
Writes out the matrix contents to the given file. For when you need to see the receipts π§Ύ
SbDPMatrix::operator double * (void )
Returns a pointer to the matrix' 4x4 double array. Raw access, no filter.
SbDPMatrix::operator SbDPMat & (void )
Returns a pointer to the matrix' 4x4 double array. Yes, same description, that's genuinely what it says, we're not editing the lore.
double * SbDPMatrix::operator[] (int i)
Returns a pointer to the 4 element array representing a matrix row. i should be within [0, 3] β stay in your lane, bestie, there are only four.
- See also:
getValue(),setValue().
const double * SbDPMatrix::operator[] (int i) const
Returns a pointer to the 4 element array representing a matrix row. i should be within [0, 3]. Const version, so read-only vibes only.
- See also:
getValue(),setValue().
SbDPMatrix & SbDPMatrix::operator= (const SbDPMat & m)
Assignment operator. Copies the elements from m to the matrix. Sliding into your DMs but it's a struct.
SbDPMatrix & SbDPMatrix::operator= (const SbDPMatrix & m)
Assignment operator. Copies the elements from m to the matrix. Matrix to matrix, the classic.
SbDPMatrix & SbDPMatrix::operator= (const SbDPRotation & q)
Sets the matrix to be a rotation matrix with the given rotation. Different right-hand side, different behavior β careful with that β¨
- See also:
setRotate().
SbDPMatrix & SbDPMatrix::operator*= (const SbDPMatrix & m)
Right-multiplies with the m matrix. Compound assignment, compound slay.
- See also:
multRight().
βοΈ Author βοΈ
Generated automatically by Doxygen for Coin from the source code. So like, nobody hand-wrote this, it's a robot's art and we respect the robot π«Ά
And that's the whole page, bestie!! π This was Version 4.0.10, dated Thu Jun 25 2026 00:00:00, and you made it all the way to SbDPMatrix(3)'s footer with me. Go forth and multiply your matrices (correctly, with multRight()). 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