SoModelMatrixElement(3)

πŸ“¦
version 4.0.10 Β· 4 versions
, in fedora 43, fedora 44

✨ 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: SoModelMatrixElement does NOT contain the same matrix as the OpenGL GL_MODELVIEW matrix. 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 SoType object 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 SoType object. 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 modelMatrix is the identity matrix πŸ’–
  • Reimplemented from SoAccumulatedElement.
  • Reimplemented in SoBBoxModelMatrixElement, and SoGLModelMatrixElement.

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 indirectly SoElement::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 using SoElement::getNextInStack().
  • Reimplemented from SoAccumulatedElement.
  • Reimplemented in SoBBoxModelMatrixElement, and SoGLModelMatrixElement.

matches ✨ [virtual]

SbBool SoModelMatrixElement::matches (const SoElement * element) const
  • This function returns TRUE if 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 a copyMatchInfo() 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 matrix into 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 translation to the model matrix. scoot scoot πŸ¦‹

rotateBy ✨ [static]

void SoModelMatrixElement::rotateBy (SoState *const state, SoNode *const node,
    const SbRotation & rotation)
  • Appends rotation to the model matrix. spin it, twist it, slay it πŸ”₯

scaleBy ✨ [static]

void SoModelMatrixElement::scaleBy (SoState *const state, SoNode *const node,
    const SbVec3f & scaleFactor)
  • Appends scaleFactor to the model matrix. big mood, literally πŸ“

pushMatrix ✨ [static]

SbMatrix SoModelMatrixElement::pushMatrix (SoState *const state)
  • Used by SoTransformSeparator to 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 SoTransformSeparator to 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 isIdentity to TRUE if 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, and SoGLModelMatrixElement.

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 to matrix.
  • Reimplemented in SoBBoxModelMatrixElement, and SoGLModelMatrixElement.

multElt ✨ [protected], [virtual]

void SoModelMatrixElement::multElt (const SbMatrix & matrix)
  • A virtual method which is called from the static method mult(). it multiplies matrix into the element model matrix.
  • Reimplemented in SoBBoxModelMatrixElement, and SoGLModelMatrixElement.

translateEltBy ✨ [protected], [virtual]

void SoModelMatrixElement::translateEltBy (const SbVec3f & translation)
  • A virtual method which is called from the static method translateBy(). it appends translation to the element model matrix.
  • Reimplemented in SoBBoxModelMatrixElement, and SoGLModelMatrixElement.

rotateEltBy ✨ [protected], [virtual]

void SoModelMatrixElement::rotateEltBy (const SbRotation & rotation)
  • A virtual method which is called from the static method rotateBy(). it appends rotation to the element model matrix.
  • Reimplemented in SoBBoxModelMatrixElement, and SoGLModelMatrixElement.

scaleEltBy ✨ [protected], [virtual]

void SoModelMatrixElement::scaleEltBy (const SbVec3f & scaleFactor)
  • A virtual method which is called from the static method scaleBy(). it appends scaleFactor to the element model matrix.
  • Reimplemented in SoBBoxModelMatrixElement, and SoGLModelMatrixElement.

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, and SoGLModelMatrixElement.

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 from pushMatrix().
  • Reimplemented in SoBBoxModelMatrixElement, and SoGLModelMatrixElement.

πŸŽ€ 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