From 50cce536b4a673a94adfef7f2df2d083207fd5a4 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 29 Sep 2022 21:42:40 -0400 Subject: [PATCH] Grep for 'PHYSICSSTATE TODO' --- common/src/states/climb.rs | 3 +++ common/src/states/glide.rs | 4 ++++ common/src/states/skate.rs | 1 + common/src/states/spin_melee.rs | 1 + common/src/states/utils.rs | 4 ++++ 5 files changed, 13 insertions(+) diff --git a/common/src/states/climb.rs b/common/src/states/climb.rs index 97951d2989..f69720f4b3 100644 --- a/common/src/states/climb.rs +++ b/common/src/states/climb.rs @@ -60,8 +60,10 @@ impl CharacterBehavior for Data { // If no wall is in front of character or we stopped climbing; let (wall_dir, climb) = if let (Some(wall_dir), Some(climb), None) = ( + // PHYSICSSTATE TODO data.physics.state.on_wall, data.inputs.climb, + // PHYSICSSTATE TODO data.physics.state.on_ground, ) { (wall_dir, climb) @@ -102,6 +104,7 @@ impl CharacterBehavior for Data { // Smooth orientation data.ori.slerped_towards( Ori::from(ori_dir), + // PHYSICSSTATE TODO if data.physics.state.on_ground.is_some() { 9.0 } else { diff --git a/common/src/states/glide.rs b/common/src/states/glide.rs index 5729b98dbe..31064b0209 100644 --- a/common/src/states/glide.rs +++ b/common/src/states/glide.rs @@ -79,10 +79,13 @@ impl CharacterBehavior for Data { let mut update = StateUpdate::from(data); // If player is on ground, end glide + // PHYSICSSTATE TODO if data.physics.state.on_ground.is_some() + // PHYSICSSTATE TODO && (data.vel.0 - data.physics.state.ground_vel).magnitude_squared() < 2_f32.powi(2) { update.character = CharacterState::GlideWield(glide_wield::Data::from(data)); + // PHYSICSSTATE TODO } else if data.physics.state.in_liquid().is_some() || data .inventory @@ -172,6 +175,7 @@ impl CharacterBehavior for Data { Quaternion::rotation_3d( PI / 2.0 * accel_factor + // PHYSICSSTATE TODO * if data.physics.state.on_ground.is_some() { -1.0 } else { diff --git a/common/src/states/skate.rs b/common/src/states/skate.rs index 25198b3759..8c452e5137 100644 --- a/common/src/states/skate.rs +++ b/common/src/states/skate.rs @@ -39,6 +39,7 @@ impl CharacterBehavior for Data { handle_wield(data, &mut update); handle_jump(data, output_events, &mut update, 1.0); + // PHYSICSSTATE TODO if !data.physics.state.skating_active { update.character = CharacterState::Idle(idle::Data { is_sneaking: false, diff --git a/common/src/states/spin_melee.rs b/common/src/states/spin_melee.rs index 0c500c87a2..d1bc53e13f 100644 --- a/common/src/states/spin_melee.rs +++ b/common/src/states/spin_melee.rs @@ -62,6 +62,7 @@ impl CharacterBehavior for Data { match self.static_data.movement_behavior { MovementBehavior::ForwardGround | MovementBehavior::Stationary => {}, MovementBehavior::AxeHover => { + // PHYSICSSTATE TODO update.movement = update.movement.with_movement(if data.physics.state.on_ground.is_some() { // TODO: Just remove axehover entirely with axe rework, it's really janky // TODO: Should 5 even be used here, or should body accel be used? Maybe just call handle_move? diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 5c4a02bbe4..00c3df94ac 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -363,6 +363,7 @@ pub fn handle_move(data: &JoinData<'_>, update: &mut StateUpdate, efficiency: f3 fn basic_move(data: &JoinData<'_>, update: &mut StateUpdate, efficiency: f32) { let efficiency = efficiency * data.stats.move_speed_modifier * data.stats.friction_modifier; + // PHYSICSSTATE TODO let accel = if let Some(block) = data.physics.state.on_ground { // FRIC_GROUND temporarily used to normalize things around expected values data.body.base_accel() * block.get_traction() * block.get_friction() / FRIC_GROUND @@ -410,6 +411,7 @@ pub fn handle_forced_movement( match movement { ForcedMovement::Forward { strength } => { let strength = strength * data.stats.move_speed_modifier * data.stats.friction_modifier; + // PHYSICSSTATE TODO if let Some(accel) = data.physics.state.on_ground.map(|block| { // FRIC_GROUND temporarily used to normalize things around expected values data.body.base_accel() * block.get_traction() * block.get_friction() / FRIC_GROUND @@ -475,6 +477,7 @@ pub fn handle_orientation( // unit is multiples of 180° let half_turns_per_tick = data.body.base_ori_rate() * efficiency + // PHYSICSSTATE TODO * if data.physics.state.on_ground.is_some() { 1.0 } else { @@ -580,6 +583,7 @@ pub fn fly_move(data: &JoinData<'_>, update: &mut StateUpdate, efficiency: f32) Density((update.density.0 + data.dt.0 * rate * change).clamp(min, max)) }; let def_density = ship.density().0; + // PHYSICSSTATE TODO if data.physics.state.in_liquid().is_some() { let hull_density = ship.hull_density().0; update.density.0 =