Difference between revisions of "Vector"

From Second Life Wiki
Jump to navigation Jump to search
m (LSL vector moved to Vector: pseudonamespace fix)
(New entry for glossary)
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{LSL Header}}
#REDIRECT [[:Category:LSL Vector]]
==Vector==


A datatype that contains a set of three [[LSL_float|float]] values.  Each element can be accessed individually by appending .x, .y, or .z to the variable name. 
[[Category:LSL_Types|vector]]
 
{{Help |Glossary=*}}
Vectors support the following operations:
* Addition, Operator "+"
* Subtraction, Operator "-"
* Multiplication (Dot Product), Operator "*"
* Cross Product, Operator "%"
 
A vector can be multiplied with a [[LSL_quaternion|Quaternion]] to rotate it.
 
===Example===
<pre>
vector test=<1.0, 2.0, 3.0>;
llOwnerSay((string)test.z); // Outputs 3.0
</pre>
 
[[Category:LSL_Types|vector]][[Category:LSL_Stub]]

Latest revision as of 10:34, 8 August 2008