-- -- common_tt.lua -- Common setting for server and client -- --_DEBUG_LOG = {'UNDEF','MISC','OPTIMIZATION','TOPTIMES','STATE','JOINER','TIMER'} -- More logging _TESTING = false -- Any user can issue test commands --------------------------------------------------------------------------- -- Math extentions --------------------------------------------------------------------------- function math.lerp(from,to,alpha) return from + (to-from) * alpha end function math.clamp(low,value,high) return math.max(low,math.min(value,high)) end function math.wrap(low,value,high) while value > high do value = value - (high-low) end while value < low do value = value + (high-low) end return value end function math.wrapdifference(low,value,other,high) return math.wrap(low,value-other,high)+other end -- curve is { {x1, y1}, {x2, y2}, {x3, y3} ... } function math.evalCurve( curve, input ) -- First value if input 0 then self.count = self.count - 1 if self.count == 0 then self.timer = nil end end self.fn(unpack(self.args)) end ---------------------------------------------------------------------------