Skip to content

Physics for Terrain #14

Description

@voxelias

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions