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

Physics for Terrain #14

Open
pixelijo opened this issue Aug 17, 2020 · 0 comments
Open

Physics for Terrain #14

pixelijo opened this issue Aug 17, 2020 · 0 comments

Comments

@pixelijo
Copy link

Hi! I have tried to extend your example with falling cubes amethyst_physics_test with a flat terrain mesh instead of the floor.

Terrain mesh is a 8.0x8.0 sqare built from 128 triangles. I've also prepared a ShapeDesc for it from the same vertices and indices.

Here comes the first question: MeshBuilder and ShapeDesc::TriMesh expect vectors with different content:

error[E0308]: mismatched types
  --> src/terrain.rs:63:21
   |
63 |             points: pos,
   |                     ^^^ expected struct `nalgebra::geometry::point::Point`, found struct `rendy_util::types::vertex::Position`
   |
   = note: expected struct `std::vec::Vec<nalgebra::geometry::point::Point<_, nalgebra::base::dimension::U3>>`
              found struct `std::vec::Vec<rendy_util::types::vertex::Position>`

error[E0308]: mismatched types
  --> src/terrain.rs:64:22
   |
64 |             indices: idx,
   |                      ^^^ expected struct `nalgebra::geometry::point::Point`, found `u16`
   |
   = note: expected struct `std::vec::Vec<nalgebra::geometry::point::Point<usize, nalgebra::base::dimension::U3>>`
              found struct `std::vec::Vec<u16>`

How it is intended to do? At this moment I simply fill out two more vectors with the same values, but it does not feel right

And second thing is that as soon as I do it, it works as expected, but I have a heavy FPS drop when cubes collide. Any idea from what point should I start my investigation?

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

1 participant