SbDPMatrix(3)
β¨ NAME β¨
SbDPMatrix β bestie, it's the SbDPMatrix class, aka a 4x4 dimensional representation of a double-precision matrix π
πΈ 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)SbDPMatrix & operator= (const SbDPMat &m)operator double * (void)SbDPMatrix & operator= (const SbDPMatrix &m)void setValue (const SbDPMat &m)const SbDPMat & getValue (void) constvoid makeIdentity (void)void setRotate (const SbDPRotation &q)SbDPMatrix inverse (void) constdouble det3 (int r1, int r2, int r3, int c1, int c2, int c3) constdouble det3 (void) constdouble det4 (void) constSbBool equals (const SbDPMatrix &m, double tolerance) constoperator SbDPMat & (void)double * operator[] (int i)const double * operator[] (int i) constSbDPMatrix & operator= (const SbDPRotation &q)SbDPMatrix & operator*= (const SbDPMatrix &m)void getValue (SbDPMat &m) constvoid 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) constvoid getTransform (SbVec3d &translation, SbDPRotation &rotation, SbVec3d &scaleFactor, SbDPRotation &scaleOrientation, const SbVec3d ¢er) constSbBool 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]) constSbDPMatrix transpose (void) constSbDPMatrix & multRight (const SbDPMatrix &m)SbDPMatrix & multLeft (const SbDPMatrix &m)void multMatrixVec (const SbVec3d &src, SbVec3d &dst) constvoid multVecMatrix (const SbVec3d &src, SbVec3d &dst) constvoid multDirMatrix (const SbVec3d &src, SbVec3d &dst) constvoid multLineMatrix (const SbDPLine &src, SbDPLine &dst) constvoid multVecMatrix (const SbVec4d &src, SbVec4d &dst) constvoid print (FILE *fp) const
β Static Public Member Functions
static SbDPMatrix identity (void)
π«Ά Friends
SbDPMatrix operator* (const SbDPMatrix &m1, const SbDPMatrix &m2)int operator== (const SbDPMatrix &m1, const SbDPMatrix &m2)int operator!= (const SbDPMatrix &m1, const SbDPMatrix &m2)
π Detailed Description
So the SbDPMatrix class is a 4x4 dimensional representation of a double-precision matrix. Iconic, honestly. π
It's giving the same energy as the SbMatrix class, except β plot twist β it uses double-precision floating point values for its elements instead. If you want the full class documentation tea, go read up on SbMatrix. π¦
Since
Coin 2.0. yes bestie, it's been around π
π Constructor & Destructor Documentation
SbDPMatrix::SbDPMatrix (void )
The default constructor literally does nothing. That's it, that's the whole vibe. The matrix will be uninitialized β so like, don't come crying to me when it's full of garbage, ok? π
Referenced by equals(), factor(), getTransform(), identity(), inverse(), multLeft(), multRight(), operator!=, operator*, operator*=(), operator=(), operator==, setTransform(), setTransform(), setTransform(), and transpose().
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 sixteen of them, bestie, count 'em. π
References setValue().
SbDPMatrix::SbDPMatrix (const SbDPMat & matrixref)
Constructs a matrix instance with the initial elements from the matrix argument. Copy-paste but make it classy. β¨
References setValue().
SbDPMatrix::SbDPMatrix (const SbDPMat * matrixptr)
This constructor is courtesy of the Microsoft Visual C++ compiler. literally just doing MSVC a solid, no big deal π«Ά
References setValue().
SbDPMatrix::SbDPMatrix (const SbMatrix & matrixref)
This constructor converts a single-precision matrix to a double-precision matrix. glow-up arc complete πΈ
References setValue().
SbDPMatrix::~SbDPMatrix (void )
Default destructor does nothing. She simply leaves. π
π Member Function Documentation
SbDPMatrix & SbDPMatrix::operator= (const SbDPMat & m)
Assignment operator. Copies the elements from m to the matrix.
References setValue().
SbDPMatrix::operator double * (void )
Return pointer to the matrix' 4x4 double array. raw pointer moment, handle with care π
SbDPMatrix & SbDPMatrix::operator= (const SbDPMatrix & m)
Assignment operator. Copies the elements from m to the matrix.
References SbDPMatrix(), and setValue().
void SbDPMatrix::setValue (const SbDPMat & m)
Copies the elements from m into the matrix.
See also
getValue().
Referenced by operator=(), operator=(), SbDPMatrix(), SbDPMatrix(), SbDPMatrix(), and SbDPMatrix().
const SbDPMat & SbDPMatrix::getValue (void ) const
Returns a pointer to the 2 dimensional double array with the matrix elements.
See also
setValue().
void SbDPMatrix::makeIdentity (void )
Set the matrix to be the identity matrix. she's everything and nothing all at once π
See also
identity().
Referenced by setScale(), setScale(), and setTranslate().
void SbDPMatrix::setRotate (const SbDPRotation & q)
Set matrix to be a rotation matrix with the given rotation. spin spin spin π«
See also
setTranslate(), setScale().
Referenced by operator=(), setTransform(), setTransform(), and setTransform().
SbDPMatrix SbDPMatrix::inverse (void ) const
Return a new matrix which is the inverse matrix of this.
β οΈ bestie the user is responsible for checking that this is a valid operation to execute β by first making sure that the result of SbDPMatrix::det4() is not equal to zero. no cap, do the check or perish π
References SbMatrix::identity(), SoDebugError::postWarning(), and SbDPMatrix().
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. you pick the rows (r1, r2, r3) and the columns (c1, c2, c3), she does the math π₯
References SoDebugError::post().
Referenced by SbXfBox3d::getVolume().
double SbDPMatrix::det3 (void ) const
Returns the determinant of the upper left 3x3 submatrix. the little corner submatrix getting its own moment π
References det3().
Referenced by det3(), and det4().
double SbDPMatrix::det4 (void ) const
Returns the determinant of the matrix. the whole thing, all four-by-four of her β¨
References det3().
SbBool SbDPMatrix::equals (const SbDPMatrix & m, double tolerance) const
Check if the m matrix is equal to this one, within the given tolerance value. The tolerance value is applied in the comparison on a component by component basis. so like, close enough counts, but only as close as you said π
References SoDebugError::postWarning(), and SbDPMatrix().
SbDPMatrix::operator SbDPMat & (void )
Return pointer to the matrix' 4x4 double array.
double * SbDPMatrix::operator[] (int i)
Returns pointer to the 4 element array representing a matrix row. i should be within [0, 3]. stay in range bestie, don't be chaotic π
See also
getValue(), setValue().
References SoDebugError::post().
const double * SbDPMatrix::operator[] (int i) const
Returns pointer to the 4 element array representing a matrix row. i should be within [0, 3].
See also
getValue(), setValue().
References SoDebugError::postWarning().
SbDPMatrix & SbDPMatrix::operator= (const SbDPRotation & q)
Set matrix to be a rotation matrix with the given rotation.
See also
setRotate().
References setRotate().
SbDPMatrix & SbDPMatrix::operator*= (const SbDPMatrix & m)
Right-multiply with the m matrix.
See also
multRight().
References multRight(), and SbDPMatrix().
void SbDPMatrix::getValue (SbDPMat & m) const
Return matrix components in the SbDPMat structure.
See also
setValue().
SbDPMatrix SbDPMatrix::identity (void ) [static]
Return the identity matrix.
See also
makeIdentity().
References SbDPMatrix().
Referenced by SbXfBox3d::intersect().
void SbDPMatrix::setScale (const double s)
Set matrix to be a pure scaling matrix. Scale factors are specified by s. no rotation, no translation, just vibes and size π
See also
setRotate(), setTranslate().
References makeIdentity().
Referenced by setTransform(), setTransform(), and setTransform().
void SbDPMatrix::setScale (const SbVec3d & s)
Set matrix to be a pure scaling matrix. Scale factors in x, y and z is specified by the s vector. three numbers, three directions, slay π
See also
setRotate(), setTranslate().
References makeIdentity().
void SbDPMatrix::setTranslate (const SbVec3d & t)
Make this matrix into a pure translation matrix (no scale or rotation components) with the given vector \t as the translation.
See also
setRotate(), setScale().
References makeIdentity().
Referenced by getTransform(), setTransform(), setTransform(), and setTransform().
void SbDPMatrix::setTransform (const SbVec3d & t, const SbDPRotation & r, const SbVec3d & s)
Set 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. one call, whole transform, obsessed π
See also
setTranslate(), setRotate(), setScale() and getTransform().
References multRight(), SbDPMatrix(), setRotate(), setScale(), and setTranslate().
void SbDPMatrix::setTransform (const SbVec3d & t, const SbDPRotation & r, const SbVec3d & s, const SbDPRotation & so)
Set translation, rotation and scaling all at once with a specified scale orientation. The resulting matrix gets calculated like this:
M = Ro-ΒΉ * 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() and getTransform().
References multRight(), SbDPMatrix(), setRotate(), setScale(), and setTranslate().
void SbDPMatrix::setTransform (const SbVec3d & translation, const SbDPRotation & rotation, const SbVec3d & scaleFactor, const SbDPRotation & scaleOrientation, const SbVec3d & center)
Set translation, rotation and scaling all at once with a specified scale orientation and center point. The resulting matrix gets calculated like this:
M = -Tc * Ro-ΒΉ * 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() and getTransform().
References:multRight(),SbDPMatrix(),setRotate(),setScale(), andsetTranslate().
void SbDPMatrix::getTransform (SbVec3d & t, SbDPRotation & r, SbVec3d & s, SbDPRotation & so) const
Okay bestie, this one factors the matrix back into its translation, rotation, scale and scaleorientation components. It's literally the reverse-engineering queen. π
See also:factor()Referenced by:getTransform().
void SbDPMatrix::getTransform (SbVec3d & translation, SbDPRotation & rotation, SbVec3d & scaleFactor, SbDPRotation & scaleOrientation, const SbVec3d & center) const
Same vibe, but this one factors into translation, rotation, scaleFactor and scaleorientation components. And get this: it will eliminate the center variable from the matrix. No center left behind, periodt.
See also:factor()References:getTransform(),multLeft(),multRight(),SbDPMatrix(), andsetTranslate().
SbBool SbDPMatrix::factor (SbDPMatrix & r, SbVec3d & s, SbDPMatrix & u, SbVec3d & t, SbDPMatrix & proj)
Not me finding out this function is not implemented in Coin π. It's giving "coming soon" but never coming. fr fr.
See also:getTransform()References:SbDPMatrix(). Referenced by:LUDecomposition().
SbBool SbDPMatrix::LUDecomposition (int index[4], double & d)
This one produces a permuted LU decomposition of the matrix. It uses the common single-row-pivoting strategy. Slay.
FALSE is returned if the matrix is singular, which it <em>never</em> is, because of small adjustment values inserted if a singularity is found (as Open Inventor does too). So like, don't worry about it? π
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. (Mood.)
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! Read that twice, bestie.
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::LUBackSubstitutionReferences:factor().
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). It's giving math class but make it fashion. β¨
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. So it's like a glow-up for your array. π
BUGS: As is done by Open Inventor, unsolvablexvalues will not returnNaNbut0. So don't be surprised, okay?
SbDPMatrix SbDPMatrix::transpose (void ) const
Returns the transpose of this matrix. That's it. Iconic. π
References: SbDPMatrix().
SbDPMatrix & SbDPMatrix::multRight (const SbDPMatrix & m)
Let this matrix be right-multiplied by m. Returns reference to self. So it's like, "I'm changing but I'm still me." π
See also:multLeft()References:SbDPMatrix(). Referenced by:SbXfBox3d::extendBy(),getTransform(),operator*=(),setTransform(),setTransform(), andsetTransform().
SbDPMatrix & SbDPMatrix::multLeft (const SbDPMatrix & m)
Let this matrix be left-multiplied by m. Returns reference to self. Left side represent. β¨
See also:multRight()References:SbDPMatrix(). Referenced by:getTransform().
void SbDPMatrix::multMatrixVec (const SbVec3d & src, SbVec3d & dst) const
Multiply src vector with this matrix and return the result in dst. Multiplication is done with the vector on the right side of the expression, i.e. dst = M * src. So the matrix is on the left, the vector on the right. Math but make it cute. π
See also:multVecMatrix(),multDirMatrix()andmultLineMatrix().
void SbDPMatrix::multVecMatrix (const SbVec3d & src, SbVec3d & dst) const
Multiply src vector with this matrix and return the result in dst. Multiplication is done with the vector on the left side of the expression, i.e. dst = src * M. So the vector is on the left, matrix on the right. It's giving flipped. π
It is safe to let src and \dst be the same SbVec3d instance. So you can do the thing without making a whole new variable. Slay.
See also:multMatrixVec(),multDirMatrix()andmultLineMatrix(). Referenced by:SbXfBox3d::extendBy(),SbXfBox3d::extendBy(),SbXfBox3d::extendBy(),multLineMatrix(),SbBox3d::outside(), andSbBox3d::transform().
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. So if you're moving, this one doesn't care about where you are, only where you're going. π§
Multiplication is done with the vector on the left side of the expression, i.e. dst = src * M.
See also:multVecMatrix(),multMatrixVec()andmultLineMatrix(). Referenced by:multLineMatrix().
void SbDPMatrix::multLineMatrix (const SbDPLine & src, SbDPLine & dst) const
Multiplies line point with the full matrix and multiplies the line direction with the matrix without the translation components. So it's like, point gets the whole thing, direction gets the vibe only. π
See also:multVecMatrix(),multMatrixVec()andmultDirMatrix(). References:multDirMatrix(), andmultVecMatrix().
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. So same energy, different vector type. π
void SbDPMatrix::print (FILE * fp) const
Write out the matrix contents to the given file. So you can see all the numbers. Perfect for when you need receipts. π§Ύ
β¨ Friends And Related Symbol Documentation β¨
SbDPMatrix operator* (const SbDPMatrix & m1, const SbDPMatrix & m2) [friend]
Multiplies matrix m1 with matrix m2 and returns the resultant matrix. It's giving collaboration. π€
References: SbDPMatrix().
int operator== (const SbDPMatrix & m1, const SbDPMatrix & m2) [friend]
Compare matrices to see if they are equal. For two matrices to be equal, all their individual elements must be equal. So every single number has to match. No exceptions. π―
See also:equals(). References:SbDPMatrix().
int operator!= (const SbDPMatrix & m1, const SbDPMatrix & m2) [friend]
Compare matrices to see if they are not equal. For two matrices to not be equal, it is enough that at least one of their elements are unequal. So just one little difference and it's a no. π
See also:equals(). References:SbDPMatrix().
π Author
Generated automatically by Doxygen for Coin from the source code. So like, a robot wrote this but I made it cute. π€π
This page is from Coin, version 2.5.0, and it's all about SbDPMatrix(3). Byeee bestie! βοΈ
π¦ where this page comes from
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.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