SoModelMatrixElement(3)
β¨ NAME β¨
SoModelMatrixElement β bestie, this is the class that manages the current transformation. That's the whole job. That's the assignment. π
π¦ SYNOPSIS π¦
okay so first you gotta pull it in, no cap:
#include <Inventor/elements/SoModelMatrixElement.h>
It inherits from SoAccumulatedElement.
And it gets inherited by SoBBoxModelMatrixElement, and SoGLModelMatrixElement. The family tree is thriving fr fr π³
π Public Member Functions π
virtual void init (SoState *state)
virtual void push (SoState *state)
virtual SbBool matches (const SoElement *element) const
const SbMatrix & getModelMatrix (void) const
That's the lil core four right there. β¨
π Public Member Functions inherited from SoElement π
const SoType getTypeId (void) const
int getStackIndex (void) const
virtual void pop (SoState *state, const SoElement *prevTopElement)
void setDepth (const int depth)
int getDepth (void) const
virtual void print (FILE *file=stdout) const
virtual ~SoElement ()
πΈ Static Public Member Functions πΈ
static SoType getClassTypeId (void)
static int getClassStackIndex (void)
static void * createInstance (void)
static void initClass (void)
static void makeIdentity (SoState *const state, SoNode *const node)
static void set (SoState *const state, SoNode *const node, const SbMatrix &matrix)
static void setCullMatrix (SoState *state, SoNode *node, const SbMatrix &matrix)
static void mult (SoState *const state, SoNode *const node, const SbMatrix &matrix)
static void translateBy (SoState *const state, SoNode *const node, const SbVec3f &translation)
static void rotateBy (SoState *const state, SoNode *const node, const SbRotation &rotation)
static void scaleBy (SoState *const state, SoNode *const node, const SbVec3f &scaleFactor)
static SbMatrix pushMatrix (SoState *const state)
static void popMatrix (SoState *const state, const SbMatrix &matrix)
static const SbMatrix & getCombinedCullMatrix (SoState *const state)
static const SbMatrix & get (SoState *const state)
static const SbMatrix & get (SoState *const state, SbBool &isIdentity)
look at all these static besties. We got your identity-setters, your matrix-setters, your translate/rotate/scale squad, and a push/pop duo. Also two get overloads, because one was never gonna be enough, obviously. π«Ά
π§ Static Public Member Functions inherited from SoAccumulatedElement π§
static SoType getClassTypeId (void)
static int getClassStackIndex (void)
static void initClass (void)
π Static Public Member Functions inherited from SoElement π
static void initClass (void)
static SoType getClassTypeId (void)
static int getClassStackIndex (void)
static void initElements (void)
static int getNumStackIndices (void)
static SoType getIdFromStackIndex (const int stackIndex)
π Protected Member Functions π
virtual ~SoModelMatrixElement ()
virtual void makeEltIdentity (void)
virtual void setElt (const SbMatrix &matrix)
virtual void multElt (const SbMatrix &matrix)
virtual void translateEltBy (const SbVec3f &translation)
virtual void rotateEltBy (const SbRotation &rotation)
virtual void scaleEltBy (const SbVec3f &scaleFactor)
virtual SbMatrix pushMatrixElt (void)
virtual void popMatrixElt (const SbMatrix &matrix)
Note the Elt suffix β those are the ones doing the actual heavy lifting under the hood, iykyk. π
π¦ Protected Member Functions inherited from SoAccumulatedElement π¦
virtual ~SoAccumulatedElement ()
void clearNodeIds (void)
void addNodeId (const SoNode *const node)
void setNodeId (const SoNode *const node)
void copyNodeIds (const SoAccumulatedElement *copyfrom)
virtual SoElement * copyMatchInfo (void) const
virtual void captureThis (SoState *state) const
β Protected Member Functions inherited from SoElement β
SoElement (void)
void capture (SoState *const state) const
void setTypeId (const SoType typeId)
void setStackIndex (const int index)
SoElement * getNextInStack (void) const
SoElement * getNextFree (void) const
π Protected Attributes π
SbMatrix modelMatrix
SbMatrix cullMatrix
SbMatrix combinedMatrix
uint32_t flags
π Protected Attributes inherited from SoAccumulatedElement π
SbList< SbUniqueId > nodeIds
π Protected Attributes inherited from SoElement π
SoType typeId
int stackIndex
int depth
π₯ Additional Inherited Members π₯
π Static Protected Member Functions inherited from SoElement π
static SoElement * getElement (SoState *const state, const int stackIndex)
static const SoElement * getConstElement (SoState *const state, const int stackIndex)
static int createStackIndex (const SoType id)
π Static Protected Attributes inherited from SoElement π
static int classStackIndex
static SoTypeList * stackToType
π Detailed Description π
So SoModelMatrixElement is the class used to manage the current transformation. Periodt. β¨
It contains the object-to-world matrix. That's its whole thing, that's its moment, that's its main character arc. π«
The world-to-camera transformation is stored in the SoViewingMatrixElement class instead β different element, different vibe, don't mix them up bestie. π
β οΈ okay listen, this is the one that trips everybody:SoModelMatrixElementdoes NOT contain the same matrix as the OpenGLGL_MODELVIEWmatrix. Yes, really. The API is a lil confusing like that. It's giving "why is it like this" but it is like this, so. π
π See also π
SoViewingMatrixElement
π Constructor & Destructor Documentation π
πΈ SoModelMatrixElement::~SoModelMatrixElement (void ) [protected], [virtual] πΈ
Destructor. π The cleanup era. Byeeeee π
π MEMBER FUNCTION DOCUMENTATION π
ok bestie, deep breath, we're in the function-by-function zone now π«Ά this is where every single method gets its moment, so grab a snack and let's go. no skipping, we're doing all of them, periodt.
getClassTypeId β¨ [static]
SoType SoModelMatrixElement::getClassTypeId (void )
- This static method hands you the
SoTypeobject that's associated with objects of this class. that's it, that's the whole job. iconic behaviour, zero drama π
getClassStackIndex β¨ [static]
int SoModelMatrixElement::getClassStackIndex (void )
- This static method gives you the state stack index for the class. iykyk, it's the little number that tells the state machinery where your element lives in the stack πΈ
createInstance β¨ [static]
void * SoModelMatrixElement::createInstance (void )
- fair warning bestie: this API member is considered internal to the library, because it is not likely to be of interest to the application programmer. so like... not for you unless you're doing very specific wizardry π§
- What it does: creates a new instance of the class type corresponding to the
SoTypeobject. that's the whole vibe.
initClass β¨ [static]
void SoModelMatrixElement::initClass (void )
- Initializes the relevant common data for all instances, like the type system. the class-wide setup ritual, basically π
init β¨ [virtual]
void SoModelMatrixElement::init (SoState * state)
- Initializes the element to its default value. and the default value for
modelMatrixis the identity matrix π - Reimplemented from
SoAccumulatedElement. - Reimplemented in
SoBBoxModelMatrixElement, andSoGLModelMatrixElement.
push β¨ [virtual]
void SoModelMatrixElement::push (SoState * state)
- This method is called every time a new element is required in one of the stacks. when does that happen, you ask? when a writable element is requested, using
SoState::getElement()or indirectlySoElement::getElement(), and the depth of the current element is less than the state depth. boom,push()time π - Override this method if your element needs to copy data from the previous top of stack. the
push()method is called on the new element, and the previous element can be found usingSoElement::getNextInStack(). - Reimplemented from
SoAccumulatedElement. - Reimplemented in
SoBBoxModelMatrixElement, andSoGLModelMatrixElement.
matches β¨ [virtual]
SbBool SoModelMatrixElement::matches (const SoElement * element) const
- This function returns
TRUEif the element matches another element (of the same class), with respect to cache validity. (the original says "TRUE is the element matches", which is a lil typo situation, but you get it π) - Heads up: if the application programmer's extension element has a
matches()function, it should also have acopyMatchInfo()function. they're a package deal, fr fr. - Reimplemented from
SoAccumulatedElement.
makeIdentity β¨ [static]
void SoModelMatrixElement::makeIdentity (SoState *const state, SoNode *const node)
- Sets the current model matrix to the identity matrix. clean slate energy β¨
set β¨ [static]
void SoModelMatrixElement::set (SoState *const state, SoNode *const node,
const SbMatrix & matrix)
- Sets the current model matrix to
matrix. straightforward, we love her π«Ά
setCullMatrix β¨ [static]
void SoModelMatrixElement::setCullMatrix (SoState * state, SoNode * node,
const SbMatrix & matrix)
- Sets the current cull matrix. that's the assignment, bestie, no notes π
mult β¨ [static]
void SoModelMatrixElement::mult (SoState *const state, SoNode *const node,
const SbMatrix & matrix)
- Multiplies
matrixinto the model matrix. not replacing it, multiplying it in, okay? important distinction π
translateBy β¨ [static]
void SoModelMatrixElement::translateBy (SoState *const state, SoNode *const node,
const SbVec3f & translation)
- Appends
translationto the model matrix. scoot scoot π¦
rotateBy β¨ [static]
void SoModelMatrixElement::rotateBy (SoState *const state, SoNode *const node,
const SbRotation & rotation)
- Appends
rotationto the model matrix. spin it, twist it, slay it π₯
scaleBy β¨ [static]
void SoModelMatrixElement::scaleBy (SoState *const state, SoNode *const node,
const SbVec3f & scaleFactor)
- Appends
scaleFactorto the model matrix. big mood, literally π
pushMatrix β¨ [static]
SbMatrix SoModelMatrixElement::pushMatrix (SoState *const state)
- Used by
SoTransformSeparatorto store and restore the model matrix. - > Don't use it for any other reason. for real. it's not a general-purpose toy, it's a very specific favour for
SoTransformSeparatorπ
popMatrix β¨ [static]
void SoModelMatrixElement::popMatrix (SoState *const state, const SbMatrix & matrix)
- Also used by
SoTransformSeparatorto store and restore the model matrix. - > Don't use it for any other reason. same deal, same warning, same energy π«
getCombinedCullMatrix β¨ [static]
const SbMatrix & SoModelMatrixElement::getCombinedCullMatrix (SoState *const state)
- Returns the combined cull and model matrix. and good news: this matrix is cached, so it's not recomputing every single time like a hater π
get β¨ [static]
const SbMatrix & SoModelMatrixElement::get (SoState *const state)
- Returns the current model matrix. short, sweet, iconic β¨
get β¨ [static] β the two-argument edition
const SbMatrix & SoModelMatrixElement::get (SoState *const state, SbBool & isIdentity)
- Returns the current model matrix. also sets
isIdentitytoTRUEif the model matrix is known to be an identity matrix. two-for-one, we love efficiency π - (yes, it's the same name as the one above β overloading said "let me cook" π)
getModelMatrix β¨
const SbMatrix & SoModelMatrixElement::getModelMatrix (void ) const
- Returns the current model matrix. the non-static cousin, doing the exact same iconic thing but on the instance πΈ
makeEltIdentity β¨ [protected], [virtual]
void SoModelMatrixElement::makeEltIdentity (void )
- A virtual method which is called from the static method
makeIdentity(). it sets the element model matrix to identity. - Reimplemented in
SoBBoxModelMatrixElement, andSoGLModelMatrixElement.
setElt β¨ [protected], [virtual]
void SoModelMatrixElement::setElt (const SbMatrix & matrix)
- A virtual method which is called from the static method
set(). it sets the element model matrix tomatrix. - Reimplemented in
SoBBoxModelMatrixElement, andSoGLModelMatrixElement.
multElt β¨ [protected], [virtual]
void SoModelMatrixElement::multElt (const SbMatrix & matrix)
- A virtual method which is called from the static method
mult(). it multipliesmatrixinto the element model matrix. - Reimplemented in
SoBBoxModelMatrixElement, andSoGLModelMatrixElement.
translateEltBy β¨ [protected], [virtual]
void SoModelMatrixElement::translateEltBy (const SbVec3f & translation)
- A virtual method which is called from the static method
translateBy(). it appendstranslationto the element model matrix. - Reimplemented in
SoBBoxModelMatrixElement, andSoGLModelMatrixElement.
rotateEltBy β¨ [protected], [virtual]
void SoModelMatrixElement::rotateEltBy (const SbRotation & rotation)
- A virtual method which is called from the static method
rotateBy(). it appendsrotationto the element model matrix. - Reimplemented in
SoBBoxModelMatrixElement, andSoGLModelMatrixElement.
scaleEltBy β¨ [protected], [virtual]
void SoModelMatrixElement::scaleEltBy (const SbVec3f & scaleFactor)
- A virtual method which is called from the static method
scaleBy(). it appendsscaleFactorto the element model matrix. - Reimplemented in
SoBBoxModelMatrixElement, andSoGLModelMatrixElement.
pushMatrixElt β¨ [protected], [virtual]
SbMatrix SoModelMatrixElement::pushMatrixElt (void )
- A virtual method which is called from the static method
pushMatrix(). returns the current model matrix. - Reimplemented in
SoBBoxModelMatrixElement, andSoGLModelMatrixElement.
popMatrixElt β¨ [protected], [virtual]
void SoModelMatrixElement::popMatrixElt (const SbMatrix & matrix)
- A virtual method which is called from the static method
popMatrix(). restores the model matrix to the matrix returned frompushMatrix(). - Reimplemented in
SoBBoxModelMatrixElement, andSoGLModelMatrixElement.
π MEMBER DATA DOCUMENTATION π
the protected data members, aka the β¨vibesβ¨ behind the curtain. and honestly? the docs are just a promise, bestie π
modelMatrix [protected]
SbMatrix SoModelMatrixElement::modelMatrix
- FIXME: write doc. that's it. that's the doc. we move π
cullMatrix [protected]
SbMatrix SoModelMatrixElement::cullMatrix
- FIXME: write doc. same energy, no notes π«
combinedMatrix [protected]
SbMatrix SoModelMatrixElement::combinedMatrix
- FIXME: write doc. the trilogy continues π
flags [protected]
uint32_t SoModelMatrixElement::flags
- FIXME: write doc. and the fourth one, for the culture β
βοΈ AUTHOR βοΈ
Generated automatically by Doxygen for Coin from the source code. so if the prose feels a lil robotic in places... yeah, that's why, don't blame the humans π
and that's a wrap on part 2, bestie!! π you made it through every single member function and every single undocumented data member. main character energy fr fr π
this was Version 4.0.10, dated Thu Jun 25 2026 00:00:00, and you've been reading SoModelMatrixElement(3) the whole time. 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