Difference between revisions of "LlGetVel"

From Second Life Wiki
Jump to navigation Jump to search
m (this is a less then optimal example but it's what we got)
Line 5: Line 5:
|func_footnote
|func_footnote
|func_desc
|func_desc
|return_text=that is the velocity.
|return_text=that is the velocity of the object. It is relative to the [[Viewer coordinate frames#Global|global coordinate frame]] (the object rotation has no affect on this functions output).
|spec
|spec
|caveats
|caveats
|constants
|constants
|examples=
|examples=
<lsl>
<lsl>//A very simple (and not very effective) way of keeping a physical object in place.
//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)
//If you ever want to actually stop an object, use llMoveToTarget(llGetPos(), .1)
default {
default {
Line 22: Line 21:
         jump loop;}
         jump loop;}
     }
     }
}//Code by Xaviar Czervik
}//Code by Xaviar Czervik</lsl>
</lsl>
|helpers
|helpers
|also_functions=
|also_functions=

Revision as of 14:42, 8 February 2008

Summary

Function: vector llGetVel( );
0.0 Forced Delay
10.0 Energy

Returns a vector that is the velocity of the object. It is relative to the global coordinate frame (the object rotation has no affect on this functions output).

Examples

<lsl>//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;}
   }
}//Code by Xaviar Czervik</lsl>

See Also

Functions

•  llGetAccel
•  llGetOmega

Deep Notes

Signature

function vector llGetVel();