dimforge / ncollide

2 and 3-dimensional collision detection library in Rust.
https://ncollide.org
Apache License 2.0
921 stars 105 forks source link

Improve triangle AABB performance #282

Closed ghost closed 5 years ago

ghost commented 5 years ago

A relatively long time inside TriMesh::new is spent computing AABBs for triangles in the mesh. Solves the problem by rolling a custom AABB function for triangles, which is around three times as fast as using the generic support map implementation.

This could be further improved in the future by providing an AABB function which doesn't take an isometry parameter (as TriMesh::new just passes in Isometry::identity() anyway), but it would require some API changes that I wasn't sure how to best approach.

sebcrozet commented 5 years ago

Thanks! I agree being able to avoid the isometry could significantly improve performance here. Would you mind opening an issue for this please?