Added test get methods and some comments.

This commit is contained in:
William Moberg
2015-12-07 16:25:01 +01:00
parent 955c9ce534
commit 04a8eeebe8
2 changed files with 19 additions and 4 deletions
+9 -2
View File
@@ -1,7 +1,9 @@
#ifndef OctTree_h__
#define OctTree_h__
#include "Core/Collision.h"
#include "Core/AABB.h"
struct Ray;
class OctTree
{
@@ -19,13 +21,18 @@ public:
//Returns true if the ray collides with something in the tree. Result is written to [data].
bool RayCollides(const Ray& ray, Output& data) const;
//Test Getters.
OctTree** Children() { return m_Children; }
const AABB& Box() { return m_Box; }
const std::vector<AABB>& ContainingBoxes() { return m_ContainingBoxes; }
private:
OctTree* m_Children[8];
std::vector<AABB> m_ContainingBoxes;
//TODO: Do derived class from AABB with a bool Tested, falsify at
//start of Collision test, set on check, don't check if set already. Solves duplicate boxes in tree.
AABB m_Box;
bool rayCollides(const Ray& ray, Output& data) const;
inline bool hasChildren() const;
int childIndexContainingPoint(const glm::vec3& point) const;