mirror of
https://github.com/Relintai/godot_voxel.git
synced 2024-11-11 20:35:08 +01:00
46 lines
1.5 KiB
C
46 lines
1.5 KiB
C
|
#ifndef OCTREE_UTILITY_H
|
||
|
#define OCTREE_UTILITY_H
|
||
|
|
||
|
namespace OctreeUtility {
|
||
|
|
||
|
// Corners: Octants:
|
||
|
//
|
||
|
// 6---------------18--------------7 o---o---o
|
||
|
// / / /| | 6 | 7 |
|
||
|
// / / / | o---o---o Upper
|
||
|
// 17--------------25--------------19 | | 5 | 4 |
|
||
|
// / / / | o---o---o
|
||
|
// / / / |
|
||
|
// 5---------------16--------------4 | o---o---o
|
||
|
// | 14--------|-----23--------|-----15 | 2 | 3 |
|
||
|
// | / | / | /| o---o---o Lower Z
|
||
|
// | / | / | / | | 1 | 0 | |
|
||
|
// | 22-----------|--26-----------|--24 | o---o---o X---o
|
||
|
// | / | / | / |
|
||
|
// |/ |/ |/ |
|
||
|
// 13--------------21--------------12 |
|
||
|
// | 2---------|-----10--------|-----3
|
||
|
// | / | / | /
|
||
|
// | / | / | /
|
||
|
// | 9------------|--20-----------|--11 Y
|
||
|
// | / | / | / | Z
|
||
|
// |/ |/ |/ |/
|
||
|
// 1---------------8---------------0 X----o
|
||
|
|
||
|
const int g_octant_position[8][3]{
|
||
|
|
||
|
{ 0, 0, 0 },
|
||
|
{ 1, 0, 0 },
|
||
|
{ 1, 0, 1 },
|
||
|
{ 0, 0, 1 },
|
||
|
|
||
|
{ 0, 1, 0 },
|
||
|
{ 1, 1, 0 },
|
||
|
{ 1, 1, 1 },
|
||
|
{ 0, 1, 1 }
|
||
|
};
|
||
|
|
||
|
} // namespace OctreeUtility
|
||
|
|
||
|
#endif // OCTREE_UTILITY_H
|