“LlDetectedTouchPos”的版本间的差异
| 第55行: | 第55行: | ||
| − | |相关函数 | + | |相关函数= |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
[[llDetectedLinkNumber]] | [[llDetectedLinkNumber]] | ||
[[llDetectedTouchFace]] | [[llDetectedTouchFace]] | ||
| 第68行: | 第61行: | ||
[[llDetectedTouchUV]] | [[llDetectedTouchUV]] | ||
[[llDetectedTouchNormal]] | [[llDetectedTouchNormal]] | ||
| − | [[llDetectedTouchBinormal]] | + | [[llDetectedTouchBinormal]] |
| + | |||
| + | |||
| + | |相关事件= | ||
| + | [[touch_start]] | ||
| + | [[touch]] | ||
| + | [[touch_end]] | ||
}} | }} | ||
2021年1月20日 (三) 04:14的最新版本
| 首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | 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();
}
|
| 相关函数 |
|---|
| llDetectedLinkNumber
llDetectedTouchFace llDetectedTouchST llDetectedTouchUV llDetectedTouchNormal llDetectedTouchBinormal |
| 相关事件 |
|---|
| touch_start |