git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@285 92aac97c-a6ce-11dd-a772-7fcde58d38e6
This commit is contained in:
parent
0cf0364098
commit
6bc9298b5f
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue
Block a user