Difference between revisions of "LlEdgeOfWorld"
Jump to navigation
Jump to search
All Issues ~ Search JIRA for related Bugs
m |
m |
||
Line 1: | Line 1: | ||
{{LSL_Function | {{LSL_Function | ||
|inject-2={{LSL_Function/position|pos|region=*}} | |||
|func=llEdgeOfWorld | |func=llEdgeOfWorld | ||
|sort=EdgeOfWorld | |sort=EdgeOfWorld | ||
|func_id=205|func_sleep=0.0|func_energy=10.0 | |func_id=205|func_sleep=0.0|func_energy=10.0 | ||
|return_type=integer | |return_type=integer | ||
|p1_type=vector|p1_name=pos|p1_desc | |p1_type=vector|p1_name=pos|p1_desc | ||
|p2_type=vector|p2_name=dir|p2_desc=direction | |||
|func_footnote | |func_footnote | ||
|func_desc=Checks to see whether the border hit by | |func_desc=Checks to see whether the border hit by {{LSLP|dir}} from {{LSLP|pos}} is the edge of the world (has no neighboring simulator). | ||
|return_text=that is a {{HoverText|boolean|TRUE or FALSE}}, [[TRUE]] indicating there is a simulator in the direction indicated. | |return_text=that is a {{HoverText|boolean|TRUE or FALSE}}, [[TRUE]] indicating there is a simulator in the direction indicated. | ||
|spec | |spec | ||
|caveats=* Zero direction vector ([[ZERO_VECTOR]]) always returns [[TRUE]]. | |caveats=* Zero direction vector ([[ZERO_VECTOR]]) always returns [[TRUE]]. | ||
* | * {{LSLP|pos}} must be in the region. | ||
* Can only be used to detect directly adjacent regions, not diagonally adjacent regions | * Can only be used to detect directly adjacent regions, not diagonally adjacent regions | ||
|constants | |constants |
Revision as of 11:01, 7 June 2012
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 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 |