projects
/
physics.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added ball to ball collisions
[physics.git]
/
src
/
entityManager.cpp
diff --git
a/src/entityManager.cpp
b/src/entityManager.cpp
index
82dc6d8
..
c7fc78b
100644
(file)
--- a/
src/entityManager.cpp
+++ b/
src/entityManager.cpp
@@
-19,12
+19,13
@@
#include "debug.h"
#include <set>
#include "debug.h"
#include <set>
-#include <iostream>
#include "Entities/Entity.h"
#include "Entities/Particle.h"
#include "Entities/PhysicsEntity.h"
#include "Entities/Entity.h"
#include "Entities/Particle.h"
#include "Entities/PhysicsEntity.h"
+#include "collisionHandler.h"
+
/// ***** Private Method Headers *****
void updateParticles(float);
/// ***** Private Method Headers *****
void updateParticles(float);
@@
-46,11
+47,11
@@
setPhys physics_To_Remove;
void manager::init()
{
void manager::init()
{
-
+ collision::init();
}
void manager::clean()
{
}
void manager::clean()
{
-
+ collision::clean();
}
/// ***** Public Methods *****
}
/// ***** 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)
{
}
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()
}
void manager::handleInput()
@@
-180,6
+183,9
@@
void updatePhysics(float time_step)
}
physics_To_Remove.clear();
}
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();
// update active PhysicsEntity*s
for( setPhys::iterator it = active_Physics.begin();
it != active_Physics.end();