MinieExamples/src/main/java/jme3utilities/minie/test/TestDac.java
/**
     * Process an action that wasn't handled by the active input mode.
     *
     * @param actionString textual description of the action (not null)
     * @param ongoing true if the action is ongoing, otherwise false
     * @param tpf time interval between frames (in seconds, &ge;0)
     */
Process an action that wasn't handled by the active input mode.

@param actionString textual description of the action (not null)
@param ongoing true if the action is ongoing, otherwise false
@param tpf time interval between frames (in seconds, ≥0)
Process an action that wasn ' t handled by the active input mode . @param actionString textual description of the action ( not null ) @param ongoing true if the action is ongoing otherwise false @param tpf time interval between frames ( in seconds ≥0 )
@Override
    public void onAction(String actionString, boolean ongoing, float tpf) {
        if (ongoing) {
            switch (actionString) {
                case "add":
                    addBall();
                    return;
                case "amputate left elbow":
                    dac.amputateSubtree(leftUlna, 2f);
                    return;
                case "blend all to kinematic":
                    animPose = null;
                    dac.blendToKinematicMode(2f, null);
                    return;
                case "drop attachments":
                    dac.dropAttachments();
                    return;
                case "freeze all":
                    animPose = null;
                    dac.freezeSubtree(dac.getTorsoLink(), false);
                    return;
                case "freeze upper body":
                    dac.freezeSubtree(upperBody, false);
                    return;
                case "ghost upper body":
                    dac.setContactResponseSubtree(upperBody, false);
                    return;
                case "go anim pose":
                    goAnimPose();
                    return;
                case "go bind pose":
                    animPose = null;
                    dac.bindSubtree(dac.getTorsoLink(), 2f);
                    return;
                case "go dynamic bind pose":
                    if (dac.isReady()) {
                        goDynamicBindPose();
                    }
                    return;
                case "go floating":
                    if (dac.isReady()) {
                        animPose = null;
                        dac.setDynamicSubtree(dac.getTorsoLink(), Vector3f.ZERO,
                                false);
                    }
                    return;
                case "go frozen":
                    if (dac.isReady()) {
                        animPose = null;
                        Vector3f gravity = dac.gravity(null);
                        dac.setDynamicSubtree(dac.getTorsoLink(), gravity,
                                true);
                    }
                    return;
                case "go limp":
                    if (dac.isReady()) {
                        animPose = null;
                        dac.setRagdollMode();
                    }
                    return;
                case "limp left arm":
                    if (dac.isReady()) {
                        dac.setDynamicSubtree(leftClavicle,
                                new Vector3f(0f, -150f, 0f), false);
                    }
                    return;
                case "limp right arm":
                    if (dac.isReady()) {
                        dac.setDynamicSubtree(rightClavicle,
                                new Vector3f(0f, -150f, 0f), false);
                    }
                    return;
                case "load":
                    load();
                    return;
                case "pin leftFemur":
                    if (dac.isReady()) {
                        boolean disableForRagdoll = false;
                        dac.pinToWorld(leftFemur, disableForRagdoll);
                    }
                    return;
                case "raise leftFoot":
                    if (dac.isReady()) {
                        dac.setDynamicSubtree(leftFemur,
                                new Vector3f(0f, 100f, 0f), false);
                    }
                    return;
                case "raise leftHand":
                    if (dac.isReady()) {
                        dac.setDynamicSubtree(leftClavicle,
                                new Vector3f(0f, 100f, 0f), false);
                    }
                    return;
                case "raise rightFoot":
                    if (dac.isReady()) {
                        dac.setDynamicSubtree(rightFemur,
                                new Vector3f(0f, 100f, 0f), false);
                    }
                    return;
                case "raise rightHand":
                    if (dac.isReady()) {
                        dac.setDynamicSubtree(rightClavicle,
                                new Vector3f(0f, 100f, 0f), false);
                    }
                    return;
                case "reset model transform":
                    cgModel.setLocalTransform(resetTransform);
                    return;
                case "save":
                    save(cgModel, saveAssetPath);
                    save(cgModel, saveAssetPath1);
                    return;
                case "set height 1":
                    setHeight(5f);
                    return;
                case "set height 2":
                    setHeight(10f);
                    return;
                case "set height 3":
                    setHeight(15f);
                    return;
                case "toggle meshes":
                    toggleMeshes();
                    return;
                case "toggle skeleton":
                    toggleSkeleton();
                    return;
            }
            String[] words = actionString.split(" ");
            if (words.length >= 2 && "load".equals(words[0])) {
                addModel(words[1]);
                return;
            }
        }
        super.onAction(actionString, ongoing, tpf);
    }
