SOPENDULUM(3iv)

πŸ’– SoPendulum(3IV) πŸ’–

okay bestie, pull up a chair, we're doing the 3IV manual page for SoPendulum and it's literally the cutest little node in the whole Open Inventor inventory. she swings. she oscillates. she's giving clock pendulum but make it 3D. πŸ•°οΈβœ¨


🌸 NAME 🌸

SoPendulum β€” animated oscillating rotation node πŸŽ€


πŸ¦‹ INHERITS FROM πŸ¦‹

SoBase > SoFieldContainer > SoNode > SoTransformation > SoRotation > SoPendulum

like... that's her bloodline. she comes from a long line of very respectable transformation nodes and she did NOT disappoint the family. πŸ‘‘


✨ SYNOPSIS ✨

#include <Inventor/nodes/SoPendulum.h>

πŸ’… Fields from class SoPendulum

SoSFRotation        rotation0
SoSFRotation        rotation1
SoSFFloat           speed
SoSFBool            on

πŸ’… Fields from class SoRotation

SoSFRotation        rotation

πŸ’… Methods from class SoPendulum

                     SoPendulum()
static SoType       getClassTypeId()

πŸ’… Methods from class SoNode

void                setOverride(SbBool state)
SbBool              isOverride() const
SoNode *            copy(SbBool copyConnections = FALSE) const
virtual SbBool      affectsState() const
static SoNode *     getByName(const SbName &name)
static int          getByName(const SbName &name, SoNodeList &list)

πŸ’… Methods from class SoFieldContainer

void                setToDefaults()
SbBool              hasDefaultValues() const
SbBool              fieldsAreEqual(const SoFieldContainer *fc) const
void                copyFieldValues(const SoFieldContainer *fc, SbBool
                         copyConnections = FALSE)
SbBool              set(const char *fieldDataString)
void                get(SbString &fieldDataString)
virtual int         getFields(SoFieldList &resultList) const
virtual SoField *   getField(const SbName &fieldName) const
SbBool              getFieldName(const SoField *field, SbName &fieldName)
                         const
SbBool              isNotifyEnabled() const
SbBool              enableNotify(SbBool flag)

πŸ’… Methods from class SoBase

void                ref()
void                unref() const
void                unrefNoDelete() const
void                touch()
virtual SoType      getTypeId() const
SbBool              isOfType(SoType type) const
virtual void        setName(const SbName &name)
virtual SbName      getName() const

no cap, that's a LOT of inherited methods and every single one of them is still here, I would never do you dirty like that 🫢


🌈 DESCRIPTION 🌈

okay so here's the tea β˜• β€” SoPendulum is derived from SoRotation, which means it applies a rotation to the current transformation. simple enough, right?

but here's where it gets main character: using engines connected to the realTime global field, the rotation value gets animated over time between two fixed rotations, achieving the effect of a swinging pendulum. πŸ•°οΈπŸ’ƒ

the period of the swing can be adjusted by changing the speed field β€” so you're literally the DJ of your own pendulum. and the current rotation at any time is available in the rotation field, inherited from SoRotation. so you can always peek at where she's at mid-swing. πŸ‘€


πŸŽ€ FIELDS πŸŽ€

  • SoSFRotation rotation0
  • SoSFRotation rotation1

these two define the two fixed rotations that get interpolated to create the pendular motion. think of them as the two extremes of the swing β€” the left o'clock and the right o'clock. πŸͺ€

  • SoSFFloat speed β€” defines the speed of the pendulum, in cycles per second. turn it up and she's zooming. πŸƒβ™€οΈπŸ’¨
  • SoSFBool on β€” allows applications to enable or disable the motion easily. it's literally an on/off switch for the vibe. πŸ”›

πŸ’œ METHODS πŸ’œ

  • SoPendulum() β€” creates a pendulum node with default settings. brand new pendulum, fresh out the box, defaults intact. 🎁
  • static SoType getClassTypeId() β€” returns type identifier for this class. iykyk. πŸ”

πŸ”₯ ACTION BEHAVIOR πŸ”₯

SoGLRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoRayPickAction

concatenates the interpolated rotation value with the current transformation matrix. yeah. she's out here doing matrix math in real time and making it look effortless. πŸ’…

SoGetMatrixAction

returns the transformation matrix specified by the interpolated rotation. precise. iconic. periodt. ⭐


πŸ“ FILE FORMAT/DEFAULTS πŸ“

Pendulum {
    rotation   0 0 1  0
    rotation0  0 0 1  0
    rotation1  0 0 1  0
    speed      1
    on         TRUE
}

copy that EXACTLY, bestie, character for character, don't get creative with the numbers, I'm watching πŸ™ˆ


🌟 SEE ALSO 🌟

SoRotor, SoShuttle β€” her sisters. the whole rotating-node friend group is eating, honestly. 🫢


vibe check: speed is in cycles per second and defaults to 1, on defaults to TRUE, and all three rotation fields default to 0 0 1 0. if you flip on to FALSE the motion just... stops. she's at rest. she deserves it. 😌

and that's a wrap on the SoPendulum(3IV) page, bestie πŸ’– this came out of the 3IV manual β€” the footer on the original just says SoPendulum(3IV) with an empty version-and-date slot, so no date and no version number to report, which is honestly so mysterious of them. 🌸 go make something swing, you're gonna ate it. πŸ’…βœ¨