|
MVE - Multi-View Environment mve-devel
|
The voxel index is a unique 64 bit ID for each voxel in the octree. More...
#include <voxel.h>
Public Member Functions | |
| math::Vec3d | compute_position (math::Vec3d const ¢er, double size) const |
| Computes the position of a voxel given octree root size and center. | |
| void | from_path_and_corner (uint8_t level, uint64_t path, int corner) |
| Computes the octree corner index given octree node path and level. | |
| int32_t | get_offset_x (void) const |
| int32_t | get_offset_y (void) const |
| int32_t | get_offset_z (void) const |
| bool | operator< (VoxelIndex const &other) const |
Public Attributes | |
| uint64_t | index |
The voxel index is a unique 64 bit ID for each voxel in the octree.
The index is designed in such a way that it is independent of the level, i.e., neighboring nodes on different levels share voxels with the same ID. The bits are assigned as follows:
0 000...000 000...000 000...000
1 unused 21 bits 21 bits 21 bits bit z-coord y-coord x-coord
Since the maximum voxel index for level L is 2^L, this limits the maximum level to 20 with 21 bits, i.e. 2^20-1 < 2^20 < 2^21-1. Voxels at a lower level are shifted to the hightest bit to obtain the same index over different levels. For example, index I on level L is shifted I << (20 - L).
| math::Vec3d fssr::VoxelIndex::compute_position | ( | math::Vec3d const & | center, |
| double | size | ||
| ) | const |
| void fssr::VoxelIndex::from_path_and_corner | ( | uint8_t | level, |
| uint64_t | path, | ||
| int | corner | ||
| ) |
|
inline |