Vector2

Constructors

this
this(float x, float y)

Members

Functions

angleTo
float angleTo(Vector2 vector)

Returns the angle to the vector in degrees

distanceTo
float distanceTo(Vector2 vector)

Returns the distance between the vectors

distanceToSquared
float distanceToSquared(Vector2 vector)

Returns the squared distance between the vectors

dot
float dot(Vector2 vector)
Undocumented in source. Be warned that the author may not have intended to support it.
getDirection
float getDirection()

Returns the direction of the vector in degrees

getMagnitude
float getMagnitude()

Returns the magnitude of the vector

getNormalized
Vector2 getNormalized()

Returns a normalized copy of this vector

normalize
void normalize()

Normalizes the vector

opAdd
Vector2 opAdd(Vector2 vector)
Undocumented in source. Be warned that the author may not have intended to support it.
opAdd
Vector3 opAdd(Vector3 vector)
Undocumented in source. Be warned that the author may not have intended to support it.
opAddAssign
Vector2 opAddAssign(Vector2 vector)
Undocumented in source. Be warned that the author may not have intended to support it.
opDiv
Vector2 opDiv(float a)
Undocumented in source. Be warned that the author may not have intended to support it.
opDivAssign
Vector2 opDivAssign(float a)
Undocumented in source. Be warned that the author may not have intended to support it.
opMul
Vector2 opMul(float a)
Undocumented in source. Be warned that the author may not have intended to support it.
opMulAssign
Vector2 opMulAssign(float a)
Undocumented in source. Be warned that the author may not have intended to support it.
opSub
Vector2 opSub(Vector2 vector)
Undocumented in source. Be warned that the author may not have intended to support it.
opSub
Vector3 opSub(Vector3 vector)
Undocumented in source. Be warned that the author may not have intended to support it.
opSubAssign
Vector2 opSubAssign(Vector2 vector)
Undocumented in source. Be warned that the author may not have intended to support it.
opUnary
Vector2 opUnary()
Undocumented in source. Be warned that the author may not have intended to support it.
set
void set(float x, float y)

Sets the values of x and y in a single statement

setDirection
void setDirection(float angle)

Sets the direction of the vector using degrees

setMagnitude
void setMagnitude(float magnitude)

Sets the magnitude of this vector

Static functions

random
Vector2 random()

Creates a normalized vector with a random direction

Variables

x
float x;
y
float y;

Meta