Advertisement

Ball bouncing against a cuboid

Started by April 14, 2003 10:11 PM
-1 comments, last by HarryW 21 years, 10 months ago
Hi all. This is probably a question with a very simple answer, so my apologies in advance if it''s obvious. I did check the forum FAQ. I have a ball bouncing around. I also have static objects, constructed from cuboids, with which the ball might collide. I would like to know how I can detect this, given that the collision could occur at any angle. My idea so far is that I should take the displacement vector between the sphere and cuboid and project it onto each of the three unit vectors aligned with the normals of the cuboid''s faces. I hope that makes sense. If the magnitude of each of these projections is less than the radius of the sphere, a collision would be detected. I am not sure if this is correct, though, and I am not certain how I would know with which of the faces of the cuboid the sphere had collided. Any advice would be much appreciated Thanks. Harry.
Harry.

This topic is closed to new replies.

Advertisement