Difference between revisions of "LlEdgeOfWorld"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 41: Line 41:
{{LSL DefineRow||[[STATUS_DIE_AT_EDGE]]}}
{{LSL DefineRow||[[STATUS_DIE_AT_EDGE]]}}
{{LSL DefineRow||[[STATUS_RETURN_AT_EDGE]]}}
{{LSL DefineRow||[[STATUS_RETURN_AT_EDGE]]}}
|also_functions
|also_functions=
{{LSL DefineRow||[[llScriptDanger]]}}
|also_events
|also_events
|also_tests
|also_tests

Revision as of 22:48, 21 November 2013

Summary

Function: integer llEdgeOfWorld( vector pos, vector dir );
0.0 Forced Delay
10.0 Energy

Checks to see whether the border hit by dir from pos is the edge of the world (has no neighboring simulator).
Returns an integer that is a boolean, TRUE indicating there is a simulator in the direction indicated.

• vector pos position in region coordinates
• vector dir direction

Caveats

  • Zero direction vector (ZERO_VECTOR) always returns TRUE.
  • pos must be in the region.
  • Can only be used to detect directly adjacent regions, not diagonally adjacent regions

Examples

<lsl> //--// Tells if there are neighboring sims on touch //--//

default{

 touch_start( integer vIntTouched ){
   vector vPosObject = llGetPos();
   if (!llEdgeOfWorld( vPosObject, <0.0, 1.0, 0.0> )){
     llOwnerSay( "There is a Sim to the North" );
   }
   if (!llEdgeOfWorld( vPosObject, <1.0, 0.0, 0.0> )){
     llOwnerSay( "There is a Sim to the East" );
   }
   if (!llEdgeOfWorld( vPosObject, <0.0, -1.0, 0.0> )){
     llOwnerSay( "There is a Sim to the South" );
   }
   if (!llEdgeOfWorld( vPosObject, <-1.0, 0.0, 0.0> )){
     llOwnerSay( "There is a Sim to the West" );
   }
 }

}

</lsl>

See Also

Constants

•  STATUS_DIE_AT_EDGE
•  STATUS_RETURN_AT_EDGE

Functions

•  llScriptDanger

Deep Notes

Signature

function integer llEdgeOfWorld( vector pos, vector dir );