3
\$\begingroup\$

I'm reading this paper, and using it to perfect the narrow phase collision system for my game engine. To make the question as self-contained as possible, the essential strategy used to detect collisions is the following: scale your axes to reduce the problem to unit sphere/triangle collision, calculate the triangle plane and such, and see if the closest intersection with the plane is inside the triangle itself (probably using barycentric coordinates).

However, beyond this point (going into section 3.4 in the paper), I begin to get confused. He starts talking about some relatively intensive mathematical calculations to test whether the sphere/plane intersection point is on one of the triangle's edges or vertices after testing whether this point is inside the triangle. My question is: why should it possibly be necessary to spend so much computing power on checking against the edges of the triangle? More specifically, why does the original calculation using barycentric coordinates not necessarily account itself for vertices and edges?

\$\endgroup\$
1
  • \$\begingroup\$ (Also, excuse my probably messed-up tagging: seeing as I'm new to the site I'm not really aware of tagging norms.) \$\endgroup\$
    – user67576
    Commented Jun 19, 2015 at 15:18

1 Answer 1

2
\$\begingroup\$

I'm sorry for answering my own question: I figured it out and it was just a matter of correct visualization. The inside-triangle check only works if the sphere meets the triangle head-on: in other words, the point of tangency between the sphere and the plane occurs exactly at the correct time. In the other case, if the sphere passes by the triangle such that the initial point of contact is not directly inside the triangle, it waits through the time interval between the two points of tangency to see if any part of the sphere hits the edge of the triangle. Hopefully this isn't too confusing, as I don't have any way of creating relevant diagrams.

\$\endgroup\$
3
  • \$\begingroup\$ If this answered your question, even if it's your own answer, please accept it. You can do so by clicking the gray checkmark below the up and down vote arrows. \$\endgroup\$ Commented Jun 19, 2015 at 18:57
  • \$\begingroup\$ And by the way, answering your own questions is perfectly fine! You don't have to be sorry for that. \$\endgroup\$ Commented Jun 19, 2015 at 18:58
  • \$\begingroup\$ @AlexandreDesbiens Self-accepting isn't allowed for two days - I can't yet. \$\endgroup\$
    – user67576
    Commented Jun 20, 2015 at 0:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .