查看“LlDetectedTouchST”的源代码
←
LlDetectedTouchST
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}} {{函数详情 |函数名 = Function: vector llDetectedTouchST( integer index ); |参数= 参数:integer index–Index of detection information index does not support negative indexes. |返回值= 返回值:Returns a vector that is the surface coordinates for where the prim was touched. The x & y vector positions contain the horizontal (s) & vertical (t) face coordinates respectively (<s, t, 0.0>). Each component is usually in the interval [0.0, 1.0] with the origin in the bottom left corner.[1] With some mesh objects, values of less than 0.0 and higher than 1.0 have been observed. |注意事项= 注意事项 *If index is out of bounds the script continues to execute without an error message. *TOUCH_INVALID_TEXCOORD 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 touch happened too close to the edge of the face to determine a location. **The event triggered is not a touch event. |示例= 示例1 <pre> default { touch_start(integer total_number) { integer touchFace = llDetectedTouchFace(0); vector touchST = llDetectedTouchST(0); // ZERO_VECTOR (<0.0, 0.0, 0.0> ... the origin) is in the bottom left corner of the face // touchST.x goes across the face from the left to the right // touchST.y goes up the face from the bottom to the top if (touchFace == -1) llWhisper(PUBLIC_CHANNEL, "Sorry, your viewer doesn't support touched faces."); else if (touchST == TOUCH_INVALID_TEXCOORD) llWhisper(PUBLIC_CHANNEL, "Sorry, the touch position upon the face could not be determined."); else llSay(PUBLIC_CHANNEL, "llDetectedTouchST(0) = " + (string)touchST + "\ntouchST.x = " + (string)touchST.x + "\ntouchST.y = " + (string)touchST.y); } } </pre> 示例2 <pre> integer numberOfRows = 12; integer numberOfColumns = 12; default { touch_start(integer total_number) { vector touchST = llDetectedTouchST(0); // ZERO_VECTOR (<0.0, 0.0, 0.0> ... the origin) is in the bottom left corner of the face // touchST.x goes across the face from the left to the right // touchST.y goes up the face from the bottom to the top integer columnIndex = (integer) (touchST.x * numberOfColumns); integer rowIndex = (integer) (touchST.y * numberOfRows); integer cellIndex = (rowIndex * numberOfColumns) + columnIndex; llSay(PUBLIC_CHANNEL, "ST grid (" + (string)columnIndex + ", " + (string)rowIndex + ") --> cell " + (string)cellIndex); } } </pre> 示例3 <pre> // with friendly permission of Supremius Maximus // who made the texture used in this script // // click&hold the mouse while dragging across // the face of the prim default { touch(integer num_detected) { integer link = llDetectedLinkNumber(0); integer face = llDetectedTouchFace(0); vector touchST = llDetectedTouchST(0); // ZERO_VECTOR (<0.0, 0.0, 0.0> ... the origin) is in the bottom left corner of the face // touchST.x goes across the face from the left to the right // touchST.y goes across the face from the bottom to the top string uuid = "23badbe7-6d8c-639b-0131-bb321f8e9db5"; llSetLinkPrimitiveParamsFast(link, [ PRIM_TEXTURE, face, uuid, <1.0, 1.0, 0.0>, touchST, 0, PRIM_FULLBRIGHT, ALL_SIDES, TRUE]); } } </pre> |相关函数= [[llDetectedLinkNumber]] [[llDetectedTouchFace]] [[llDetectedTouchUV]] [[llDetectedTouchPos]] [[llDetectedTouchNormal]] [[llDetectedTouchBinormal]] |相关事件= [[touch_start]] [[touch]] [[touch_end]] }}
该页面使用的模板:
模板:LSL Header
(
查看源代码
)
模板:LSLC
(
查看源代码
)
模板:LSLGC
(
查看源代码
)
模板:Multi-lang
(
查看源代码
)
模板:函数详情
(
查看源代码
)
返回至
LlDetectedTouchST
。
导航菜单
个人工具
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
网站首页
知识百科
编辑帮助
最近更改
工具
链入页面
相关更改
特殊页面
页面信息