MinieExamples/src/main/java/jme3utilities/minie/test/TestDac.java
/**
     * Delete all balls from the scene.
     */
Delete all balls from the scene.
Delete all balls from the scene .
private void removeAllBalls() {
        List<Geometry> geometries = rootNode.descendantMatches(Geometry.class);
        for (Geometry geometry : geometries) {
            String name = geometry.getName();
            if (NameGenerator.isFrom(name, "ball")) {
                RigidBodyControl rbc
                        = geometry.getControl(RigidBodyControl.class);
                rbc.setPhysicsSpace(null);
                geometry.removeControl(rbc);
                geometry.removeFromParent();
            }
        }
    }
private void removeAllBalls ( ) { List < Geometry > geometries = rootNode . descendantMatches ( Geometry . class ) ; for ( Geometry geometry : geometries ) { String name = geometry . getName ( ) ; if ( NameGenerator . isFrom ( name , "ball" ) ) { RigidBodyControl rbc = geometry . getControl ( RigidBodyControl . class ) ; rbc . setPhysicsSpace ( null ) ; geometry . removeControl ( rbc ) ; geometry . removeFromParent ( ) ; } } }
Delete all balls from the scene.
Delete all balls from the scene .