Vector2
A 2D vector: an ordered pair of numbers (x, y).
Vectors are mutable and not thread-safe; confine an instance (and any object graph holding it) to a single thread, exactly as in three.js. Most methods mutate this and return it for chaining.
Iterating a vector yields its components (x, y) in order.
Properties
Functions
Sets this vector to a + b.
Multiplies this vector by the 3x3 matrix m.
Clamps this vector's length into [min, max].
Clamps each component into the scalar range [minVal, maxVal].
Returns the distance from this vector to v.
Returns the squared distance from this vector to v.
Divides all components by scalar.
Sets x = array[offset], y = array[offset + 1].
Returns the component at index (0 = x, 1 = y).
Returns the Manhattan distance from this vector to v.
Returns the Manhattan length of this vector.
Multiplies all components by scalar.
Rounds each component toward zero.
Sets this vector to a - b.