2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 07:07:42 +00:00

CLineRenderer fixes

This commit is contained in:
Jack Andersen
2017-11-15 17:24:20 -10:00
parent f1329268a6
commit 21505e46ce
2 changed files with 3 additions and 8 deletions

View File

@@ -106,6 +106,8 @@ static zeus::CVector2f IntersectLines(const zeus::CVector2f& pa1, const zeus::CV
zeus::CVector2f pa1mpa2 = pa1 - pa2;
zeus::CVector2f pb1mpb2 = pb1 - pb2;
float denom = pa1mpa2.x * pb1mpb2.y - pa1mpa2.y * pb1mpb2.x;
if (denom < 0.0001f)
return pa2;
float numt1 = pa1.x * pa2.y - pa1.y * pa2.x;
float numt2 = pb1.x * pb2.y - pb1.y * pb2.x;
return {(numt1 * pb1mpb2.x - pa1mpa2.x * numt2) / denom,