rapier.js icon indicating copy to clipboard operation
rapier.js copied to clipboard

Expose DynamicRayCastVehicleController

Open roman01la opened this issue 2 years ago • 5 comments

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

roman01la avatar Feb 25 '23 16:02 roman01la

I could not neither

richi-coder avatar Jun 27 '23 00:06 richi-coder

It's in the latest canary release, see:

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

isaac-mason avatar Jun 27 '23 02:06 isaac-mason

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?

AndyGura avatar Sep 12 '23 13:09 AndyGura

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 avatar Dec 26 '23 19:12 vis-prime

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' }
        }
      },
    },
  ],
})

vis-prime avatar Jan 07 '24 15:01 vis-prime