New nphysics crate names on crates.io

The crate nphysics is now deprecated in favor of nphysics2d and nphysics3d!

Until now, it was not possible to depend on the crate nphysics without specifying at least one feature to select both the dimension (3d or 2d) and the precision (f32 or f64). This was confusing because failing to do so led to cryptic error messages. Users of nphysics must now depend on either nphysics2d or nphysics3d. Those two crates will compile out-of-the box and default to 32-bit floating point numbers. To use double precision, enable the feature f64.


EDIT: after some clarifications about the working of cargo features, everything is parametrized by the scalar type now. Thus, starting with the version 0.2.0 of nphysics’ crates most structures are generic (e.g. you have to use things like World<f32> or World<f64>) and the f64 feature has been removed.

I am not sure how this will affect compilation times for users so if the additional overhead is too dramatic, we might have to revert back to the old system (or another alternative on the futur).

Great news :slight_smile:

I’ve just tried to switch a project over to the crates version, but I get the following compile error:

   Compiling nalgebra v0.6.0
   Compiling ncollide_pipeline v0.6.1
/home/jhasse/.cargo/registry/src/github.com-88ac128001ac3a9a/ncollide_pipeline-0.6.1/broad_phase/dbvt_broad_phase.rs:81:46: 81:59 error: the trait `nalgebra::traits::geometry::Translation<_>` is not implemented for the type `BV` [E0277]
/home/jhasse/.cargo/registry/src/github.com-88ac128001ac3a9a/ncollide_pipeline-0.6.1/broad_phase/dbvt_broad_phase.rs:81         let leaf: DBVTLeaf<P, FastKey, BV> = DBVTLeaf::new(lbv.clone(), FastKey::new_invalid());
                                                                                                                                                                     ^~~~~~~~~~~~~
[...]

I’m using Rust 1.7.0, any ideas?

I am not sure why you get that error. I attempted to compile the nphysics examples with Rust 1.7.0, and it worked fine.

Just in case, did you try to run a cargo update ? Otherwise, perhaps showing me your Cargo.toml (or even the full project if it is open-source) might help better understand the issue.

Sorry, I must had forgot to run cargo update. Works now :slight_smile: