-
Notifications
You must be signed in to change notification settings - Fork 2
raylib.Vector2Refract
JoeStrout edited this page Apr 29, 2026
·
2 revisions
Compute the direction of a refracted ray v: normalized direction of the incoming ray n: normalized normal vector of the interface of two optical media r: ratio of the refractive index of the medium from where the ray comes to the refractive index of the medium on the other side of the surface
| Parameter | Default Value | Note |
|---|---|---|
| v | [0, 0] | |
| n | [0, 1] | |
| r | 1 |
| Condition | Return Value |
|---|---|
| (always) | list |
v = [0, -1] // normalized incoming ray (straight down)
n = [0, 1] // surface normal pointing up
r = 0.9 // ratio of refractive indices
result = raylib.Vector2Refract(v, n, r)
print result