mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-29 16:24:35 +00:00
[fixed] broken intersect.circle_circle_collide result
This commit is contained in:
parent
6eb979a68c
commit
ab0839430a
@ -55,7 +55,7 @@ function intersect.circle_circle_collide(a_pos, a_rad, b_pos, b_rad, into)
|
|||||||
into = vec2:zero()
|
into = vec2:zero()
|
||||||
end
|
end
|
||||||
--normalise, scale to separating distance
|
--normalise, scale to separating distance
|
||||||
into:vset(_ccc_delta):sdiv(dist):smuli(rad - dist)
|
into:vset(_ccc_delta):sdivi(dist):smuli(rad - dist)
|
||||||
return into
|
return into
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
@ -97,7 +97,7 @@ function intersect._line_displacement_to_sep(a_start, a_end, separation, total_r
|
|||||||
if sep <= 0 then
|
if sep <= 0 then
|
||||||
if distance <= COLLIDE_EPS then
|
if distance <= COLLIDE_EPS then
|
||||||
--point intersecting the line; push out along normal
|
--point intersecting the line; push out along normal
|
||||||
separation:vset(a_end):vsub(a_start):normalisei():rot90li()
|
separation:vset(a_end):vsubi(a_start):normalisei():rot90li()
|
||||||
else
|
else
|
||||||
separation:smuli(-sep)
|
separation:smuli(-sep)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user