public void setDucked(boolean enabled) {
        if (enabled) {
            setHeightPercent(duckedFactor);
            ducked = true;
            wantToUnDuck = false;
        } else {
            if (checkCanUnDuck()) {
                setHeightPercent(1);
                ducked = false;
            } else {
                wantToUnDuck = true;
            }
        }
    }
Toggle character ducking. When ducked the characters capsule collision
shape height will be multiplied by duckedFactor to make the capsule
smaller. When unducking, the character will check with a ray test if it
can in fact unduck and only do so when it's possible. You can test the
state using isDucked().

@param enabled true&rarr;duck, false&rarr;unduck
jme3-jbullet/src/main/java/com/jme3/bullet/control/BetterCharacterControl.java