LlWater/ja - Second Life Wiki

LlWater/ja

From Second Life Wiki

Jump to: navigation, search

関数: float llWater( vector offset );

オブジェクトの位置 + offset下の水位のfloat値を返します。

• vector offset

offsetのXとY構成のみが意味を持ちます。
水位はそのSim全体を通して一定で、一般的には20メートルですが、それが普通というわけではありません。

警告

  • 要求される位置は同じSim内である必要があります。

// Gets the object to land on ground or on water
// by Konigmann Lippmann & Strife Onizuka
FindGroundOrWater()
{
    float fHeight = llGround( ZERO_VECTOR );
    float fWaterLevel = llWater( ZERO_VECTOR );
    if( fHeight < fWaterLevel )
        fHeight = fWaterLevel;
    vector vTarget = llGetPos();
 
    //llSetPos can only move 10m at a time.
    integer iCounter = 1 + llAbs((integer)(vTarget.z - fHeight) / 10);
    vTarget.z = fHeight;
    do
        llSetPos( vTarget );
    while( --iCounter );
}
 
default
{
    touch_start(integer total_number)
    {
        FindGroundOrWater();
    }
}
 

関連項目

関数

•  llGround 地面高を取得します
•  llWind 風の速さを取得します
•  llCloud 雲の密度を取得します
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。