Changes related to ray-collision, and luprex global variable stuff

This commit is contained in:
2025-01-14 18:37:31 -05:00
parent cd3e78a206
commit a01f6f4e7b
24 changed files with 180 additions and 317 deletions

21
luprex/lua/old/basics.lua Normal file
View File

@@ -0,0 +1,21 @@
makeclass('NilIsZero') -- This is intended to be used as a metatable
makeclass('login')
function NilIsZero.__index(t,k)
return 0
end
function NilIsZero.__newindex(t,k,v)
if v~=nil and v~=0 then rawset(t,k,v) end
end
function seq(a,b,c) return a<=b and b<=c end
function bound(a,b,c)
if b<a then return b elseif b>c then return c else return b end
end
function lerp(a,b,c,d,e)
return d+(e-d)*(a-b)/(c-b)
end