Class SoSensor

java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.inventor.sensors.SoSensor
Direct Known Subclasses:
SoDelayQueueSensor, SoTimerQueueSensor

public class SoSensor extends Inventor
Abstract base class for Open Inventor sensors. Sensors detect changes either to time or to Open Inventor objects in a scene graph, and call a user-defined callback function. Sensors are scheduled when the thing they are attached to changes, and sometime after they are scheduled they are triggered , calling the user's callback function.

See Also:
  • Method Details

    • setTask

      public void setTask(Runnable task)
      Sets the task to be executed when the sensor is triggered. Execute the task means simply call its run method.
    • schedule

      public void schedule()
    • unschedule

      public void unschedule()
    • isScheduled

      public boolean isScheduled()
      Returns true if this sensor has been scheduled and is waiting in a sensor queue to be triggered. Sensors are removed from the queue before their callback function is triggered.