summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRay <[email protected]>2021-03-01 23:39:08 +0100
committerRay <[email protected]>2021-03-01 23:39:08 +0100
commit3f6a08535fab019512f7c4560878d76fee77f83a (patch)
tree0f773e205f04cf9e1fe772a6053afac7c984545d /src
parent0f10c44578c4500b770589e34cd8404bee4e8cba (diff)
downloadraylib-3f6a08535fab019512f7c4560878d76fee77f83a.tar.gz
raylib-3f6a08535fab019512f7c4560878d76fee77f83a.zip
REVIEWED: CheckCollisionLines()
Diffstat (limited to 'src')
-rw-r--r--src/shapes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shapes.c b/src/shapes.c
index 0f5e4d5c..343625df 100644
--- a/src/shapes.c
+++ b/src/shapes.c
@@ -1477,7 +1477,7 @@ bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2,
if (div == 0.0f) return false; // WARNING: This check could not work due to float precision rounding issues...
- const float xi = ((startPos2.x - startPos2.x)*(startPos1.x*endPos1.y - startPos1.y*endPos1.x) - (startPos1.x - endPos1.x)*(startPos2.x*endPos2.y - startPos2.y*endPos2.x))/div;
+ const float xi = ((startPos2.x - endPos2.x)*(startPos1.x*endPos1.y - startPos1.y*endPos1.x) - (startPos1.x - endPos1.x)*(startPos2.x*endPos2.y - startPos2.y*endPos2.x))/div;
const float yi = ((startPos2.y - endPos2.y)*(startPos1.x*endPos1.y - startPos1.y*endPos1.x) - (startPos1.y - endPos1.y)*(startPos2.x*endPos2.y - startPos2.y*endPos2.x))/div;
if (xi < fminf(startPos1.x, endPos1.x) || xi > fmaxf(startPos1.x, endPos1.x)) return false;