Difference between revisions of "LlVecNorm"
Jump to navigation
Jump to search
All Issues ~ Search JIRA for related Bugs
m (hm... wonder why this didn't throw an error here...) |
(adding zero vector caveat) |
||
Line 7: | Line 7: | ||
|func_footnote=Functionally equivalent to: <code>'''vec''' / [[llVecMag]]('''vec'''))</code> | |func_footnote=Functionally equivalent to: <code>'''vec''' / [[llVecMag]]('''vec'''))</code> | ||
|spec | |spec | ||
|caveats | |caveats=*Will return <0.0, 0.0, 0.0> when <0.0, 0.0, 0.0> is given as input. | ||
|examples= | |examples= | ||
<lsl> | <lsl> |
Revision as of 06:05, 10 August 2009
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: vector llVecNorm( vector vec );13 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Returns a vector that is vec normalized (a unit vector sharing the same direction as vec).
• vector | vec | – | Any valid vector |
Functionally equivalent to: vec / llVecMag(vec))
Caveats
- Will return <0.0, 0.0, 0.0> when <0.0, 0.0, 0.0> is given as input.
Examples
<lsl> default {
state_entry() { vector input = <1.0,2.0,3.0>; llSay(0,"The unit vector on "+(string)input+" is: "+(string)llVecNorm(input) ); }
}
</lsl>