MinieExamples/src/main/java/jme3utilities/minie/test/RopeDemo.java
/**
     * Add a rope cross to the scene.
     *
     * @return the new DAC (added to the spatial and physics space, in kinematic
     * mode)
     */
Add a rope cross to the scene.

@return the new DAC (added to the spatial and physics space, in kinematic
mode)
Add a rope cross to the scene . @return the new DAC ( added to the spatial and physics space in kinematic mode )
private void addRopeCross() {
        /*
         * Generate a cross-shaped Armature.
         */
        int[] stepCounts = {5, 5, 5, 5};
        Vector3f[] stepOffsets = {
            new Vector3f(stepLength, 0f, 0f),
            new Vector3f(-stepLength, 0f, 0f),
            new Vector3f(0f, 0f, stepLength),
            new Vector3f(0f, 0f, -stepLength)
        };
        Armature armature = makeArmature(stepCounts, stepOffsets);
        TubeTreeMesh ropeMesh = new TubeTreeMesh(armature, ropeRadius,
                0f, loopsPerSegment, samplesPerLoop);
        String geometryName = geometryNamer.unique("rope cross");
        Geometry geometry = new Geometry(geometryName, ropeMesh);
        addRopeSpatial(armature, geometry);
        /*
         * Curl all branches clockwise to introduce some slack.
         */
        curlBranch(armature, 0, Vector3f.UNIT_Y, 0.2f);
        curlBranch(armature, 1, Vector3f.UNIT_Y, 0.2f);
        curlBranch(armature, 2, Vector3f.UNIT_Y, 0.2f);
        curlBranch(armature, 3, Vector3f.UNIT_Y, 0.2f);
    }
private void addRopeCross ( ) { /*
         * Generate a cross-shaped Armature.
         */ int [ ] stepCounts = { 5 , 5 , 5 , 5 } ; Vector3f [ ] stepOffsets = { new Vector3f ( stepLength , 0f , 0f ) , new Vector3f ( - stepLength , 0f , 0f ) , new Vector3f ( 0f , 0f , stepLength ) , new Vector3f ( 0f , 0f , - stepLength ) } ; Armature armature = makeArmature ( stepCounts , stepOffsets ) ; TubeTreeMesh ropeMesh = new TubeTreeMesh ( armature , ropeRadius , 0f , loopsPerSegment , samplesPerLoop ) ; String geometryName = geometryNamer . unique ( "rope cross" ) ; Geometry geometry = new Geometry ( geometryName , ropeMesh ) ; addRopeSpatial ( armature , geometry ) ; /*
         * Curl all branches clockwise to introduce some slack.
         */ curlBranch ( armature , 0 , Vector3f . UNIT_Y , 0.2f ) ; curlBranch ( armature , 1 , Vector3f . UNIT_Y , 0.2f ) ; curlBranch ( armature , 2 , Vector3f . UNIT_Y , 0.2f ) ; curlBranch ( armature , 3 , Vector3f . UNIT_Y , 0.2f ) ; }
Add a rope cross to the scene.
Add a rope cross to the scene .