Cell centroids were only used to detect element ordering. For this purpose, the centroid of the element's bounding box can be used.
In order to recover the performances lost due to the computation of the cell bounding box centroid, I've also optimized the generation of the Skd-Tree. The splitting between left and right elements can be done evaluating only the position of the element along the direction of the splitting rather than evaluating the whole bounding box of the element.
Cell centroids were only used to detect element ordering. For this purpose, the centroid of the element's bounding box can be used.
In order to recover the performances lost due to the computation of the cell bounding box centroid, I've also optimized the generation of the Skd-Tree. The splitting between left and right elements can be done evaluating only the position of the element along the direction of the splitting rather than evaluating the whole bounding box of the element.