Fixed multiple collisions
This commit is contained in:
parent
d7e0b55a82
commit
954dc67f7a
|
@ -36,8 +36,8 @@ GameSession::GameSession()
|
|||
this->isCreated = false;
|
||||
this->isRunning = false;
|
||||
this->gameSession = this;
|
||||
this->logicFrameTime = DELTA_TIME_20;
|
||||
this->networkFrameTime = DELTA_TIME_20;
|
||||
this->logicFrameTime = DELTA_TIME_120;
|
||||
this->networkFrameTime = DELTA_TIME_120;
|
||||
this->networkTimer.reset();
|
||||
this->logicTimer.reset();
|
||||
|
||||
|
|
|
@ -291,7 +291,7 @@ void API_Impl::UpdateWorld()
|
|||
simpleBody->SetPreviousVelocity(simpleBody->GetLinearVelocity());
|
||||
}
|
||||
|
||||
this->dynamicsWorld->stepSimulation(this->timeStep, 1, this->timeStep);
|
||||
this->dynamicsWorld->stepSimulation(this->timeStep, 10, this->timeStep);
|
||||
|
||||
ICustomBody::State state;
|
||||
|
||||
|
@ -314,9 +314,34 @@ void API_Impl::UpdateWorld()
|
|||
ICustomBody* bodyA = (ICustomBody*)obA->getUserPointer();
|
||||
ICustomBody* bodyB = (ICustomBody*)obB->getUserPointer();
|
||||
|
||||
|
||||
|
||||
int numContacts = contactManifold->getNumContacts();
|
||||
for (int j=0;j<numContacts;j++)
|
||||
{
|
||||
btManifoldPoint& pt = contactManifold->getContactPoint(j);
|
||||
if (pt.getDistance()<0.f)
|
||||
{
|
||||
if(bodyA->GetState().mass == 40 && bodyB->GetState().centerPos == Float3::null)
|
||||
{
|
||||
const char* breakPoint = "STOP";
|
||||
}
|
||||
if(bodyB->GetState().mass == 40 && bodyA->GetState().centerPos == Float3::null)
|
||||
{
|
||||
const char* breakPoint = "STOP";
|
||||
}
|
||||
|
||||
const btVector3& ptA = pt.getPositionWorldOnA();
|
||||
const btVector3& ptB = pt.getPositionWorldOnB();
|
||||
const btVector3& normalOnB = pt.m_normalWorldOnB;
|
||||
|
||||
bodyA->CallSubscription_AfterCollisionResponse(bodyA, bodyB, 0.0f);
|
||||
bodyB->CallSubscription_AfterCollisionResponse(bodyB, bodyA, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue