added ball to ball collisions
[physics.git] / src / entityManager.cpp
index 82dc6d8..c7fc78b 100644 (file)
 #include "debug.h"
 
 #include <set>
-#include <iostream>
 
 #include "Entities/Entity.h"
 #include "Entities/Particle.h"
 #include "Entities/PhysicsEntity.h"
 
+#include "collisionHandler.h"
+
 /// ***** Private Method Headers *****
 
 void updateParticles(float);
@@ -46,11 +47,11 @@ setPhys physics_To_Remove;
 
 void manager::init()
 {
-
+    collision::init();
 }
 void manager::clean()
 {
-
+    collision::clean();
 }
 
 /// ***** Public Methods *****
@@ -75,8 +76,9 @@ void manager::add(Entity* e)
         }
     }
 
-    std::cerr << "ENTITY TYPE NOT SUPPORTED BY addEntity()!!";
-    std::cerr << std::endl;
+#ifdef WARNINGS
+    cerr << "ENTITY TYPE NOT SUPPORTED BY addEntity()!!" << endl;
+#endif
 }
 void manager::remove(Entity* e)
 {
@@ -98,8 +100,9 @@ void manager::remove(Entity* e)
         }
     }
 
-    std::cerr << "ENTITY TYPE NOT SUPPORTED BY deleteEntity()!!";
-    std::cerr << std::endl;
+#ifdef WARNINGS
+    cerr << "ENTITY TYPE NOT SUPPORTED BY deleteEntity()!!" << endl;
+#endif
 }
 
 void manager::handleInput()
@@ -180,6 +183,9 @@ void updatePhysics(float time_step)
     }
     physics_To_Remove.clear();
 
+    // apply collision math
+    collision::update(active_Physics, time_step);
+
     // update active PhysicsEntity*s
     for( setPhys::iterator it = active_Physics.begin();
          it != active_Physics.end();