LlEdgeOfWorld

来自人工智能助力教育知识百科
Mkx讨论 | 贡献2020年4月13日 (一) 03:01的版本 (创建页面,内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}} {{函数详情 |函数名 = Function: integer llEdgeOfWorld( vector pos, vector dir ); |参数=…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航搜索

Template:Needs Translation/


函数名
Function: integer llEdgeOfWorld( vector pos, vector dir );
参数: vector pos – position in region coordinates

vector dir – direction

返回值:Returns a boolean (an integer) value. FALSE indicating there is a simulator in the direction indicated.
注意事项
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

示例
示例1
//--// 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" );
    }
  }
}
相关函数
llScriptDanger
相关事件