Animation

class cee.pt.Animation()

Controls time-step animation of a ParticleModel.

Access via ParticleModel.animation. Frames advance inside the render loop at the configured targetFrameRate.

Example:

Accessors

Animation.frameStride()

Frames to advance per step. Default 1.

E.g. stride 5 with targetFrameRate = 30 gives a 150x speedup. Also used by setNextFrame and setPreviousFrame.

Return type:number
Animation.frameStride(value)
Arguments:
  • value (number) – None
Return type:

void

Animation.loop()

Wraps from the last frame to the first. Default true.

Return type:boolean
Animation.loop(value)
Arguments:
  • value (boolean) – None
Return type:

void

Animation.targetFrameRate()

Target animation speed in frames per second. Actual speed may be lower if data is not yet cached.

Return type:number
Animation.targetFrameRate(fps)
Arguments:
  • fps (number) – None
Return type:

void

Methods

isModelAnimationRunning

Animation.isModelAnimationRunning()

Whether the animation is running.

Return type:boolean

runAnimation

Animation.runAnimation(start)
Arguments:
  • start (boolean) – None

Start or stop playback.

Return type:void

setAnimationFrameChangedCallback

Animation.setAnimationFrameChangedCallback(callback)
Arguments:

Register a callback invoked on each frame change.

Return type:void

setFirstFrame

Animation.setFirstFrame()

Seek to the first frame. Stops animation.

Return type:void

setLastFrame

Animation.setLastFrame()

Seek to the last frame. Stops animation.

Return type:void

setNextFrame

Animation.setNextFrame()

Advance by frameStride frames. Stops animation.

Return type:void

setPreviousFrame

Animation.setPreviousFrame()

Rewind by frameStride frames. Stops animation.

Return type:void