Difference between revisions of "Vector"

From Second Life Wiki
Jump to navigation Jump to search
m (LSL vector moved to Vector: pseudonamespace fix)
Line 18: Line 18:
</pre>
</pre>


[[Category:LSL_Types|vector]][[Category:LSL_Stub]]
[[Category:LSL_Types|vector]]

Revision as of 11:11, 25 February 2007

Vector

A datatype that contains a set of three float values. Each element can be accessed individually by appending .x, .y, or .z to the variable name.

Vectors support the following operations:

  • Addition, Operator "+"
  • Subtraction, Operator "-"
  • Multiplication (Dot Product), Operator "*"
  • Cross Product, Operator "%"

A vector can be multiplied with a Quaternion to rotate it.

Example

vector test=<1.0, 2.0, 3.0>;
llOwnerSay((string)test.z); // Outputs 3.0