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

Can't compile demos #9

Closed
PonasKovas opened this issue Mar 16, 2020 · 4 comments
Closed

Can't compile demos #9

PonasKovas opened this issue Mar 16, 2020 · 4 comments
Assignees
Labels

Comments

@PonasKovas
Copy link

PonasKovas commented Mar 16, 2020

errors:
error[E0432]: unresolved import `rand::StdRng`
  --> world.rs:20:25
   |
20 | use rand::{SeedableRng, StdRng};
   |                         ^^^^^^ no `StdRng` in the root

error[E0432]: unresolved imports `rand::distributions::Range`, `rand::distributions::IndependentSample`
  --> world.rs:21:27
   |
21 | use rand::distributions::{Range, IndependentSample};
   |                           ^^^^^  ^^^^^^^^^^^^^^^^^ no `IndependentSample` in `distributions`
   |                           |
   |                           no `Range` in `distributions`

error[E0308]: mismatched types
  --> capsules.rs:69:20
   |
69 |                 a: Point3::new(-0.5, 0.0, 0.0),
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `mgf::cgmath::Point3`, found struct `cgmath::Point3`
   |
   = note: expected struct `mgf::cgmath::Point3<f32>`
              found struct `cgmath::Point3<{float}>`
   = note: perhaps two different versions of crate `cgmath` are being used?

error[E0308]: mismatched types
  --> capsules.rs:70:20
   |
70 |                 d: Vector3::new(1.0, 0.0, 0.0),
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `mgf::cgmath::Vector3`, found struct `cgmath::Vector3`
   |
   = note: expected struct `mgf::cgmath::Vector3<f32>`
              found struct `cgmath::Vector3<{float}>`
   = note: perhaps two different versions of crate `cgmath` are being used?

error[E0308]: mismatched types
  --> capsules.rs:90:28
   |
90 |                 rb.set_pos(Point3::new(x, y, z));
   |                            ^^^^^^^^^^^^^^^^^^^^ expected struct `mgf::cgmath::Point3`, found struct `cgmath::Point3`
   |
   = note: expected struct `mgf::cgmath::Point3<f32>`
              found struct `cgmath::Point3<f32>`
   = note: perhaps two different versions of crate `cgmath` are being used?

error[E0308]: mismatched types
   --> world.rs:131:36
    |
131 |             terrain_mesh.push_vert(Point3::from(vert.pos));
    |                                    ^^^^^^^^^^^^^^^^^^^^^^ expected struct `mgf::cgmath::Point3`, found struct `cgmath::Point3`
    |
    = note: expected struct `mgf::cgmath::Point3<f32>`
               found struct `cgmath::Point3<f32>`
    = note: perhaps two different versions of crate `cgmath` are being used?

error[E0308]: mismatched types
   --> world.rs:150:30
    |
150 |         terrain_mesh.set_pos(Point3::new(0.0, -10.0, 0.0));
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `mgf::cgmath::Point3`, found struct `cgmath::Point3`
    |
    = note: expected struct `mgf::cgmath::Point3<f32>`
               found struct `cgmath::Point3<{float}>`
    = note: perhaps two different versions of crate `cgmath` are being used?

error[E0308]: mismatched types
   --> world.rs:179:85
    |
179 |         let id: usize = self.bodies.add_body(collider, mass, restitution, friction, world_force).into();
    |                                                                                     ^^^^^^^^^^^ expected struct `mgf::cgmath::Vector3`, found struct `cgmath::Vector3`
    |
    = note: expected struct `mgf::cgmath::Vector3<f32>`
               found struct `cgmath::Vector3<f32>`
    = note: perhaps two different versions of crate `cgmath` are being used?

error[E0599]: no method named `to_vec` found for struct `mgf::cgmath::Point3<f32>` in the current scope
   --> world.rs:335:76
    |
