查看“LlDetectedTouchPos”的源代码
←
LlDetectedTouchPos
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}} {{函数详情 |函数名 = Function: vector llDetectedTouchPos( integer index ); |参数= 参数:integer index–Index of detection information index does not support negative indexes. |返回值= 返回值:Returns the vector position where the object was touched in region coordinates, unless it is attached to the HUD, in which case it returns the position in screen space coordinates. |注意事项= 注意事项 *HUD attachments currently return coordinates relative to the center of the screen rather than the attachment point. SVC-3425 *If index is out of bounds the script continues to execute without an error message. *TOUCH_INVALID_VECTOR is returned when... **The avatar's viewer does not support face touch detection. ***To check if face touch detection is supported check the return of llDetectedTouchFace. **The touch has moved off the surface of the prim. **The event triggered is not a touch event. |示例= 示例1 <pre> default { touch_start(integer num_detected) { llWhisper(0, "Pos clicked: " + (string)llDetectedTouchPos(0)); } } </pre> 示例2 <pre> 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(); } </pre> |相关函数= [[touch_start]] [[touch]] [[touch_end]] |相关事件= [[llDetectedLinkNumber]] [[llDetectedTouchFace]] [[llDetectedTouchST]] [[llDetectedTouchUV]] [[llDetectedTouchNormal]] [[llDetectedTouchBinormal]] }}
该页面使用的模板:
模板:LSL Header
(
查看源代码
)
模板:LSLC
(
查看源代码
)
模板:LSLGC
(
查看源代码
)
模板:Multi-lang
(
查看源代码
)
模板:函数详情
(
查看源代码
)
返回至
LlDetectedTouchPos
。
导航菜单
个人工具
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
网站首页
知识百科
编辑帮助
最近更改
工具
链入页面
相关更改
特殊页面
页面信息