Merge pull request #37 from teamfisk/OctTree

Oct tree
This commit is contained in:
2016-01-21 09:57:46 +01:00
15 changed files with 265 additions and 207 deletions
+2 -2
View File
@@ -68,8 +68,8 @@ Game::Game(int argc, char* argv[])
// Create Octrees
m_OctreeCollision = new Octree(AABB(glm::vec3(-100), glm::vec3(100)), 4);
m_OctreeFrustrumCulling = new Octree(AABB(glm::vec3(-100), glm::vec3(100)), 4);
m_OctreeCollision = new Octree<AABB>(AABB(glm::vec3(-100), glm::vec3(100)), 4);
m_OctreeFrustrumCulling = new Octree<AABB>(AABB(glm::vec3(-100), glm::vec3(100)), 4);
// Create system pipeline
m_SystemPipeline = new SystemPipeline(m_EventBroker);
+3 -1
View File
@@ -9,7 +9,9 @@ void PlayerMovementSystem::UpdateComponent(World* world, EntityWrapper& entity,
ComponentWrapper& cPhysics = entity["Physics"];
glm::vec3& velocity = cPhysics["Velocity"];
velocity.y -= 9.82 * dt;
if (cPhysics["Gravity"]) {
velocity.y -= 9.82 * dt;
}
glm::vec3& position = cTransform["Position"];
position += velocity * (float)dt;