Tuesday, October 21, 2008

Another way to do the collision detection

Here's another idea I had for detecting the collision. I'm not sure how to do the line-triangle intersection detection though, so whether this is simpler would depend on that.

Read a bit on the subject. It seems to be simple. To know if a line segment defined by two points goes through a triangle, first you check if the line goes through the plane defined by the triangle. This is actually cleverly easy: see if the start point of the line segment is on the other side of the plane than the end point. But hmm... somehow I need to know the intersection point to do the point-in-triangle check after that...