SbMatrix(3)
๐ธ NAME ๐ธ
SbMatrix โ bestie, it's the 4x4 dimensional representation of a matrix ๐
(You're on page SbMatrix(3), straight out of the Library Functions Manual. You're in the right place, don't worry ๐ซถ)
โจ SYNOPSIS โจ
#include <Inventor/SbLinear.h>
๐ Public Member Functions
SbMatrix (void)
SbMatrix (const float a11, const float a12, const float a13, const float a14, const float a21, const float a22, const float a23, const float a24, const float a31, const float a32, const float a33, const float a34, const float a41, const float a42, const float a43, const float a44)
SbMatrix (const SbMat &matrix)
SbMatrix (const SbMat *matrix)
~SbMatrix (void)
SbMatrix & operator= (const SbMat &m)
operator float * (void)
SbMatrix & operator= (const SbMatrix &m)
void setValue (const SbMat &m)
const SbMat & getValue (void) const
void makeIdentity (void)
void setRotate (const SbRotation &q)
SbMatrix inverse (void) const
float det3 (int r1, int r2, int r3, int c1, int c2, int c3) const
float det3 (void) const
float det4 (void) const
SbBool equals (const SbMatrix &m, float tolerance) const
operator SbMat & (void)
float * operator[] (int i)
const float * operator[] (int i) const
SbMatrix & operator= (const SbRotation &q)
SbMatrix & operator*= (const SbMatrix &m)
void getValue (SbMat &m) const
void setScale (const float s)
void setScale (const SbVec3f &s)
void setTranslate (const SbVec3f &t)
void setTransform (const SbVec3f &t, const SbRotation &r, const SbVec3f &s)
void setTransform (const SbVec3f &t, const SbRotation &r, const SbVec3f &s, const SbRotation &so)
void setTransform (const SbVec3f &translation, const SbRotation &rotation, const SbVec3f &scaleFactor, const SbRotation &scaleOrientation, const SbVec3f ¢er)
void getTransform (SbVec3f &t, SbRotation &r, SbVec3f &s, SbRotation &so) const
void getTransform (SbVec3f &translation, SbRotation &rotation, SbVec3f &scaleFactor, SbRotation &scaleOrientation, const SbVec3f ¢er) const
SbBool factor (SbMatrix &r, SbVec3f &s, SbMatrix &u, SbVec3f &t, SbMatrix &proj)
SbBool LUDecomposition (int index[4], float &d)
void LUBackSubstitution (int index[4], float b[4]) const
SbMatrix transpose (void) const
SbMatrix & multRight (const SbMatrix &m)
SbMatrix & multLeft (const SbMatrix &m)
void multMatrixVec (const SbVec3f &src, SbVec3f &dst) const
void multVecMatrix (const SbVec3f &src, SbVec3f &dst) const
void multDirMatrix (const SbVec3f &src, SbVec3f &dst) const
void multLineMatrix (const SbLine &src, SbLine &dst) const
void multVecMatrix (const SbVec4f &src, SbVec4f &dst) const
void print (FILE *fp) const
๐ซ Static Public Member Functions
static SbMatrix identity (void)
๐ฆ Friends
SbMatrix operator* (const SbMatrix &m1, const SbMatrix &m2)
int operator== (const SbMatrix &m1, const SbMatrix &m2)
int operator!= (const SbMatrix &m1, const SbMatrix &m2)
๐ Detailed Description ๐
SbMatrix is a 4x4 dimensional representation of a matrix. That's the whole vibe ๐
SbMatrix is used by so many other classes in Coin, it's basically the popular girl. It provides storage for a 4x4 matrix of single-precision floating point values.
By definition, matrices in Coin should be set up in column-order mode. That's the same order as, say, OpenGL uses โ but heads up bestie, books on geometry often use the opposite row-order mode, and that can seriously confuse newcomers to the API ๐ญ
Another way to think of column-order matrices is that they use post-order multiplications: meaning, to concatenate a transformation from a second matrix with your current matrix, it should be multiplied on the right-hand side, i.e. with the SbMatrix::multRight() method.
If you have a matrix in row-order from some other source, it can be "converted" to column-order by transposing it with SbMatrix::transpose(). A simple example will help to explain this.
With row-order matrices, a transformation matrix with position, rotation and scale looks like this:
M = T * R * S
Where T is translation, R is rotation and S is the scale. What this means is that scale is applied first. The scaled matrix is then rotated, and finally the scaled and rotated matrix is translated. When using column-order matrices, as done in Coin, matrices are represented slightly differently; the order of multiplication is reversed:
M = S * R * T
The transformation is just the same as the row-order matrix. The only difference being the order of multiplication. To understand why this is so, consider the sample transformation:
M = T * R * S
Converting M from a row-order matrix to a column-order matrix is done as follows:
M^t = (T * R * S)^t
M^t = ((T * R) * S)^t
M^t = S^t * (T * R)^t
M^t = S^t * R^t * T^t
All left to be done is to remove the transpose symbols, and the matrices have been converted to column-order matrices:
M = S * R * T
This was done using the fact that:
A^t = (B * C)^t = C^t * B^t
Converting from column-order to row-order is done using the same principle. Periodt โจ
๐ Constructor & Destructor Documentation ๐
๐ง SbMatrix::SbMatrix (void )
The default constructor does nothing. Not a single thing. The matrix will be uninitialized โ so yeah, don't go reading it before you write to it, okay? ๐
Referenced by equals(), factor(), getTransform(), identity(), inverse(), multLeft(), multRight(), operator!=, operator*, operator*=(), operator=(), operator==, setTransform(), setTransform(), setTransform(), and transpose().
๐ง SbMatrix::SbMatrix (const float a11, const float a12, const float a13, const float a14, const float a21, const float a22, const float a23, const float a24, const float a31, const float a32, const float a33, const float a34, const float a41, const float a42, const float a43, const float a44)
Constructs a matrix instance with the given initial elements. All sixteen of them, no cap ๐
References setValue().
๐ง SbMatrix::SbMatrix (const SbMat & matrixref)
Constructs a matrix instance with the initial elements from the matrix argument. Copying the fit, iconic behavior ๐
References setValue().
๐ง SbMatrix::SbMatrix (const SbMat * matrixptr)
This constructor is courtesy of the Microsoft Visual C++ compiler. Yes, really. That's the whole reason it exists ๐ซถ
References setValue().
๐ง SbMatrix::~SbMatrix (void )
Default destructor does nothing. It simply exists, and honestly? Same energy ๐
๐ Member Function Documentation ๐
๐ฆ SbMatrix & SbMatrix::operator= (const SbMat & m)
Assignment operator. Copies the elements from m to the matrix.
References setValue().
๐ฆ SbMatrix::operator float * (void )
Return pointer to the matrix' 4x4 float array. Just handing you the keys to the whole thing ๐ฅ
๐ฆ SbMatrix & SbMatrix::operator= (const SbMatrix & m)
Assignment operator. Copies the elements from m to the matrix.
References SbMatrix(), and setValue().
๐ฆ void SbMatrix::setValue (const SbMat & m)
Copies the elements from m into the matrix.
See also getValue().
Referenced by operator=(), operator=(), SbMatrix(), SbMatrix(), and SbMatrix().
๐ฆ const SbMat & SbMatrix::getValue (void ) const
Returns a pointer to the 2 dimensional float array with the matrix elements.
See also setValue().
๐ฆ void SbMatrix::makeIdentity (void )
Set the matrix to be the identity matrix. The glow-up where the matrix becomes its true, most authentic self โจ
See also identity().
Referenced by SoResetTransform::getMatrix(), setScale(), setScale(), and setTranslate().
๐ฆ void SbMatrix::setRotate (const SbRotation & q)
Set matrix to be a rotation matrix with the given rotation.
See also setTranslate(), setScale().
References SbRotation::getValue().
Referenced by SoDragger::appendRotation(), SoTransform::getRotationSpaceMatrix(), SoVRMLTransform::getRotationSpaceMatrix(), SoTransform::getScaleSpaceMatrix(), SoVRMLTransform::getScaleSpaceMatrix(), SoTransform::getTranslationSpaceMatrix(), SoVRMLTransform::getTranslationSpaceMatrix(), SbRotation::multVec(), operator=(), setTransform(), setTransform(), setTransform(), SoCenterballDragger::transferCenterDraggerMotion(), and SoCenterballDragger::valueChangedCB().
๐ฆ SbMatrix SbMatrix::inverse (void ) const
Return a new matrix which is the inverse matrix of this one.
โ ๏ธ The user is responsible for checking that this is a valid operation to execute, by first making sure that the result of SbMatrix::det4() is not equal to zero. Bestie, please check. Do not skip the check ๐
References identity(), SoDebugError::postWarning(), and SbMatrix().
Referenced by SoDragger::appendRotation(), SoDragger::appendScale(), SoDragger::appendTranslation(), SoCamera::doAction(), SoVRMLProximitySensor::doAction(), SoGeoLocation::getMatrix(), SoGeoSeparator::getMatrix(), SoMatrixTransform::getMatrix(), SoTexture2Transform::getMatrix(), SoTexture3Transform::getMatrix(), SoTransform::getMatrix(), SoVRMLTextureTransform::getMatrix(), SoVRMLTransform::getMatrix(), SoTransform::getRotationSpaceMatrix(), SoVRMLTransform::getRotationSpaceMatrix(), SoTransform::getScaleSpaceMatrix(), SoVRMLTransform::getScaleSpaceMatrix(), SoTransform::getTranslationSpaceMatrix(), SoVRMLTransform::getTranslationSpaceMatrix(), SoAntiSquish::getUnsquishingMatrix(), SoCamera::GLRender(), SoVRMLDragSensor::handleEvent(), SbProjector::setWorkingSpace(), SoShape::shouldGLRender(), SbPlane::transform(), and SoCenterballDragger::valueChangedCB().
๐ฆ float SbMatrix::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), it does the math ๐งฎ
References SoDebugError::post().
Referenced by SbXfBox3f::getVolume().
๐ฆ float SbMatrix::det3 (void ) const
Returns the determinant of the upper left 3x3 submatrix.
References det3().
Referenced by det3(), and det4().
๐ฆ float SbMatrix::det4 (void ) const
Returns the determinant of the matrix.
References det3().
๐ฆ SbBool SbMatrix::equals (const SbMatrix & m, float 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 SbMatrix().
๐ฆ SbMatrix::operator SbMat & (void )
Return pointer to the matrix' 4x4 float array. Yes, the same energy as the other one โ this is the non-const-flavored pointer handoff ๐
๐ฆ float * SbMatrix::operator[] (int i)
Returns pointer to the 4 element array representing a matrix row. i should be within [0, 3].
See also getValue(), setValue().
References SoDebugError::post().
๐ฆ const float * SbMatrix::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().
๐ฆ SbMatrix & SbMatrix::operator= (const SbRotation & q)
Set matrix to be a rotation matrix with the given rotation.
See also setRotate().
References setRotate().
๐ฆ SbMatrix & SbMatrix::operator*= (const SbMatrix & m)
Right-multiply with the m matrix.
See also multRight().
References multRight(), and SbMatrix().
๐ฆ void SbMatrix::getValue (SbMat & m) const
Return matrix components in the SbMat structure.
See also setValue().
SbMatrix SbMatrix::identity (void ) [static]
Bestie. This one just hands you the identity matrix โจ like the "do nothing" matrix, the neutral element, the no thoughts head empty of transformations. It returns it, doesn't touch this. Iconic behaviour tbh.
See also: makeIdentity() โ that one does it to you, this one just gives you a fresh one. ๐
References: SbMatrix().
Referenced by: SoGetBoundingBoxAction::checkResetAfter(), SoGetBoundingBoxAction::checkResetBefore(), SoCamera::doAction(), SoMatrixTransform::doAction(), SoArray::getBoundingBox(), SoLevelOfDetail::getBoundingBox(), SoMultipleCopy::getBoundingBox(), SoVRMLGroup::getBoundingBox(), SoDragger::getLocalToWorldMatrix(), SoNurbsProfile::getVertices(), SoDragger::getWorldToLocalMatrix(), SoCamera::GLRender(), SbXfBox3f::intersect(), SbDPMatrix::inverse(), inverse(), setTransform(), setTransform(), setTransform(), SoCenterballDragger::SoCenterballDragger(), SoMatrixTransform::SoMatrixTransform(), SoMultipleCopy::SoMultipleCopy(), SoTransformVec3f::SoTransformVec3f(), and SoDragger::transferMotion().
void SbMatrix::setScale (const float s)
Glow-up time ๐
Turn this matrix into a pure scaling matrix. The scale factor gets specified by s โ one single float, applying everywhere.
See also: setRotate(), setTranslate().
References: makeIdentity().
Referenced by: SoDragger::appendScale(), SoScale::getMatrix(), SoSurroundScale::getMatrix(), SoUnits::getMatrix(), SoTransform::getRotationSpaceMatrix(), SoVRMLTransform::getRotationSpaceMatrix(), SoTransform::getScaleSpaceMatrix(), SoVRMLTransform::getScaleSpaceMatrix(), SoTransform::getTranslationSpaceMatrix(), SoVRMLTransform::getTranslationSpaceMatrix(), setTransform(), setTransform(), setTransform(), and SoClipPlaneManip::setValue().
void SbMatrix::setScale (const SbVec3f & s)
Same vibe as above but per-axis ๐ฆ โ pure scaling matrix again, except the scale factors for x, y and z are specified by the s vector. Yes bestie, non-uniform scaling, we love to see it.
See also: setRotate(), setTranslate().
References: makeIdentity().
void SbMatrix::setTranslate (const SbVec3f & t)
Make this matrix into a pure translation matrix โ and I mean pure, no scale, no rotation components, nothing else invited to the party. The vector \t becomes the translation. Periodt. โจ
See also: setRotate(), setScale().
References: makeIdentity().
Referenced by: SoDragger::appendRotation(), SoDragger::appendScale(), SoDragger::appendTranslation(), SoCenterballDragger::fieldSensorCB(), SbProjector::findVanishingDistance(), SoArray::getBoundingBox(), SoSurroundScale::getMatrix(), SoTranslation::getMatrix(), SoTransform::getRotationSpaceMatrix(), SoVRMLTransform::getRotationSpaceMatrix(), SoTransform::getScaleSpaceMatrix(), SoVRMLTransform::getScaleSpaceMatrix(), getTransform(), SoTransform::getTranslationSpaceMatrix(), SoVRMLTransform::getTranslationSpaceMatrix(), SoCamera::GLRender(), setTransform(), setTransform(), setTransform(), SoCenterballDragger::transferCenterDraggerMotion(), and SoCenterballDragger::valueChangedCB().
void SbMatrix::setTransform (const SbVec3f & t, const SbRotation & r, const SbVec3f & s)
Set translation, rotation and scaling all at once ๐ฅ one call, three jobs, main character energy. 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() and getTransform().
References: identity(), SbRotation::identity(), multRight(), SbMatrix(), setRotate(), setScale(), and setTranslate().
Referenced by: SoDragger::appendScale(), SoTexture3Transform::doAction(), SoTransform::doAction(), SoClipPlaneManip::fieldSensorCB(), SoDirectionalLightManip::fieldSensorCB(), SoRotateCylindricalDragger::fieldSensorCB(), SoRotateDiscDragger::fieldSensorCB(), SoRotateSphericalDragger::fieldSensorCB(), SoScale1Dragger::fieldSensorCB(), SoScale2Dragger::fieldSensorCB(), SoScale2UniformDragger::fieldSensorCB(), SoScaleUniformDragger::fieldSensorCB(), SoSpotLightManip::fieldSensorCB(), SoTransformManip::fieldSensorCB(), SoTexture3Transform::getMatrix(), SoTransform::getMatrix(), SoVRMLTransform::getMatrix(), SoAntiSquish::getUnsquishingMatrix(), SoTexture3Transform::GLRender(), SoTransform::multLeft(), SoVRMLTransform::multLeft(), SoTransform::multRight(), SoVRMLTransform::multRight(), SoTransform::recenter(), SoVRMLTransform::recenter(), and SoDragger::workValuesIntoTransform().
void SbMatrix::setTransform (const SbVec3f & t, const SbRotation & r, const SbVec3f & s, const SbRotation & so)
Okay so this is the same "all at once" slay but now 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: identity(), SbRotation::identity(), SbRotation::inverse(), multRight(), SbMatrix(), setRotate(), setScale(), and setTranslate().
void SbMatrix::setTransform (const SbVec3f & translation, const SbRotation & rotation, const SbVec3f & scaleFactor, const SbRotation & scaleOrientation, const SbVec3f & center)
The full five-argument edition, no crumbs ๐ โ 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-ยน * 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: identity(), SbRotation::identity(), SbRotation::inverse(), multRight(), SbMatrix(), setRotate(), setScale(), and setTranslate().
void SbMatrix::getTransform (SbVec3f & t, SbRotation & r, SbVec3f & s, SbRotation & so) const
The un-glow-up ๐ Factor the matrix back into its translation, rotation, scale and scaleorientation components. Everything you smushed in with setTransform(), handed back to you one piece at a time.
See also: factor()
Referenced by: SoDragger::appendScale(), SoCamera::audioRender(), SoTransformerDragger::dragFinish(), SoClipPlaneManip::fieldSensorCB(), SoDirectionalLightManip::fieldSensorCB(), SoRotateCylindricalDragger::fieldSensorCB(), SoRotateDiscDragger::fieldSensorCB(), SoRotateSphericalDragger::fieldSensorCB(), SoScale1Dragger::fieldSensorCB(), SoScale2Dragger::fieldSensorCB(), SoScale2UniformDragger::fieldSensorCB(), SoScaleUniformDragger::fieldSensorCB(), SoSpotLightManip::fieldSensorCB(), getTransform(), SoAntiSquish::getUnsquishingMatrix(), SoTabPlaneDragger::reallyAdjustScaleTabSize(), SoTransform::recenter(), SoVRMLTransform::recenter(), SoTransform::setMatrix(), SoVRMLTransform::setMatrix(), SoCenterballDragger::valueChangedCB(), SoDirectionalLightDragger::valueChangedCB(), SoHandleBoxDragger::valueChangedCB(), SoJackDragger::valueChangedCB(), SoRotateCylindricalDragger::valueChangedCB(), SoRotateDiscDragger::valueChangedCB(), SoRotateSphericalDragger::valueChangedCB(), SoScale1Dragger::valueChangedCB(), SoScale2Dragger::valueChangedCB(), SoScale2UniformDragger::valueChangedCB(), SoScaleUniformDragger::valueChangedCB(), SoSpotLightDragger::valueChangedCB(), SoSpotLightManip::valueChangedCB(), SoTabBoxDragger::valueChangedCB(), SoTrackballDragger::valueChangedCB(), SoTransformBoxDragger::valueChangedCB(), SoTransformerDragger::valueChangedCB(), SoTransformManip::valueChangedCB(), SoTranslate1Dragger::valueChangedCB(), and SoDragger::workValuesIntoTransform().
void SbMatrix::getTransform (SbVec3f & translation, SbRotation & rotation, SbVec3f & scaleFactor, SbRotation & scaleOrientation, const SbVec3f & center) const
Factor the matrix back into its translation, rotation, scaleFactor and scaleorientation components โ same deal as the other overload, except this one will eliminate the center variable from the matrix. So the center gets baked out, bestie. ๐ง
See also: factor()
References: getTransform(), multLeft(), multRight(), SbMatrix(), and setTranslate().
SbBool SbMatrix::factor (SbMatrix & r, SbVec3f & s, SbMatrix & u, SbVec3f & t, SbMatrix & proj)
Not me finding out this function is not implemented in Coin ๐ญ like at all. It exists, it's here, it does nothing. Do not build your dreams on it.
See also: getTransform()
References: SbMatrix().
Referenced by: LUDecomposition().
SbBool SbMatrix::LUDecomposition (int index[4], float & d)
This function produces a permuted LU decomposition of the matrix โจ and it uses the common single-row-pivoting strategy.
FALSE is returned if the matrix is singular โ which it never is, btw, because of small adjustment values inserted if a singularity is found (as Open Inventor does too). Sneaky little fudge numbers, love that for us.
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. (Real.)
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! ๐ซ
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: SbMatrix::LUBackSubstitution
References: factor().
void SbMatrix::LUBackSubstitution (int index[4], float 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 solve, we ate. ๐
The index[] argument is the one returned from SbMatrix::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. In-place glow-up ๐ฆ.
BUGS: As is done by Open Inventor, unsolvablexvalues will not returnNaNbut0. So if your math is cursed, you get a zero and not a warning. Beware.
SbMatrix SbMatrix::transpose (void ) const
Returns the transpose of this matrix. Rows and columns swapped, flipped like a pancake ๐ฅ, no notes.
References: SbMatrix().
Referenced by: SbPlane::transform().
SbMatrix & SbMatrix::multRight (const SbMatrix & m)
Let this matrix be right-multiplied by m. Returns reference to self โ so you can chain, bestie. Chain away. ๐ฅ
This is the most common multiplication / concatenation operation when using column-order matrices, as SbMatrix instances are, by definition. Iykyk.
See also: multLeft()
References: SbMatrix().
Referenced by (the whole friend group pulls up on this one ๐ ):
SoDragger::appendRotation()SoDragger::appendScale()SoDragger::appendTranslation()SoCamera::doAction()SbXfBox3f::extendBy()SoGetBoundingBoxAction::extendBy()SoGetBoundingBoxAction::extendBy()SoAntiSquish::getMatrix()SoGeoLocation::getMatrix()SoMatrixTransform::getMatrix()SoRotation::getMatrix()SoRotationXYZ::getMatrix()SoScale::getMatrix()SoSurroundScale::getMatrix()SoTexture2Transform::getMatrix()SoTexture3Transform::getMatrix()SoTransform::getMatrix()SoTranslation::getMatrix()SoUnits::getMatrix()SoVRMLTextureTransform::getMatrix()SoVRMLTransform::getMatrix()SoDragger::getPartToLocalMatrix()SoTransform::getRotationSpaceMatrix()SoVRMLTransform::getRotationSpaceMatrix()SoTransform::getScaleSpaceMatrix()SoVRMLTransform::getScaleSpaceMatrix()getTransform()SoTransform::getTranslationSpaceMatrix()SoVRMLTransform::getTranslationSpaceMatrix()SoAntiSquish::getUnsquishingMatrix()SoDragger::getWorldToLocalMatrix()SoCamera::GLRender()SoTransform::multRight()SoVRMLTransform::multRight()operator*=()SoGetBoundingBoxAction::setCenter()setTransform()setTransform()setTransform()SoDragger::transformMatrixLocalToWorld()SoDragger::transformMatrixToLocalSpace()SoDragger::transformMatrixWorldToLocal()SoCenterballDragger::valueChangedCB()
๐ SbMatrix & SbMatrix::multLeft (const SbMatrix & m)
Okay so this makes this matrix get left-multiplied by m. It returns a reference to self, so you can chain that thing if you want. ๐
Heads up bestie: it's way more common to useSbMatrix::multRight()when you're concatenating transformations, becauseSbMatrixinstances are by definition in column-order, and they use post-multiplication for common geometry operations. No cap.
See also: multRight()
References: SbMatrix()
Referenced by (another long list, she's popular):
SoDragger::appendRotation()SoDragger::appendScale()SoDragger::appendTranslation()SoDragger::getLocalToWorldMatrix()SoAntiSquish::getMatrix()SoGeoLocation::getMatrix()SoMatrixTransform::getMatrix()SoRotation::getMatrix()SoRotationXYZ::getMatrix()SoScale::getMatrix()SoSurroundScale::getMatrix()SoTexture2Transform::getMatrix()SoTexture3Transform::getMatrix()SoTransform::getMatrix()SoTranslation::getMatrix()SoUnits::getMatrix()SoVRMLTextureTransform::getMatrix()SoVRMLTransform::getMatrix()getTransform()SoTransform::multLeft()SoVRMLTransform::multLeft()SoTabPlaneDragger::reallyAdjustScaleTabSize()SoShape::shouldGLRender()SoDragger::transferMotion()SoDragger::transformMatrixLocalToWorld()SoDragger::transformMatrixToLocalSpace()SoDragger::transformMatrixWorldToLocal()SoCenterballDragger::valueChangedCB()
โจ void SbMatrix::multMatrixVec (const SbVec3f & src, SbVec3f & dst) const
Multiply the src vector with this matrix and drop the result into dst. The multiplication puts the vector on the right side of the expression, so it's literally dst = M * src. ๐ซ
Real talk: it's more common to useSbMatrix::multVecMatrix()when you're doing vector transformations, becauseSbMatrixinstances are by definition in column-order, and they use post-multiplication for common geometry operations.
See also: multVecMatrix(), multDirMatrix() and multLineMatrix().
๐ธ void SbMatrix::multVecMatrix (const SbVec3f & src, SbVec3f & dst) const
Multiply src vector with this matrix and return the result in dst. This time the vector is on the left side of the expression, so dst = src * M. ๐
It is safe to let src and dst be the same SbVec3f instance. So you can do the in-place glow-up. โจ
This method can be used (using the current model matrix) to transform a point from an object coordinate systems to the world coordinate system.
This operation is what you would usually do when transforming vectors, as SbMatrix instances are, by definition, column-order matrices.
See also: multMatrixVec(), multDirMatrix() and multLineMatrix().
Referenced by (okay she's literally everywhere):
SoVRMLProximitySensor::doAction()SoHandleBoxDragger::drag()SoRotateSphericalDragger::drag()SoTabPlaneDragger::drag()SoTrackballDragger::drag()SoTranslate2Dragger::drag()SoVRMLSphereSensor::drag()SoHandleBoxDragger::dragStart()SoRotateSphericalDragger::dragStart()SoTabPlaneDragger::dragStart()SoTrackballDragger::dragStart()SoTranslate2Dragger::dragStart()SoVRMLSphereSensor::dragStart()SbXfBox3f::extendBy()SbXfBox3f::extendBy()SbXfBox3f::extendBy()SoDragger::getLocalStartingPoint()SoPickedPoint::getObjectPoint()SoPickedPoint::getObjectTextureCoords()SoShape::getScreenSize()SoAntiSquish::getUnsquishingMatrix()SoMarkerSet::GLRender()SoText2::GLRender()SoVRMLDragSensor::handleEvent()SoVRMLTouchSensor::handleEvent()multLineMatrix()SbRotation::multVec()SbBox3f::outside()SbBox3i32::outside()SoTabPlaneDragger::reallyAdjustScaleTabSize()SoGetBoundingBoxAction::setCenter()SoCenterballDragger::transferCenterDraggerMotion()SbBox3f::transform()SbBox3i32::transform()SbPlane::transform()SoLOD::whichToTraverse()SoVRMLLOD::whichToTraverse()
๐ฆ void SbMatrix::multDirMatrix (const SbVec3f & src, SbVec3f & dst) const
Multiplies src by the matrix. src is assumed to be a direction vector, so the translation components of the matrix are therefore ignored. (Bye translation, you're not invited to this one. ๐)
Multiplication is done with the vector on the left side of the expression, so dst = src * M.
See also: multVecMatrix(), multMatrixVec() and multLineMatrix().
Referenced by:
SoPickedPoint::getObjectNormal()SoVRMLTouchSensor::handleEvent()multLineMatrix()SbPlane::transform()SoDirectionalLightManip::valueChangedCB()SoSpotLightManip::valueChangedCB()
๐ void SbMatrix::multLineMatrix (const SbLine & src, SbLine & dst) const
Multiplies the line point with the full matrix, and multiplies the line direction with the matrix without the translation components. So the point gets the whole vibe, and the direction only gets the rotation/scale part. ๐
See also: multVecMatrix(), multMatrixVec() and multDirMatrix().
References: SbLine::getDirection(), SbLine::getPosition(), multDirMatrix(), multVecMatrix(), and SbLine::setValue().
โญ void SbMatrix::multVecMatrix (const SbVec4f & src, SbVec4f & 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 signature. โจ
๐จ๏ธ void SbMatrix::print (FILE * fp) const
Write out the matrix contents to the given file. Like, spill the tea to fp. ๐
Referenced by: SoTransformerDragger::dragFinish(), and SbXfBox3f::print().
๐ค FRIENDS AND RELATED SYMBOL DOCUMENTATION ๐ค
๐ SbMatrix operator* (const SbMatrix & m1, const SbMatrix & m2) [friend]
Multiplies matrix m1 with matrix m2 and returns the resultant matrix. It's giving bestie collab. โจ
References: SbMatrix().
๐ int operator== (const SbMatrix & m1, const SbMatrix & 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 element has to match, no exceptions. ๐
See also: equals().
References: SbMatrix().
๐ int operator!= (const SbMatrix & m1, const SbMatrix & 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 one little mismatch and it's over. ๐
See also: equals().
References: SbMatrix().
๐ AUTHOR ๐
Generated automatically by Doxygen for Coin from the source code.
That's the whole page, bestie! โจ This iconic manual page is from Coin Version 2.5.0, and it's SbMatrix(3). Now go slay those matrices. ๐
๐ซถ
๐ฆ 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