The underlying typed array containing vector components (mutable)
Readonly
bytesNumber of bytes per component in the underlying array
Readonly
classThe class name identifier
Readonly
glslGLSL string representation for float type
Readonly
glslGLSL string representation for integer type
Readonly
wgslWGSL string representation for float type
Readonly
wgslWGSL string representation for integer type
The x component (mutable)
The y component (mutable)
Adds another Vector2 to this vector.
Vector to add
This vector for chaining
Creates a copy of this vector.
New mutable Vector2 instance
Copies components from another Vector2.
Source vector
This vector for chaining
Divides vector by scalar.
Scalar divisor
This vector for chaining
Divides vector component-wise by another Vector2.
Vector to divide by
This vector for chaining
Calculates dot product with another Vector2.
Other vector
Dot product
Checks equality with another Vector2 within tolerance.
Vector to compare with
Optional
delta: numberOptional tolerance
True if approximately equal
Checks strict equality with another Vector2.
Vector to compare with
True if exactly equal
Calculates distance to another Vector2.
Target vector
Distance
Multiplies vector by scalar.
Scalar multiplier
This vector for chaining
Multiplies vector component-wise by another Vector2.
Vector to multiply by
This vector for chaining
Normalizes vector to unit length.
This vector for chaining
Sets vector to (1, 1).
This vector for chaining
Gets the raw underlying typed array.
The raw typed array
Sets component at index.
Component index (0=x, 1=y)
New value
This vector for chaining
Sets both components.
X component value
Y component value
This vector for chaining
Subtracts another Vector2 from this vector.
Vector to subtract
This vector for chaining
Sets vector to (0, 0).
This vector for chaining
Interface for mutable 2D vectors. Provides in-place operations for 2-component vectors.