Vector3

Constructors

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

Members

Functions

cross
Vector3 cross(Vector3 vector)

Returns the cross product of the two vectors

distanceTo
float distanceTo(Vector3 vector)

Returns the distance between the vectors

distanceToSquared
float distanceToSquared(Vector3 vector)

Returns the squared distance between the vectors

dot
float dot(Vector3 vector)

Returns the dot product of the two vectors

getMagnitude
float getMagnitude()

Returns the magnitude of the vector

getNormalized
Vector3 getNormalized()

Returns a normalized copy of this vector

normalize
void normalize()

Normalizes the vector

set
void set(float x, float y, float z)

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

setMagnitude
void setMagnitude(float magnitude)

Sets the magnitude of this vector

Static functions

random
Vector3 random()

Creates a normalized vector with a random direction

Variables

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

Meta