Creates a new quaternion. This function takes the same arguments as Quat:set
.
Arguments
Name | Type | Default | Description |
angle | number | 0 |
An angle to use for the rotation, in radians.
|
ax | number | 0 |
The x component of the axis of rotation.
|
ay | number | 0 |
The y component of the axis of rotation.
|
az | number | 0 |
The z component of the axis of rotation.
|
raw | boolean | false |
Whether the components should be interpreted as raw (x, y, z, w) components.
|
Returns
Name | Type | Description |
q | Quat |
The new quaternion.
|
Arguments
Name | Type | Description |
r | Quat |
An existing quaternion to copy the values from.
|
Returns
Name | Type | Description |
q | Quat |
The new quaternion.
|
Uses the direction of a vector.
Arguments
Name | Type | Description |
v | Vec3 |
A normalized direction vector.
|
Returns
Name | Type | Description |
q | Quat |
The new quaternion.
|
Sets the rotation to represent the rotation between two vectors.
Arguments
Name | Type | Description |
v | Vec3 |
A normalized direction vector.
|
u | Vec3 |
Another normalized direction vector.
|
Returns
Name | Type | Description |
q | Quat |
The new quaternion.
|
Arguments
Name | Type | Description |
m | Mat4 |
A matrix to use the rotation from.
|
Returns
Name | Type | Description |
q | Quat |
The new quaternion.
|
Set the quaternion to the identity (0, 0, 0, 1).
Arguments
None
Returns
Name | Type | Description |
q | Quat |
The new quaternion.
|
See also