mirror of
https://github.com/appgurueu/modlib.git
synced 2024-12-22 05:12:28 +01:00
Add vector.reflect
This commit is contained in:
parent
9d29f42b4c
commit
b938ef85e0
@ -187,6 +187,10 @@ function dot(v, w)
|
||||
return sum
|
||||
end
|
||||
|
||||
function reflect(v, normal --[[**normalized** plane normal vector]])
|
||||
return subtract(v, multiply_scalar(normal, 2 * dot(v, normal))) -- reflection of v at the plane
|
||||
end
|
||||
|
||||
--+ Angle between two vectors
|
||||
--> Signed angle in radians
|
||||
function angle(v, w)
|
||||
|
Loading…
Reference in New Issue
Block a user