Universe.Physics.BulletSPlugin.BSPrim.AddForceImpulse C# (CSharp) Method

AddForceImpulse() public method

public AddForceImpulse ( OpenMetaverse impulse, bool pushforce, bool inTaintTime ) : void
impulse OpenMetaverse
pushforce bool
inTaintTime bool
return void
        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;
                }
            }
        }