Love2d: Haxe: Ray-circle intersection test


HaxeNME version. Love2d version works equally to this.
Click and drag different parts for interaction.

By user request on Love2d IRC channel, yesterday I've made this nice function to do intersection/collision check between a ray (for clearance, here, a ray is a infinite line with starting point but no end point) and a circle.
Underlying code is fairly simple, though it does not even require understanding to use the function.
Love2d version takes advantage of multi-return values.
Haxe version has slightly longer code due for more optimal implementation of interface.

Download Haxe .hx
Download Love2d .love

Related posts:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.