Put back old version of OctTree for testing, made unit tests.
Tests shows the old version checks for collisions etc. faster, new version adds objects into tree faster, and doesn't give duplicated results.
This commit is contained in:
@@ -163,7 +163,7 @@ OctTree::OctChild::~OctChild()
|
||||
|
||||
void OctTree::Update(float dt, World* world, Camera* cam)
|
||||
{
|
||||
for (ComponentWrapper& c : world->GetComponents("Collision")) {
|
||||
for (ComponentWrapper& c : *world->GetComponents("Collision")) {
|
||||
AABB aabb;
|
||||
aabb.CreateFromCenter(c["BoxCenter"], c["BoxSize"]);
|
||||
AddDynamicObject(aabb);
|
||||
|
||||
Reference in New Issue
Block a user