# 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

- `frameStride`
- `loop`
- `targetFrameRate`

Methods

- `isModelAnimationRunning`
- `runAnimation`
- `setAnimationFrameChangedCallback`
- `setFirstFrame`
- `setLastFrame`
- `setNextFrame`
- `setPreviousFrame`

## 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: | callback (`AnimationFrameChangedCallback`) – None

  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

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your multilingual generative AI assistant for documentation. Ask me anything about HOOPS Envision for Web in your own language, or choose a sample question below to start a conversation:

What is HOOPS Envision for Web?
What are the latest release notes for HOOPS Envision for Web?
How do I start evaluating HOOPS Envision for Web?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...