Don't click here unless you want to be banned.

LSL Wiki : llApplyImpulse

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org
llApplyImpulse(vector force, integer local)

If an object is physical, this call applies a single push in a specific direction to the object defined by the argument force. If local is true, force is applied along the object's local axis, otherwise it is applied along the global axis.

Note: unlike llApplyRotationalImpulse, llApplyImpulse does work on attachments.

Because there is no air friction, any impulse off the vertical (gravity) axis will cause the object to keep moving forever. Hence, this can be used to set a velocity.

To set the object's velocity using llApplyImpulse():
setVel(vector newVel, integer localAxis)
{
     vector curVel = llGetVel();
     
     if(localAxis)
     {
          rotation rot = llGetRot();
          curVel /= rot; // Un-rotate curVel.
     }

     newVel -= curVel;
     newVel *= llGetMass();

     llApplyImpulse(newVel,localAxis);
}

Compare with llApplyRotationalImpulse.


llApplyImpulse(llGetMass()*<0,0,10>,FALSE);
//10 meters per second upwards
//Gravity will slow the object down immediately and make it fall back

To overcome gravity effects, use a force which, unlike an impulse, is constant over time:

llSetForce(<0,0,9.8>*llGetMass(),FALSE);
// will cancel the effects of gravity

To stop a moving object dead in its tracks, apply an impulse to counter its current impulse:

llApplyImpulse(-llGetMass()*llGetVel(),FALSE);
//This will cancel the speed of an object that has no other forces set on it
//and will cause it to stop in place relative to the ground

Q:Is it possible to apply Impulses to other peoples objects that havn't been scripted to do so?

Limitations

The actual impulse may be less than requested for two reasons.


This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Dynamics | Force | Impulse Jasa SEO Jasa SEO Murah Sepatu Online Toko Sepatu Online Sepatu Sepatu Murah Sepatu Safety Sepatu Futsal Cheapes Hostgator Coupon Link Booking Televisori offerte Notebook Offerte Berita Terkini Internet Marketer Muda Internet Marketer Indonesia Portatile Apple RDAnet Lorks Karikatur Bisnis Modal Kecil Bisnis UKM Berita Terbaru Iklan Baris Jasa SEO Jasa SEO Murah SEO Indonesia Konsultan SEO SEO Belajar SEO Kursus SEO Kursus SEO Murah Jam Tangan Casio Jam Tangan Casio Jam Tangan Murah Jam Tangan Grosir Baju Terbaru Grosir Baju Baju Terbaru Grosir Baju Murah Bisnis Online Belajar SEO Kerupuk Kerupuk kulit Social Bookmark Dofollow Social Bookmark Kumpulan Puisi Kirim Puisi bola hantu Penumbuh Rambut Penumbuh Rambut timbangan WBC Wonogiri Jasa SEO Murah Jasa SEO Jam Tangan Murah
There are 8 comments on this page. [Display comments/form]