public void swapChildren(int index1,int index2){
  Spatial c2=children.get(index2);
  Spatial c1=children.remove(index1);
  children.add(index1,c2);
  children.remove(index2);
  children.add(index2,c1);
}

public void swapChildren ( int index1 , int index2 ) { Spatial c2 = children . get ( index2 ) ; Spatial c1 = children . remove ( index1 ) ; children . add ( index1 , c2 ) ; children . remove ( index2 ) ; children . add ( index2 , c1 ) ; }
more efficient than e . g detaching and attaching as no updates are needed .
