-
Notifications
You must be signed in to change notification settings - Fork 2
raylib.GetRayCollisionTriangle
JoeStrout edited this page Apr 29, 2026
·
2 revisions
Get collision info between ray and triangle NOTE: The points are expected to be in counter-clockwise winding NOTE: Based on https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm
| Parameter | Default Value | Note |
|---|---|---|
| ray | ||
| p1 | ||
| p2 | ||
| p3 |
| Condition | Return Value |
|---|---|
| (always) | map |
ray = {position:[0,5,0], direction:[0,-1,0]}
v1 = [-1,0,-1]
v2 = [1,0,-1]
v3 = [0,0,1]
rc = raylib.GetRayCollisionTriangle(ray, v1, v2, v3)
if rc.hit then
print "Hit triangle at: " + rc.point
end if