Template:Needs Translation/
函数名
|
Function: vector llGetAccel( )
|
参数:无
|
返回值:返回一个向量,该向量是物体在区域参考系中的加速度。
|
注意事项
|
返回附件中的零矢量,与化身的加速度无关,返回子素中的零矢量,与链接集的加速度无关
|
示例
|
//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)
default {
moving_start(){
vector ac;
// Go forever
while(llVecMag(ac = llGetAccel()) > .001) { //We're accelerating...
llApplyImpulse(-ac, 0); //Slow us down.
}
}
}
|