SOONESHOT(3iv)
β¨ SoOneShot β¨
okay bestie, so this one is from the SoOneShot(3IV) manual and it's literally a timer that runs for a pre-set amount of time and then, like, stops. no cap. π
πΈ INHERITS FROM
SoBase > SoFieldContainer > SoEngine > SoOneShot
she comes from a long line of iconic ancestors, we love a lineage π
π SYNOPSIS
#include <Inventor/engines/SoOneShot.h>
enum Flags {
SoOneShot::RETRIGGERABLE Can start over during the cycle
SoOneShot::HOLD_FINAL Output values stay high after cycle
}
Inputs from class SoOneShot:
SoSFTime timeIn
SoSFTime duration
SoSFTrigger trigger
SoSFBitMask flags
SoSFBool disable
Outputs from class SoOneShot:
(SoSFTime) timeOut
(SoSFBool) isActive
(SoSFFloat) ramp
Methods from class SoOneShot:
SoOneShot()
Methods from class SoEngine:
static SoType getClassTypeId()
virtual int getOutputs(SoEngineOutputList &list) const
SoEngineOutput * getOutput(const SbName &outputName) const
SbBool getOutputName(const SoEngineOutput *output, SbName &outputName) const
SoEngine * copy() const
static SoEngine * getByName(const SbName &name)
static int getByName(const SbName &name, SoEngineList &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
π DESCRIPTION
okay so this engine is a timer that runs for a pre-set amount of time and then stops, periodt. by default the timeIn input is connected to the realTime global field β iconic default behaviour honestly. but lowkey you can hook it up to any other time source you want. π°οΈ
the timer starts when the trigger input gets touched. then it runs for the specified duration and updates the timeOut output with the time that has elapsed. during that time the ramp output is also getting updated. and the ramp output? it starts at 0.0 at the beginning of the cycle and linearly increases until it reaches 1.0 at the end of the cycle. it's giving very linear, very demure π
you can disable the timer by setting the disable input to TRUE. while the timer is disabled the output value remains 0.0. and heads up β if the timer gets disabled in the middle of a cycle, the output values will be set to 0.0. just like that. gone. π
the flags input holds the control flags. using the flags you can set the timer to be retriggerable in the middle of a cycle, and set the output values to stay high after the cycle has been completed. by default these flags are not set. π©
β INPUTS
SoSFTimetimeInβ running time. the clock, the vibe, the whole timeline bestie β³SoSFTimedurationβ duration of the active cycle. how long the whole thing goes for.SoSFTriggertriggerβ start the cycle. important: the trigger will be ignored if it is touched in the middle of a cycle and theRETRIGGERABLEflag is not set. so don't come for her mid-cycle unless you set the flag, iykyk πSoSFBitMaskflagsβ control flags. the little switches that change the whole personality.SoSFBooldisableβ ifTRUE, the timer is disabled. naptime fr π΄
π₯ OUTPUTS
(SoSFTime)timeOutβ elapsed time from the start.(SoSFBool)isActiveβ isTRUEduring the active cycle. main character energy while it's running π(SoSFFloat)rampβ ramps linearly from0.0to1.0. the glow-up arc, literally.
π¦ METHODS
SoOneShot()β constructor. hey bestie, you made one β¨
π FILE FORMAT/DEFAULTS
OneShot {
duration 1
trigger
flags ()
disable FALSE
timeIn <current time>
}
look at those defaults, so clean, so untouched, we love to see it π
π SEE ALSO
SoElapsedTime, SoEngineOutput
no cap: if something's retriggerable, the trigger has to actually be allowed to fire mid-cycle. otherwise it's ignored. don't @ me, that's just the rules π
and that's the whole page babes π this was the SoOneShot(3IV) manual β source/version SoOneShot(3IV)(), no date on it because she's timeless like that π slay, go build your timers, ily, bye π«ΆπΈ
π¦ 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