LlVecNorm: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
Zai Lynch (talk | contribs)
m changed it back to |Return_text: since there's only one normalized vector
Zai Lynch (talk | contribs)
Issues/SVC-4711
Line 1: Line 1:
{{LSL_Function
{{Issues/SVC-4711}}{{LSL_Function
|func=llVecNorm
|func=llVecNorm
|func_id=13|func_sleep=0.0|func_energy=10.0
|func_id=13|func_sleep=0.0|func_energy=10.0

Revision as of 03:24, 11 August 2009

Summary

Function: vector llVecNorm( vector vec );
0.0 Forced Delay
10.0 Energy

Returns the 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>

See Also

Functions

•  llVecMag
•  llVecDist

Deep Notes

Signature

function vector llVecNorm( vector vec );