It seems that the octree has been built correctly. Going to use bitset to count children, not sure how I'm going to determine what quadrants they lie in. Perhaps masks?

This commit is contained in:
2017-02-20 22:49:41 -08:00
parent 6534e3303b
commit 0c9ef2ae6a
4 changed files with 13 additions and 32 deletions

View File

@@ -1,11 +1,6 @@
#include "Map.h"
int BitCount(unsigned int u) {
unsigned int uCount;
uCount = u - ((u >> 1) & 033333333333) - ((u >> 2) & 011111111111);
return ((uCount + (uCount >> 3)) & 030707070707) % 63;
}
void SetBit(int position, char* c) {
*c |= (uint64_t)1 << position;

View File

@@ -83,8 +83,7 @@ int main() {
// Currently just close it right away for debug
ni.stop_listening_for_clients();
sf::RenderWindow window(sf::VideoMode(WINDOW_X, WINDOW_Y), "SFML");
window.setMouseCursorVisible(false);
// =============================
Map _map(sf::Vector3i(0, 0, 0));
@@ -93,7 +92,10 @@ int main() {
_map.a.get_voxel(sf::Vector3i(0, 0, 0));
// =============================
//return 0;
return 0;
sf::RenderWindow window(sf::VideoMode(WINDOW_X, WINDOW_Y), "SFML");
window.setMouseCursorVisible(false);
/*GL_Testing t;
t.compile_shader("../shaders/passthrough.frag", GL_Testing::Shader_Type::FRAGMENT);