mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 12:01:50 +00:00
add mat4.from_quat(...) & update mat4.decompose(...)
This commit is contained in:
parent
2294690f29
commit
02c9c4ced3
16 changed files with 167 additions and 137 deletions
|
|
@ -10,6 +10,7 @@ Type conventions will be used on this page.
|
|||
- vector - an array of three or four numbers
|
||||
- vec3 - array of three numbers
|
||||
- vec4 - array of four numbers
|
||||
- quat - array of four numbers - quaternion
|
||||
- matrix - array of 16 numbers - matrix
|
||||
|
||||
> [!WARNING]
|
||||
|
|
@ -33,6 +34,16 @@ mat4.idt(dst: matrix)
|
|||
mat4.determinant(m: matrix)
|
||||
```
|
||||
|
||||
## Matrix from quaternion - *mat4.from_quat(...)*
|
||||
|
||||
```lua
|
||||
-- creates a rotation matrix from quaternion
|
||||
mat4.from_quat(quaternion: quat)
|
||||
|
||||
-- writes the quaternion rotation matrix to dst
|
||||
mat4.from_quat(quaternion: quat, dst: matrix)
|
||||
```
|
||||
|
||||
## Matrix multiplication - *mat4.mul(...)*
|
||||
|
||||
```lua
|
||||
|
|
@ -109,6 +120,7 @@ mat4.decompose(m: matrix)
|
|||
{
|
||||
scale=vec3,
|
||||
rotation=matrix,
|
||||
quaternion=quat,
|
||||
translation=vec3,
|
||||
skew=vec3,
|
||||
perspective=vec4
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue