mirror of
https://github.com/orange-cpp/omath.git
synced 2026-06-09 16:54:35 +00:00
Merge pull request #192 from orange-cpp/feature/lua
added more lua stuff
This commit is contained in:
@@ -124,7 +124,7 @@ namespace omath
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
static consteval MatSize size() noexcept
|
||||
static constexpr MatSize size() noexcept
|
||||
{
|
||||
return {Rows, Columns};
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user