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?

  • \$\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 Jun 19 '15 at 15:18

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.

  • \$\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\$ – Alexandre Desbiens Jun 19 '15 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\$ – Alexandre Desbiens Jun 19 '15 at 18:58
  • \$\begingroup\$ @AlexandreDesbiens Self-accepting isn't allowed for two days - I can't yet. \$\endgroup\$ – user67576 Jun 20 '15 at 0:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.