Quaternion methods

Static methods

Quaternion.identity

This function returns the identity quaternion. Meaning no rotation would be applied to the Object, Vector, other Quaternion, etc.

const Q = Quaternion.identity();
Q; // Quaternion [ 1, 0, 0, 0 ]

Quaternion.fromEuler

Returns a Quaternion corresponding to a euler angle rotation in radians

const Q = Quaternion.fromEuler(0, 0, 0);
Q; // Quaternion [ 1, 0, 0, 0 ]

Quaternion.lookAt

const Q = Quaternion.lookAt(new Vector(), new Vector(1,1,1));
Q; // A quaternion with a rotation looking from a towards b

Quaternion.lookAtOptimized

This function takes in an array for the heading it should point towards, and returns a Volts.Quaternion

Instance methods

Quaternion.copy

This copies the values of a Quaternion and returns a new one

Last updated

Was this helpful?