Changes related to ray-collision, and luprex global variable stuff
This commit is contained in:
21
luprex/lua/old/basics.lua
Normal file
21
luprex/lua/old/basics.lua
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user