SOLEVELOFDETAIL(3iv)
π SoLevelOfDetail β level-of-detail switching group node π
Hiii bestie, welcome to the SoLevelOfDetail(3IV) page, aka the node that decides which version of your lil object gets to show up depending on how big it looks on screen. She's giving main character energy and she's here to explain herself. π
π¦ INHERITS FROM
SoBase > SoFieldContainer > SoNode > SoGroup > SoLevelOfDetail
So yeah, she's a whole descendant chain β everything in that line is her ancestry, and she carries all their baggage (and their methods, which is honestly a slay). β¨
πΈ SYNOPSIS
#include <Inventor/nodes/SoLevelOfDetail.h>
Fields from class SoLevelOfDetail:
SoMFFloatscreenArea
Methods from class SoLevelOfDetail:
SoLevelOfDetail()static SoTypegetClassTypeId()
Methods from class SoGroup:
voidaddChild(SoNode *child)voidinsertChild(SoNode *child, int newChildIndex)SoNode *getChild(int index) constintfindChild(const SoNode *child) constintgetNumChildren() constvoidremoveChild(int index)voidremoveChild(SoNode *child)voidremoveAllChildren()voidreplaceChild(int index, SoNode *newChild)voidreplaceChild(SoNode *oldChild, SoNode *newChild)
Methods from class SoNode:
voidsetOverride(SbBool state)SbBoolisOverride() constSoNode *copy(SbBool copyConnections = FALSE) constvirtual SbBoolaffectsState() conststatic SoNode *getByName(const SbName &name)static intgetByName(const SbName &name, SoNodeList &list)
Methods from class SoFieldContainer:
voidsetToDefaults()SbBoolhasDefaultValues() constSbBoolfieldsAreEqual(const SoFieldContainer *fc) constvoidcopyFieldValues(const SoFieldContainer *fc, SbBool copyConnections = FALSE)SbBoolset(const char *fieldDataString)voidget(SbString &fieldDataString)virtual intgetFields(SoFieldList &resultList) constvirtual SoField *getField(const SbName &fieldName) constSbBoolgetFieldName(const SoField *field, SbName &fieldName) constSbBoolisNotifyEnabled() constSbBoolenableNotify(SbBool flag)
Methods from class SoBase:
voidref()voidunref() constvoidunrefNoDelete() constvoidtouch()virtual SoTypegetTypeId() constSbBoolisOfType(SoType type) constvirtual voidsetName(const SbName &name)virtual SbNamegetName() const
β¨ DESCRIPTION β¨
Okay so picture this: the children of this node are all the same object or objects, just at varying levels of detail, listed from highest detail to lowest. π«Ά And the thing that picks the winner is β drumroll β the size of the objects when projected into the viewport. That's literally the whole vibe check. Whichever version matches that size gets traversed (i.e., which child gets traversed).
So how is that size computed? It's the area of the screen rectangle enclosing the projection of the 3D bounding box that encloses all of the children. When rendering, this size gets compared against the values sitting in the screenArea field, and the rules are:
- If the size is greater than the first value,
child 0is traversed. π - If it's smaller than the first, but greater than the second,
child 1is traversed. - And so on, and so on, forever and ever. π«
- If there are fewer children than are required by this rule, the last child is traversed. (No crash, no drama, she just serves you what she's got.)
- The
screenAreafield contains just0by default, so the first child is always traversed out of the box. Periodt.
Now β the size calculation takes the current complexity into account, and this part matters, so listen up:
- If the complexity is
0or is of typeBOUNDING_BOX, the last child is always traversed. - If the complexity is less than
.5, the computed size is scaled down appropriately to use (possibly) a less detailed representation. - If the complexity is greater than
.5, the size is scaled up. - At complexity
1, the first child is always used.
π Also note, bestie: theSoLODnode is similar toSoLevelOfDetail, except the switching between levels in theSoLODnode is based on distance from the camera, which is faster than using screen area. Two different girls, two different strategies. Pick your fighter. π₯
π FIELDS π
SoMFFloatscreenAreaβ Areas to use for comparison. That's it, that's the field. She's simple but she runs the whole show. π
π§ METHODS π§
SoLevelOfDetail()β Creates a level-of-detail node with default settings. Fresh out the box, defaults on, ready to go. β¨static SoTypegetClassTypeId()β Returns type identifier for this class. Iykyk, you need this for all the type-checking nonsense. π
π¦ ACTION BEHAVIOR
SoGLRenderAction, SoRayPickAction, SoCallbackAction
- Only the child with the appropriate level of detail is traversed. She's not doing extra work, she's efficient, she's iconic. π
SoGetBoundingBoxAction
- The box that encloses all children is computed. (This is the box that is needed to compute the projected size.) Like, all of them, even the low-detail ones. Because math. π
others
- All implemented as for
SoGroup. No surprises, no chaos, just group behavior. πΈ
π FILE FORMAT/DEFAULTS π
LevelOfDetail {
screenArea 0
}
Look at her. One field. Zero. Beautiful. π
π SEE ALSO π
SoLOD, SoComplexity, SoSwitch, SoGroup
And that's the whole page, bestie! π«Ά This was SoLevelOfDetail(3IV)() β the footer's got the manual name and that empty date slot sitting there unfilled, so if anyone asks, that's the version stamp and we're not gonna pretend otherwise. Go forth and let the screen area decide which child gets to shine. πβ¨π¦
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms