Difference between revisions of "LlSetForce"

From Second Life Wiki
Jump to navigation Jump to search
m (<lsl> example)
m (Replaced old <LSL> block with <source lang="lsl2">)
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{LSL Function
{{LSL Function
|inject-2={{LSL_Function/force|force|local=local}}{{LSL_Function/physical}}
|func_id=64
|func_id=64
|func_sleep=0.0
|func_sleep=0.0
Line 5: Line 6:
|func=llSetForce
|func=llSetForce
|p1_type=vector|p1_name=force|p1_desc=directional force
|p1_type=vector|p1_name=force|p1_desc=directional force
|p2_type=integer|p2_name=local|p2_desc=boolean, if {{LSLG|TRUE}} uses [[Viewer coordinate frames#Local|local]] axis, if {{LSLG|FALSE}} uses [[Viewer coordinate frames#Region|region]] axis.
|p2_type=integer|p2_subtype=boolean|p2_name=local
|func_footnote=Continuous force. [[llApplyImpulse]] has instantaneous push.
|func_desc=Applies force to the object (if the script is physical)
|func_desc=Applies force to the object (if the script is physical)
|spec
|spec
|caveats=Only works on physical objects.
|caveats=Only works on physical objects and attachments (non-physical as well as physical).  Used on an attachment, it will apply the force to the avatar.
|constants
|constants
|examples=<lsl>//A simple rocket script. Launches object up when touched.  
|examples=<source lang="lsl2">//A simple rocket script. Launches object up when touched.  
//Sit on it for an interesting ride!
//Sit on it for an interesting ride!
default {
default
    touch_start(integer i) {
{
          llSetForce(<0,0,0x7FFFFFFF>, 0);  //FLY!
    touch_start(integer i)
    }
    {
}</lsl>
        llSetStatus(STATUS_PHYSICS, TRUE);
        llSetForce(<0,0,0x7FFFFFFF>, 0);  //FLY!
    }
}</source>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llSetForceAndTorque]]|}}
|also_functions={{LSL DefineRow||[[llSetForceAndTorque]]|}}
{{LSL DefineRow||[[llSetTorque]]|}}
{{LSL DefineRow||[[llSetTorque]]|}}
{{LSL DefineRow||[[llApplyImpulse]]|Instantaneous force}}
|also_tests
|also_tests
|also_events
|also_events

Revision as of 14:43, 22 January 2015

Summary

Function: llSetForce( vector force, integer local );

Applies force to the object (if the script is physical)

• vector force directional force
• integer local boolean, if TRUE force is treated as a local directional vector, if FALSE force is treated as a region directional vector

Continuous force. llApplyImpulse has instantaneous push.

Caveats

  • Only works in physics-enabled objects.Only works on physical objects and attachments (non-physical as well as physical). Used on an attachment, it will apply the force to the avatar.
All Issues ~ Search JIRA for related Bugs

Examples

//A simple rocket script. Launches object up when touched. 
//Sit on it for an interesting ride!
default
{
    touch_start(integer i)
    {
        llSetStatus(STATUS_PHYSICS, TRUE);
        llSetForce(<0,0,0x7FFFFFFF>, 0);  //FLY!
    }
}

See Also

Functions

•  llSetForceAndTorque
•  llSetTorque
•  llApplyImpulse Instantaneous force

Deep Notes

Search JIRA for related Issues

Signature

function void llSetForce( vector force, integer local );