dimforge / nphysics

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

Make the testbed generic over RealField. #259

Closed m-ou-se closed 4 years ago

m-ou-se commented 4 years ago

This leaves all the graphics objects in f32, but allows using an f64 world: Shapes are converted to an f32 representation, and inputs are converted back.

m-ou-se commented 4 years ago

Looks like I forgot some --features=fluids stuff. Working on it.

m-ou-se commented 4 years ago

Getting some frustrating errors now with the fluids feature:

the trait `nphysics3d::object::collider_set::ColliderSet<N, _>` is not implemented for `nphysics::object::DefaultColliderSet<N>`
the trait `nphysics3d::object::body_set::BodySet<N>` is not implemented for `nphysics::object::DefaultBodySet<N>`

Any ideas?

m-ou-se commented 4 years ago

Turns out salva was pulling in a copy of nphysics from crates.io. The traits and objects in the errors were from different copies of nalgebra. Looks like this was already a problem. #260 fixes that.

With #260, this PR now also works fine with --features=fluids.

sebcrozet commented 4 years ago

Thanks 👍