Tresjs / tres

Declarative ThreeJS using Vue Components
https://tresjs.org
MIT License
1.91k stars 85 forks source link

fix: start loop if user calls `useRenderLoop` #695

Closed andretchen0 closed 1 month ago

andretchen0 commented 1 month ago

Problem

useRenderLoop used to be resume()d by default. resume() starts the loop, calling the users callbacks without the user needing to call resume themselves.

Since v4 the useRenderLoop is not started by default. This results in:

At the same time, useRenderLoop is no longer Tres' preferred way of looping. So it shouldn't consume resources unless necessary.

Solution

On the first call to useRenderLoop, resume the loop.