I made crashcat, a lightweight 3D physics library for JavaScript games and creative websites.
Existing WASM physics libraries you can find on npm today are performant, but sometimes you just want a little capsule guy to run around on a mesh without downloading a ~3mb WASM file. They often require manual memory management, which feels a bit alien in JavaScript and is easy to mess up.
My view on WASM is becoming: go all in, or all out. Having physics state in WASM and game state in JavaScript is an architectural wart. Just build a C++ or Rust engine if you want the best result! But if you want something simple in JS, crashcat can serve that better.
Some existing pure JavaScript libraries solve the bundle size problem but miss useful features like shapecasting, CCD (continuous collision detection, prevents fast moving bodies "tunneling" through other bodies), and fast raycasts.
The library is written in TypeScript and designed to be highly tree-shakeable. Only need boxes and spheres? Your bundler will strip out all the collision logic for triangle meshes, convex hulls, etc.
It supports rigid body simulation with various convex shapes, triangle meshes, and compound shapes. It uses GJK/EPA for collision detection, has CCD, broadphase spatial acceleration with a dynamic bounding volume tree, and APIs for world queries like raycasts and shapecasts. It's library agnostic.
Give it a try!
Demo: https://crashcat.dev GitHub: https://github.com/isaac-mason/crashcat