My use case is that I have a voxel octree which needs to be very memory efficient. So I can't store an AABB for every single voxel. That's 6 floats, i.e. 24 bytes per voxel.
Rather, voxel presence is encoded in bitsets, and the efficiency is such that a single voxel can be stored in far less than 1 bit per voxel.
So the issue is that when I tried to impl BVH for this octree, I could not implement fn content(&self, node: Self::Node) -> (&BV, Option<&T>) because it returns a reference to a bounding volume. I could easily generate an AABB for a given voxel, but it would not live long enough to return a reference. The only hack I can think of is to keep an AABB temporary variable on self that gets unsafely mutated to overcome &self, but that may be unsound depending on the code that's using this structure.
My use case is that I have a voxel octree which needs to be very memory efficient. So I can't store an AABB for every single voxel. That's 6 floats, i.e. 24 bytes per voxel.
Rather, voxel presence is encoded in bitsets, and the efficiency is such that a single voxel can be stored in far less than 1 bit per voxel.
So the issue is that when I tried to
impl BVH
for this octree, I could not implementfn content(&self, node: Self::Node) -> (&BV, Option<&T>)
because it returns a reference to a bounding volume. I could easily generate anAABB
for a given voxel, but it would not live long enough to return a reference. The only hack I can think of is to keep anAABB
temporary variable onself
that gets unsafely mutated to overcome&self
, but that may be unsound depending on the code that's using this structure.