SOPRIMITIVEVERTEX(3iv)

πŸ’… SoPrimitiveVertex β€” straight from the 3IV manual, bestie ✨


🌸 NAME 🌸

SoPrimitiveVertex β€” the lil glow-up that represents a vertex of a generated primitive πŸŽ€


🧬 INHERITS FROM 🧬

SoPrimitiveVertex

(no cap, that's literally what it says β€” it inherits from itself, main character energy fr fr πŸ‘‘)


✨ SYNOPSIS ✨

Drop this include in and you're in business:

#include <Inventor/SoPrimitiveVertex.h>

These are the methods living in class SoPrimitiveVertex, exactly as written:

                      SoPrimitiveVertex()
                      SoPrimitiveVertex(const SoPrimitiveVertex &pv)
                      ~SoPrimitiveVertex()
 const SbVec3f &      getPoint() const
 const SbVec3f &      getNormal() const
 const SbVec4f &      getTextureCoords() const
 int                  getMaterialIndex() const
 const SoDetail *     getDetail() const
 SoPrimitiveVertex &  operator =(const SoPrimitiveVertex &pv)

πŸ’– DESCRIPTION πŸ’–

okay so. An SoPrimitiveVertex is the whole vibe of a vertex β€” like a triangle vertex, a line segment vertex, or a point vertex β€” one of those primitives that's getting generated by an SoCallbackAction. πŸ¦‹

It's carrying around:

  • an object-space point
  • a normal
  • texture coordinates
  • a material index
  • and a pointer to an instance of an SoDetail subclass πŸ‘€

That detail might hold even more tea about the vertex… or it might just be a NULL pointer if there's no such info. It's giving "mystery box, possibly empty." πŸ™ˆ

Lowkey important: instances of SoPrimitiveVertex are typically created on the stack by shape classes while they're generating primitives. So if you're someone who wants to save them as return values from SoCallbackAction? Bestie, you should probably make copies of them. Do not just hold onto the original. πŸ’€


πŸ› οΈ METHODS πŸ› οΈ

  • SoPrimitiveVertex()
  • SoPrimitiveVertex(const SoPrimitiveVertex &pv)
  • ~SoPrimitiveVertex()

Constructors and destructor, the whole trilogy 🎬 Heads up though: copying a primitive vertex copies the detail pointer, not the detail itself. That's the rule, periodt.

  • const SbVec3f & getPoint() const
  • const SbVec3f & getNormal() const
  • const SbVec4f & getTextureCoords() const

These three hand you the surface point, the normal, and the texture coordinates β€” all in object space. Obsessed with a clean return tbh.

  • int getMaterialIndex() const

Returns the index into the current set of materials of the material that's active at the vertex. iykyk 🧚

  • const SoDetail * getDetail() const

Returns the detail that gives you more info about the vertex. And bestie, real talk: this pointer may be NULL if there is no more info. Always check it. πŸ™

  • SoPrimitiveVertex & operator =(const SoPrimitiveVertex &pv)

Copies the given vertex. But β€” say it with me β€” just the pointer to the detail gets copied, not the detail itself. Same energy as the copy constructor, no surprises. ✨


🌈 friendly reminder from the group chat: stack-allocated vertices + wanting to keep them = make a copy. The detail pointer is not the detail. That's the whole plot. 🫢

mwah πŸ’‹ that's the page β€” the footer tags it as SoPrimitiveVertex(3IV)() (the date slot is just vibing empty, iconic of it) and the header matches, so we're fully synced, slay, bye bestie πŸ‘‘πŸ’–