Closed gygy1993 closed 1 year ago
You might want fixed time steps with interpolation.
This is a good post on the topic: https://gafferongames.com/post/fix_your_timestep/
A good reference for doing this with the js lib could be the @react-three/rapier
library: https://github.com/pmndrs/react-three-rapier
It's a react library but the approach isn't specific to react.
If you've got more questions specific to the js library though, probably best to create a discussion on the rapier.js GitHub repo, or post some questions in the discord.
A good reference for doing this with the js lib could be the
@react-three/rapier
library: https://github.com/pmndrs/react-three-rapierIt's a react library but the approach isn't specific to react.
If you've got more questions specific to the js library though, probably best to create a discussion on the rapier.js GitHub repo, or post some questions in the discord.
Thanks for your answer, see timestep parameter in world
Yep you can change the timestep each frame (variable time stepping), which is good for many use cases, but has tradeoffs with determinism.
For example, apply a force to the ball to make it roll. Run it at 60fps and 144fps. 144fps takes a lot less time than 60fps. js version