voxelizer icon indicating copy to clipboard operation
voxelizer copied to clipboard

Calculating AABB center

Open kaichsu opened this issue 1 year ago • 0 comments

In the vx__voxelize function, the vx__aabb_center function is used to obtain the center point of an AABB by calculating (saabb.min + saabb.max) / 2. However, this is equivalent to ((xyz - hvs) + (xyz + hvs)) / 2, which simplifies to xyz.

Is there a specific reason for using vx__aabb_center to get the AABB center rather than using xyz directly?

https://github.com/karimnaaji/voxelizer/blob/f6ee9cf6863c034853a587f205f12183c7d57b74/voxelizer.h#L630-L637 https://github.com/karimnaaji/voxelizer/blob/f6ee9cf6863c034853a587f205f12183c7d57b74/voxelizer.h#L756-L769

kaichsu avatar Aug 17 '24 01:08 kaichsu