Skip to content

Master-Hash/rapier.js

 
 

Repository files navigation

crates.io

Build status

Website | Documentation | 2D examples (sources) | 3D examples (sources)


2D and 3D physics engines for the JavaScript programming language (official bindings).


在官方 binding 基础上,调整如下:

  1. 砍掉 control 模块;
  2. wasm-bindgen target web 而不是 bundler,兼容 vite;
  3. 启用 -Oz 等编译参数,减少体积;
  4. 使用最新的 rapier rust 依赖。

编译参数:

cd rapier2d
cargo build --release --verbose --target wasm32-unknown-unknown
wasm-bindgen ../target/wasm32-unknown-unknown/release/rapier_wasm2d.wasm --out-dir ./pkg --typescript --target web
wasm-opt ./pkg/rapier_wasm2d_bg.wasm -o ./pkg/rapier_wasm2d_bg.wasm.opt -Oz --dce
./build_typescript.sh
pnpm tsc

About

Official JavaScript bindings for the Rapier physics engine.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 66.0%
  • Rust 32.7%
  • Other 1.3%