Difference between revisions of "LlEdgeOfWorld"

From Second Life Wiki
Jump to navigation Jump to search
m (added example)
Line 11: Line 11:
|caveats
|caveats
|constants
|constants
|examples
|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>
|helpers
|helpers
|also_functions
|also_functions

Revision as of 10:17, 11 February 2008

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 an integer that is a boolean.

• vector pos
• vector dir

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>

Deep Notes

Search JIRA for related Issues

Signature

function integer llEdgeOfWorld( vector pos, vector dir );