X coordinate for the vector.
Y coordinate for the vector.
Calculates the squared distance between the vector and the given vector.
A vector with which the squared distance is calculated.
The squared distance.
Calculates the dot product of the vector and the given vector.
A vector with which to calculate the dot product.
The result of the dot product.
Vec2 represents a 2D position or a 2D vector. It is used everywhere in Illuminated.
Vec2 is based on Box2D's Vec2 except that in Illuminated, a Vec2 vector is immutable. It means every method creates a new Vec2 instance and you can safely use a same Vec2 instance everywhere because the immutability guarantees that properties will not be modified.