Difference between revisions of "LlApplyImpulse"

From Second Life Wiki
Jump to navigation Jump to search
m (updated lsl tags)
m
Line 8: Line 8:
|p2_name=local
|p2_name=local
|p2_desc=boolean, if [[TRUE]], '''force''' is treated as a [[Viewer coordinate frames#Local|local]] directional vector instead of [[Viewer coordinate frames#Region|region]] directional vector.
|p2_desc=boolean, if [[TRUE]], '''force''' is treated as a [[Viewer coordinate frames#Local|local]] directional vector instead of [[Viewer coordinate frames#Region|region]] directional vector.
|func_footnote=Instantaneous impulse. llSetForce has continuous push
|func_desc=Applies impulse to object
|func_desc=Applies impulse to object
|return_text|spec
|return_text|spec
Line 28: Line 29:
</lsl>
</lsl>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llApplyRotationalImpulse]]|}}
|also_functions=
{{LSL DefineRow||[[llApplyRotationalImpulse]]|}}
{{LSL DefineRow||[[llSetForce]]|Set continuous force}}
|notes
|notes
|cat1=Physics
|cat1=Physics

Revision as of 10:19, 18 February 2008

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.

Instantaneous impulse. llSetForce has continuous push

Caveats

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

Examples

<lsl> //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);
         }
    }

}

</lsl>

See Also

Functions

•  llApplyRotationalImpulse
•  llSetForce Set continuous force

Deep Notes

Search JIRA for related Issues

Signature

function void llApplyImpulse( vector force, integer local );