remove damping

* try fix sliding upwards gaining speed
This commit is contained in:
2025-03-27 00:00:11 +08:00
parent ad6e4a1272
commit 7fa31a91a6
3 changed files with 44 additions and 117 deletions

View File

@@ -99,6 +99,7 @@ pub fn kinematic_controller_collisions(
// up and down the surface smoothly.
if climbable {
// Points in the normal's direction in the XZ plane.
let normal_direction_xz =
normal.reject_from_normalized(Vector::Y).normalize_or_zero();
@@ -120,7 +121,11 @@ pub fn kinematic_controller_collisions(
// *───────────────────*
let max_y_speed = -linear_velocity_xz * slope_angle.tan();
linear_velocity.y = linear_velocity.y.max(max_y_speed);
// TODO: figure out why this is needed, without it we
// cannot do these crate to crate jumps anymore which is intented.
// linear_velocity.y = linear_velocity.y.max(max_y_speed);
} else {
// The character is intersecting an unclimbable object, like a wall.
// We want the character to slide along the surface, similarly to