Frequently Asked Questions§


What does the n of ncollide stands for?§

ncollide is some kind of abbreviation for n-dimensional collision detection library, where n is usually equal to 2 or 3 for common uses. Higher finite dimensions will work fine as well, except for ncollide_procedural and ncollide_transformation which are both mostly specialized for 2D and 3D.


What units are used by ncollide?§

This is left to your imagination. They can as well be kilometers, miles, litters, lumens, or nyan cats. It all depends on your application. Just try to choose your units such that the quantities (especially sizes) remain close to 1.0. Therefore it is generally a very bad idea to choose one pixel as your reference distance unit! In addition, significant size ratios (big objects interacting with small objects) should be avoided as they are very prone to generate rounding errors.

The recommended units are those given by the International System of Units−that is−meters, kilograms, seconds, and so on. But again, it depends on your application!


The compiler claims the trait method .foo(...) does not exists!§

Make sure to use the trait if you use at least one of its methods! For example, the following cannot work:

extern crate ncollide;

use ncollide::shape::Ball;

fn main() {
    let ball = Ball::new(1.0f32);

    ball.to_trimesh();
    //   ^^^^^^^^^^
    // Error: type `Ball` does not implement any method in scope named `to_trimesh`.
}

To help the compiler find .to_trimesh(), the procedural::ToTriMesh trait must be imported explicitly:

extern crate ncollide;

use ncollide::shape::Ball;
use ncollide::procedural::ToTriMesh; // needed to call `.to_trimesh()`.

fn main() {
    let ball = Ball::new(1.0f32);

    ball.to_trimesh();
}

If doing so does not work, double check the API documentation: you might just have misspelled the method name.


Do I need some kind of permission to reuse the figures of this guide?§

Nope! They were all created using Inkscape or generated with nrays, kiss3d, and rust-sfml. We know how time-consuming creating those kinds of illustrations can be so feel free to modify, publish, and redistribute them anywhere you want without asking or even telling anybody.


Miscellaneous