MinieExamples/src/main/java/jme3utilities/minie/test/TrackDemo.java
/**
     * Add an animated model to the scene, removing any previously added model.
     *
     * @param modelName the name of the model to add (not null, not empty)
     */
Add an animated model to the scene, removing any previously added model.
@param modelName the name of the model to add (not null, not empty)
Add an animated model to the scene removing any previously added model . @param modelName the name of the model to add ( not null not empty )
private void addModel(String modelName) {
        if (cgModel != null) {
            dac.getSpatial().removeControl(dac);
            rootNode.detachChild(cgModel);
            rootNode.removeControl(sv);
            dacReadyInitDone = false;
        }
        chainLength = 6; 
        switch (modelName) {
            case "BaseMesh":
                loadBaseMesh();
                break;
            case "Jaime":
                loadJaime();
                break;
            case "MhGame":
                loadMhGame();
                break;
            case "Ninja":
                loadNinja();
                break;
            case "Oto":
                loadOto();
                break;
            case "Puppet":
                loadPuppet();
                break;
            case "Sinbad":
                loadSinbad();
                break;
            case "SinbadWith1Sword":
                loadSinbadWith1Sword();
                break;
            case "SinbadWithSwords":
                loadSinbadWithSwords();
                break;
            default:
                throw new IllegalArgumentException(modelName);
        }
        List<Spatial> list = MySpatial.listSpatials(cgModel);
        for (Spatial spatial : list) {
            spatial.setShadowMode(RenderQueue.ShadowMode.Cast);
        }
        cgModel.setCullHint(Spatial.CullHint.Never);
        sc = (SkinningControl) RagUtils.findSControl(cgModel);
        sc.getArmature().applyBindPose(); 
        rootNode.attachChild(cgModel);
        setCgmHeight(cgModel, 2f);
        centerCgm(cgModel);
        Spatial controlledSpatial = sc.getSpatial();
        controlledSpatial.addControl(dac);
        PhysicsSpace physicsSpace = getPhysicsSpace();
        dac.setPhysicsSpace(physicsSpace);
        sv = new SkeletonVisualizer(assetManager, sc);
        sv.setLineColor(ColorRGBA.Yellow);
        InfluenceUtil.hideNonInfluencers(sv, (SkinningControl) sc);
        rootNode.addControl(sv);
        addGrid();
    }
private void addModel ( String modelName ) { if ( cgModel != null ) { dac . getSpatial ( ) . removeControl ( dac ) ; rootNode . detachChild ( cgModel ) ; rootNode . removeControl ( sv ) ; dacReadyInitDone = false ; } chainLength = 6 ; switch ( modelName ) { case "BaseMesh" : loadBaseMesh ( ) ; break ; case "Jaime" : loadJaime ( ) ; break ; case "MhGame" : loadMhGame ( ) ; break ; case "Ninja" : loadNinja ( ) ; break ; case "Oto" : loadOto ( ) ; break ; case "Puppet" : loadPuppet ( ) ; break ; case "Sinbad" : loadSinbad ( ) ; break ; case "SinbadWith1Sword" : loadSinbadWith1Sword ( ) ; break ; case "SinbadWithSwords" : loadSinbadWithSwords ( ) ; break ; default : throw new IllegalArgumentException ( modelName ) ; } List < Spatial > list = MySpatial . listSpatials ( cgModel ) ; for ( Spatial spatial : list ) { spatial . setShadowMode ( RenderQueue . ShadowMode . Cast ) ; } cgModel . setCullHint ( Spatial . CullHint . Never ) ; sc = ( SkinningControl ) RagUtils . findSControl ( cgModel ) ; sc . getArmature ( ) . applyBindPose ( ) ; rootNode . attachChild ( cgModel ) ; setCgmHeight ( cgModel , 2f ) ; centerCgm ( cgModel ) ; Spatial controlledSpatial = sc . getSpatial ( ) ; controlledSpatial . addControl ( dac ) ; PhysicsSpace physicsSpace = getPhysicsSpace ( ) ; dac . setPhysicsSpace ( physicsSpace ) ; sv = new SkeletonVisualizer ( assetManager , sc ) ; sv . setLineColor ( ColorRGBA . Yellow ) ; InfluenceUtil . hideNonInfluencers ( sv , ( SkinningControl ) sc ) ; rootNode . addControl ( sv ) ; addGrid ( ) ; }
Add an animated model to the scene, removing any previously added model.
Add an animated model to the scene removing any previously added model .
// constant? // see JME issue #1395