vector llGetVel();- Returns
vector- Energy
- 10
Speed is the magnitude of the velocity. Speed is measured in meter per second.
Velocity reported is relative to the global coordinate frame (the object rotation has no affect on this functions output).
For physic objects , velocity is the velocity of its center of mass llGetCenterOfMass . ( When the object has some torque and has not force , position of the object moves ( it turns ) , but its center of mass is unchanged , so the velocity is null )
Returns a vector that is the velocity of the object.
vector result = llGetVel();Examples
Section titled “Examples”Example 1
8 collapsed lines
//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 CzervikTo get the velocity relative the local frame (the direction the object is pointing), divide the output of this function by that of its rotation.
vector local_vel = llGetVel() / llGetRot()See also
Section titled “See also”Functions
Section titled “Functions”llGetAccelllGetOmegallGetForce— Gets the objects forcellGetTorquellGetMass
Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.