dimforge/rapier: a Rust physics engine for games, animation and robotics
2D and 3D physics engines focused on performance.
At a glance
- What is it?
- Rapier ships as four crates (rapier2d, rapier3d, rapier2d-f64, rapier3d-f64) with SIMD constraint solving on by default and an optional parallel feature. Here is what the repository documents, and where it stops.
- Who is it for?
- Adopt Rapier if you are writing a Rust game, animation tool or robotics simulation and want a physics core you can pull in as a crate rather than a binary. Do not adopt it if you need 2D or f64 Python bindings today (the Python package wraps only the 3D engine with 32-bit floats) or if you expect the README to tell you how to recover from a diverging simulation, because it does not.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 21 days ago.
- What is it written in?
- Mainly Rust, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.
Star history
- dimforge/rapier6,109 ★ · +344
| Repository | 2026-09-23 | 2026-11-22 |
|---|---|---|
| dimforge/rapier | 5.8k | 6.1k |
344 Stars in the last 60 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
What Rapier is for, and who ends up using it
Rapier is a set of rigid-body physics engines, not a game engine. The README states the target plainly: games, animation and robotics. That list matters because the three audiences load the engine differently. A game wants a fixed timestep and cheap contact queries. An animation tool wants deterministic replay of a recorded simulation. A robotics project wants joint limits, motors and an accurate solver more than it wants frame rate. Rapier exposes the same crates to all three, and the choice of which crate you depend on is the first real decision: rapier2d and rapier3d use f32, while rapier2d-f64 and rapier3d-f64 use f64. Nothing in the README tells you which to pick for your scene scale, so the honest answer is that you benchmark both on your own geometry before committing to a dependency line. The project is Apache-2.0 and the README calls it forever free and open-source.
The solver: SIMD by default, rayon behind a feature flag
The mechanism the README spends the most words on is constraint solving. SIMD-batched constraint solving and contact processing are always on, and the solver processes four contact manifolds per instruction, falling back to scalar code on targets without SIMD support. That fallback is the detail worth noticing: the same crate compiles to different code paths depending on the target. Multithreading is not on by default. It lives behind the parallel feature, which parallelizes the whole physics step (broad phase, narrow phase, solver) through rayon. Enabling it is a one-line change in your manifest:
rapier3d = { version = "*", features = ["parallel"] }The README then flags a trap that is easy to miss. On CPUs with heterogeneous cores, such as Apple silicon or Intel hybrid parts, the barrier-paced stages of the solver run at the speed of the slowest core in the pool, which is usually an efficiency core. The documented fix is to call PhysicsPipeline::set_dedicated_thread_pool(None) so the step runs on a pool sized to the performance cores only. That is a real design constraint, not a footnote: adding threads can make the step slower on exactly the laptops many developers use, and the API to correct it is not something you would find without reading this section.
Installing Rapier and running a first simulation
Rapier is distributed as crates, so installation is a Cargo dependency. The README does not give a minimal program, but it does give the two commands that matter for a first look, run from a checkout of the repository:
cargo run --release --bin all_examples2
cargo run --release --bin all_examples3The first opens the 2D example testbed, the second the 3D one. Their source lives in the examples2d/ and examples3d/ directories, and reading those files alongside the running window is the fastest way to see how a world, a rigid body and a collider are wired together. The --release flag matters here; a debug build of a physics step is not representative of anything. For the workspace itself, note that a bare cargo build or cargo test only touches the pure-Rust crates. The Python binding crates need a pyo3 extension-module build environment and are excluded from default-members, so they are exercised by a dedicated workflow with explicit -p rapier-py-* invocations. If you clone the repository and expect cargo test to cover everything, it will not. The user guide at rapier.rs/docs is where the README sends you for actual API usage, and the README is explicit that this is step one of getting started.
Where Rapier is the wrong tool
The README does not document rollback, deterministic replay guarantees, or how to recover a simulation that has already diverged. For netcode that needs to re-simulate from a past state, or for a robotics pipeline that needs bit-identical results across machines, that silence is the thing to resolve before you build on it, not after. The f64 crates reduce floating-point drift but the README makes no claim that they eliminate it, and it makes no claim about cross-platform determinism at all. The parallel feature is another boundary. The README's own advice about heterogeneous cores shows that thread pool composition changes how fast the step runs. Finally, the Python bindings ship as a single package, rapier3d, wrapping the 3D engine with 32-bit floats; there are no 2D or f64 Python bindings yet. The README points you at bindings/python/README.md for building the bindings, the docs and the testbed from a checkout.
How Rapier differs from a C++ engine you link against
The obvious comparison is with a C++ physics library exposed to Rust through FFI, and the difference is not speed, it is the build and the type surface. Rapier is Rust crates in a Cargo workspace; the dependency resolves like any other crate. A C++ engine arrives as a native library you compile or vendor, with a C ABI boundary that you wrap by hand. Rapier also ships bindings beyond Rust: the README points to NPM packages under the @dimforge scope for JavaScript and TypeScript, and the repository carries a bindings/typescript/ directory that is its own Cargo workspace, deliberately excluded from the root workspace so root-level cargo commands never absorb its crates. That layout tells you the Wasm path is a first-class target rather than an afterthought. What you give up in exchange is the ecosystem: a C++ engine has decades of tooling, exporters and forum answers, while Rapier's documentation surface is the user guide, the example testbeds and Discord.
Maintenance, licence and the cost of upgrading
The repository is not archived, and the last push was on 2026-10-10, so the codebase is moving. The workspace version is 0.36.1, which is a pre-1.0 line, and that is the upgrade cost in one number: pre-1.0 crates are free to break APIs between minor versions, and the README gives no compatibility policy. There is a CHANGELOG.md at the repository root, and reading it before bumping the version is the only documented way to know what moved. The licence is Apache-2.0 across the workspace, which permits commercial use and modification and requires that you preserve notices; the README frames the project as forever free and open-source. That is a permissive licence, not a copyleft one, so it does not force you to publish your game or your robot controller. None of this is legal advice, and if you redistribute a modified engine you should read the LICENSE file rather than a summary. One more maintenance note that is unusual to see stated: the README declares that AI coding is extensively used for mjcf-rs, rapier3d-mjcf and the Python bindings, including tests and docs, with human review, and it sets conditions for accepting AI-generated contributions. Whatever you think of that policy, it is disclosed rather than hidden, which is more than most projects do.
Editorial conclusion
Adopt Rapier if you are writing a Rust game, animation tool or robotics simulation and want a physics core you can pull in as a crate rather than a binary. Do not adopt it if you need 2D or f64 Python bindings today (the Python package wraps only the 3D engine with 32-bit floats) or if you expect the README to tell you how to recover from a diverging simulation, because it does not. Before you commit, run the 2D and 3D example binaries to see the solver on your own hardware, and read ARCHITECTURE.md alongside the user guide at rapier.rs/docs.
Frequently asked questions
How do I install dimforge/rapier in a Rust project?
Add one of the four crates as a Cargo dependency: rapier2d, rapier3d, rapier2d-f64 or rapier3d-f64. The parallel feature is opt-in, written as rapier3d = { version = "*", features = ["parallel"] } in the README.
What is the difference between rapier2d, rapier3d and the -f64 crates?
The README lists four crates: rapier2d and rapier3d for the two dimensions, and rapier2d-f64 and rapier3d-f64 as the double-precision flavors. The README does not state which one to choose for a given scene, so the choice is yours to measure.
How do I run the Rapier examples?
From a checkout, the README gives cargo run --release --bin all_examples2 and cargo run --release --bin all_examples3. The source for those binaries is in the examples2d/ and examples3d/ directories.
Does Rapier support Python?
Yes, with limits. According to the README, the Python bindings ship as a single package, rapier3d, wrapping the 3D engine with 32-bit floats; there are no 2D or f64 Python bindings yet. bindings/python/README.md describes how to build them from a checkout.
Is Rapier multithreaded by default?
No. The README states that SIMD-batched constraint solving is always on, but multithreading of the whole physics step requires enabling the parallel feature, which routes broad phase, narrow phase and solver through rayon.
Why does enabling parallel physics run slowly on Apple silicon or Intel hybrid CPUs?
The README explains that the solver's barrier-paced stages run at the speed of the slowest core in the pool, which is typically an efficiency core. It documents PhysicsPipeline::set_dedicated_thread_pool(None) as the way to run the step on a pool sized to performance cores only.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/dimforge-rapier)Star history chart for your README
[](https://hysenlabs.com/projects/dimforge-rapier)Was this useful?