dimforge / rapier.js

Official JavaScript bindings for the Rapier physics engine.
https://rapier.rs
Apache License 2.0
397 stars 55 forks source link

Expose DynamicRayCastVehicleController #219

Open roman01la opened 1 year ago

roman01la commented 1 year ago

Hello. Are bindings to DynamicRayCastVehicleController planned for RapierJS? I couldn't find any pointers what's the status of vehicle controller bindings for JS.

richi-coder commented 1 year ago

I could not neither

isaac-mason commented 1 year ago

It's in the latest canary release, see:

https://github.com/dimforge/rapier.js/blob/master/src.ts/control/ray_cast_vehicle_controller.ts

AndyGura commented 10 months ago

It's been half of an year, but control/ray_cast_vehicle_controller.d.ts is still missed from latest npm package (v0.11.2). Can it be added please in near foreseeable future?

vis-prime commented 7 months ago

using canary build the vehicle rig is working great on localhost local

but after building using vite.js, the prod version shows this error when const world = new RAPIER.World() is created

canary

any clue why this happens ? v0.11.2 does not have this issue

vis-prime commented 6 months ago

found a vite/rollup fix ( thanks to @CodyJasonBennett )

This excludes rapier from "tree shaking" , which fixed the build issue

add this into the vite.config file

// vite.config.js
import { defineConfig } from 'vite'

export default defineConfig({
   ...

  plugins: [
    {
      name: 'no-treeshake-rapier',
      transform(_code, id) {
        if (id.includes('@dimforge/rapier3d')) {
          return { moduleSideEffects: 'no-treeshake' }
        }
      },
    },
  ],
})