335 |                         model: (Matrix4::from_translation(self.bodies.x[i].to_vec())
    |                                                                            ^^^^^^ method not found in `mgf::cgmath::Point3<f32>`
    |
    = help: items from traits can only be used if the trait is in scope
    = note: the following trait is implemented but not in scope; perhaps add a `use` for it:
            `use mgf::cgmath::EuclideanSpace;`

error[E0599]: no method named `to_vec` found for struct `mgf::cgmath::Point3<f32>` in the current scope
   --> world.rs:351:63
    |
351 |                         model: (Matrix4::from_translation(c.a.to_vec())
    |                                                               ^^^^^^ method not found in `mgf::cgmath::Point3<f32>`
    |
    = help: items from traits can only be used if the trait is in scope
    = note: the following trait is implemented but not in scope; perhaps add a `use` for it:
            `use mgf::cgmath::EuclideanSpace;`

error[E0599]: no method named `to_vec` found for struct `mgf::cgmath::Point3<f32>` in the current scope
   --> world.rs:360:63
    |
360 |                         model: (Matrix4::from_translation(c.a.to_vec() + c.d)
    |                                                               ^^^^^^ method not found in `mgf::cgmath::Point3<f32>`
    |
    = help: items from traits can only be used if the trait is in scope
    = note: the following trait is implemented but not in scope; perhaps add a `use` for it:
            `use mgf::cgmath::EuclideanSpace;`

error[E0599]: no method named `to_vec` found for struct `mgf::cgmath::Point3<f32>` in the current scope
   --> world.rs:369:70
    |
369 |                         model: (Matrix4::from_translation(c.center().to_vec())
    |                                                                      ^^^^^^ method not found in `mgf::cgmath::Point3<f32>`
    |
    = help: items from traits can only be used if the trait is in scope
    = note: the following trait is implemented but not in scope; perhaps add a `use` for it:
            `use mgf::cgmath::EuclideanSpace;`

error[E0277]: the trait bound `cgmath::Matrix4<_>: std::convert::From<mgf::cgmath::Quaternion<f32>>` is not satisfied
   --> world.rs:370:35
    |
370 | ...                   * Matrix4::from(self.bodies.q[i])
    |                         ^^^^^^^^^^^^^ the trait `std::convert::From<mgf::cgmath::Quaternion<f32>>` is not implemented for `cgmath::Matrix4<_>`
    |
    = help: the following implementations were found:
              <&'a cgmath::Matrix4<S> as std::convert::From<&'a [S; 16]>>
              <&'a cgmath::Matrix4<S> as std::convert::From<&'a [[S; 4]; 4]>>
              <&'a mut cgmath::Matrix4<S> as std::convert::From<&'a mut [S; 16]>>
              <&'a mut cgmath::Matrix4<S> as std::convert::From<&'a mut [[S; 4]; 4]>>
            and 9 others
    = note: required by `std::convert::From::from`

error[E0599]: no method named `magnitude` found for struct `mgf::cgmath::Vector3<f32>` in the current scope
   --> world.rs:371:75
    |
371 | ...                   * Matrix4::from_nonuniform_scale(c.r, c.d.magnitude(), c.r)).into(),
    |                                                                 ^^^^^^^^^ method not found in `mgf::cgmath::Vector3<f32>`
    |
    = help: items from traits can only be used if the trait is in scope
    = note: the following trait is implemented but not in scope; perhaps add a `use` for it:
            `use mgf::cgmath::InnerSpace;`

error[E0599]: no method named `to_vec` found for struct `mgf::cgmath::Point3<f32>` in the current scope
   --> world.rs:385:68
    |
385 |             model: Matrix4::from_translation(self.terrain.center().to_vec()).into(),
    |                                                                    ^^^^^^ method not found in `mgf::cgmath::Point3<f32>`
    |
    = help: items from traits can only be used if the trait is in scope
    = note: the following trait is implemented but not in scope; perhaps add a `use` for it:
            `use mgf::cgmath::EuclideanSpace;`

error: aborting due to 15 previous errors

Some errors have detailed explanations: E0277, E0308, E0432, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `mgf_demo`.

To learn more, run the command again with --verbose.

is this project dead?

@maplant
Copy link
Owner

maplant commented Mar 16, 2020

It’s not dead, but it’s not being actively worked on. I don’t think I pinned any of the demos to specific package versions so they’re prone to breaking. I’ll try to fix them up if I have some free time today

@maplant maplant self-assigned this Mar 16, 2020
@maplant maplant added the bug label Mar 16, 2020
@maplant
Copy link
Owner

maplant commented Mar 17, 2020

Just fixed this, master should compile now. Thanks for filling this issue!

@maplant maplant closed this as completed Mar 17, 2020
@maplant maplant reopened this Mar 17, 2020
@maplant
Copy link
Owner

maplant commented Mar 17, 2020

My bad, spoke too soon. Seeing some weird errors.

@maplant
Copy link
Owner

maplant commented Apr 26, 2020

Should be fine now.

@maplant maplant closed this as completed Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants