pub struct WorldConfig {
Show 24 fields pub max_clients: usize, pub chunk_size: usize, pub sub_chunks: usize, pub min_chunk: [i32; 2], pub max_chunk: [i32; 2], pub max_height: usize, pub max_light_level: u32, pub max_chunks_per_tick: usize, pub max_updates_per_tick: usize, pub max_response_per_tick: usize, pub max_saves_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 collision_repulsion: f32, pub seed: u32, pub terrain: NoiseParams, pub saving: bool, pub save_dir: String, pub save_interval: usize,
}
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.

sub_chunks: usize

The number of sub chunks a chunk is divided into to mesh more efficiently. Defaults to 4.

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_chunks_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.

max_saves_per_tick: usize

Maximum chunks saved per tick.

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.

collision_repulsion: f32

The repulsion factor when a collision is detected between entities.

seed: u32

Seed of the world. Default is “Voxelize”.

terrain: NoiseParams

Terrain parameters

saving: bool

Whether this world is saved.

save_dir: String

Path to save all the saved chunks. Needs save to be true to be used.

save_interval: usize

Saving interval.

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

Convert 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. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. 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 inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

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