Struct voxelize::WorldConfig
source · pub struct WorldConfig {Show 30 fields
pub max_clients: usize,
pub chunk_size: usize,
pub sub_chunks: usize,
pub min_chunk: [i32; 2],
pub max_chunk: [i32; 2],
pub preload: bool,
pub preload_radius: usize,
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 time_per_day: u64,
pub water_level: usize,
pub gravity: [f32; 3],
pub min_bounce_impulse: f32,
pub air_drag: f32,
pub does_tick_time: bool,
pub default_time: f32,
pub fluid_drag: f32,
pub fluid_density: f32,
pub collision_repulsion: f32,
pub client_collision_repulsion: f32,
pub seed: u32,
pub terrain: NoiseOptions,
pub saving: bool,
pub save_dir: String,
pub save_interval: usize,
pub command_symbol: String,
}
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 8.
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].
preload: bool
Whether or not should the world preload.
preload_radius: usize
The radius at which the world should preload.
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 1000 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.
time_per_day: u64
The amount of ticks per day. Default is 24000 ticks.
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.
does_tick_time: bool
§default_time: f32
§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.
client_collision_repulsion: f32
The repulsion factor when a collision is detected between clients and clients.
seed: u32
Seed of the world. Default is “Voxelize”.
terrain: NoiseOptions
Terrain options
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.
command_symbol: String
Prefix for all commands.
Implementations§
source§impl WorldConfig
impl WorldConfig
sourcepub fn new() -> WorldConfigBuilder
pub fn new() -> WorldConfigBuilder
Create a new world config using the Builder pattern.
Trait Implementations§
source§impl Clone for WorldConfig
impl Clone for WorldConfig
source§fn clone(&self) -> WorldConfig
fn clone(&self) -> WorldConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Default for WorldConfig
impl Default for WorldConfig
Auto Trait Implementations§
impl Freeze for WorldConfig
impl RefUnwindSafe for WorldConfig
impl Send for WorldConfig
impl Sync for WorldConfig
impl Unpin for WorldConfig
impl UnwindSafe for WorldConfig
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
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.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.source§impl<T> TryDefault for Twhere
T: Default,
impl<T> TryDefault for Twhere
T: Default,
source§fn try_default() -> Result<T, String>
fn try_default() -> Result<T, String>
source§fn unwrap_default() -> Self
fn unwrap_default() -> Self
try_default
and panics on an error case.