Added Update call in Game to test OctTree by using collision.

This commit is contained in:
William Moberg
2015-12-09 13:52:17 +01:00
parent bad42fae1c
commit 14bcb7ea0d
5 changed files with 101 additions and 0 deletions
+10
View File
@@ -4,6 +4,8 @@
#include "Core/AABB.h"
struct Ray;
class World;
class Camera;
class OctTree
{
@@ -23,6 +25,9 @@ public:
OctTree(const OctTree&& other) = delete;
OctTree& operator= (const OctTree& other) = delete;
//Collision test function. WTODO: Probably remove or relocate elsewhere, Collision system?
void Update(float dt, World* world, Camera* cam);
void AddDynamicObject(const AABB& box);
void AddStaticObject(const AABB& box);
@@ -47,6 +52,11 @@ private:
std::vector<AABB> m_DynamicObjects;
AABB m_Box;
bool m_UpdatedOnce;
unsigned int m_BoxID;
glm::vec3 m_PrevPos;
glm::quat m_PrevOri;
inline bool hasChildren() const;
int childIndexContainingPoint(const glm::vec3& point) const;
std::vector<int> childIndicesContainingBox(const AABB& box) const;