查看“LlDetectedTouchFace”的源代码
←
LlDetectedTouchFace
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}} {{函数详情 |函数名 = Function: integer llDetectedTouchFace( integer index ); |参数= 参数:integer index–Index of detection information index does not support negative indexes. |返回值= 返回值:Returns an integer that is the index of the face the avatar clicked on. |注意事项= *If index is out of bounds the script continues to execute without an error message. *TOUCH_INVALID_FACE is returned when... **The avatar's viewer does not support face touch detection. **The touch has moved off the surface of the prim. **The event triggered is not a touch event. |示例= 示例1 <pre> // This is the essential script to drop in a prim when you need to ascertain the number of a face (or faces) // Touch the prim surfaces to learn their face numbers, which you can then use in other scripts for texturing, colouring etc. say(string message) { llSay(PUBLIC_CHANNEL, message); } default { touch_start(integer num_detected) { integer face = llDetectedTouchFace(0); if (face == TOUCH_INVALID_FACE) // { say("The touched face could not be determined"); // } else // { say("You touched face number " + (string) face); // } } } </pre> 示例2 <pre> default { touch_start(integer num_detected) { integer link = llDetectedLinkNumber(0); integer face = llDetectedTouchFace(0); if (face == TOUCH_INVALID_FACE) llSay(PUBLIC_CHANNEL, "Sorry, your viewer doesn't support touched faces."); else { // store the original color list colorParams = llGetLinkPrimitiveParams(link, [PRIM_COLOR, face]); vector originalColor = llList2Vector(colorParams, 0); // color detected face white llSetLinkColor(link, <1.0, 1.0, 1.0>, face); llSleep(0.2); // color detected face black llSetLinkColor(link, ZERO_VECTOR, face); llSleep(0.2); // color detected face back to original color llSetLinkColor(link, originalColor, face); } } } </pre> |相关函数= [[llDetectedLinkNumber]] [[llDetectedTouchST]] [[llDetectedTouchUV]] [[llDetectedTouchPos]] [[llDetectedTouchNormal]] [[llDetectedTouchBinormal]] |相关事件= [[touch_start]] [[touch]] [[touch_end]] }}
该页面使用的模板:
模板:LSL Header
(
查看源代码
)
模板:LSLC
(
查看源代码
)
模板:LSLGC
(
查看源代码
)
模板:Multi-lang
(
查看源代码
)
模板:函数详情
(
查看源代码
)
返回至
LlDetectedTouchFace
。
导航菜单
个人工具
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
网站首页
知识百科
编辑帮助
最近更改
工具
链入页面
相关更改
特殊页面
页面信息