Difference between revisions of "LlGetRootPosition/ja"

From Second Life Wiki
Jump to navigation Jump to search
m (Undo revision 849942 by Mako Nozaki (Talk))
Line 4: Line 4:
|func_footnote
|func_footnote
|func_desc
|func_desc
|return_text=スクリプトが添付されたプリムの親プリムの[[Viewer coordinate frames#Region|リージョン]]位置
|return_text=スクリプトが添付されたプリムの親プリムの [[Viewer coordinate frames/ja#Region|リージョン]] 位置
|spec
|spec
|caveats
|caveats
Line 12: Line 12:
default{
default{
   touch_start( integer vIntTouched ){
   touch_start( integer vIntTouched ){
     string vStrMessage = "The prim with this scipt is ";
     string vStrMessage = "The prim with this script is ";
     if (llGetPos() != llGetRootPosition()){
     if (llGetPos() != llGetRootPosition()){
       vStrMessage += "NOT ";
       vStrMessage += "NOT ";
Line 22: Line 22:
|helpers=
|helpers=
<lsl>
<lsl>
//-- there is no llSetLocalPos, this adds the functionality
//-- llSetLocalPos は存在しません。これは関数の中で
//-- to match llGetLocalPos() in a child prim
//-- 子プリムの llGetLocalPos() に対応するように足し算しています
fSetLocalPos( vector vPosOffset ){
fSetLocalPos( vector vPosOffset ){
   llSetPos( llGetRootPosition() + vPosOffset );
   llSetPos( llGetRootPosition() + vPosOffset );
}
}
//-- this will move a root prim by the offset, or set the
//-- これはルートプリムをオフセットの分だけ動かしたり、
//-- position of a child prim relative to the root.
//-- ルートプリムに対する子プリムの位置を設定したりします。
</lsl>
</lsl>
|also_functions=
|also_functions=
Line 39: Line 39:
|notes
|notes
|cat1=Movement
|cat1=Movement
|cat2
|cat2=Prim
|cat3
|cat3
|cat4
|cat4
}}
}}

Revision as of 03:23, 4 May 2010

要約

関数: vector llGetRootPosition( );

スクリプトが添付されたプリムの親プリムの リージョン 位置を vector で返します。

サンプル

<lsl> default{

 touch_start( integer vIntTouched ){
   string vStrMessage = "The prim with this script is ";
   if (llGetPos() != llGetRootPosition()){
     vStrMessage += "NOT ";
   }
   llSay( PUBLIC_CHANNEL, vStrMessage + "centered on the root prim." );
 }

}

</lsl>

便利なスニペット

<lsl> //-- llSetLocalPos は存在しません。これは関数の中で //-- 子プリムの llGetLocalPos() に対応するように足し算しています fSetLocalPos( vector vPosOffset ){

 llSetPos( llGetRootPosition() + vPosOffset );

} //-- これはルートプリムをオフセットの分だけ動かしたり、 //-- ルートプリムに対する子プリムの位置を設定したりします。 </lsl>

関連項目

関数

•  llGetLocalPos 子プリムの親プリムに対する相対的な位置を取得します
•  llGetPos プリムのグローバル位置を取得します
•  llSetPos プリムのグローバル位置を設定します

特記事項

Search JIRA for related Issues

Signature

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