Class SoElapsedTime

  • All Implemented Interfaces:
    SafeDisposable

    public class SoElapsedTime
    extends SoEngine
    Basic controllable time source. This engine functions as a stopwatch; it outputs the time that has elapsed since it started running. By default, the timeIn input is connected to the realTime global field. It can, however, be connected to any other time source.

    The ouput from the engine is the time that has elapsed since it started running, or since the reset input was last triggered. You can affect the speed of the output time by setting the speed scale factor. A value greater than 1.0 will speed up the output, and a value less than 1.0 will slow it down.

    If you pause the engine, by setting the pause input to true, it stops updating the timeOut output. When you turn off the pause, it jumps to its current position without losing time. Alternatively, if you want to stop the engine for a while, and then restart it from where it left off, use the on input field.

    File format/default:

    ElapsedTime {

      timeIn <current time>
      speed 1
      on true
      pause false
      reset
    }

    See Also:
    SoTimeCounter, SoOneShot, SoEngineOutput
    • Field Detail

      • timeIn

        public final SoSFTime timeIn
        Running time.
      • speed

        public final SoSFFloat speed
        Scale factor for time.
      • on

        public final SoSFBool on
        true to start running, false to stop.
      • pause

        public final SoSFBool pause
        true to freeze, false to continue running.
      • reset

        public final SoSFTrigger reset
        Reset the base time.
    • Constructor Detail

      • SoElapsedTime

        public SoElapsedTime()
        Constructor.