SOSENSOR(3iv)
β¨ NAME β¨
SoSensor β the abstract base class for alllll the Inventor sensors π (yes bestie, it's abstract, meaning you don't just go make one of these and vibe, it's the blueprint the other sensors inherit from π«Ά)
πΈ INHERITS FROM
SoSensor
(no cap, that's the whole lineage β she's the top of the family tree π)
π SYNOPSIS π
#include <Inventor/sensors/SoSensor.h>
typedef void SoSensorCB(void *data, SoSensor *sensor)
Methods from class SoSensor:
void setFunction(SoSensorCB *callbackFunction)
SoSensorCB * getFunction() const
void setData(void *callbackData)
void * getData() const
π¦ DESCRIPTION π¦
Okay so here's the whole vibe π β sensors detect changes. Changes to time, or changes to Inventor objects in a scene graph. And when they catch one? They call a user-defined callback function. That's the entire point of their existence, slay π .
So the lifecycle goes like this: a sensor gets scheduled when the thing it's attached to changes, and then sometime after it's scheduled, it gets triggered β and that's when your callback function gets called. That's it, that's the tea β. Scheduled β triggered β your function runs. Periodt.
π METHODS π
void setFunction(SoSensorCB *callbackFunction)
Sets the callback function that gets called when the sensor is triggered π₯. Important: that function must take two arguments β
- the user-supplied callback data (of type
void *), and - a pointer to the sensor that's triggering the function (of type
SoSensor *).
Two args, no exceptions bestie π
SoSensorCB * getFunction() const
Hands you back the callback function that will be called when the sensor is triggered π. Like, "who's on aux?" but for callbacks.
void setData(void *callbackData)
Sets the callback data that gets passed to the callback function π«Ά. This is the stuff you want your function to know about when it fires.
void * getData() const
Returns that user-supplied pointer β the one that's gonna get passed to the callback function β¨. She gives it back exactly how you set it, iconic.
π SEE ALSO π
The whole sensor friend group, go say hi:
SoAlarmSensorSoDataSensorSoFieldSensorSoIdleSensorSoNodeSensorSoPathSensorSoSensorManager
And that's the page, bestie π«Ά this was SoSensor(3IV) β the manual page tag reads SoSensor(3IV)() with the date slot left blank, so no timestamp tea today, she's mysterious like that πβ¨ go forth and schedule responsibly πΈ
π¦ 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