X-Git-Url: http://gitweb.pgornicz.com/gitweb.cgi?p=physics.git;a=blobdiff_plain;f=src%2FentityManager.cpp;h=c7fc78b91abbca14de1ba322edcccb98c31427db;hp=82dc6d824f43b5dbe63047910f8e8893d337ff00;hb=54fe85c5d10e60da6a9c9bbde11f7215723da572;hpb=e7005f1741c5dd50c07f0449670ba704507a3fec diff --git a/src/entityManager.cpp b/src/entityManager.cpp index 82dc6d8..c7fc78b 100644 --- a/src/entityManager.cpp +++ b/src/entityManager.cpp @@ -19,12 +19,13 @@ #include "debug.h" #include -#include #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();