#collision #geometry #distance #ray #convex

ncollide2d

2 and 3-dimensional collision detection library in Rust. Will be superseded by the parry2d crate.

36 releases (16 breaking)

0.30.0 Jun 2, 2021
0.28.0 Mar 1, 2021
0.26.1 Oct 31, 2020
0.23.2 Jun 10, 2020
0.17.1 Jul 28, 2018

#333 in Algorithms

Download history 741/week @ 2021-02-26 677/week @ 2021-03-05 586/week @ 2021-03-12 808/week @ 2021-03-19 726/week @ 2021-03-26 1104/week @ 2021-04-02 1302/week @ 2021-04-09 859/week @ 2021-04-16 843/week @ 2021-04-23 599/week @ 2021-04-30 609/week @ 2021-05-07 594/week @ 2021-05-14 618/week @ 2021-05-21 995/week @ 2021-05-28 748/week @ 2021-06-04 723/week @ 2021-06-11

3,384 downloads per month
Used in 13 crates (8 directly)

Apache-2.0

1MB
23K SLoC

crates.io crates.io Build status

2D Documentation | 3D Documentation | User Guide | Forum

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

ncollide

ncollide is a 2 and 3-dimensional collision detection library written with the rust programming language.

The official user guide is available here. The rustdoc documentation is available for 3D and for 2D.

Compilation

You will need the last stable build of the rust compiler and the official package manager: cargo.

Simply add one the following (or both) to your Cargo.toml file:

[dependencies]
ncollide2d = "0.23" # For 2D collision detection.
ncollide3d = "0.23" # For 3D collision detection.

Features

  • dynamic bounding volume tree based broad phase
  • ball vs. ball collision detection,
  • plane vs. any convex object collision detection.
  • collision detection between arbitrary convex objects
  • compound geometries
  • ray-casting
  • time of impact computation for objects without rotational movement (compound vs. compound is not yet implemented)

And various traits for collision detectors and broad phase collision detection.

Dependencies

~4MB
~87K SLoC