🔢 Quat
Quaternion à virgule flottante qui peut représenter une rotation sur un axe dans l'espace 3-D
🎒 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?)
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| number | X | 0 | Le composant X du quaternion |
| number | Y | X | Le composant Y du quaternion |
| number | Z | X | Le composant Z du quaternion |
| number | W | X | Le composant W du quaternion |
🧽 Properties
| Type | Name | Description |
|---|---|---|
| number | X | Le composant X du quaternion |
| number | Y | Le composant Y du quaternion |
| number | Z | Le composant Z du quaternion |
| number | W | Le composant W du quaternion |
🦠 Functions
info
This structure supports *, +, - and tostring operations.
| Returns | Name | Description | |
|---|---|---|---|
Normalize | Normaliser ce quaternion | ||
| Rotator | Rotator | Obtenir la représentation Rotator de ce Quaternion | |
| Quat | Inverse | Retourne l'inverse de ce 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
Normaliser ce quaternion
my_quat:Normalize()
Rotator
Obtenir la représentation Rotator de ce Quaternion
local ret = my_quat:Rotator()
Returns
| Type | Description |
|---|---|
| Rotator | Rotator representation of this Quaternion |
Inverse
Retourne l'inverse de ce Quaternion
local ret = my_quat:Inverse()
Returns
| Type | Description |
|---|---|
| Quat | Inverse of this Quaternion |
RotateVector
Rotates a vector by this Quaternion
local ret = my_quat:RotateVector(vector)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| Vector | vector | Required parameter | Vector to rotate |
Returns
| Type | Description |
|---|---|
| Vector | Rotated vector |
UnrotateVector
Unrotates a vector by this Quaternion
local ret = my_quat:UnrotateVector(vector)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| Vector | vector | Required parameter | Vector to unrotate |
Returns
| Type | Description |
|---|---|
| Vector | Unrotated vector |
GetForwardVector
Get the forward direction vector from this Quaternion
local ret = my_quat:GetForwardVector()
Returns
| Type | Description |
|---|---|
| Vector | Forward vector |
GetRightVector
Get the right direction vector from this Quaternion
local ret = my_quat:GetRightVector()
Returns
| Type | Description |
|---|---|
| Vector | Right vector |
GetUpVector
Get the up direction vector from this Quaternion
local ret = my_quat:GetUpVector()
Returns
| Type | Description |
|---|---|
| Vector | Up vector |