Difference between revisions of "LlGetLocalPos/ja"

From Second Life Wiki
Jump to navigation Jump to search
m (カテゴリ変更)
 
(3 intermediate revisions by 2 users not shown)
Line 3: Line 3:
|func=llGetLocalPos|sort=GetLocalPos
|func=llGetLocalPos|sort=GetLocalPos
|return_type=vector
|return_type=vector
|func_footnote=ルートプリムから呼ばれる場合、[[llGetAttached|装着されたもの]]の[[Viewer coordinate frames#Attachments|装着箇所]]と相対的な位置を返す場合を除いて、[[Viewer coordinate frames#Region|リージョン位置]]を返します。
|func_footnote=ルートプリムから呼ばれる場合、 [[llGetAttached/ja|装着されたもの]] の [[Viewer coordinate frames/ja#Attachments|装着箇所]] に相対的な位置を返す場合を除いて、 [[Viewer coordinate frames/ja#Region|リージョン位置]] を返します。
|func_desc
|func_desc
|return_text=ルートとの([[Viewer coordinate frames#Local|ローカル]])相対位置
|return_text=ルートとの相対 ( [[Viewer coordinate frames/ja#Local|ローカル]] ) 位置
|spec
|spec
|caveats
|caveats
|constants
|constants
|examples=
|examples=
<lsl>
<source lang="lsl2">
default(
default
{
   touch_start( integer vIntTouched )
   touch_start( integer vIntTouched )
  {
     string vStrMessage = "The touched prim is ";
     string vStrMessage = "The touched prim is ";
     if (llDetectedLinkNumber( 0 ) > 1){
     if (llDetectedLinkNumber( 0 ) > 1)
       vStrMessage += (string)llVecMag( llGetLocalPos() ) + "m from "
    {
       vStrMessage += (string)llVecMag( llGetLocalPos() ) + "m from ";
     }
     }
     llSay( 0, vStrMessage + "the root prim" );
     llSay( 0, vStrMessage + "the root prim" );
   }
   }
}
}
</lsl>
</source>
|helpers=
|helpers=
llSetLocalPos関数はありません。ローカルでの、自身のルートプリム位置を設定するには、このようにすべきでしょう。
llSetLocalPos関数はありません。
<lsl>
ローカルでの、自身のルートプリム位置を設定するには、このようにすべきでしょう。
SetLocalPosition(vector local_position)
<source lang="lsl2">
SetPositionLocalToCurrentPosition(vector local_position)
{
{
   vector root_position = llGetPos();
   llSetPos(llGetLocalPos() + (local_position * llGetLocalRot()));
  vector absolute_position = root_position + local_position;
  llSetPos(absolute_position);
}
}
</lsl>
</source>
|also_functions={{LSL DefineRow||[[llGetRootPosition/ja|llGetRootPosition]]|ルートプリムのグローバル位置を設定します}}
|also_functions={{LSL DefineRow||[[llGetRootPosition/ja|llGetRootPosition]]|ルートプリムのグローバル位置を設定します}}
{{LSL DefineRow||[[llGetPos/ja|llGetPos]]|プリムのグローバル位置を取得します}}
{{LSL DefineRow||[[llGetPos/ja|llGetPos]]|プリムのグローバル位置を取得します}}
Line 38: Line 40:
|also_articles
|also_articles
|notes
|notes
|cat1=Movement/ja
|cat1=Movement
|cat2=Prim/ja
|cat2=Prim
|cat3=Object/ja
|cat3
|cat4
|cat4
}}
}}

Latest revision as of 13:49, 25 February 2016

要約

関数: vector llGetLocalPos( );

ルートとの相対 ( ローカル ) 位置を vector で返します。

ルートプリムから呼ばれる場合、 装着されたもの装着箇所 に相対的な位置を返す場合を除いて、 リージョン位置 を返します。

サンプル

default
{
  touch_start( integer vIntTouched )
  {
    string vStrMessage = "The touched prim is ";
    if (llDetectedLinkNumber( 0 ) > 1)
    {
      vStrMessage += (string)llVecMag( llGetLocalPos() ) + "m from ";
    }
    llSay( 0, vStrMessage + "the root prim" );
  }
}

便利なスニペット

llSetLocalPos関数はありません。 ローカルでの、自身のルートプリム位置を設定するには、このようにすべきでしょう。

SetPositionLocalToCurrentPosition(vector local_position)
{
   llSetPos(llGetLocalPos() + (local_position * llGetLocalRot()));
}

関連項目

関数

•  llGetRootPosition ルートプリムのグローバル位置を設定します
•  llGetPos プリムのグローバル位置を取得します
•  llSetPos プリムのグローバル位置を設定します

特記事項

Search JIRA for related Issues

Signature

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