pmndrs / use-cannon

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

Shaky body when using api.velocity.set() with fixed velocity #239

Open tommhuth opened 3 years ago

tommhuth commented 3 years ago

See the basic demo where a sphere moves at a fixed pace (using api.velocity.set) along a plane: https://codesandbox.io/s/shaky-986lm?file=/src/index.js. the sphere will every now and then exhibit some shakiness, as if the position or velocity is not stable. When the movement of the sphere is hardcoded the behaviour is especially noticeable, and the sphere is clearly skipping around, before becoming stable again.

Is setting the velocity like this a bad idea?