MinieExamples/src/main/java/jme3utilities/minie/test/DropTest.java
/**
     * Initialize the library of named collision shapes during startup.
     */
Initialize the library of named collision shapes during startup.
Initialize the library of named collision shapes during startup .
@Override
    public void generateShapes() {
        super.generateShapes();
        CollisionShape shape;
        /*
         * "ankh" using manual decomposition
         */
        String ankhPath = "CollisionShapes/ankh.j3o";
        shape = (CollisionShape) assetManager.loadAsset(ankhPath);
        registerShape("ankh", shape);
        /*
         * "banana" using manual decomposition
         */
        String bananaPath = "CollisionShapes/banana.j3o";
        shape = (CollisionShape) assetManager.loadAsset(bananaPath);
        registerShape("banana", shape);
        /*
         * "barrel"
         */
        String barrelPath = "CollisionShapes/barrel.j3o";
        shape = (CollisionShape) assetManager.loadAsset(barrelPath);
        shape.setScale(3f);
        registerShape("barrel", shape);
        /*
         * "bowlingPin" using manual decomposition
         */
        String bowlingPinPath = "CollisionShapes/bowlingPin.j3o";
        shape = (CollisionShape) assetManager.loadAsset(bowlingPinPath);
        registerShape("bowlingPin", shape);
        /*
         * "candyDish"
         */
        String candyDishPath = "Models/CandyDish/CandyDish.j3o";
        Node candyDishNode = (Node) assetManager.loadModel(candyDishPath);
        Geometry candyDishGeometry = (Geometry) candyDishNode.getChild(0);
        Mesh candyDishMesh = candyDishGeometry.getMesh();
        shape = new MeshCollisionShape(candyDishMesh);
        shape.setScale(5f);
        registerShape("candyDish", shape);
        /*
         * "duck" using V-HACD
         */
        String duckPath = "CollisionShapes/duck.j3o";
        shape = (CollisionShape) assetManager.loadAsset(duckPath);
        shape.setScale(2f);
        registerShape("duck", shape);
        /*
         * "heart"
         */
        String heartPath = "CollisionShapes/heart.j3o";
        shape = (CollisionShape) assetManager.loadAsset(heartPath);
        shape.setScale(1.2f);
        registerShape("heart", shape);
        /*
         * "horseshoe" using manual decomposition
         */
        String horseshoePath = "CollisionShapes/horseshoe.j3o";
        shape = (CollisionShape) assetManager.loadAsset(horseshoePath);
        registerShape("horseshoe", shape);
        /*
         * "sword" using V-HACD
         */
        String swordPath = "CollisionShapes/sword.j3o";
        shape = (CollisionShape) assetManager.loadAsset(swordPath);
        shape.setScale(5f);
        registerShape("sword", shape);
        /*
         * "teapot" using V-HACD
         */
        String teapotPath = "CollisionShapes/teapot.j3o";
        shape = (CollisionShape) assetManager.loadAsset(teapotPath);
        shape.setScale(3f);
        registerShape("teapot", shape);
        /*
         * letter shapes
         */
        for (char character = 'A'; character <= 'Z'; ++character) {
            char[] array = new char[]{character};
            String glyphString = new String(array);
            String assetPath = String.format("CollisionShapes/glyphs/%s.j3o",
                    glyphString);
            shape = (CollisionShape) assetManager.loadAsset(assetPath);
            registerShape(glyphString, shape);
        }
        /*
         * digit shapes
         */
        for (char character = '0'; character <= '9'; ++character) {
            char[] array = new char[]{character};
            String glyphString = new String(array);
            String assetPath = String.format("CollisionShapes/glyphs/%s.j3o",
                    glyphString);
            shape = (CollisionShape) assetManager.loadAsset(assetPath);
            registerShape(glyphString, shape);
        }
    }
