dimforge / parry

2D and 3D collision-detection library for Rust.
https://parry.rs
Apache License 2.0
567 stars 100 forks source link

TriMesh avoid memory duplication #90

Closed luiswirth closed 2 years ago

luiswirth commented 2 years ago

The current implementation of TriMesh forces me to have two copies of my vertex buffer, because I have a custom Vertex type that has additional data associated with it and TriMesh only stores points as vertices.

The simplest solution that comes to my mind, would be to allow a generic parameter for the specific vertex type together with a Vertex trait which provides one method, which is get_point.

What do you think?

luiswirth commented 2 years ago

I no longer store the other copy of my vertex buffers on the cpu anymore. Therefore I don't care about this issue anymore.