public void cut() { float choice = Random.Range(0,2); if (choice <=0.5){ splitX (cube); }else{ splitZ(cube); } }
//split the tree public void split(BSPNode _aNode) { if (_aNode.getLeftNode() != null){ split(_aNode.getLeftNode()); }else{ _aNode.cut(); return; } if (_aNode.getLeftNode() != null){ split(_aNode.getRightNode()); } }