Merge pull request #192 from orange-cpp/feature/lua

added more lua stuff
This commit is contained in:
2026-05-18 11:11:13 +03:00
committed by GitHub
19 changed files with 2272 additions and 30 deletions
+1 -1
View File
@@ -124,7 +124,7 @@ namespace omath
}
[[nodiscard]]
static consteval MatSize size() noexcept
static constexpr MatSize size() noexcept
{
return {Rows, Columns};
}
+6 -1
View File
@@ -15,11 +15,16 @@ namespace omath::lua
static void register_vec2(sol::table& omath_table);
static void register_vec3(sol::table& omath_table);
static void register_vec4(sol::table& omath_table);
static void register_matrices(sol::table& omath_table);
static void register_quaternion(sol::table& omath_table);
static void register_color(sol::table& omath_table);
static void register_hud(sol::table& omath_table);
static void register_triangle(sol::table& omath_table);
static void register_3d_primitives(sol::table& omath_table);
static void register_collision(sol::table& omath_table);
static void register_shared_types(sol::table& omath_table);
static void register_engines(sol::table& omath_table);
static void register_pattern_scan(sol::table& omath_table);
};
}
#endif
#endif
+2 -1
View File
@@ -107,7 +107,8 @@ namespace omath::projection
// m[1,1] == 1 / tan(fov/2) => fov = 2 * atan(1 / m[1,1])
const auto f = proj_matrix.at(1, 1);
// m[0,0] == m[1,1] / aspect_ratio => aspect = m[1,1] / m[0,0]
return {FieldOfView::from_radians(NumericType{2} * std::atan(NumericType{1} / f)),
const auto fov_radians = NumericType{2} * std::atan(NumericType{1} / f);
return {FieldOfView::from_radians(static_cast<typename FieldOfView::ArithmeticType>(fov_radians)),
f / proj_matrix.at(0, 0)};
}