Vector4

Constructors

this
this(float x, float y, float z, float w)
this
this(Vector3 vector)
this
this(Vector2 vector)

Members

Functions

distanceTo
float distanceTo(Vector4 vector)

Returns the distance between the vectors

distanceToSquared
float distanceToSquared(Vector4 vector)

Returns the squared distance between the vectors

dot
float dot(Vector4 vector)

Returns the dot product of the two vectors

getMagnitude
float getMagnitude()

Returns the magnitude of the vector

getNormalized
Vector4 getNormalized()

Returns a normalized copy of this vector

normalize
void normalize()

Normalizes the vector

opAdd
Vector4 opAdd(Vector4 vector)
opAddAssign
Vector4 opAddAssign(Vector4 vector)
opAssign
void opAssign(Vector2 vector)
opAssign
void opAssign(Vector3 vector)
opDiv
Vector3 opDiv(Vector3 vector)
opDiv
Vector4 opDiv(Vector4 vector)
opDiv
Vector4 opDiv(float a)
opDivAssign
Vector4 opDivAssign(Vector4 vector)
opDivAssign
Vector4 opDivAssign(float a)
opMul
Vector4 opMul(Vector4 vector)
opMul
Vector4 opMul(float a)
opMulAssign
Vector4 opMulAssign(Vector4 vector)
opMulAssign
Vector4 opMulAssign(float a)
opSub
Vector4 opSub(Vector4 vector)
opSubAssign
Vector4 opSubAssign(Vector4 vector)
opUnary
Vector4 opUnary()
set
void set(float x, float y, float z, float w)

Sets the values of x, y, z, and w in a single statement

setMagnitude
void setMagnitude(float magnitude)

Sets the magnitude of this vector

Properties

xy
Vector2 xy [@property getter]
xyz
Vector3 xyz [@property getter]

Static functions

random
Vector4 random()

Creates a normalized vector with a random direction

Variables

w
float w;
x
float x;
y
float y;
z
float z;

Meta