When an attempt was made to construct the tree, the process was not completed because it was not possible to determine the clusters by means of kmeans. This was due to an incorrect calculation of the centroids, which had some Nan components. Firstly, an attempt was made to solve this bug by placing arbitrary centroids, only that getClosestHit, perhaps due to the infinite size of the AABBs, still did not allow the intersections with the planes to be evaluated. We therefore opted for a different approach, excluding planes from the BVHTree and adding a check on them before entering the getClosestHit proper algorithm.
Here is an example of render done with new procedure:
I would like to remark that you can't render a scene of only planes, because we want to have at least another shape as light emitter.
This PR should fix a bug in version 1.0.0.
When an attempt was made to construct the tree, the process was not completed because it was not possible to determine the clusters by means of kmeans. This was due to an incorrect calculation of the centroids, which had some Nan components. Firstly, an attempt was made to solve this bug by placing arbitrary centroids, only that getClosestHit, perhaps due to the infinite size of the AABBs, still did not allow the intersections with the planes to be evaluated. We therefore opted for a different approach, excluding planes from the BVHTree and adding a check on them before entering the getClosestHit proper algorithm.
Here is an example of render done with new procedure:
I would like to remark that you can't render a scene of only planes, because we want to have at least another shape as light emitter.