Skip to content

Commit

Permalink
Copy documentation from SimConfigRaw to SimConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
patowen committed Jun 24, 2024
1 parent 2e110c9 commit b95f693
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions common/src/sim_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ pub struct SimConfigRaw {
pub struct SimConfig {
/// Amount of time between each step. Inverse of the rate
pub step_interval: Duration,
/// Maximum distance at which anything can be seen in absolute units
pub view_distance: f32,
pub input_queue_size: Duration,
/// Whether gameplay-like restrictions exist, such as limited inventory
pub gameplay_enabled: bool,
/// Number of voxels along the edge of a chunk
pub chunk_size: u8,
/// Static configuration information relevant to character physics
pub character: CharacterConfig,
/// Scaling factor converting meters to absolute units
pub meters_to_absolute: f32,
Expand Down Expand Up @@ -93,28 +97,41 @@ pub struct CharacterConfigRaw {
pub air_resistance: Option<f32>,
/// How fast the player jumps off the ground in m/s
pub jump_speed: Option<f32>,
/// How far away the player needs to be from the ground in meters to be considered in the air
/// How far away the player needs to be from the ground in meters to be considered in the air in meters
pub ground_distance_tolerance: Option<f32>,
/// Radius of the character in meters
pub character_radius: Option<f32>,
/// How far a character can reach when placing blocks
/// How far a character can reach when placing blocks in meters
pub block_reach: Option<f32>,
}

/// Static configuration information relevant to character physics
/// Static configuration information relevant to character physics. Most fields are based on
/// absolute units and seconds.
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct CharacterConfig {
/// Character movement speed in units/s during no-clip
pub no_clip_movement_speed: f32,
/// Character maximumum movement speed while on the ground in units/s
pub max_ground_speed: f32,
/// Character artificial speed cap to avoid overloading the server in units/s
pub speed_cap: f32,
/// Maximum ground slope (0=horizontal, 1=45 degrees)
pub max_ground_slope: f32,
/// Character acceleration while on the ground in units/s^2
pub ground_acceleration: f32,
/// Character acceleration while in the air in units/s^2
pub air_acceleration: f32,
/// Acceleration of gravity in units/s^2
pub gravity_acceleration: f32,
/// Air resistance in (units/s^2) per (units/s); scales linearly with respect to speed
pub air_resistance: f32,
/// How fast the player jumps off the ground in units/s
pub jump_speed: f32,
/// How far away the player needs to be from the ground in meters to be considered in the air in absolute units
pub ground_distance_tolerance: f32,
/// Radius of the character in absolute units
pub character_radius: f32,
/// How far a character can reach when placing blocks in absolute units
pub block_reach: f32,
}

Expand Down

0 comments on commit b95f693

Please sign in to comment.