LlGetRot/ja

From Second Life Wiki
< LlGetRot
Revision as of 23:23, 15 April 2008 by Asuka Neely (talk | contribs) (New page: {{multi-lang}} {{LSL_Function/ja |func=llGetRot |sort=GetRot |func_id=62|func_sleep=0.0|func_energy=10.0 |func_desc |func_footnote |return_type=rotation |return_text=[[Viewer coordinate fr...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

要約

関数: rotation llGetRot( );

リージョン面と相対的なプリムの回転を rotation で返します。

サンプル

<lsl> //-- rotates an object to face the nearest cardinal direction (N,E,S,W)

//-- assumes build is aligned to root object facing

default{

 state_entry()
 {
   llSay( 0, "Rotate me in edit, then touch to make me face the nearest compass point" );
 }
 touch_start( integer vIntTouches )
 {
    //-- convert our rotation to x/y/z radians
   vector vRadBase = llRot2Euler( llGetRot() );
    //-- round the z-axis to the nearest 90deg (PI_BY_TWO = 90deg in radians)
   llSetRot( llEuler2Rot( <0.0, 0.0, llRound( vRadBase.z / PI_BY_TWO ) * PI_BY_TWO > ) );
 }
}</lsl>

注意点

アタッチメントによるMouselookでのllGetRot (see llForceMouselookを参考)はアバタの視野角を返します。 クライアント内エディタのツールチップが誤っていると、物理オブジェクト内のスクリプトが動くでしょう。

特記事項

Search JIRA for related Issues

Signature

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