X-Git-Url: http://gitweb.pgornicz.com/gitweb.cgi?a=blobdiff_plain;f=src%2FentityManager.cpp;h=0707dfe03eb8e1015882a5502ad03855c69c39c9;hb=823da4ea799e7e0ad8a52c9a2c86ce1278bb432a;hp=b646c1ac50b71fe8bcb994a2f43d5498dee79065;hpb=617dcc71d9a71663f63fb56ffac2505b45bf91b9;p=physics.git
diff --git a/src/entityManager.cpp b/src/entityManager.cpp
index b646c1a..0707dfe 100644
--- a/src/entityManager.cpp
+++ b/src/entityManager.cpp
@@ -1,13 +1,32 @@
+/*
+ * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
#include "entityManager.h"
#include "debug.h"
#include
-#include
#include "Entities/Entity.h"
#include "Entities/Particle.h"
#include "Entities/PhysicsEntity.h"
+#include "collisionManager.h"
+#include "effectManager.h"
+
/// ***** Private Method Headers *****
void updateParticles(float);
@@ -29,11 +48,11 @@ setPhys physics_To_Remove;
void manager::init()
{
-
+ collision::init();
}
void manager::clean()
{
-
+ collision::clean();
}
/// ***** Public Methods *****
@@ -58,8 +77,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)
{
@@ -81,16 +101,19 @@ 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()
{
- // TODO
+ effect::handleInput();
}
void manager::update(float time_step)
{
+ effect::update(time_step);
+
updateParticles(time_step);
updatePhysics(time_step);
}
@@ -163,6 +186,9 @@ void updatePhysics(float time_step)
}
physics_To_Remove.clear();
+ // apply collision math
+ collision::update(active_Physics);
+
// update active PhysicsEntity*s
for( setPhys::iterator it = active_Physics.begin();
it != active_Physics.end();