mirror of
https://github.com/t-affeldt/regional_weather.git
synced 2025-07-17 16:00:35 +02:00
Change map_range behavior
This commit is contained in:
@ -14,7 +14,9 @@ end
|
||||
|
||||
-- maps range of 0 to 1 to any other range
|
||||
local function map_range(val, low, high)
|
||||
return (val + low) * (high - low)
|
||||
local cal_val = math.min(math.max(val, 0), 1)
|
||||
local range = high - low
|
||||
return low + (cal_val * range)
|
||||
end
|
||||
|
||||
local function generate_effects(params)
|
||||
|
Reference in New Issue
Block a user