dimforge / parry

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

implement TODO for <Triangle as Shape>::ccd_thickness #9

Open LoganDark opened 3 years ago

LoganDark commented 3 years ago

This is just about the lamest change I could make to qualify as a "contributor", but I saw this TODO and thought it was something I could implement so here it is.

cargo test passes of course.

LoganDark commented 3 years ago

Quick note, there are a few different things that TODO comment could have meant, such as:

  1. the minimum distance an object aimed at some part of the triangle would have to travel in order to make it through the triangle (so 0.0, naturally, because of the points)
  2. the diameter of the largest circle that could fit inside the triangle, which is an ok approximation of number 1 without the points causing it to always be 0
  3. the minimum side length
  4. some other estimate? maybe the minimum distance from an edge to a point?

I just went with 3, but it's totally okay if something else was intended. Let me know and I might be able to do that instead.