[kernel] fix bug in multiple calls to NEDS::computeForces when MExt in inertial frame
@@ -1050,8 +1050,12 @@ void NewtonEulerDS::computeForces(double time, SP::SiconosVector q, SP::SiconosV
{
computeMExt(time);
assert(!isnan(_mExt->vector_sum()));
- if(_isMextExpressedInInertialFrame)
- ::changeFrameAbsToBody(q,_mExt);
+ if(_isMextExpressedInInertialFrame) {
+ SP::SiconosVector mExt(std11::make_shared<SiconosVector>(*_mExt));
+ ::changeFrameAbsToBody(q,mExt);
+ _wrench->setBlock(3, *mExt);
+ }
+ else
_wrench->setBlock(3, *_mExt);
}
