llApplyImpulse

From Second Life Wiki
Revision as of 08:52, 29 November 2007 by Strife Onizuka (talk | contribs) (an example like that leads to drama.)
Jump to navigation Jump to search

Summary

Function: llApplyImpulse( vector force, integer local );

Applies impulse to object

• vector force
• integer local boolean, if [[TRUE}}]], force is treated as a local directional vector instead of region directional vector.

Caveats

  • Object must be physical.
All Issues ~ Search JIRA for related Bugs

Examples

//Rez an object, and drop this script in it.
//This will launch it at the owner.
default {
     state_entry() {
          list p = llGetObjectDetails(llGetOwner(), [OBJECT_POS]);
          if(p != []) {
              llSetStatus(STATUS_PHYSICS, TRUE);
              vector pos = llList2Vector(p, 0);
              vector direction = llVecNorm(pos - llGetPos());
              llApplyImpulse(direction * 100, 0);
          }
     }
}

See Also

Functions

•  llApplyRotationalImpulse

Deep Notes

Search JIRA for related Issues

Signature

function void llApplyImpulse( vector force, integer local );