dimforge / rapier

2D and 3D physics engines focused on performance.
https://rapier.rs
Apache License 2.0
3.77k stars 235 forks source link

`KinematicCharacterController` climbing and sliding along along vertical walls are broken #611

Closed cleak closed 2 months ago

cleak commented 3 months ago

I opened an issue over on bevy_rapier, but since the fix is in this repo, I'm opening an issue here as well.

It looks like slope climbing is completely broken due to the check with self.max_slope_climb_angle being reversed. I haven't tried this on any actual slopes, but this breaks movement along vertical and near vertical walls.

if climbing && angle_with_floor >= self.max_slope_climb_angle {
    // Prevent horizontal movement from pushing through the slope.
    vertical_translation
} else if !climbing && angle_with_floor <= self.min_slope_slide_angle {

the fix is simple at least:

if climbing && angle_with_floor <= self.max_slope_climb_angle {

I'll submit a PR.