Difference between revisions of "LlDetectedTouchFace/ja"

From Second Life Wiki
Jump to navigation Jump to search
m (Undo revision 849382 by Mako Nozaki (Talk))
 
Line 14: Line 14:
** この関数を呼び出したイベントが {{LSLGC/ja|Touch|touch}} 系イベントでない。
** この関数を呼び出したイベントが {{LSLGC/ja|Touch|touch}} 系イベントでない。
|examples=
|examples=
<lsl>
<source lang="lsl2">
default {
default {


Line 42: Line 42:


}
}
</lsl>
</source>
|helpers
|helpers
|related
|related

Latest revision as of 06:36, 25 February 2016

要約

関数: integer llDetectedTouchFace( integer index );

アバターがクリックした面のインデックス番号を integer で返します。

• integer index 探知情報の番号

index には 負のインデックス を使用できません。 touch 系イベントでのみ有効です。touch されたプリムとイベントが処理されるプリムは別かもしれません。これは llDetectedLinkNumber でチェックできます。同様に、どの面が touch されたかは llDetectedTouchFace でチェックできます。

警告

  • index が正常なインデックス範囲を外れていても、スクリプトはエラー表示を出さずに処理を続けます。
  • 以下の場合は TOUCH_INVALID_FACE が返されます:
    • アバターのビューアが touch 面の検出に対応していない。
    • touch 点がプリムの表面から外れた。
    • この関数を呼び出したイベントが touch 系イベントでない。
All Issues ~ Search JIRA for related Bugs

サンプル

default {

    touch_start(integer num_detected) {
        integer i;
        for (i = 0; i < num_detected; i++) {
            integer touchedFace = llDetectedTouchFace(i);      

            if (touchedFace == -1) {
                llWhisper(0, "お使いのビューアでは touch 面を判別できません。");
            }
            else {
                // 元の色を記憶しておく
                vector oldColor = llGetColor(touchedFace);

                // touch された面を白、黒と変更する。
                llSetColor(<1., 1., 1.>, touchedFace);
                llSleep(0.1);
                llSetColor(<0., 0., 0.>, touchedFace);
                llSleep(0.1);
                
                // 記憶しておいた色に戻す
                llSetColor(oldColor, touchedFace);
            } // if ...
        } // for ...
    } // touch_start

}

関連項目

イベント

•  touch_start
•  touch
•  touch_end

関数

•  llDetectedLinkNumber
•  llDetectedTouchST
•  llDetectedTouchUV
•  llDetectedTouchPos
•  llDetectedTouchNormal
•  llDetectedTouchBinormal

記事

•  検出

特記事項

経緯

Search JIRA for related Issues

Signature

function integer llDetectedTouchFace( integer index );
この翻訳は 原文 と比べて古いですか?間違いがありますか?読みにくいですか?みんなで 修正 していきましょう! (手順はこちら)
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。