git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@187 92aac97c-a6ce-11dd-a772-7fcde58d38e6
This commit is contained in:
parent
4ce65e9aaa
commit
385301229d
|
@ -43,15 +43,14 @@ void CollisionEngine::update() {
|
||||||
|
|
||||||
// While the time accumulator is not empty
|
// While the time accumulator is not empty
|
||||||
while(timer.getAccumulator() >= timer.getTimeStep().getValue()) {
|
while(timer.getAccumulator() >= timer.getTimeStep().getValue()) {
|
||||||
|
|
||||||
// Remove all old collision contact constraints
|
// Remove all old collision contact constraints
|
||||||
collisionWorld->removeAllContactConstraints();
|
collisionWorld->removeAllContactConstraints();
|
||||||
|
|
||||||
Time timeFirst = 0; // First collision time
|
Time timeFirst(0); // First collision time
|
||||||
Time timeLast = DBL_MAX; // Last collision separation time
|
Time timeLast(DBL_MAX); // Last collision separation time
|
||||||
|
|
||||||
// Compute the collision detection
|
// Compute the collision detection
|
||||||
if(collisionDetection.computeCollisionDetection(collisionWorld, timer.getTimeStep(), timeFirst, timeLast)) {
|
if (collisionDetection.computeCollisionDetection(collisionWorld, timer.getTimeStep(), timeFirst, timeLast)) {
|
||||||
// For each body in the dynamic world
|
// For each body in the dynamic world
|
||||||
for(std::vector<Body*>::const_iterator it = world->getBodyListStartIterator(); it != world->getBodyListEndIterator(); ++it) {
|
for(std::vector<Body*>::const_iterator it = world->getBodyListStartIterator(); it != world->getBodyListEndIterator(); ++it) {
|
||||||
// If the body is a RigidBody and if the rigid body motion is enabled
|
// If the body is a RigidBody and if the rigid body motion is enabled
|
||||||
|
@ -60,6 +59,9 @@ void CollisionEngine::update() {
|
||||||
// Update the state of the rigid body
|
// Update the state of the rigid body
|
||||||
updateBodyState(rigidBody, timeFirst);
|
updateBodyState(rigidBody, timeFirst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Stop the body (TO DELETE)
|
||||||
|
rigidBody->setIsMotionEnabled(false); // TODO : DELETE THIS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -70,6 +72,7 @@ void CollisionEngine::update() {
|
||||||
if (rigidBody && rigidBody->getIsMotionEnabled()) {
|
if (rigidBody && rigidBody->getIsMotionEnabled()) {
|
||||||
// Update the state of the rigid body with an entire time step
|
// Update the state of the rigid body with an entire time step
|
||||||
updateBodyState(rigidBody, timer.getTimeStep());
|
updateBodyState(rigidBody, timer.getTimeStep());
|
||||||
|
std::cout << "NO NO NO" << std::endl; // TODO : DELETE THIS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user