1
0
mirror of https://github.com/t-affeldt/regional_weather.git synced 2025-07-18 08:20:28 +02:00

Enable snow setting, update presets to renamed lighting condition

This commit is contained in:
Till Affeldt
2020-04-18 08:03:02 +02:00
parent 9084bdf4b2
commit 52f06da30f
12 changed files with 29 additions and 18 deletions

View File

@ -3,16 +3,19 @@ local name = "regional_weather:ambient"
local CLOUD_SPEED = 1.8
local conditions = {
min_light = 15
min_daylight = 15
}
local function generate_effects(params)
local override = {}
local wind = vector.new(params.wind_x, 0, params.wind_z)
--[[override["climate_api:clouds"] = {
size = climate_api.utility.rangelim(params.humidity / 100, 0.25, 0.98),
speed = vector.multiply(params.wind, CLOUD_SPEED)
}]]
override["climate_api:skybox"] = {
cloud_data = {
size = climate_api.utility.rangelim(params.humidity / 100, 0.25, 0.98),
speed = vector.multiply(wind, CLOUD_SPEED)
}
}
local movement = params.player:get_player_velocity()
local movement_direction
@ -21,7 +24,7 @@ local function generate_effects(params)
else
movement_direction = vector.normalize(movement)
end
local vector_product = vector.dot(movement_direction, params.wind)
local vector_product = vector.dot(movement_direction, wind)
local movement_penalty = climate_api.utility.sigmoid(vector_product, 1.6, 0.2, 0.8) + 0.2
override["regional_weather:speed_buff"] = movement_penalty
return override