ray casting.

Dec 9, 2010 at 8:45 AM

Hi im really stuck with how to check a collison between a line and a circle. Im asuming i need to use ray casting, but cant work out how to do it. Any help would be greate.

Dec 9, 2010 at 9:57 AM

Could you provide a bit more information, what exactly you are trying to achieve? Basically Farseer handles collision detection between any objects for you and you should not need to use any ray casting at all for that purpose. Most of the time ray casting should only be needed to gain information on presumable collisions in the (near) future that have not happend yet.

You need to subscribe to the OnCollision delegate of a fixtures for example, to be notified when a collision between this fixture and other objects happens.

Dec 9, 2010 at 10:07 AM

Im createing a pool game, where as i set the angle of the cueball i want to callculate the angle of the  ball that im going to hit and draw a line for it.