Remove debug prints

This commit is contained in:
Jan Nils Ferner
2023-01-26 21:21:09 +01:00
parent 6701108f6f
commit 3cabe58ac6

View File

@@ -247,8 +247,9 @@ impl KinematicCharacterController {
toi, toi,
}); });
// If the slope is too big, try to step on the stair. if ![self.up, -self.up] // Try to move up or down stairs
if !self.handle_stairs( .iter()
.any(|up| self.handle_stairs(
bodies, bodies,
colliders, colliders,
queries, queries,
@@ -259,20 +260,9 @@ impl KinematicCharacterController {
handle, handle,
&mut translation_remaining, &mut translation_remaining,
&mut result, &mut result,
&self.up up
) && !self.handle_stairs( )) {
bodies, // No stairs, try to move along slopes.
colliders,
queries,
character_shape,
&(Translation::from(result.translation) * character_pos),
&dims,
filter,
handle,
&mut translation_remaining,
&mut result,
&-self.up
){
if let Some(translation_on_slope) = if let Some(translation_on_slope) =
self.handle_slopes(&toi, &mut translation_remaining, offset) self.handle_slopes(&toi, &mut translation_remaining, offset)
{ {
@@ -498,8 +488,6 @@ impl KinematicCharacterController {
// Check if there is a slope to climb. // Check if there is a slope to climb.
let angle_with_floor = self.up.angle(&hit.normal1); let angle_with_floor = self.up.angle(&hit.normal1);
let climbing = self.up.dot(&slope_translation) >= 0.0; let climbing = self.up.dot(&slope_translation) >= 0.0;
println!("angle_with_floor: {}, climbing: {}", angle_with_floor, climbing);
println!("max_slope_climb_angle: {}, min_slope_slide_angle: {}", self.max_slope_climb_angle, self.min_slope_slide_angle);
climbing climbing
.then(||(angle_with_floor <= self.max_slope_climb_angle) // Are we allowed to climb? .then(||(angle_with_floor <= self.max_slope_climb_angle) // Are we allowed to climb?