BlackSheep-LSL@Wiki

llRot2Up

最終更新:

mizcremorne

- view
メンバー限定 登録/ログイン

llRot2Up

vector llRot2Up(rotation q)

あるオブジェクトの回転がqである時、オブジェクトの上方向(ローカルZ軸)の向きを得る。
戻り値のvectorは長さが1の単位ベクトルである。

例えば、アタッチメントにおいて、アバターの上方向がどちらなのかを判断するのに使える。
default {
  touch_start(integer detected){
    vector axis = llRot2Up(llGetRot());
    llOwnerSay("Avatar's Z-axis direction is " + (string)axis);
  }
}

同様に、正面方向(ローカルX軸)の向きを得るにはllRot2Fwd関数、
左方向(ローカルY軸)の向きを得るにはllRot2Left関数を使う。

名前:
コメント:
記事メニュー
目安箱バナー