Skip to content

Commit

Permalink
fix: character controller: walls less likely to trigger ground detect…
Browse files Browse the repository at this point in the history
…ion (#655)
  • Loading branch information
Vrixyz authored Jun 17, 2024
1 parent 5c6d34a commit 84b66d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/control/character_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,9 @@ impl KinematicCharacterController {
) -> bool {
let normal = -(character_pos * manifold.local_n1);

if normal.dot(&self.up) >= 1.0e-5 {
// For the controller to be grounded, the angle between the contact normal and the up vector
// has to be smaller than acos(1.0e-3) = 89.94 degrees.
if normal.dot(&self.up) >= 1.0e-3 {
let prediction = self.predict_ground(dims.y);
for contact in &manifold.points {
if contact.dist <= prediction {
Expand Down

0 comments on commit 84b66d6

Please sign in to comment.