MinieLibrary/src/main/java/com/jme3/bullet/control/BetterCharacterControl.java
/**
     * This checks if the character can go from ducked to unducked state by
     * doing a ray test.
     *
     * @return true if able to unduck, otherwise false
     */
This checks if the character can go from ducked to unducked state by
doing a ray test.

@return true if able to unduck, otherwise false
This checks if the character can go from ducked to unducked state by doing a ray test . @return true if able to unduck otherwise false
protected boolean checkCanUnDuck() {
        TempVars vars = TempVars.get();
        Vector3f loc = vars.vect1;
        Vector3f rayVector = vars.vect2;
        loc.set(localUp).multLocal(FastMath.ZERO_TOLERANCE).addLocal(this.location);
        rayVector.set(localUp).multLocal(height + FastMath.ZERO_TOLERANCE).addLocal(loc);
        List<PhysicsRayTestResult> results
                = getPhysicsSpace().rayTestRaw(loc, rayVector);
        vars.release();
        for (PhysicsRayTestResult physicsRayTestResult : results) {
            if (!physicsRayTestResult.getCollisionObject().equals(rigidBody)) {
                return false;
            }
        }
        return true;
    }
protected boolean checkCanUnDuck ( ) { TempVars vars = TempVars . get ( ) ; Vector3f loc = vars . vect1 ; Vector3f rayVector = vars . vect2 ; loc . set ( localUp ) . multLocal ( FastMath . ZERO_TOLERANCE ) . addLocal ( this . location ) ; rayVector . set ( localUp ) . multLocal ( height + FastMath . ZERO_TOLERANCE ) . addLocal ( loc ) ; List < PhysicsRayTestResult > results = getPhysicsSpace ( ) . rayTestRaw ( loc , rayVector ) ; vars . release ( ) ; for ( PhysicsRayTestResult physicsRayTestResult : results ) { if ( ! physicsRayTestResult . getCollisionObject ( ) . equals ( rigidBody ) ) { return false ; } } return true ; }
This checks if the character can go from ducked to unducked state by
 doing a ray test.
This checks if the character can go from ducked to unducked state by doing a ray test .