SOSFMATRIX(3iv)

πŸ’– SoSFMatrix πŸ’–

okay bestie, so this is a page from the SoSFMatrix(3IV) manual β€” yes the section number is literally 3IV, iconic, don't question it β€” and we're about to get into a field that holds a whole 4x4 matrix. yes. the entire grid. slay.


✨ NAME ✨

SoSFMatrix β€” a field containing a 4x4 matrix 🧊


🌸 INHERITS FROM 🌸

it's giving a whole family tree, periodt:

SoField > SoSField > SoSFMatrix


πŸ¦‹ SYNOPSIS πŸ¦‹

first things first, you gotta include the header, no cap:

#include <Inventor/fields/SoSFMatrix.h>

πŸ’… Methods from class SoSFMatrix

void                setValue(float a11, float a12, float a13, float a14,
                         float a21, float a22, float a23, float a24, float
                         a31, float a32, float a33, float a34, float a41,
                         float a42, float a43, float a44)
static SoType       getClassTypeId()
virtual void        getTypeId() const
const SbMatrix &    getValue() const
const SbMatrix &    operator =(const SbMatrix & newValue)
void                setValue(const SbMatrix & newValue)
int                 operator ==(const SoSFMatrix &f) const
int                 operator !=(const SoSFMatrix &f) const

🫢 Methods from class SoField

(she inherited these, she didn't have to do a thing, main character energy fr fr)

void                setIgnored(SbBool ignore)
SbBool              isIgnored() const
SbBool              isDefault() const
virtual SbBool      isOfType(SoType type) const
SbBool              set(const char *valueString)
void                get(SbString &valueString)
void                touch()
SbBool              connectFrom(SoField *fromField)
SbBool              connectFrom(SoEngineOutput *fromEngine)
void                disconnect()
SbBool              isConnected() const
SbBool              isConnectedFromField() const
SbBool              getConnectedField(SoField *&writingField) const
SbBool              isConnectedFromEngine() const
SbBool              getConnectedEngine(SoEngineOutput *&engineOutput)
                         const
void                enableConnection(SbBool flag)
SbBool              isConnectionEnabled() const
int                 getForwardConnections(SoFieldList &list) const
SoFieldContainer *  getContainer() const

🌈 DESCRIPTION 🌈

so basically, this field holds a transformation matrix β€” an SbMatrix, to be exact. that's the whole vibe. πŸ’œ

when SoSFMatrix fields get written to a file, they show up as 16 floating point numbers separated by whitespace. sixteen!! like a little number army. πŸ“

for example, an identity matrix is written as:

1 0 0 0  0 1 0 0  0 0 1 0  0 0 0 1

look at her. perfect. symmetrical. the moment. ✨


πŸ‘‘ METHODS πŸ‘‘

πŸ’– void setValue(float a11, float a12, float a13, float a14, float a21, float a22, float a23, float a24, float a31, float a32, float a33, float a34, float a41, float a42, float a43, float a44)

sets this field to contain the matrix you build out of those 16 values. that's it, that's the job. πŸ’…

⭐ pro tip straight from the docs, bestie: if you're building a translation matrix, the x, y and z translations belong in the a41, a42, and a43 arguments. not a11, not a22 β€” a41, a42, a43. write that down. πŸ“

πŸŽ€ static SoType getClassTypeId() and virtual void getTypeId() const

these two give you back the type β€” either for the class as a whole (getClassTypeId()), or for one specific object of this class (getTypeId()). type check yourself before you wreck yourself. βœ…

πŸ¦‹ const SbMatrix & getValue() const

hands you this field's value. that's the whole thing, no notes. 🀲

πŸ’œ const SbMatrix & operator =(const SbMatrix & newValue) and void setValue(const SbMatrix & newValue)

both of these set this field to newValue. two doors, same room, pick whichever. πŸšͺπŸšͺ

🌟 int operator ==(const SoSFMatrix &f) const and int operator !=(const SoSFMatrix &f) const

returns TRUE if f is the same type as this field and has the same value as this field. same type AND same value. both. no shortcuts. 😀


πŸ”₯ SEE ALSO πŸ”₯

go read these next, bestie, they're all in the family:

  • SoField
  • SoSField
  • SoMFMatrix
  • SbMatrix

k that's the whole page!! ty for reading my little manual rant, ily, go forth and multiply your matrices πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

this has been SoSFMatrix(3IV) β€” version/date slot is empty on this one (SoSFMatrix(3IV)(), she left it blank, mysterious of her ngl) β€” ok bye bestie, hydrate and check your indices!! πŸ“πŸ§šβ­