Crouching is back, finally

This commit is contained in:
Franklin 2023-11-23 14:03:20 -04:00
parent 2d12f5b392
commit 44e245cfde
3 changed files with 7 additions and 8 deletions

View File

@ -18,11 +18,11 @@ Multiplayer
# TODOs:
- [x] Detach player rotation from character model
- [ ] Weapon Sway PENDING!!!
- [x] Weapon Sway
- [x] Fixing leaning
- [x] Snap back leaning too quick
- [x] Issue with moving around quickly
- [ ] Bring Crouching back
- [x] Bring Crouching back
- [ ] Inspect animation (procedural)
- [ ] Reload animation (procedural)
- [ ] Real world magazines

View File

@ -53,15 +53,14 @@ pub fn update_camera_vertical_position(
(delta / player_values_state.player_crouch_time_s).clamp(0.0, 1.0),
);
} else {
// TODO: Add elapsed time to standup so that crouch time and standup time is the same.
/*camera_transform.translation = camera_transform.translation.lerp(
camera_transform.translation = camera_transform.translation.lerp(
Vec3 {
x: camera_transform.translation.x,
y: player_values_state.player_camera_height,
z: camera_transform.translation.z,
},
time.delta_seconds().clamp(0.0, 1.0),
);*/
time.delta_seconds() / player_values_state.player_crouch_time_s,
);
}
}

View File

@ -45,8 +45,8 @@ impl Default for PlayerValuesState {
player_initial_weight: 75.0,
player_gravity_scale: 4.0,
player_height: 2.5,
player_camera_height: 1.25,
player_crouch_height: 0.0,
player_camera_height: 1.70858,
player_crouch_height: 1.0,
player_crouch_time_s: 1.25,
player_linear_damping: 3.5,
player_linear_damping_while_jumping: 0.8,