pmndrs / use-cannon

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

Missing Hinge’s motor? #176

Closed brunnolou closed 3 years ago

brunnolou commented 3 years ago

Hi all! Is it possible to enable a motor for a hinge? If not, is there any workaround?

Basically, I wanna rotate around a joint to simulate an arm. Without a motor every force that I apply looks "external" to the body...

I won’t mind to contribute with a PR, but some guidance would be appreciated. Apparently, right now useConstraint has only enable or disable available. Do you think adding support for extra worker’s messages for the missing methods would work?

Ref

cannon-es hinge example with motor https://github.com/pmndrs/cannon-es/blob/master/src/constraints/HingeConstraint.ts#L65