Skip to content

Commit

Permalink
Use the absolute value of the up attribute when calculating up_extent
Browse files Browse the repository at this point in the history
  • Loading branch information
Linentio committed Sep 30, 2023
1 parent dfb4f2a commit fa2be3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/control/character_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ impl KinematicCharacterController {

fn compute_dims(&self, character_shape: &dyn Shape) -> Vector2<Real> {
let extents = character_shape.compute_local_aabb().extents();
let up_extent = extents.dot(&self.up);
let up_extent = extents.dot(&self.up.abs());
let side_extent = (extents - *self.up * up_extent).norm();
Vector2::new(side_extent, up_extent)
}
Expand Down Expand Up @@ -679,7 +679,7 @@ impl KinematicCharacterController {
filter: QueryFilter,
) {
let extents = character_shape.compute_local_aabb().extents();
let up_extent = extents.dot(&self.up);
let up_extent = extents.dot(&self.up.abs());
let movement_to_transfer =
*collision.toi.normal1 * collision.translation_remaining.dot(&collision.toi.normal1);
let prediction = self.predict_ground(up_extent);
Expand Down

0 comments on commit fa2be3f

Please sign in to comment.