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

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

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