vec2 [object]
- methods
- rotate - return vector, rotated by specified angle
- read-only properties
- [real] length
- [real] length_squared
- [vec2] normalized - return a vector with length = 1 if possible, length = 0 if too short
- [vec2] perp - returns vec2(-y,x) - 90 degree clockwise vector
- [vec2] perp2 - returns vec2(y,-x) - 90 degree counter-clockwise vector
- [int] size - returns 2 - the number of components in this vector
- read/write properties
- [real] x
- [real] y
- [real] angle
- overloaded operators
+
- adds two vec2/real values
-
- subtracts two vec2/real values
*
- multiplies two vec2/real values
/
- divides two vec2/real values
%
- returns modulo of two vec2/real values
- comparison between vec2 values: first by X, then by Y
- unary
-
- returns negated vec2
- other features:
- cloning support
- serialization support
- GC-safe
- indexing support for indices 0 - 1: returns/sets the specified subvalue
- tostring, dump = "vec2(<x>;<y>)"