diff --git a/sources/reactphysics3d/integration/ExplicitEuler.cpp b/sources/reactphysics3d/integration/ExplicitEuler.cpp index f2d1430a..193934ec 100644 --- a/sources/reactphysics3d/integration/ExplicitEuler.cpp +++ b/sources/reactphysics3d/integration/ExplicitEuler.cpp @@ -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(); diff --git a/sources/reactphysics3d/integration/SemiImplicitEuler.cpp b/sources/reactphysics3d/integration/SemiImplicitEuler.cpp index 5f286fb8..d3d8c220 100644 --- a/sources/reactphysics3d/integration/SemiImplicitEuler.cpp +++ b/sources/reactphysics3d/integration/SemiImplicitEuler.cpp @@ -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();