From f8910333a2dc883b093bd49a3a3ca78814a86678 Mon Sep 17 00:00:00 2001 From: Manan Karnik Date: Mon, 22 Jan 2024 20:47:14 +0530 Subject: [PATCH] refactor: update default values --- src/map.rs | 4 ++-- src/noise.rs | 15 +++++---------- src/planet.rs | 21 ++++++++------------- src/terrain.rs | 2 +- 4 files changed, 16 insertions(+), 26 deletions(-) diff --git a/src/map.rs b/src/map.rs index a4baa60..bbd0f9e 100644 --- a/src/map.rs +++ b/src/map.rs @@ -68,8 +68,8 @@ impl Default for Map { fn default() -> Self { Self { noise: Noise::default(), - size: [100; 2], - image_size: [100; 2], + size: [400; 2], + image_size: [400; 2], same_size: true, anti_aliasing: true, export: false, diff --git a/src/noise.rs b/src/noise.rs index e8a82fd..87aad49 100644 --- a/src/noise.rs +++ b/src/noise.rs @@ -138,7 +138,7 @@ impl Default for Gradient { Self { image: Handle::default(), size: [250, 50], - segments: 3, + segments: 0, smoothness: 0.0, } } @@ -179,18 +179,13 @@ impl Default for Noise { function: Function::default(), regions: vec![ Region { - label: "Sand".to_string(), - color: [242, 241, 199, 255], + label: "Region #1".to_string(), + color: [255, 0, 0, 255], position: 0.0, }, Region { - label: "Grass".to_string(), - color: [24, 148, 67, 255], - position: 50.0, - }, - Region { - label: "Forest".to_string(), - color: [10, 82, 35, 255], + label: "Region #2".to_string(), + color: [0, 0, 255, 255], position: 100.0, }, ], diff --git a/src/planet.rs b/src/planet.rs index 3eb9dbc..47ebab6 100644 --- a/src/planet.rs +++ b/src/planet.rs @@ -82,33 +82,28 @@ impl Default for Planet { fn default() -> Self { Self { seed: 0, - scale: 1.0, + scale: 20.0, offset: [0.0; 3], method: Method::Perlin, function: Function::default(), - resolution: 10, + resolution: 20, regions: vec![ Region { - label: "Sand".to_string(), - color: [242, 241, 199, 255], + label: "Region #1".to_string(), + color: [255, 0, 0, 255], position: 0.0, }, Region { - label: "Grass".to_string(), - color: [24, 148, 67, 255], - position: 50.0, - }, - Region { - label: "Forest".to_string(), - color: [10, 82, 35, 255], + label: "Region #2".to_string(), + color: [0, 0, 255, 255], position: 100.0, }, ], gradient: Gradient::default(), base_color: [255, 255, 255, 255], wireframe: false, - height_exponent: 1.0, - sea_percent: 10.0, + height_exponent: 1.5, + sea_percent: 50.0, export: false, } } diff --git a/src/terrain.rs b/src/terrain.rs index 47f7738..951b8c0 100644 --- a/src/terrain.rs +++ b/src/terrain.rs @@ -62,7 +62,7 @@ impl Default for Terrain { Self { noise: Noise::default(), size: [2; 2], - resolution: 10, + resolution: 15, wireframe: false, height_exponent: 1.0, sea_percent: 10.0,