CGPdocs

timer_interval

Timer looping over a time interval [t_min, t_max] (periodic animations).

Derives from: timer_basic

The same irregular frames seen by the three timers: timer_basic.t grows by dt at each update, timer_interval.t loops back to t_min when it reaches t_max, and timer_event_periodic sets event to true at the first frame after each period has elapsed.
The same irregular frames seen by the three timers: timer_basic.t grows by dt at each update, timer_interval.t loops back to t_min when it reaches t_max, and timer_event_periodic sets event to true at the first frame after each period has elapsed. Tap to enlarge.

Fields and methods

Members of the struct timer_interval. Most of what you do with a CGP type goes through the free functions listed below.

Fields

float t_minLower bound of the interval in which t loops, 0 by default.
float t_maxUpper bound (excluded) of the interval in which t loops, 1 by default.

Methods

Builds a running timer whose time t starts at t_min and loops in [t_min, t_max) (asserts t_max > t_min). src
Advances t as timer_basic::update() and wraps it back into [t_min, t_max), returning the time step; a step longer than t_max - t_min is discarded (t unchanged) and 0 is returned. src
Inherited from timer_basic (4 members)

Fields

float tAccumulated time in seconds, multiplied by scale, 0 until the second update().
float scaleMultiplier applied to the elapsed real time (1 by default; larger values accelerate the animation).

Methods

Resumes the timer, measuring the next time step from now (the time spent stopped is not counted). src
Pauses the timer; update() then returns 0 and t stays constant. src

Functions taking a timer_interval

None.

Functions returning a timer_interval

None.

Operators

None.

CGP - Computer Graphics Programming.