Fix missing ground assignment

This commit is contained in:
Jan Nils Ferner
2023-01-28 00:03:50 +01:00
parent 337a963ce3
commit 9daa741af2

View File

@@ -410,6 +410,9 @@ impl KinematicCharacterController {
for m in &manifolds {
let normal = -(character_pos * m.local_n1);
if normal.dot(&self.up) >= -1e-5 {
grounded = true;
}
if let Some(kinematic_parent) = kinematic_parent {
let mut num_active_contacts = 0;
@@ -456,7 +459,7 @@ impl KinematicCharacterController {
for m in &manifolds {
let normal = character_pos * m.local_n1;
if normal.dot(&self.up) <= -1.0e-5 {
if normal.dot(&self.up) <= 1.0e-5 {
for contact in &m.points {
if contact.dist <= prediction {
grounded = true;