Replies: 1 comment
-
FYI: I've solved this now by re-building the physics world with plain cannon-es, basically porting everything 1:1 from my use-cannon setup. There I then step through the physics simulation in a while loop until my end detection is hit. Works well so far. The use case is dice rolling btw, where I want to use physics based dice rolling, but using pre-determined numbers from a RNG. By running the physics sim until all dice are settled first, I can then rotate the dice and run the rendered physics simulation with same inputs (starting positions & velocities) to end up with the pre-determined numbers as the roll result. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey, I have a rather special use case that I'm trying to solve with r3f and @react-three/cannon: I want to uncap the frameloop, to have as many frame loop calls as possible without actually rendering. This would then cause use-cannon to step through the physics simulation in that rate, as it's using
useFrame
to step.I've tried a couple approaches, like patching use-cannon' physics-provider with something like
but this doesn't work as the changes are then not reflected in the component tree (as far as I understand).
The only approach I can think of before rebuilding my r3f & use-cannon physics setup in plain cannon-es is somehow uncapping the framerate in r3f to have it run as fast as possible until the physics reach my end check.
Thankful for any ideas on how this could be achieved, if at all. 🙏
Beta Was this translation helpful? Give feedback.
All reactions