Guest User

Untitled

a guest
Feb 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #pragma once
  2. #include "../math/Vector2.h"
  3. #include "BaseEntity.h"
  4. #include <vector>
  5.  
  6. namespace Exoterra
  7. {
  8.     namespace Client
  9.     {
  10.         namespace Scene
  11.         {
  12.             class QuadTree
  13.             {
  14.             protected:
  15.                 static int MAX_ENTITIES_PER_NODE = 8;
  16.  
  17.                 Math::Vector2 mSize;
  18.                 Math::Vector2 mPos;
  19.  
  20.                 QuadTree* mNodes[2][2];
  21.                 std::vector<BaseEntity*> mEntities;
  22.             public:
  23.                 QuadTree(Math::Vector2 size);
  24.                 QuadTree(Math::Vector2 size, Math::Vector2 postition);
  25.  
  26.                 ~QuadTree();
  27.  
  28.                 bool AddEntity(BaseEntity* pEntity);
  29.                 //bool RemoveEntity(BaseEntity* pEntity);
  30.                 // Still not sure on how to implement this.  Will switch to maps later.
  31.  
  32.                 QuadTree* LocatePoint(Math::Vector2 location);
  33.             };
  34.         }
  35.     }
  36. }
Add Comment
Please, Sign In to add comment