From Second Life Wiki
GetVel
llGetVel
関数: vector llGetVel( );
オブジェクトの速度のvector値を返します。
報告された速度は、グローバル座標構成と相対的です。 (オブジェクトの回転はこの関数の出力には影響しません)
例
//A very simple (and not very effective) way of keeping a physical object in place.
//If you ever want to actually stop an object, use llMoveToTarget(llGetPos(), .1)
default
{
state_entry()
{
vector spd;
{
@loop;
if (llVecMag(spd = llGetVel()) > .001)
{ //We're accelerating...
llApplyImpulse(-spd, 0) //Slow us down.
}
jump loop;
}
}
}//Written by Xaviar Czervik