Add debug prints to grounded

This commit is contained in:
Jan Nils Ferner
2023-01-27 18:02:48 +01:00
parent 05db3e8e0a
commit 0f6aa49422

View File

@@ -346,6 +346,7 @@ impl KinematicCharacterController {
if snap_distance.abs() > 1.0e-5 {
result.translation -= *self.up * snap_distance;
}
println!("snap");
result.grounded = true;
return Some((hit_handle, hit));
}
@@ -413,6 +414,7 @@ impl KinematicCharacterController {
let normal2 = -normal1;
if normal1.dot(&self.up) <= -1.0e-5 {
println!("Grounded 1");
grounded = true;
}
@@ -464,6 +466,7 @@ impl KinematicCharacterController {
if normal.dot(&self.up) <= -1.0e-5 {
for contact in &m.points {
if contact.dist <= prediction {
println!("Grounded 2");
grounded = true;
return false; // We can stop the search early.
}