dimforge / nphysics

2 and 3-dimensional rigid body physics engine for Rust.
https://nphysics.org
Apache License 2.0
1.62k stars 121 forks source link
joints physics physics-engine rigid-bodies

crates.io

crates.io (nphysics2d) crates.io (nphysics3d) Build status

Users guide | 2D Documentation | 3D Documentation | Forum

⚠️This crate is now passively-maintained. It is being superseded by the Rapier project.⚠️


nphysics

nphysics is a 2 and 3-dimensional physics engine for games and animations. It uses ncollide for collision detection, and nalgebra for vector/matrix math. 2D and 3D implementations both share the same code!

Examples are available in the examples2d and examples3d directories. Interactive 3D are available there. Because those demos are based on WASM and WebGl 1.0 they should work on most modern browsers. Feel free to ask for help and discuss features on the official user forum.

Why another physics engine?

There are a lot of physics engine out there. However having a physics engine written in Rust is much more fun than writing bindings and has several advantages:

Features

What is missing?

nphysics is a very young library and needs to learn a lot of things to become a grown up. Many missing features are because of missing features on ncollide. Features missing from nphysics itself include:

Dependencies

The libraries needed to compile the physics engine are:

The libraries needed to compile the examples are: