mirror of
https://github.com/vrld/HC.git
synced 2024-11-18 12:54:23 +00:00
Fix PointShape:intersectsRay() - return true only of point on ray
This commit is contained in:
parent
787c980fdd
commit
736c9ba933
@ -279,7 +279,8 @@ end
|
||||
function PointShape:intersectsRay(x,y,dx,dy)
|
||||
local p = self._pos - vector(x,y)
|
||||
local d = vector(dx,dy)
|
||||
return p * vector(dy, -dx), p * d / d:len2()
|
||||
local t = p * d / d:len2()
|
||||
return t >= 0, t
|
||||
end
|
||||
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user