@ Override public void generateShapes ( ) { super . generateShapes ( ) ; CollisionShape shape ; /*
         * "ankh" using manual decomposition
         */ String ankhPath = "CollisionShapes/ankh.j3o" ; shape = ( CollisionShape ) assetManager . loadAsset ( ankhPath ) ; registerShape ( "ankh" , shape ) ; /*
         * "banana" using manual decomposition
         */ String bananaPath = "CollisionShapes/banana.j3o" ; shape = ( CollisionShape ) assetManager . loadAsset ( bananaPath ) ; registerShape ( "banana" , shape ) ; /*
         * "barrel"
         */ String barrelPath = "CollisionShapes/barrel.j3o" ; shape = ( CollisionShape ) assetManager . loadAsset ( barrelPath ) ; shape . setScale ( 3f ) ; registerShape ( "barrel" , shape ) ; /*
         * "bowlingPin" using manual decomposition
         */ String bowlingPinPath = "CollisionShapes/bowlingPin.j3o" ; shape = ( CollisionShape ) assetManager . loadAsset ( bowlingPinPath ) ; registerShape ( "bowlingPin" , shape ) ; /*
         * "candyDish"
         */ String candyDishPath = "Models/CandyDish/CandyDish.j3o" ; Node candyDishNode = ( Node ) assetManager . loadModel ( candyDishPath ) ; Geometry candyDishGeometry = ( Geometry ) candyDishNode . getChild ( 0 ) ; Mesh candyDishMesh = candyDishGeometry . getMesh ( ) ; shape = new MeshCollisionShape ( candyDishMesh ) ; shape . setScale ( 5f ) ; registerShape ( "candyDish" , shape ) ; /*
         * "duck" using V-HACD
         */ String duckPath = "CollisionShapes/duck.j3o" ; shape = ( CollisionShape ) assetManager . loadAsset ( duckPath ) ; shape . setScale ( 2f ) ; registerShape ( "duck" , shape ) ; /*
         * "heart"
         */ String heartPath = "CollisionShapes/heart.j3o" ; shape = ( CollisionShape ) assetManager . loadAsset ( heartPath ) ; shape . setScale ( 1.2f ) ; registerShape ( "heart" , shape ) ; /*
         * "horseshoe" using manual decomposition
         */ String horseshoePath = "CollisionShapes/horseshoe.j3o" ; shape = ( CollisionShape ) assetManager . loadAsset ( horseshoePath ) ; registerShape ( "horseshoe" , shape ) ; /*
         * "sword" using V-HACD
         */ String swordPath = "CollisionShapes/sword.j3o" ; shape = ( CollisionShape ) assetManager . loadAsset ( swordPath ) ; shape . setScale ( 5f ) ; registerShape ( "sword" , shape ) ; /*
         * "teapot" using V-HACD
         */ String teapotPath = "CollisionShapes/teapot.j3o" ; shape = ( CollisionShape ) assetManager . loadAsset ( teapotPath ) ; shape . setScale ( 3f ) ; registerShape ( "teapot" , shape ) ; /*
         * letter shapes
         */ for ( char character = 'A' ; character <= 'Z' ; ++ character ) { char [ ] array = new char [ ] { character } ; String glyphString = new String ( array ) ; String assetPath = String . format ( "CollisionShapes/glyphs/%s.j3o" , glyphString ) ; shape = ( CollisionShape ) assetManager . loadAsset ( assetPath ) ; registerShape ( glyphString , shape ) ; } /*
         * digit shapes
         */ for ( char character = '0' ; character <= '9' ; ++ character ) { char [ ] array = new char [ ] { character } ; String glyphString = new String ( array ) ; String assetPath = String . format ( "CollisionShapes/glyphs/%s.j3o" , glyphString ) ; shape = ( CollisionShape ) assetManager . loadAsset ( assetPath ) ; registerShape ( glyphString , shape ) ; } }
Initialize the library of named collision shapes during startup.
Initialize the library of named collision shapes during startup .