Difference between revisions of "LlEdgeOfWorld"

From Second Life Wiki
Jump to navigation Jump to search
Line 7: Line 7:
|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
|p2_type=vector|p2_name=dir|p2_desc=direction
|func_footnote
|func_footnote=The z component of {{LSLP|dir}} is ignored.
|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).
|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=[[FALSE]] indicating there is a simulator in the direction indicated.
|return_text=[[FALSE]] indicating there is a simulator in the direction indicated.
|spec
|spec
|caveats=* If {{LSLP|dir}} is a [[ZERO_VECTOR|zero vector]], [[TRUE]] is always returned.
|caveats=*If the '''x''' and '''y''' components of {{LSLP|dir}} are zero (like with [[ZERO_VECTOR]]), [[TRUE]] is always returned.
* {{LSLP|pos}} must be in the region.
* {{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

Revision as of 14:01, 5 March 2014

Summary

Function: integer llEdgeOfWorld( vector pos, vector dir );

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) 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
All Issues ~ Search JIRA for related Bugs

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

Search JIRA for related Issues

Signature

function integer llEdgeOfWorld( vector pos, vector dir );