pmndrs / use-cannon

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

Is there a way to translate position of body? #109

Closed indiebubbler closed 4 years ago

indiebubbler commented 4 years ago

THREE supports .translate method that could be used to reposition objects according to their local orientation (ie. move forward, up, left/right etc). Is there a way to achieve this same effect for cannon bodies?

indiebubbler commented 4 years ago

Nevermind, I've achieved desired effect by applying pattern from translateOnAxis method found here: https://github.com/mrdoob/three.js/blob/dev/src/core/Object3D.js