MinieLibrary/src/main/java/com/jme3/bullet/control/BetterCharacterControl.java
/**
     * Test whether the character is on the ground, by means of a ray test.
     */
Test whether the character is on the ground, by means of a ray test.
Test whether the character is on the ground by means of a ray test .
protected void checkOnGround() {
        TempVars vars = TempVars.get();
        Vector3f loc = vars.vect1;
        Vector3f rayVector = vars.vect2;
        float scaledHeight = getFinalHeight();
        loc.set(localUp).multLocal(scaledHeight).addLocal(location);
        rayVector.set(localUp).multLocal(-scaledHeight - 0.1f).addLocal(loc);
        List<PhysicsRayTestResult> results
                = getPhysicsSpace().rayTestRaw(loc, rayVector);
        vars.release();
        for (PhysicsRayTestResult physicsRayTestResult : results) {
            if (!physicsRayTestResult.getCollisionObject().equals(rigidBody)) {
                onGround = true;
                return;
            }
        }
        onGround = false;
    }
protected void checkOnGround ( ) { TempVars vars = TempVars . get ( ) ; Vector3f loc = vars . vect1 ; Vector3f rayVector = vars . vect2 ; float scaledHeight = getFinalHeight ( ) ; loc . set ( localUp ) . multLocal ( scaledHeight ) . addLocal ( location ) ; rayVector . set ( localUp ) . multLocal ( - scaledHeight - 0.1f ) . addLocal ( loc ) ; List < PhysicsRayTestResult > results = getPhysicsSpace ( ) . rayTestRaw ( loc , rayVector ) ; vars . release ( ) ; for ( PhysicsRayTestResult physicsRayTestResult : results ) { if ( ! physicsRayTestResult . getCollisionObject ( ) . equals ( rigidBody ) ) { onGround = true ; return ; } } onGround = false ; }
Test whether the character is on the ground, by means of a ray test.
Test whether the character is on the ground by means of a ray test .