Difference between revisions of "LlSetForceAndTorque"

From Second Life Wiki
Jump to: navigation, search
(cleanup)
m (Replaced old <LSL> block with <source lang="lsl2">)
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{LSL Function
 
{{LSL Function
 +
|inject-2={{LSL_Function/force|force|torque|local=local}}{{LSL_Function/physical}}
 
|func_id=76
 
|func_id=76
 
|func_sleep=0.0
 
|func_sleep=0.0
 
|func_energy=10.0
 
|func_energy=10.0
 
|func=llSetForceAndTorque
 
|func=llSetForceAndTorque
|p1_type=vector
+
|p1_type=vector|p1_name=force|p1_desc=directional force
|p1_name=force
+
|p2_type=vector|p2_name=torque|p2_desc=torque force
|p2_type=vector
+
|p3_type=integer|p3_subtype=boolean|p3_name=local
|p2_name=torque
+
|func_desc=Sets the force and torque of object (if the script is physical)
|p3_type=integer
+
|spec
|p3_name=local
+
|caveats=
|func_desc=sets the force and torque of object, in local coords if local == TRUE (if the script is physical)
+
* If either value is [[ZERO_VECTOR]], the function eliminates both forces. Both values must be non-zero for this function to work. (The workaround to this is setting both separately.)
|}}
+
|constants
[[Category:LSL Functions|Set Force and Torque]]
+
|examples=
[[Category:LSL Stub]]
+
<source lang="lsl2">
 +
default
 +
{
 +
    touch_start(integer total_number)
 +
    {
 +
        llSetForceAndTorque( <0.0,0.0,5.0>, <1.0,0.0,0.0>, FALSE );
 +
    }
 +
}
 +
</source>
 +
|helpers
 +
|also_functions={{LSL DefineRow||[[llSetForce]]|}}
 +
{{LSL DefineRow||[[llSetTorque]]|}}
 +
|also_tests
 +
|also_events
 +
|also_articles
 +
|notes
 +
|cat1=Physics
 +
|cat2=Movement
 +
|cat3
 +
|cat4
 +
}}

Latest revision as of 14:42, 22 January 2015

Summary

Function: llSetForceAndTorque( vector force, vector torque, integer local );

Sets the force and torque of object (if the script is physical)

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

Caveats

  • Only works in physics-enabled objects.
  • If either value is ZERO_VECTOR, the function eliminates both forces. Both values must be non-zero for this function to work. (The workaround to this is setting both separately.)
All Issues ~ Search JIRA for related Bugs

Examples

default
{
    touch_start(integer total_number)
    {
        llSetForceAndTorque( <0.0,0.0,5.0>, <1.0,0.0,0.0>, FALSE );
    }
}

See Also

Functions

•  llSetForce
•  llSetTorque

Deep Notes

Search JIRA for related Issues

Signature

function void llSetForceAndTorque( vector force, vector torque, integer local );