LlList2Rot/ja

From Second Life Wiki

メインページ > LlList2Rot > LlList2Rot/ja
Jump to: navigation, search

関数: rotation llList2Rot( list src, integer index );

srcindex にある要素のrotation値を返します。

• list src 処理対象の要素が含まれるリスト
• integer index 処理対象の要素のインデックス

index には負のインデックスを使用できます。
indexsrc の有効なインデックス外だった場合 ZERO_ROTATION が返されます。
srcindex にある要素の型が rotation でなかった場合 ZERO_ROTATION が返されます。
右のような代替手段があります: (rotation)llList2String(src, index);

仕様

インデックス
先頭 0 -length
末尾 length - 1 -1

Indexes

  • 正のインデックスは先頭から数えます。先頭の要素は 0、末尾の要素は (length - 1) のインデックスを持ちます。
  • 負のインデックスは末尾から数えます。先頭の要素は -length、末尾の要素は -1 のインデックスを持ちます。

警告

  • index が正常なインデックス範囲を外れていても、スクリプトはエラー表示を出さずに処理を続けます。
  • 要素が文字列だった場合 ZERO_ROTATION が返ります。
    • 文字列の要素を正しく型変換する方法: (rotation)llList2String(src, index);
      • 要素が rotation 型だった場合、llList2String で string 型に変換すると小数点以下の桁数が 6 桁に切り詰められます。

// チャットウィンドウ (Ctrl-H) でご覧ください。 
default
{
    state_entry()
    {
        list my_list = ["a", 1, 2.0, <1,2,3>, <1,2,3,4>, llGetOwner()];
        integer i = ~llGetListLength(my_list);
        while (++i)
        {
            llOwnerSay("string=" + llList2String(my_list,i)
                        + "\n   integer=" + (string)llList2Integer(my_list,i)
                        + "\n   float=" + (string)llList2Float(my_list,i)
                        + "\n   vector=" + (string)llList2Vector(my_list,i)
                        + "\n   rot=" + (string)llList2Rot(my_list,i)
                        + "\n   key=" + (string)llList2Key(my_list,i) );
        }
    }
}

関連項目

ディープノート

要因

New Feature - A new feature of the product, which has yet to be developed. Open - The issue is open and ready for the assignee to start work on it.    Perform typecasting with all llList2* functions
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。
In other languages