git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@285 92aac97c-a6ce-11dd-a772-7fcde58d38e6

This commit is contained in:
chappuis.daniel 2010-02-23 08:38:37 +00:00
parent 0cf0364098
commit 6bc9298b5f
2 changed files with 4 additions and 4 deletions

View File

@ -44,9 +44,9 @@ void ExplicitEuler::integrate(BodyState& bodyState, const Time& time, const Time
// Compute the integrated body state
bodyState.setPosition(bodyState.getPosition() + bodyState.getLinearVelocity() * dt);
bodyState.setLinearMomentum(bodyState.getLinearMomentum() + bodyState.getForce() * dt);
bodyState.setLinearMomentum(bodyState.getLinearMomentum() + bodyState.getExternalForce() * dt);
bodyState.setOrientation(bodyState.getOrientation() + bodyState.getSpin() * dt);
bodyState.setAngularMomentum(bodyState.getAngularMomentum() + bodyState.getTorque() * dt);
bodyState.setAngularMomentum(bodyState.getAngularMomentum() + bodyState.getExternalTorque() * dt);
// Recalculate the secondary values of the body state
bodyState.recalculate();

View File

@ -43,8 +43,8 @@ void SemiImplicitEuler::integrate(BodyState& bodyState, const Time& time, const
double dt = timeStep.getValue(); // Timestep
// Compute the integrated body state
bodyState.setLinearMomentum(bodyState.getLinearMomentum() + bodyState.getForce() * dt);
bodyState.setAngularMomentum(bodyState.getAngularMomentum() + bodyState.getTorque() * dt);
bodyState.setLinearMomentum(bodyState.getLinearMomentum() + bodyState.getExternalForce() * dt);
bodyState.setAngularMomentum(bodyState.getAngularMomentum() + bodyState.getExternalTorque() * dt);
// Recalculate the secondary values of the body state
bodyState.recalculate();