static int findIndex(Spatial spatial, Control sgc) {
        int numControls = spatial.getNumControls();
        int result = -1;
        for (int controlIndex = 0; controlIndex < numControls; ++controlIndex) {
            Control control = spatial.getControl(controlIndex);
            if (control == sgc) {
                result = controlIndex;
                break;
            }
        }

        return result;
    }
Find the index of the specified scene-graph control in the specified
spatial.

@param spatial the spatial to search (not null, unaffected)
@param sgc the control to search for (not null, unaffected)
@return the index (&ge;0) or -1 if not found
jme3-jbullet/src/main/java/com/jme3/bullet/animation/RagUtils.java