@ Override public void onAction ( String actionString , boolean ongoing , float tpf ) { if ( ongoing ) { switch ( actionString ) { case "add" : addBall ( ) ; return ; case "amputate left elbow" : dac . amputateSubtree ( leftUlna , 2f ) ; return ; case "blend all to kinematic" : animPose = null ; dac . blendToKinematicMode ( 2f , null ) ; return ; case "drop attachments" : dac . dropAttachments ( ) ; return ; case "freeze all" : animPose = null ; dac . freezeSubtree ( dac . getTorsoLink ( ) , false ) ; return ; case "freeze upper body" : dac . freezeSubtree ( upperBody , false ) ; return ; case "ghost upper body" : dac . setContactResponseSubtree ( upperBody , false ) ; return ; case "go anim pose" : goAnimPose ( ) ; return ; case "go bind pose" : animPose = null ; dac . bindSubtree ( dac . getTorsoLink ( ) , 2f ) ; return ; case "go dynamic bind pose" : if ( dac . isReady ( ) ) { goDynamicBindPose ( ) ; } return ; case "go floating" : if ( dac . isReady ( ) ) { animPose = null ; dac . setDynamicSubtree ( dac . getTorsoLink ( ) , Vector3f . ZERO , false ) ; } return ; case "go frozen" : if ( dac . isReady ( ) ) { animPose = null ; Vector3f gravity = dac . gravity ( null ) ; dac . setDynamicSubtree ( dac . getTorsoLink ( ) , gravity , true ) ; } return ; case "go limp" : if ( dac . isReady ( ) ) { animPose = null ; dac . setRagdollMode ( ) ; } return ; case "limp left arm" : if ( dac . isReady ( ) ) { dac . setDynamicSubtree ( leftClavicle , new Vector3f ( 0f , - 150f , 0f ) , false ) ; } return ; case "limp right arm" : if ( dac . isReady ( ) ) { dac . setDynamicSubtree ( rightClavicle , new Vector3f ( 0f , - 150f , 0f ) , false ) ; } return ; case "load" : load ( ) ; return ; case "pin leftFemur" : if ( dac . isReady ( ) ) { boolean disableForRagdoll = false ; dac . pinToWorld ( leftFemur , disableForRagdoll ) ; } return ; case "raise leftFoot" : if ( dac . isReady ( ) ) { dac . setDynamicSubtree ( leftFemur , new Vector3f ( 0f , 100f , 0f ) , false ) ; } return ; case "raise leftHand" : if ( dac . isReady ( ) ) { dac . setDynamicSubtree ( leftClavicle , new Vector3f ( 0f , 100f , 0f ) , false ) ; } return ; case "raise rightFoot" : if ( dac . isReady ( ) ) { dac . setDynamicSubtree ( rightFemur , new Vector3f ( 0f , 100f , 0f ) , false ) ; } return ; case "raise rightHand" : if ( dac . isReady ( ) ) { dac . setDynamicSubtree ( rightClavicle , new Vector3f ( 0f , 100f , 0f ) , false ) ; } return ; case "reset model transform" : cgModel . setLocalTransform ( resetTransform ) ; return ; case "save" : save ( cgModel , saveAssetPath ) ; save ( cgModel , saveAssetPath1 ) ; return ; case "set height 1" : setHeight ( 5f ) ; return ; case "set height 2" : setHeight ( 10f ) ; return ; case "set height 3" : setHeight ( 15f ) ; return ; case "toggle meshes" : toggleMeshes ( ) ; return ; case "toggle skeleton" : toggleSkeleton ( ) ; return ; } String [ ] words = actionString . split ( " " ) ; if ( words . length >= 2 && "load" . equals ( words [ 0 ] ) ) { addModel ( words [ 1 ] ) ; return ; } } super . onAction ( actionString , ongoing , tpf ) ; }
Process an action that wasn't handled by the active input mode.
Process an action that wasn ' t handled by the active input mode .