dimforge / ncollide

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

Add someting about winding order (or lack thereof) to the Tetrahedron::face documentation. #293

Open werner291 opened 5 years ago

werner291 commented 5 years ago

Hello!

I've noticed that the method https://docs.rs/ncollide/0.14.1/x86_64-pc-windows-msvc/ncollide/shape/struct.Tetrahedron.html#method.face does not return triangles in a consistent winding order.

Specifically, faces ABC and ABD have opposite vertex winding order (note how edge AB is included in both in the same order).

Although the method does not claim to provide a consistent winding order, one (read: me) might expect to be able to just call this method and get the normal of the triangle to get the normal of the face.

Perhaps a note about this should be added.

sebcrozet commented 5 years ago

Hi!

I think we should modify the returned value to provide a consistent winding order instead. This would be very convenient, especially for the very use-case your mentioned.

werner291 commented 5 years ago

Perhaps that's an option. I considered proposing that instead, but since this is a public method, that might break existing code that relies on the vertex ordering specified in the documentation. You're essentially modifying explicitly-specified behavior.

Perhaps adding a new method (and maybe deprecating the old) would be a better option?