home | project pages | download | documentation | doxygen | contact |
#include <VoxCoord.h>
The root voxel that encapsulated the full voxel space, has coord (0, 0, 0, depth=0). The coord describes the near/left/bottom corner. The far/right/top corner has coord (0x8000, 0x8000, 0x8000, depth=0). There are no voxels outside of these bounds, because it leads to an integer overflow when calculating the outer bound.
There are 8 voxels inside the root voxel, they have the following coords:
This can continue until depth = 30, i.e. the 31th level. At his level each voxel has only the size of 1.
Public Member Functions | |
VoxCoord (void) | |
Construct a new coord identifying the root voxel in the oct-tree. | |
VoxCoord (const VoxCoord &a) | |
Copy constructor. | |
VoxCoord & | operator= (const VoxCoord &a) |
Copy operator. | |
VoxCoord | nextNeighbour (int x, int y, int z) const |
Get the coord of a neighbour voxel at the same oct-tree depth. | |
VoxCoord | childCoord (int child_index) const |
Get the coord of a child voxel at the next depth of the oct-tree. | |
IntervalVector | boundingBox (double scale) const |
Get the axis aligned bounding box describing this voxel in cartesion coords. | |
double | size (double scale) const |
The size of this voxel. | |
Public Attributes | |
uint32_t | v [3] |
3D coordinate of the left,near,bottom corner of a voxel box. | |
int | depth |
Depth within the oct-tree. |
camvox::VoxCoord::VoxCoord | ( | void | ) | [inline] |
Construct a new coord identifying the root voxel in the oct-tree.
camvox::VoxCoord::VoxCoord | ( | const VoxCoord & | a | ) | [inline] |
Copy constructor.
VoxCoord camvox::VoxCoord::nextNeighbour | ( | int | x, | |
int | y, | |||
int | z | |||
) | const [inline] |
Get the coord of a neighbour voxel at the same oct-tree depth.
To get the other corner of this voxel, one would specify (1, 1, 1) on this method.
x | number of voxels away on the x-axis. | |
y | number of voxels away on the y-axis. | |
z | number of voxels away on the z-axis. |
VoxCoord camvox::VoxCoord::childCoord | ( | int | child_index | ) | const [inline] |
Get the coord of a child voxel at the next depth of the oct-tree.
child_index | An index pointing to one of the eight childs of an oct-tree node. |
IntervalVector camvox::VoxCoord::boundingBox | ( | double | scale | ) | const [inline] |
Get the axis aligned bounding box describing this voxel in cartesion coords.
scale | The size of the smalles voxel. |
double camvox::VoxCoord::size | ( | double | scale | ) | const [inline] |
The size of this voxel.
uint32_t camvox::VoxCoord::v[3] |
3D coordinate of the left,near,bottom corner of a voxel box.
Depth within the oct-tree.