Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error[E0283]: type annotations required: cannot resolve _: alga::general::real::Real #98

Closed
ndarilek opened this issue Dec 30, 2017 · 2 comments

Comments

@ndarilek
Copy link

Getting this error:

   Compiling tts v0.1.0 (file:///home/nolan/Projects/Wasm/tts)
error[E0283]: type annotations required: cannot resolve `_: alga::general::real::Real`
  --> src/ecs.rs:87:29
   |
87 |         let physics_world = nphysics2d::world::World::new();
   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: required by `<ecs::nphysics2d::world::World<N>>::new`

Do I need to pull in another crate? I'm trying to store the World instance in a struct so my ECS can access it, and it seems like I'm missing an initialization step before I can do that. I've studied the examples, and they all seem to tweak the world and bodies in the same module, when what I want to do is just instantiate the world and set up bodies elsewhere.

Thanks.

@Kerollmops
Copy link
Sponsor Contributor

Kerollmops commented Dec 30, 2017

Rust say type annotation required... it means that it cannot resolve the actual World type.

use something like nphysics2d::world::World::<f32>::new() I think.

use nphysics2d::world::World;

let physics_world: World<f32> = World::new();

@sebcrozet
Copy link
Member

Closing this since the aswer from @Kerollmops is the way to solve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants