Difference between revisions of "LlApplyImpulse"

From Second Life Wiki
Jump to navigation Jump to search
m
m (updated lsl tags)
Line 12: Line 12:
|caveats=*Object must be physical.
|caveats=*Object must be physical.
|examples=
|examples=
<pre>
<lsl>
//Rez an object, and drop this script in it.
//Rez an object, and drop this script in it.
//This will launch it at the owner.
//This will launch it at the owner.
Line 26: Line 26:
     }
     }
}
}
</pre>
</lsl>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llApplyRotationalImpulse]]|}}
|also_functions={{LSL DefineRow||[[llApplyRotationalImpulse]]|}}

Revision as of 04:26, 11 February 2008

Summary

Function: llApplyImpulse( vector force, integer local );
0.0 Forced Delay
10.0 Energy

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.

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

Deep Notes

Signature

function void llApplyImpulse( vector force, integer local );