Difference between revisions of "LlPushObject"

From Second Life Wiki
Jump to: navigation, search
m
Line 3: Line 3:
 
|func=llPushObject
 
|func=llPushObject
 
|p1_type=key|p1_name=target|p1_desc=Avatar or object [[UUID]] in the sim
 
|p1_type=key|p1_name=target|p1_desc=Avatar or object [[UUID]] in the sim
|p2_type=vector|p2_name=impulse
+
|p2_type=vector|p2_name=impulse|p2_desc=Direction and force of push. Direction is affected by '''local'''.
|p3_type=vector|p3_name=ang_impulse|p3_desc=angular impulse
+
|p3_type=vector|p3_name=ang_impulse|p3_desc=Rotational force.
|p4_type=integer|p4_name=local|p4_desc=boolean, if {{LSL Const|TRUE|integer|1}} uses the [[Viewer coordinate frames#Local|local]] axis of '''target''', if {{LSL Const|FALSE|integer|0}} uses the [[Viewer coordinate frames#Region|region]] axis.
+
|p4_type=integer|p4_name=local|p4_desc=boolean, if TRUE uses the local axis of '''target''', if FALSE uses the region axis.
 
|func_footnote
 
|func_footnote
 
|func_desc=Applies '''impulse''' and '''ang_impulse''' to object '''id'''
 
|func_desc=Applies '''impulse''' and '''ang_impulse''' to object '''id'''

Revision as of 23:11, 6 December 2008

Summary

Function: llPushObject( key target, vector impulse, vector ang_impulse, integer local );

Applies impulse and ang_impulse to object id

• key target Avatar or object UUID in the sim
• vector impulse Direction and force of push. Direction is affected by local.
• vector ang_impulse Rotational force.
• integer local boolean, if TRUE uses the local axis of target, if FALSE uses the region axis.

Caveats

  • Only works on land where Push is not restricted or where the script is owned by the land owner.
    • If the land is owned by a group, the scripted object must be deeded to the same group.
  • The effectiveness of Push is modulated by the amount of script energy available.
    • There is a simplified code snippet describing how Push is implemented in the Havok4 project and reveals some of the details of how the energy budget affects the final Push magnitude.
  • In no-push areas an object can only push its owner.
  • ang_impulse is ignored when applying to agents.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl>// Pushes the collided object or avatar. default {

   collision_start(integer num_detected)
   {
       llPushObject(llDetectedKey(0),<0,0,100>, <0,0,100>, TRUE);
   }
}</lsl>

Deep Notes

Search JIRA for related Issues

Signature

function void llPushObject( key target, vector impulse, vector ang_impulse, integer local );