pmndrs / react-three-rapier

🤺 Rapier physics in React
https://react-three-rapier.pmnd.rs
MIT License
983 stars 55 forks source link

Create react api for DynamicRayCastVehicleController #323

Open roman01la opened 1 year ago

roman01la commented 1 year ago

Hello. I see that r3p currently depends on rapier 0.11.1, however 0.17.0 got DynamicRayCastVehicleController. Would be great to have it exposed in r3p.

isaac-mason commented 1 year ago

For sure, it will be great to get this in rt/rapier!

But this is blocked on rapier.js bindings being updated to include the vehicle controller - https://github.com/dimforge/rapier.js

If you're keen to see this sooner, you could contribute to the bindings effort there. Last I heard on the dimforge discord someone was working on them, but it's been a while.

isaac-mason commented 1 year ago

There's also no open issue on rapier.js for adding vehicle bindings. Would be good to open one there to track.

grndctrl commented 1 year ago

The vehicle controller is currently available through the canary release of @dimforge/rapier3d-compat

isaac-mason commented 9 months ago

Some folks on discord shared they are working around this by overriding the version of @dimforge/rapier3d-compat that @react-three/rapier uses. See: https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides

This isn't ideal though 😞 unfortunately the maintainer of rapier is busy with non-rapier work right now and hasn't had time to get a release out.

isaac-mason commented 3 months ago

@react-three/rapier now uses a version of rapier.js with the dynamic raycast vehicle controller.

Example of usage: https://sketches.isaacmason.com/sketch/rapier/dynamic-raycast-vehicle-controller https://github.com/isaac-mason/sketches/blob/main/src/sketches/rapier/dynamic-raycast-vehicle-controller/use-vehicle-controller.ts