generateBSPTree implementation, with triangleVsPlane check