mirror of
https://github.com/Relintai/godot_voxel.git
synced 2024-12-22 01:26:50 +01:00
91a5c7ffa8
- Moved HermiteValue in its own file - VoxelBuffer channels are now predefined - Create DualGridGenerator for easier passing of data - Chunk size is no longer hardcoded - Respect padding when polygonizing voxels - BUG: due to the above, the way we build the octree is now breaking the result as mentionned in the TODO
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
|