gearbox2d
v0.1.0
Published
A 2D physics engine with TypeScript interface and WebAssembly core
Downloads
87
Maintainers
Readme
Gearbox2D - High-Speed 2D Physics Engine
⚠️ WORK IN PROGRESS (Alpha) - Gearbox2D is currently in active development. APIs are subject to change.
Gearbox2D is a blazing-fast, web-first 2D physics engine engineered from the ground up for the modern browser. Built in C++ and compiled to WebAssembly (WASM), it provides a high-performance core with a developer-friendly TypeScript wrapper.
Why Gearbox2D?
- Web-First Performance: Zero-copy memory sharing between WASM and JavaScript via shared buffers.
- Authoritative Synchronization: Designed for real-time multiplayer with stable state injection.
- Integrated AI: Built-in support for NavMeshes, RVO/ORCA, and pathfinding at native speeds.
Getting Started
1. Installation
npm install gearbox2dFor more ways to install (including CDN usage), see the Installation Guide.
2. Quick Start
import gearbox from 'gearbox2d';
async function init() {
await gearbox.init();
const world = gearbox.makeWorld();
world.setGravity(0, 9.8);
// ... setup world ...
function loop() {
world.step(1/60);
requestAnimationFrame(loop);
}
loop();
}Check out Your First Simulation for a full, copy-pasteable example.
Documentation
- Introduction - Core pillars and architecture.
- Installation - NPM, CDN, and WebAssembly requirements.
- Your First Simulation - Build a falling box demo.
- API Reference - Detailed class and method documentation.
- Development Guide - How to build from source and contribute.
Project Status & Roadmap
Gearbox2D is currently in Alpha. The core physics solver and joint system are stable, but APIs are evolving. Check the plan.md file for a detailed list of implemented features and future goals.
Contributing
We welcome contributions! If you want to build the engine from source or modify the C++ core, please follow the Development & Contributing Guide.
License
ISC
