static void render_grass(v3s32 pos, unused MapNode *node, Vertex3D *vertex, unused int f, unused int v)
{
- f32 wet_min, wet_max, temp_max;
- wet_min = 0.13f;
- wet_max = 0.33f;
+ f32 hum_min, hum_max, temp_max;
+ hum_min = 0.13f;
+ hum_max = 0.33f;
temp_max = 0.45f;
f32 temp_f = clamp(0.3f - get_temperature(pos), 0.0f, 0.3f) / 0.3f;
- vertex->color.h = (get_wetness(pos) * (wet_max - wet_min) + wet_min) * (1.0f - temp_f) + temp_max * temp_f;
+ vertex->color.h = (get_humidity(pos) * (hum_max - hum_min) + hum_min) * (1.0f - temp_f) + temp_max * temp_f;
vertex->color.s = 1.0f;
vertex->color.v = 1.0f;
}
v3s32 node_pos = {client_player.pos.x, client_player.pos.y, client_player.pos.z};
char info_text[BUFSIZ];
- sprintf(info_text, "(%.1f %.1f %.1f) wetness: %.2f temperature: %.2f flight: %s collision: %s", client_player.pos.x, client_player.pos.y, client_player.pos.z, get_wetness(node_pos), get_temperature(node_pos), client_player.fly ? "enabled" : "disabled", client_player.collision ? "enabled" : "disabled");
+ sprintf(info_text, "(%.1f %.1f %.1f) humidity: %.2f temperature: %.2f flight: %s collision: %s", client_player.pos.x, client_player.pos.y, client_player.pos.z, get_humidity(node_pos), get_temperature(node_pos), client_player.fly ? "enabled" : "disabled", client_player.collision ? "enabled" : "disabled");
hud_change_text(client_player.info_hud, info_text);
}
bool fly; // can the player fly?
bool collision; // should the player collide with the floor?
Object *obj; // 3D mesh object (currently always invisible), not thread safe
- HUDElement *info_hud; // display position, temperature and wetness on HUD, not thread safe
+ HUDElement *info_hud; // display position, temperature and humidity on HUD, not thread safe
} client_player;
void client_player_init(); // ClientPlayer singleton constructor
#include "perlin.h"
#include "util.h"
-f64 get_wetness(v3s32 pos)
+f64 get_humidity(v3s32 pos)
{
return smooth2d(U32(pos.x) / 128.0, U32(pos.z) / 128.0, 0, seed + SO_WETNESS) * 0.5 + 0.5;
}
#include "types.h"
-f64 get_wetness(v3s32 pos);
+f64 get_humidity(v3s32 pos);
f64 get_temperature(v3s32 pos);
#endif
return pow((height + 96) * pow(((smooth2d(U32(pos.x) / 48.0, U32(pos.y) / 48.0, 0, seed + SO_MOUNTAIN_HEIGHT) + 1.0) * 256.0 + 128.0), factor), 1.0 / (factor + 1.0)) - 96;
}
-static Node generate_mountain(unused v3s32 pos, s32 diff, unused f64 wetness, unused f64 temperature, unused f64 factor, unused MapBlock *block, unused List *changed_blocks, unused void *row_data, unused void *block_data)
+static Node generate_mountain(unused v3s32 pos, s32 diff, unused f64 humidity, unused f64 temperature, unused f64 factor, unused MapBlock *block, unused List *changed_blocks, unused void *row_data, unused void *block_data)
{
return diff <= 0 ? NODE_STONE : NODE_AIR;
}
return rdata->vulcano ? max(ocean_floor, rdata->vulcano_height) : ocean_floor;
}
-static Node generate_ocean(v3s32 pos, s32 diff, unused f64 wetness, unused f64 temperature, unused f64 factor, unused MapBlock *block, unused List *changed_blocks, void *row_data, unused void *block_data)
+static Node generate_ocean(v3s32 pos, s32 diff, unused f64 humidity, unused f64 temperature, unused f64 factor, unused MapBlock *block, unused List *changed_blocks, void *row_data, unused void *block_data)
{
OceanRowData *rdata = row_data;
return height;
}
-static Node generate_hills(v3s32 pos, s32 diff, unused f64 wetness, unused f64 temperature, unused f64 factor, unused MapBlock *block, List *changed_blocks, unused void *row_data, unused void *block_data)
+static Node generate_hills(v3s32 pos, s32 diff, unused f64 humidity, unused f64 temperature, unused f64 factor, unused MapBlock *block, List *changed_blocks, unused void *row_data, unused void *block_data)
{
if (diff == 2 && smooth2d(U32(pos.x), U32(pos.z), 0, seed + SO_BOULDER_CENTER) > 0.999) {
for (s8 bx = -1; bx <= 1; bx++) {
f64 threshold;
bool snow;
s32 (*height)(v2s32 pos, f64 factor, s32 height, void *row_data, void *block_data);
- Node (*generate)(v3s32 pos, s32 diff, f64 wetness, f64 temperature, f64 factor, MapBlock *block, List *changed_blocks, void *row_data, void *block_data);
+ Node (*generate)(v3s32 pos, s32 diff, f64 humidity, f64 temperature, f64 factor, MapBlock *block, List *changed_blocks, void *row_data, void *block_data);
size_t block_data_size;
void (*preprocess_block)(MapBlock *block, List *changed_blocks, void *block_data);
size_t row_data_size;
for (u8 y = 0; y < MAPBLOCK_SIZE; y++) {
v3s32 pos = {pos_horizontal.x, block_node_pos.y + y, pos_horizontal.y};
- f64 wetness = get_wetness(pos);
+ f64 humidity = get_humidity(pos);
f64 temperature = get_temperature(pos);
s32 diff = pos.y - height;
- Node node = biome_def->generate(pos, diff, wetness, temperature, factor, block, changed_blocks, row_data, block_data[biome]);
+ Node node = biome_def->generate(pos, diff, humidity, temperature, factor, block, changed_blocks, row_data, block_data[biome]);
if (biome_def->snow && diff <= 1 && temperature < 0.0 && node == NODE_AIR)
node = NODE_SNOW;