fix: mat4.decompose (-Wmaybe-uninitialized)

This commit is contained in:
MihailRis 2024-07-31 14:45:09 +03:00
parent a0fdc5e963
commit 3a1ae57bbf
3 changed files with 22 additions and 21 deletions

View File

@ -111,7 +111,7 @@ mat4.decompose(m: matrix)
translation=vec3,
skew=vec3,
perspective=vec4
}
} or nil
```
## Look at point - *mat4.look_at(...)*

View File

@ -111,7 +111,7 @@ mat4.decompose(m: matrix)
translation=vec3,
skew=vec3,
perspective=vec4
}
} или nil
```
## Отслеживание точки *mat4.look_at(...)*

View File

@ -165,7 +165,7 @@ static int l_transpose(lua::State* L) {
/// translation=float[3],
/// skew=float[3],
/// perspective=float[4]
/// }
/// } or nil
static int l_decompose(lua::State* L) {
auto matrix = lua::tomat4(L, 1);
glm::vec3 scale;
@ -173,15 +173,14 @@ static int l_decompose(lua::State* L) {
glm::vec3 translation;
glm::vec3 skew;
glm::vec4 perspective;
glm::decompose(
if (glm::decompose(
matrix,
scale,
rotation,
translation,
skew,
perspective
);
)) {
lua::createtable(L, 0, 6);
lua::pushvec3(L, scale);
@ -202,6 +201,8 @@ static int l_decompose(lua::State* L) {
lua::pushvec4(L, perspective);
lua::setfield(L, "perspective");
return 1;
}
return 0;
}
static int l_look_at(lua::State* L) {