Go to the documentation of this file.
34 return v1.
x == v2.
x && v1.
y == v2.
y && v1.
z == v2.
z;
40 printf(
"OctreeIndex size: %lu\n",
sizeof(
OctreeIndex));
41 FILE *f = fopen(filename,
"r");
45 printf(
"Error opening file\n");
51 printf(
"Header is 0x%X\n",
w.
header);
58 printf(
"Min bounds: ");
63 for (
int x = 0; x < 4; x++)
70 printf(
"Max bounds: ");
71 for (
int x = 0; x < 4; x++)
76 printf(
"Max dimension width = %d\n", maxWidth);
82 assert(fread(&
w.
grid[x],
sizeof(
w.
grid[x]), 1, f) == 1);
83 printf(
"0x%llX\n",
w.
morton[x]);
85 printf(
"(%f, %f, %f)\n", p.x, p.y, p.z);
86 printf(
"0x%llX\n",
w.
grid[x]);
90 for (
int i = 0; i < 64; i++)
114 FILE *f = fopen(filename,
"w+");
129 for (
int i = 0; i < 64; i++)
132 if ((
w.
grid[x]>>i)&1)
146 fprintf(f,
"voxel %d %d %d\n", maxx-minx+1+2*buffer, maxy-miny+1+2*buffer, maxz-minz+1+2*buffer);
151 for (
int i = 0; i < 64; i++)
154 if ((
w.
grid[x]>>i)&1)
157 fprintf(f,
"%d %d %d\n",
221 s.
y = (parent>>16)&0xFFFF;
222 s.
x = (parent>>32)&0xFFFF;
236 pt.x += minbounds[0];
238 pt.y += minbounds[1];
240 pt.z += minbounds[2];
260 bool drawFrame =
false;
261 for (
int i = 0; i < 64; i++)
264 if ((
w.
grid[x]>>i)&1)
276 glColor3f(gg, rr, bb);
277 glEnable(GL_LIGHTING);
288 glDisable(GL_LIGHTING);
289 glColor4f(1, 1, 1, 1);
334 x = (x ^ (x << 16)) & 0xff0000ff;
335 x = (x ^ (x << 8)) & 0x0300f00f;
336 x = (x ^ (x << 4)) & 0x030c30c3;
337 x = (x ^ (x << 2)) & 0x09249249;
350 x = (x ^ (x >> 2)) & 0x030c30c3;
351 x = (x ^ (x >> 4)) & 0x0300f00f;
352 x = (x ^ (x >> 8)) & 0xff0000ff;
353 x = (x ^ (x >> 16)) & 0x000003ff;
374 return(x * 16 + y * 4 + z);
rgbColor GetColor(float v, float vmin, float vmax, int type)
Given min/max values, get a color from a color schema.
double HCost(const voxelState &node1, const voxelState &node2) const
Heuristic value between two arbitrary nodes.
double min(double a, double b)
point3d GetVoxelCoordinate(uint64_t morton, float voxelSize, const float minbounds[4]) const
uint64_t GetActionHash(voxelAction act) const
void GetCoordsForIndex(size_t i, size_t &x, size_t &y, size_t &z) const
bool operator==(const voxelState &v1, const voxelState &v2)
uint32_t DecodeMorton3Y(uint32_t code) const
void ApplyAction(voxelState &s, voxelAction a) const
std::vector< uint64_t > mLayer0VoxelGrids
void GetSuccessors(const voxelState &nodeID, std::vector< voxelState > &neighbors) const
uint32_t DecodeMorton3Z(uint32_t code) const
uint32_t EncodeMorton3(uint32_t x, uint32_t y, uint32_t z) const
uint32_t Part1By2(uint32_t x) const
void DrawBoxFrame(GLfloat xx, GLfloat yy, GLfloat zz, GLfloat rad)
uint64_t GetStateHash(const voxelState &node) const
Voxels(const char *filename)
void GetStateFromHash(uint64_t parent, voxelState &s)
void GLDrawLine(const voxelState &x, const voxelState &y) const
double GCost(const voxelState &node1, const voxelState &node2) const
void DrawBox(GLfloat xx, GLfloat yy, GLfloat zz, GLfloat rad)
void GetActions(const voxelState &nodeID, std::vector< voxelAction > &actions) const
void GLLabelState(const voxelState &, const char *) const
bool InvertAction(voxelAction &a) const
uint32_t DecodeMorton3X(uint32_t code) const
void AddVoxelCubeToOctree(uint64_t values, point3d p)
void Draw(Graphics::Display &display) const
size_t GetIndex(size_t x, size_t y, size_t z) const
bool GoalTest(const voxelState &node, const voxelState &goal) const
void Export(const char *filename)
uint32_t Compact1By2(uint32_t x) const
Nodes to be stored within a Graph.