Add some abs to checks
This commit is contained in:
@@ -413,7 +413,7 @@ impl KinematicCharacterController {
|
||||
let normal1 = character_pos * m.local_n1;
|
||||
let normal2 = -normal1;
|
||||
|
||||
if normal1.dot(&self.up) <= -1.0e-5 {
|
||||
if normal1.dot(&self.up).abs() <= -1.0e-5 {
|
||||
println!("Grounded 1");
|
||||
grounded = true;
|
||||
}
|
||||
@@ -463,7 +463,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).abs() <= -1.0e-5 {
|
||||
for contact in &m.points {
|
||||
if contact.dist <= prediction {
|
||||
println!("Grounded 2");
|
||||
|
||||
Reference in New Issue
Block a user