pmndrs / use-cannon

👋💣 physics based hooks for @react-three/fiber
https://cannon.pmnd.rs
2.76k stars 154 forks source link

Pause Simulation #212

Closed funwithtriangles closed 2 years ago

funwithtriangles commented 3 years ago

Currently there doesn't seem to be a way to pause/play the simulation. I'm assuming the best approach would be to just have some state that prevents the loop from firing inside of the useFrame hook?

stockhuman commented 3 years ago

This is resolved in #226, with the caveat that it may be insufficient if your setup depends on invalidating and not stepping through physics at the same time.

seflless commented 3 years ago

@funwithtriangles It's not clear to me if you can pause/play/step explicitly now. I'm interested in some experiments around replay-able physics visualizations.