Difference between revisions of "LlGetAccel"
Jump to navigation
Jump to search
m |
(Added Example) |
||
Line 8: | Line 8: | ||
|caveats | |caveats | ||
|constants | |constants | ||
|examples | |examples= | ||
<pre> | |||
//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 { | |||
state_entry() { | |||
while (1 == 1) { // Go forever | |||
if (llVecMag(llGetAccel()) > .001) { //We're accelerating... | |||
llApplyImpulse(-llGetAccel(), 0) //Slow us down. | |||
} | |||
} | |||
} | |||
}</pre> | |||
|helpers | |helpers | ||
|also_functions= | |also_functions= |
Revision as of 11:19, 26 November 2007
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: vector llGetAccel( );78 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Returns a vector that is the acceleration of the object in the region frame of reference.
Caveats
Examples
//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 { state_entry() { while (1 == 1) { // Go forever if (llVecMag(llGetAccel()) > .001) { //We're accelerating... llApplyImpulse(-llGetAccel(), 0) //Slow us down. } } } }
See Also
Functions
• | llGetOmega | |||
• | llGetVel | |||
• | llSetForce | |||
• | llSetTorque | |||
• | llSetForceAndTorque |