Repolode
dimforge

dimforge/rapier

Rust-based 2D and 3D physics engines for games, animation, and robotics, with C, Python, JavaScript, and Bevy bindings.

Stars
6,036
Forks
432
Open issues
93
Last commit
5 days ago

What is it?

Rapier is a set of 2D and 3D physics engines written in Rust by the Dimforge organization. It is published as the crates rapier2d, rapier3d, and f64 variants of each, and targets use cases in games, animation, and robotics.

The engine supports multithreaded physics stepping through the parallel feature, with SIMD-batched constraint solving and contact processing enabled by default. Soft bodies are covered in the C bindings, which expose both 2D and 3D APIs in f32 and f64.

Bindings extend the engine beyond Rust: a C ABI with C++ helpers, a Python package wrapping the 3D engine with 32-bit floats, TypeScript/JavaScript packages, and a Bevy plugin. Examples and user-guide snippets for each language are maintained in the repository.

Key features

  • 01Provides separate 2D and 3D engines, each with f32 and f64 variants.
  • 02Offers optional multithreaded physics stepping via the parallel feature.
  • 03Uses SIMD-batched constraint solving and contact processing by default.
  • 04Includes C, Python, JavaScript/TypeScript, and Bevy bindings.
  • 05Ships examples and user-guide code that is compiled and tested.

Use cases

  • Adding rigid-body physics to a 2D or 3D game written in Rust.
  • Simulating robot or mechanical dynamics in robotics projects.
  • Using physics from a Bevy game through the official plugin.
  • Calling a native physics engine from C, C++, or Python code.

Quick start

  1. 1

    Read the user guides at rapier.rs/docs

  2. 2

    Run the 2D examples

    cargo run --release --bin all_examples2
  3. 3

    Run the 3D examples

    cargo run --release --bin all_examples3

Things to know

  • Requires a Rust toolchain to build and use the engine.
  • The Python bindings only cover the 3D engine with 32-bit floats.

In collections

Topics

FAQ

What is rapier?
Rust-based 2D and 3D physics engines for games, animation, and robotics, with C, Python, JavaScript, and Bevy bindings. Rapier is a set of 2D and 3D physics engines written in Rust by the Dimforge organization. It is published as the crates rapier2d, rapier3d, and f64 variants of each, and targets use cases in games, animation, and robotics.
Is rapier free to use? What license does it have?
rapier is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is rapier still maintained?
Actively maintained. The last commit to rapier was on Nov 1, 2026.
What can I use rapier for?
Adding rigid-body physics to a 2D or 3D game written in Rust. Simulating robot or mechanical dynamics in robotics projects. Using physics from a Bevy game through the official plugin. Calling a native physics engine from C, C++, or Python code.
How do I install rapier?
Read the user guides at rapier.rs/docs Run the 2D examples: cargo run --release --bin all_examples2 Run the 3D examples: cargo run --release --bin all_examples3
Where can I get rapier?
The source code and installation instructions are on GitHub: https://github.com/dimforge/rapier

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects