Changed order of move call

This commit is contained in:
Robin Engman 2014-02-20 11:13:52 +01:00
parent ddbc800dbb
commit 89c52d34f4
1 changed files with 6 additions and 6 deletions

View File

@ -283,6 +283,11 @@ void API_Impl::UpdateWorld()
SimpleRigidBody* simpleBody = dynamic_cast<SimpleRigidBody*>(this->customBodies[i]); SimpleRigidBody* simpleBody = dynamic_cast<SimpleRigidBody*>(this->customBodies[i]);
this->customBodies[i]->SetGravity(-(this->customBodies[i]->GetState().centerPos - this->gravityPoint).GetNormalized()*this->gravity); this->customBodies[i]->SetGravity(-(this->customBodies[i]->GetState().centerPos - this->gravityPoint).GetNormalized()*this->gravity);
simpleBody->PreStep(this->dynamicsWorld); simpleBody->PreStep(this->dynamicsWorld);
if(simpleBody->GetRigidBody()->getActivationState() == ACTIVE_TAG)
{
this->customBodies[i]->CallSubscription_Move();
}
} }
this->dynamicsWorld->stepSimulation(this->timeStep, 1, this->timeStep); this->dynamicsWorld->stepSimulation(this->timeStep, 1, this->timeStep);
@ -296,11 +301,6 @@ void API_Impl::UpdateWorld()
trans = simpleBody->GetRigidBody()->getWorldTransform(); trans = simpleBody->GetRigidBody()->getWorldTransform();
this->customBodies[i]->SetPosition(Float3(trans.getOrigin().x(), trans.getOrigin().y(), trans.getOrigin().z())); this->customBodies[i]->SetPosition(Float3(trans.getOrigin().x(), trans.getOrigin().y(), trans.getOrigin().z()));
this->customBodies[i]->SetRotation(Quaternion(Float3(trans.getRotation().x(), trans.getRotation().y(), trans.getRotation().z()), trans.getRotation().w())); this->customBodies[i]->SetRotation(Quaternion(Float3(trans.getRotation().x(), trans.getRotation().y(), trans.getRotation().z()), trans.getRotation().w()));
if(simpleBody->GetRigidBody()->getActivationState() == ACTIVE_TAG)
{
this->customBodies[i]->CallSubscription_Move();
}
} }
int numManifolds = this->dynamicsWorld->getDispatcher()->getNumManifolds(); int numManifolds = this->dynamicsWorld->getDispatcher()->getNumManifolds();