pub struct WorldConfig {
Show 18 fields pub max_clients: usize, pub chunk_size: usize, pub min_chunk: [i32; 2], pub max_chunk: [i32; 2], pub max_height: usize, pub max_light_level: u32, pub max_chunk_per_tick: usize, pub max_updates_per_tick: usize, pub max_response_per_tick: usize, pub preload_radius: u32, pub water_level: usize, pub gravity: [f32; 3], pub min_bounce_impulse: f32, pub air_drag: f32, pub fluid_drag: f32, pub fluid_density: f32, pub seed: u32, pub terrain: NoiseParams,
}
Expand description

World configuration, storing information of how a world is constructed.

Fields

max_clients: usize

Max clients for each world. Default is 100 clients.

chunk_size: usize

The horizontal dimension of the chunks in this world. Default is 16 blocks wide.

min_chunk: [i32; 2]

The minimum inclusive chunk on this world. Default is [i32::MIN, i32::MIN].

max_chunk: [i32; 2]

The maximum inclusive chunk on this world. Default is [i32::MAX, i32::MAX].

max_height: usize

Max height of the world. Default is 256 blocks high.

max_light_level: u32

Max light level that light can propagate. Default is 15 blocks.

max_chunk_per_tick: usize

Maximum chunks to be processed per tick. Default is 24 chunks.

max_updates_per_tick: usize

Maximum voxel updates to be processed per tick. Default is 500 voxels.

max_response_per_tick: usize

Maximum responses to send to client per tick to prevent bottle-necking. Default is 4 chunks.

preload_radius: u32

Radius of chunks around 0,0 to be preloaded. Default is 8 chunks.

water_level: usize

Water level of the voxelize world.

gravity: [f32; 3]

Gravity of the voxelize world.

min_bounce_impulse: f32

Minimum impulse to start bouncing.

air_drag: f32

Drag of the air in the voxelize world.

fluid_drag: f32

Drag of the fluid in the voxelize world.

fluid_density: f32

Fluid density of the voxelize world. TODO: move this to registry.

seed: u32

Seed of the world. Default is “Voxelize”.

terrain: NoiseParams

Terrain parameters

Implementations

Create a new world config using the Builder pattern.

Example
let config = WorldConfig::new().chunk_size(8).max_height(64).build();
server.create_world("small-world", &config);

Get the INIT configurations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Tries to create the default.

Calls try_default and panics on an error case.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more