Volumetrics-io / mrjs

An extensible WebComponents library for the Spatial Web
https://mrjs.io
MIT License
160 stars 9 forks source link

add `clampWhenFinished` to freeze animation on last frame #600

Closed hanbollar closed 5 months ago

hanbollar commented 5 months ago

Linking

related to https://discord.com/channels/1137890872688660500/1219366027545149462/1234958188302962739 related to #599

Problem

looping is nice and all, but want to freeze at end of animation instead of reverting back to start

Solution

add as part of animation setup (longer css feature will be different and more robust to mimic https://developer.mozilla.org/en-US/docs/Web/CSS/animation-fill-mode, but this pr is more to match the threejs paradigm, opening a separate issue for the css part: #601

Breaking Change

adding small feature

Notes

...


Required to Merge

render[bot] commented 5 months ago

Your Render PR Server URL is https://examples-mrjs-pr-600.onrender.com.

Follow its progress at https://dashboard.render.com/static/srv-cool8v5jm4es73eq5t7g.

hanbollar commented 5 months ago

merging in since it's a very small change - just looks like a lot because code was indented when moved into a loop - commit body on main will reflect the following:

add 'clampWhenFinished' to freeze animation on last frame

- includes moving the setAnimation function calls into a loop over all available animations instead of just the only available one.
- includes addition of more examples in models.html to demo the freeze vs not