Quaternion

Constructors

this
this(float x, float y, float z, float w)

Members

Functions

getConjugate
Quaternion getConjugate()
getMagnitude
float getMagnitude()

Returns the magnitude of the quaternion

getNormalized
Quaternion getNormalized()

Returns a normalized copy of this quaternion

normalize
void normalize()

Normalizes the quaternion

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 quaternion

Properties

xyz
Vector3 xyz [@property getter]

Static functions

fromAxisAngle
Quaternion fromAxisAngle(Vector3 axis, float angle)

angle is in degrees

fromAxisAngle
Quaternion fromAxisAngle(float x, float y, float z, float angle)

angle is in degrees

fromEuler
Quaternion fromEuler(Vector3 euler)

Create a quaternion from euler angles in degrees

fromEuler
Quaternion fromEuler(float x, float y, float z)

Create a quaternion from euler angles in degrees

random
Quaternion random()

Creates a normalized quaternion with a random rotation and axis

Variables

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

Meta