-
Notifications
You must be signed in to change notification settings - Fork 2
raylib.CheckCollisionLines
JoeStrout edited this page Apr 29, 2026
·
2 revisions
Check the collision between two lines defined by two points each, returns collision point by reference REF: https://en.wikipedia.org/wiki/Line–line_intersection#Given_two_points_on_each_line_segment
| Parameter | Default Value | Note |
|---|---|---|
| startPos1 | ||
| endPos1 | ||
| startPos2 | ||
| endPos2 |
| Condition | Return Value |
|---|---|
| (always) | list |
// result is [hit, collisionPoint] where hit is 0 or 1
result = raylib.CheckCollisionLines([0, 100], [400, 100], [200, 0], [200, 300])
if result[0] then print "Lines cross at: " + result[1]