Skip to content

passTypeToChildren()

Jasmin B. Maglic edited this page Jun 18, 2021 · 1 revision
void Voxel::passTypeToChildren(std::array<unsigned,3> index, int lvl)

Method of the Voxel class. Recursively passes the voxel's type to all its children, up to the bottom level. The index is needed to access the voxel and its children in the order 3 storage tensor. lvl refers to the octree level.

Implementation

Returns immediately if the level is equal to 0.

Iterate through the 2x2x2 block of subvoxels. Using the voxel's index the child index is calculated with which the child is accessed. The child's type is set to be this voxel's type before calling this function on the child.

Clone this wiki locally