Update utils.lua
removed `math.sqrt` in favor of `^ 0.5`
This commit is contained in:
parent
130fe2aca0
commit
677cb31de7
@ -4,7 +4,6 @@
|
||||
local modules = (...): gsub('%.[^%.]+$', '') .. "."
|
||||
local vec2 = require(modules .. "vec2")
|
||||
local vec3 = require(modules .. "vec3")
|
||||
local sqrt = math.sqrt
|
||||
local abs = math.abs
|
||||
local ceil = math.ceil
|
||||
local floor = math.floor
|
||||
@ -202,7 +201,7 @@ function utils.refract(i, n, ior)
|
||||
local k = 1 - ior * ior * (1 - d * d)
|
||||
|
||||
if k >= 0 then
|
||||
return (i * ior) - (n * (ior * d + sqrt(k)))
|
||||
return (i * ior) - (n * (ior * d + k ^ 0.5))
|
||||
end
|
||||
|
||||
return vec3()
|
||||
|
Loading…
x
Reference in New Issue
Block a user