dimforge / rapier.rs

Official website for the Rapier physics engine.
https://rapier.rs
17 stars 48 forks source link

nalgebra `vector!` macro usage in Rust > Getting Started causing issues #14

Closed arpan-dhatt closed 3 years ago

arpan-dhatt commented 3 years ago

Just tried out the Getting Started code example (on complete_docs branch) and it currently doesn't compile since the vector! macro errors at compile time: use of undeclared crate or module nalgebra.

I tried importing the macro by using use rapier3d::na::vector; but I still have the same error. I've worked around it by just using rapier3d::na::Vector3 for now.

sebcrozet commented 3 years ago

Hi, that's because nalgebra must be in scope. This has been fixed in the version 0.9.1 of Rapier by making nalgebra part of the prelude: rapier3d::prelude::nalgebra so that it is automatically in scope when doing use rapier3d::prelude::*.