“LlDetectedTouchPos”的版本间的差异
(创建页面,内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}} {{函数详情 |函数名 = Function: vector llDetectedTouchPos( integer index ); |参数= 参…”) |
|||
| 第4行: | 第4行: | ||
{{函数详情 | {{函数详情 | ||
|函数名 = Function: vector llDetectedTouchPos( integer index ); | |函数名 = Function: vector llDetectedTouchPos( integer index ); | ||
| − | |参数= | + | |参数= 参数:检测信息索引不支持负索引。 |
| − | |返回值= | + | |返回值= 返回值:返回在区域坐标中接触对象的矢量位置,除非它附加到HUD,在这种情况下,它在屏幕空间坐标中返回位置。 |
|注意事项= | |注意事项= | ||
注意事项 | 注意事项 | ||
| − | * | + | *HUD的附件目前返回坐标相对于屏幕的中心,而不是附着点。svc - 3425 |
| − | * | + | *如果索引超出界限,脚本将继续执行,不会出现错误消息。 |
| − | * | + | *当…时返回TOUCH_INVALID_VECTOR |
| − | ** | + | **头像查看器不支持面部触摸检测。 |
| − | *** | + | ***检查是否支持face touch检测,检查llDetectedTouchFace返回。 |
| − | ** | + | **触摸已经离开了表面的prim。 |
| − | ** | + | **触发的事件不是触摸事件。 |
|示例= | |示例= | ||
2020年5月18日 (一) 11:25的版本
| 首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials |
| 函数名 |
|---|
| Function: vector llDetectedTouchPos( integer index ); |
| 参数:检测信息索引不支持负索引。 |
| 返回值:返回在区域坐标中接触对象的矢量位置,除非它附加到HUD,在这种情况下,它在屏幕空间坐标中返回位置。 |
| 注意事项 |
|---|
注意事项
|
| 示例 |
|---|
示例1
default
{
touch_start(integer num_detected)
{
llWhisper(0, "Pos clicked: " + (string)llDetectedTouchPos(0));
}
}
示例2 vector GetRealTouchPos(vector pos)
{
// By Ariu Arai for free use to anyone
// Returns a useful HUD Position Vector from the llDetectedTouchPos(); function
// USE: vector pos = GetRealTouchPos(llDetectedTouchPos(0)); .. Etc.
// This function is intended to be used to move child prims to where the user clicks. This does not work on the root prim.
integer point = llGetAttached();
vector offset;
if (point == ATTACH_HUD_TOP_RIGHT) offset = <1.0, 0.933,-0.5>;
else if (point == ATTACH_HUD_TOP_CENTER) offset = <1.0, 0.000,-0.5>;
else if (point == ATTACH_HUD_TOP_LEFT) offset = <1.0,-0.933,-0.5>;
else if (point == ATTACH_HUD_BOTTOM_LEFT) offset = <1.0,-0.933, 0.5>;
else if (point == ATTACH_HUD_BOTTOM) offset = <1.0, 0.000, 0.5>;
else if (point == ATTACH_HUD_BOTTOM_RIGHT) offset = <1.0, 0.933, 0.5>;
//return (pos - llGetLocalPos()) + (offset * llGetLocalRot());
return ((offset - llGetLocalPos()) + pos) / llGetLocalRot();
}
|
| 相关函数 |
|---|
| touch_start |
| 相关事件 |
|---|
| llDetectedLinkNumber
llDetectedTouchFace llDetectedTouchST llDetectedTouchUV llDetectedTouchNormal llDetectedTouchBinormal |