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

@@ -29,6 +29,10 @@ struct XYZHasher {
}
};
class Octree {
public:
Octree() {
@@ -89,8 +93,11 @@ public:
uint64_t index = cp_to_index(head);
uint64_t child = block_stack.front()[index];
uint64_t child1 = block_stack.front()[index];
uint64_t child2 = block_stack.front()[index+1];
std::bitset<64> t(index);
auto val = t.count();
return true;
}

View File

@@ -272,26 +272,3 @@ inline std::vector<float> sfml_get_float_input(sf::RenderWindow *window) {
}
//struct Light {
// sf::Vector4f rgbi;
//
// // I believe that Vector3's get padded to Vector4's. Give them a non-garbage value
// sf::Vector3f position;
//
// sf::Vector3f direction_cartesian;
//
// void look_at_center() {
// direction_cartesian = SphereToCart(CartToNormalizedSphere(sf::Vector3f(256, 256, 256) - position));
// };
//
// void orbit_around_center(double time) {
// position = sf::Vector3f(
// position.x * cos(time/1000) - position.y * sin(time/1000),
// position.x * sin(time/1000) + position.y * cos(time/1000),
// position.z
// );
//
// look_at_center();
// };
//};