pub struct WorldEditor {Show 35 fields
pub heightmap: Heightmap,
pub cell_size: f32,
pub height_scale: f32,
pub sea_level: f32,
pub world_name: String,
pub metadata: HashMap<String, String>,
pub temperature_map: Vec<f32>,
pub humidity_map: Vec<f32>,
pub biome_system: BiomeSystem,
pub weather: WeatherSystem,
pub road_network: RoadNetwork,
pub atmosphere: AtmosphereParams,
pub rivers: Vec<RiverPath>,
pub lakes: Vec<LakeBody>,
pub shore: Option<OceanShore>,
pub foliage: Vec<FoliageInstance>,
pub foliage_params: Vec<FoliagePlacementParams>,
pub selection: SelectionState,
pub undo_redo: UndoRedoStack,
pub active_tool: EditorTool,
pub brush: BrushSettings,
pub utc_hour: f64,
pub day_of_year: f64,
pub latitude: f64,
pub longitude: f64,
pub solar: SolarState,
pub stats: WorldStats,
pub terrain_fbm_params: FbmParams,
pub warp_strength: f32,
pub erosion_params: ErosionParams,
pub master_seed: u64,
pub heightmap_dirty: bool,
pub climate_dirty: bool,
pub foliage_dirty: bool,
pub water_dirty: bool,
}Fields§
§heightmap: Heightmap§cell_size: f32§height_scale: f32§sea_level: f32§world_name: String§metadata: HashMap<String, String>§temperature_map: Vec<f32>§humidity_map: Vec<f32>§biome_system: BiomeSystem§weather: WeatherSystem§road_network: RoadNetwork§atmosphere: AtmosphereParams§rivers: Vec<RiverPath>§lakes: Vec<LakeBody>§shore: Option<OceanShore>§foliage: Vec<FoliageInstance>§foliage_params: Vec<FoliagePlacementParams>§selection: SelectionState§undo_redo: UndoRedoStack§active_tool: EditorTool§brush: BrushSettings§utc_hour: f64§day_of_year: f64§latitude: f64§longitude: f64§solar: SolarState§stats: WorldStats§terrain_fbm_params: FbmParams§warp_strength: f32§erosion_params: ErosionParams§master_seed: u64§heightmap_dirty: bool§climate_dirty: bool§foliage_dirty: bool§water_dirty: boolImplementations§
Source§impl WorldEditor
impl WorldEditor
pub fn new(width: usize, height: usize, cell_size: f32) -> Self
pub fn generate_terrain(&mut self)
pub fn apply_erosion(&mut self)
pub fn apply_thermal_erosion(&mut self, iterations: usize, talus_deg: f32)
pub fn generate_climate(&mut self)
pub fn get_biome_at(&self, x: usize, y: usize) -> BiomeBlendSample
pub fn generate_rivers(&mut self, num_rivers: usize)
pub fn generate_lakes(&mut self, num_lakes: usize, max_water_level: f32)
pub fn generate_shore(&mut self)
pub fn place_foliage_layer(&mut self, params: FoliagePlacementParams, seed: u64)
pub fn clear_foliage(&mut self)
pub fn cull_foliage(&mut self, frustum: &Frustum) -> Vec<usize>
pub fn build_road( &mut self, start: Vec2, end: Vec2, road_type: RoadType, ) -> Option<u32>
pub fn update_solar(&mut self)
pub fn advance_time(&mut self, delta_hours: f64)
pub fn raise_terrain(&mut self, cx: f32, cy: f32, delta: f32)
pub fn lower_terrain(&mut self, cx: f32, cy: f32, delta: f32)
pub fn smooth_terrain(&mut self, cx: f32, cy: f32, iters: usize)
pub fn flatten_terrain(&mut self, cx: f32, cy: f32, target: f32)
pub fn undo(&mut self)
pub fn redo(&mut self)
pub fn ray_cast(&self, ray_origin: Vec3, ray_dir: Vec3) -> Option<RayHit>
pub fn compute_stats(&mut self)
pub fn serialize(&self) -> Vec<u8> ⓘ
pub fn generate_full_world( &mut self, num_rivers: usize, num_lakes: usize, foliage_density: f32, )
pub fn world_to_heightmap(&self, world: Vec3) -> (usize, usize)
pub fn heightmap_to_world(&self, x: usize, z: usize) -> Vec3
pub fn world_bounds(&self) -> (Vec3, Vec3)
pub fn get_selection_pivot(&self) -> Vec3
pub fn measure_distance(&self, a_world: Vec3, b_world: Vec3) -> f32
pub fn measure_area_of_selection(&self) -> f32
pub fn compute_lod_factor( &self, pos: Vec3, camera_pos: Vec3, lod_distances: &[f32], ) -> u8
pub fn update_foliage_lod(&mut self, camera_pos: Vec3)
pub fn sample_sky_at_direction(&self, dir: Vec3) -> Vec3
Source§impl WorldEditor
impl WorldEditor
pub fn snapshot(&self) -> EditorStateSnapshot
pub fn restore_heightmap(&mut self, snapshot: &EditorStateSnapshot)
Source§impl WorldEditor
impl WorldEditor
Sourcepub fn generate_from_seed(&mut self, seed: u64)
pub fn generate_from_seed(&mut self, seed: u64)
Generate a complete terrain from a user-provided seed value
Sourcepub fn height_at_world(&self, x: f32, z: f32) -> f32
pub fn height_at_world(&self, x: f32, z: f32) -> f32
Get height at a world position (x, z in world units)
Sourcepub fn normal_at_world(&self, x: f32, z: f32) -> Vec3
pub fn normal_at_world(&self, x: f32, z: f32) -> Vec3
Get surface normal at a world position
Sourcepub fn is_underwater(&self, x: f32, z: f32) -> bool
pub fn is_underwater(&self, x: f32, z: f32) -> bool
Check if a world position is underwater
Sourcepub fn biome_at_world(&self, x: f32, z: f32) -> BiomeId
pub fn biome_at_world(&self, x: f32, z: f32) -> BiomeId
Get biome at a world position
Sourcepub fn resize_world(&mut self, new_width: usize, new_height: usize)
pub fn resize_world(&mut self, new_width: usize, new_height: usize)
Resize the world (resample heightmap to new dimensions)
Sourcepub fn import_heightmap(&mut self, data: &[f32], width: usize, height: usize)
pub fn import_heightmap(&mut self, data: &[f32], width: usize, height: usize)
Apply a heightmap from external data
Sourcepub fn export_heightmap_u16(&self) -> Vec<u8> ⓘ
pub fn export_heightmap_u16(&self) -> Vec<u8> ⓘ
Export heightmap as 16-bit grayscale image bytes (big-endian per pixel)
Sourcepub fn export_heightmap_u8(&self) -> Vec<u8> ⓘ
pub fn export_heightmap_u8(&self) -> Vec<u8> ⓘ
Export heightmap as 8-bit grayscale image bytes
Source§impl WorldEditor
impl WorldEditor
pub fn apply_island_mask(&mut self, falloff_exp: f32)
pub fn compute_snow_map(&self, snow_line: f32, temp_thresh: f32) -> Vec<f32>
pub fn build_chunk_mesh( &self, chunk_x: usize, chunk_z: usize, chunk_size: usize, lod_step: usize, ) -> TerrainMesh
pub fn compute_ao(&self, num_rays: usize, max_dist: f32) -> Vec<f32>
pub fn compute_shadow_map(&self) -> Vec<f32>
pub fn render_minimap(&self, out_w: usize, out_h: usize) -> Vec<u8> ⓘ
pub fn find_peaks( &self, min_height: f32, search_radius: usize, ) -> Vec<(usize, usize, f32)>
pub fn generate_wind_field(&self, turbulence: f32) -> WindField
pub fn stamp_hill( &mut self, world_x: f32, world_z: f32, radius: f32, height: f32, sharpness: f32, )
pub fn world_report(&self) -> String
pub fn validate(&self) -> Vec<String>
pub fn day_length_hours(&self) -> f64
pub fn rebuild_all(&mut self)
pub fn sample_sky_color(&self, view_dir: Vec3) -> Vec3
pub fn compute_viewshed( &self, obs_x: usize, obs_z: usize, obs_height: f32, max_dist: f32, ) -> Vec<bool>
Source§impl WorldEditor
impl WorldEditor
Sourcepub fn apply_profile(&mut self, profile: &WorldGenProfile, seed: u64)
pub fn apply_profile(&mut self, profile: &WorldGenProfile, seed: u64)
Apply a complete WorldGenProfile — full procedural pipeline
Source§impl WorldEditor
impl WorldEditor
Sourcepub fn place_volcano(
&mut self,
world_x: f32,
world_z: f32,
radius: f32,
rim_height: f32,
caldera_depth: f32,
)
pub fn place_volcano( &mut self, world_x: f32, world_z: f32, radius: f32, rim_height: f32, caldera_depth: f32, )
Place a volcano at a world position
Sourcepub fn place_mesa(
&mut self,
world_x: f32,
world_z: f32,
radius: f32,
height: f32,
steepness: f32,
)
pub fn place_mesa( &mut self, world_x: f32, world_z: f32, radius: f32, height: f32, steepness: f32, )
Place a mesa (flat-topped plateau) at a world position
Sourcepub fn place_crater(
&mut self,
world_x: f32,
world_z: f32,
radius: f32,
rim_height: f32,
depth: f32,
)
pub fn place_crater( &mut self, world_x: f32, world_z: f32, radius: f32, rim_height: f32, depth: f32, )
Place an impact crater at a world position
Sourcepub fn fill_terrain_sinks(&mut self)
pub fn fill_terrain_sinks(&mut self)
Fill terrain sinks (hydrological preprocessing)
Sourcepub fn stats_for_region(
&self,
x0: usize,
y0: usize,
x1: usize,
y1: usize,
) -> WorldStats
pub fn stats_for_region( &self, x0: usize, y0: usize, x1: usize, y1: usize, ) -> WorldStats
Compute statistics for a specific region
Sourcepub fn gaussian_smooth(&mut self, sigma: f32)
pub fn gaussian_smooth(&mut self, sigma: f32)
Smooth the entire heightmap with a Gaussian filter
Generate full navigation data for the world
Sourcepub fn biome_percentages(&self) -> [(BiomeId, f32); 25]
pub fn biome_percentages(&self) -> [(BiomeId, f32); 25]
Get biome statistics (percentage of each biome type)
Source§impl WorldEditor
impl WorldEditor
Sourcepub fn place_vegetation_by_rules(&mut self, seed: u64)
pub fn place_vegetation_by_rules(&mut self, seed: u64)
Place vegetation according to rules database
Sourcepub fn build_voronoi_biome_map(&self, num_sites: usize) -> VoronoiMap
pub fn build_voronoi_biome_map(&self, num_sites: usize) -> VoronoiMap
Build a Voronoi biome map
Sourcepub fn terrain_material_at(&self, x: usize, y: usize) -> TerrainMaterial
pub fn terrain_material_at(&self, x: usize, y: usize) -> TerrainMaterial
Get a material for a terrain cell based on slope/altitude/biome
Sourcepub fn set_metadata(&mut self, key: &str, value: &str)
pub fn set_metadata(&mut self, key: &str, value: &str)
Add metadata to the world
pub fn get_metadata(&self, key: &str) -> Option<&String>
Sourcepub fn simulate_rain_event(&mut self, intensity: f32, duration_hours: f32)
pub fn simulate_rain_event(&mut self, intensity: f32, duration_hours: f32)
Simulate a single rain event (increases humidity, may trigger erosion)
Sourcepub fn reseat_foliage_to_terrain(&mut self)
pub fn reseat_foliage_to_terrain(&mut self)
Move all foliage onto the current terrain surface (after terrain edit)
Sourcepub fn cull_underwater_foliage(&mut self)
pub fn cull_underwater_foliage(&mut self)
Remove all foliage below sea level (e.g. after sea level change)
Sourcepub fn terrain_triangle_count(&self) -> usize
pub fn terrain_triangle_count(&self) -> usize
Compute the total number of triangles in the terrain mesh at full LOD
Sourcepub fn terrain_memory_bytes(&self) -> usize
pub fn terrain_memory_bytes(&self) -> usize
Estimate terrain memory usage in bytes
Sourcepub fn recalculate_rivers(&mut self, num_rivers: usize)
pub fn recalculate_rivers(&mut self, num_rivers: usize)
Recalculate all rivers from scratch using current heightmap
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WorldEditor
impl RefUnwindSafe for WorldEditor
impl Send for WorldEditor
impl Sync for WorldEditor
impl Unpin for WorldEditor
impl UnsafeUnpin for WorldEditor
impl UnwindSafe for WorldEditor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.