Difference between revisions of "LlGetAccel/ja"

From Second Life Wiki
Jump to navigation Jump to search
m
 
(3 intermediate revisions by one other user not shown)
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
|constants
|constants
|examples=
|examples=
<lsl>
<source lang="lsl2">
//A very simple (and not very effective) way of keeping a physical object in place.
//物理オブジェクトをその場にとどめるシンプルな (しかしそんなに効果的ではない) 方法です。
//If the object is moving when the script is put in the object, then the object will continue to move, so long as it doesn't accelerate.
//オブジェクトにスクリプトが入れられたときにオブジェクトが動いていると、加速力がある限り動き続けます。
//If you ever want to actually stop an object, use llMoveToTarget(llGetPos(), .1)
//どうしてもオブジェクトを本当に止めたければ、llMoveToTarget(llGetPos(), .1) を使いましょう。
default {
default {
     moving_start(){  
     moving_start(){  
         vector ac;
         vector ac;
         // Go forever       
         // 永遠に繰り返します
         while(llVecMag(ac = llGetAccel()) > .001) { //We're accelerating...
         while(llVecMag(ac = llGetAccel()) > .001) { //加速しています...
             llApplyImpulse(-ac, 0); //Slow us down.
             llApplyImpulse(-ac, 0); //減速します
         }
         }
     }
     }
}</lsl>
}</source>
|helpers
|helpers
|also_functions=
|also_functions=

Latest revision as of 13:34, 25 February 2016

要約

関数: vector llGetAccel( );

リージョン 参照座標内にあるオブジェクトの加速度を vector で返します。

サンプル

//物理オブジェクトをその場にとどめるシンプルな (しかしそんなに効果的ではない) 方法です。
//オブジェクトにスクリプトが入れられたときにオブジェクトが動いていると、加速力がある限り動き続けます。
//どうしてもオブジェクトを本当に止めたければ、llMoveToTarget(llGetPos(), .1) を使いましょう。
default {
    moving_start(){ 
        vector ac;
        // 永遠に繰り返します
        while(llVecMag(ac = llGetAccel()) > .001) { //加速しています...
            llApplyImpulse(-ac, 0); //減速します
        }
    }
}

関連項目

関数

•  llGetOmega
•  llGetVel
•  llGetTorque
•  llGetMass
•  llGetForce
•  llSetForce
•  llSetTorque
•  llSetForceAndTorque

特記事項

Search JIRA for related Issues

Signature

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