public void AddForceImpulse(OMV.Vector3 impulse, bool pushforce, bool inTaintTime)
{
// for an object, doesn't matter if force is a pushforce or not
if (!IsPhysicallyActive)
{
if (impulse.IsFinite())
{
OMV.Vector3 addImpulse = Util.ClampV(impulse, BSParam.MaxAddForceMagnitude);
// DetailLog("{0},BSPrim.addForceImpulse,call,impulse={1}", LocalID, impulse);
PhysicsScene.TaintedObject(inTaintTime, "BSPrim.AddImpulse", delegate()
{
// Bullet adds this impulse immediately to the velocity
DetailLog("{0},BSPrim.addForceImpulse,taint,impulseforce={1}", LocalID, addImpulse);
if (PhysBody.HasPhysicalBody)
{
PhysicsScene.PE.ApplyCentralImpulse(PhysBody, addImpulse);
ActivateIfPhysical(false);
}
});
}
else
{
MainConsole.Instance.WarnFormat(
"{0}: AddForceImpulse: Got a NaN impulse applied to a prim. LocalID={1}", LogHeader, LocalID);
return;
}
}
}