OctTree doesn't check the same object multiple times if it exists in multiple places in the tree.

This commit is contained in:
William Moberg
2015-12-10 16:04:55 +01:00
parent e580540143
commit 0d8f7acb7e
3 changed files with 222 additions and 64 deletions
+4 -1
View File
@@ -108,12 +108,15 @@ private:
ComponentWrapper model = world.AttachComponent(entityDummyScene, "Model");
model["Resource"] = "Models/DummyScene.obj";
}
for (int i = 0; i < 16; ++i)
{
EntityID entityCollisionBox = world.CreateEntity();
ComponentWrapper transform = world.AttachComponent(entityCollisionBox, "Transform");
transform["Position"] = glm::vec3(0.f, 2.f, 0.f);
transform["Position"] = glm::vec3(rand()%11-5, rand() % 11 - 5, rand() % 11 - 5);
ComponentWrapper model = world.AttachComponent(entityCollisionBox, "Model");
model["Resource"] = "Models/Core/UnitBox.obj";
float sc = 0.20f;
transform["Scale"] = glm::vec3(sc, sc, sc);
ComponentWrapper collision = world.AttachComponent(entityCollisionBox, "Collision");
glm::vec3 pos = transform["Position"];