llEdgeOfWorld
Revision as of 14:03, 5 March 2014 by Strife Onizuka (talk | contribs)
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: integer llEdgeOfWorld( vector pos, vector dir );205 | Function ID |
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 a boolean (an integer) value. FALSE indicating there is a simulator in the direction indicated.
• vector | pos | – | position in region coordinates | |
• vector | dir | – | direction |
The z component of dir is ignored.
Caveats
- If the x and y components of dir are zero (like with ZERO_VECTOR), TRUE is always returned.
- 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>