View Full Version : Implementing ray casting

05-05-2016, 11:58 PM
Hey guys i wanted to know if any one could point me in the right place to learn how to implement ray casting. I have searched every where and i cant find any thing on the subject that is actually helpful or not outdated. I need it in order to drag 2d sprites around a screen. Any help would be much appreciated.

05-07-2016, 07:14 AM

I've never implemented ray casting myself, but I used it in physics engines like Bullet and Open Dynamics Engine. They are Open Source so you might want to learn from their code.

Here as a start:
http://ode-wiki.org/wiki/index.php?title=Manual:_Collision_Detection#Ray_Cl ass

Or this might help for 2d from Box2D:

Hope this helps.