From 20d5565cb793007f0bb0abd11eae80bfd78493f9 Mon Sep 17 00:00:00 2001 From: "iwg..ic" Date: Sat, 13 Jul 2013 02:59:16 +0000 Subject: [PATCH] Added a little offset to the physics ray to correct detecting onGround git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10705 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/bullet/control/BetterCharacterControl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/src/bullet-common/com/jme3/bullet/control/BetterCharacterControl.java b/engine/src/bullet-common/com/jme3/bullet/control/BetterCharacterControl.java index af26fde31..065a645eb 100644 --- a/engine/src/bullet-common/com/jme3/bullet/control/BetterCharacterControl.java +++ b/engine/src/bullet-common/com/jme3/bullet/control/BetterCharacterControl.java @@ -443,7 +443,7 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph public float getPhysicsDamping() { return physicsDamping; } - + /** * This actually sets a new collision shape to the character to change the * height of the capsule. @@ -464,7 +464,7 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph Vector3f rayVector = vars.vect2; float height = getFinalHeight(); location.set(localUp).multLocal(height).addLocal(this.location); - rayVector.set(localUp).multLocal(-height - FastMath.ZERO_TOLERANCE).addLocal(location); + rayVector.set(localUp).multLocal(-height - 0.1f).addLocal(location); List results = space.rayTest(location, rayVector); vars.release(); for (PhysicsRayTestResult physicsRayTestResult : results) {