Home

Awesome

<p align="center"> <img src="http://nphysics.org/img/logo_nphysics_full.svg" alt="crates.io"> </p> <p align="center"> <a href="https://discord.gg/vt9DJSW"> <img src="https://img.shields.io/discord/507548572338880513.svg?logo=discord&colorB=7289DA"> </a> <a href="https://crates.io/crates/nphysics2d"> <img src="https://img.shields.io/crates/v/nphysics3d.svg?style=flat-square&label=crates.io%20(nphysics2d)" alt="crates.io (nphysics2d)"> </a> <a href="https://crates.io/crates/nphysics3d"> <img src="https://img.shields.io/crates/v/nphysics3d.svg?style=flat-square&label=crates.io%20(nphysics3d)" alt="crates.io (nphysics3d)"> </a> <a href="https://travis-ci.org/dimforge/nphysics"> <img src="https://travis-ci.org/dimforge/nphysics.svg?branch=master" alt="Build status"> </a> </p> <p align = "center"> <strong> <a href="http://nphysics.org">Users guide</a> | <a href="http://nphysics.org/rustdoc/nphysics2d/index.html">2D Documentation</a> | <a href="http://nphysics.org/rustdoc/nphysics3d/index.html">3D Documentation</a> | <a href="https://discourse.nphysics.org">Forum</a> </strong> </p>

⚠️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: