public int detachChild(Spatial child) {
        if (child == null) {
            throw new IllegalArgumentException("child cannot be null");
        }

        if (child.getParent() == this) {
            int index = children.indexOf(child);
            if (index != -1) {
                detachChildAt(index);
            }
            return index;
        }

        return -1;
    }
<code>detachChild</code> removes a given child from the node's list.
This child will no longer be maintained.

@param child
           the child to remove (not null)
@return the index the child was at. -1 if the child was not in the list.
jme3-core/src/main/java/com/jme3/scene/Node.java