MinieExamples/src/main/java/jme3utilities/minie/test/RopeDemo.java
/**
     * Delete the most recently added rope.
     */
Delete the most recently added rope.
Delete the most recently added rope .
private void delete() {
        DynamicAnimControl latestDac = dacs.peekLast();
        if (latestDac != null) {
            latestDac.setEnabled(false);
            latestDac.setPhysicsSpace(null);
            Spatial spatial = latestDac.getSpatial();
            spatial.removeControl(latestDac);
            meshesNode.detachChild(spatial);
            sv.setSubject(null);
            dacs.removeLast();
            shapes.removeLast();
            latestDac = dacs.peekLast();
            if (latestDac != null) {
                spatial = latestDac.getSpatial();
                SkinningControl sControl
                        = spatial.getControl(SkinningControl.class);
                sv.setSubject(sControl);
            }
        }
    }
private void delete ( ) { DynamicAnimControl latestDac = dacs . peekLast ( ) ; if ( latestDac != null ) { latestDac . setEnabled ( false ) ; latestDac . setPhysicsSpace ( null ) ; Spatial spatial = latestDac . getSpatial ( ) ; spatial . removeControl ( latestDac ) ; meshesNode . detachChild ( spatial ) ; sv . setSubject ( null ) ; dacs . removeLast ( ) ; shapes . removeLast ( ) ; latestDac = dacs . peekLast ( ) ; if ( latestDac != null ) { spatial = latestDac . getSpatial ( ) ; SkinningControl sControl = spatial . getControl ( SkinningControl . class ) ; sv . setSubject ( sControl ) ; } } }
Delete the most recently added rope.
Delete the most recently added rope .