MinieExamples/src/main/java/jme3utilities/minie/test/RopeDemo.java
/**
     * Add a noose to the scene.
     *
     * @param kinematicSplice true to pre-splice the ends kinematically, false
     * to leave it Y-shaped until dynamic mode is set
     * @return the new DAC (added to the spatial and physics space, in kinematic
     * mode)
     */
Add a noose to the scene.

@param kinematicSplice true to pre-splice the ends kinematically, false
to leave it Y-shaped until dynamic mode is set
@return the new DAC (added to the spatial and physics space, in kinematic
mode)
Add a noose to the scene . @param kinematicSplice true to pre - splice the ends kinematically false to leave it Y - shaped until dynamic mode is set @return the new DAC ( added to the spatial and physics space in kinematic mode )
private void addRopeNoose(boolean kinematicSplice) {
        /*
         * Generate a Y-shaped Armature. Branch0 forms the stem of the Y.
         */
        int[] stepCounts = {6, 6, 6};
        float dx = stepLength * MyMath.rootHalf;
        Vector3f[] stepOffsets = {
            new Vector3f(stepLength, 0f, 0f),
            new Vector3f(-dx, 0f, -dx),
            new Vector3f(-dx, 0f, dx)
        };
        Armature armature = makeArmature(stepCounts, stepOffsets);
        TubeTreeMesh ropeMesh = new TubeTreeMesh(armature, ropeRadius,
                0f, loopsPerSegment, samplesPerLoop);
        String geometryName = geometryNamer.unique("noose");
        Geometry geometry = new Geometry(geometryName, ropeMesh);
        addRopeSpatial(armature, geometry);
        if (kinematicSplice) {
            /*
             * Curl branch1 and branch2 toward one another, 90 degrees each.
             */
            curlBranch(armature, 1, Vector3f.UNIT_Y, FastMath.HALF_PI);
            curlBranch(armature, 2, Vector3f.UNIT_Y, -FastMath.HALF_PI);
        }
    }
private void addRopeNoose ( boolean kinematicSplice ) { /*
         * Generate a Y-shaped Armature. Branch0 forms the stem of the Y.
         */ int [ ] stepCounts = { 6 , 6 , 6 } ; float dx = stepLength * MyMath . rootHalf ; Vector3f [ ] stepOffsets = { new Vector3f ( stepLength , 0f , 0f ) , new Vector3f ( - dx , 0f , - dx ) , new Vector3f ( - dx , 0f , dx ) } ; Armature armature = makeArmature ( stepCounts , stepOffsets ) ; TubeTreeMesh ropeMesh = new TubeTreeMesh ( armature , ropeRadius , 0f , loopsPerSegment , samplesPerLoop ) ; String geometryName = geometryNamer . unique ( "noose" ) ; Geometry geometry = new Geometry ( geometryName , ropeMesh ) ; addRopeSpatial ( armature , geometry ) ; if ( kinematicSplice ) { /*
             * Curl branch1 and branch2 toward one another, 90 degrees each.
             */ curlBranch ( armature , 1 , Vector3f . UNIT_Y , FastMath . HALF_PI ) ; curlBranch ( armature , 2 , Vector3f . UNIT_Y , - FastMath . HALF_PI ) ; } }
Add a noose to the scene.
Add a noose to the scene .