🔢 Quat
Floating point Quaternion that can represent a rotation about an axis in 3-D space
🧑💻API Source
This page is auto-generated! The Functions, Properties and Events described here are defined in our GitHub's API Repository! Feel free to commit suggestions and changes to the source .json API files!
🎒 Examples
local nouveau_quaternion = Quat(0.5, 0.5, 1, -1)
local rotation = nouveau_quaternion:Rotator()
🛠 Constructors
Default Constructor
No description provided
local my_quat = Quat(X?, Y?, Z?, W?)
| Type | Name | Default | Description |
|---|---|---|---|
| number | X | 0 | The quaternion's X-component |
| number | Y | X | The quaternion's Y-component |
| number | Z | X | The quaternion's Z-component |
| number | W | X | The quaternion's W-component |
🧽 Properties
| Type | Name | Description |
|---|---|---|
| number | X | The quaternion's X-component |
| number | Y | The quaternion's Y-component |
| number | Z | The quaternion's Z-component |
| number | W | The quaternion's W-component |
🦠 Functions
info
Cette structure supporte des opérations *, +, - et tostring.
| Returns | Name | Description | |
|---|---|---|---|
Normalize | In place normalize this Quaternion | ||
| Rotator | Rotator | Get the Rotator representation of this Quaternion | |
| Quat | Inverse | Returns the inverse of this Quaternion | |
| Vector | RotateVector | Rotates a vector by this Quaternion | |
| Vector | UnrotateVector | Unrotates a vector by this Quaternion | |
| Vector | GetForwardVector | Get the forward direction vector from this Quaternion | |
| Vector | GetRightVector | Get the right direction vector from this Quaternion | |
| Vector | GetUpVector | Get the up direction vector from this Quaternion |
Normalize
In place normalize this Quaternion
my_quat:Normalize()
Rotator
Get the Rotator representation of this Quaternion
— Returns Rotator (Rotator representation of this Quaternion).
local ret = my_quat:Rotator()
Inverse
Returns the inverse of this Quaternion
— Returns Quat (Inverse of this Quaternion).
local ret = my_quat:Inverse()
RotateVector
Rotates a vector by this Quaternion
— Returns Vector (Rotated vector).
local ret = my_quat:RotateVector(vector)
| Type | Parameter | Default | Description |
|---|---|---|---|
| Vector | vector | Required parameter | Vector to rotate |
UnrotateVector
Unrotates a vector by this Quaternion
— Returns Vector (Unrotated vector).
local ret = my_quat:UnrotateVector(vector)
| Type | Parameter | Default | Description |
|---|---|---|---|
| Vector | vector | Required parameter | Vector to unrotate |
GetForwardVector
Get the forward direction vector from this Quaternion
— Returns Vector (Forward vector).
local ret = my_quat:GetForwardVector()
GetRightVector
Get the right direction vector from this Quaternion
— Returns Vector (Right vector).
local ret = my_quat:GetRightVector()
GetUpVector
Get the up direction vector from this Quaternion
— Returns Vector (Up vector).
local ret = my_quat:GetUpVector()