diff options
-rw-r--r-- | examples/redsquare01.cpp | 4 | ||||
-rw-r--r-- | include/gamp/gamp.hpp | 20 | ||||
m--------- | jaulib | 0 |
3 files changed, 3 insertions, 21 deletions
diff --git a/examples/redsquare01.cpp b/examples/redsquare01.cpp index 901390d..064dcbf 100644 --- a/examples/redsquare01.cpp +++ b/examples/redsquare01.cpp @@ -141,7 +141,7 @@ void reshape(RenderContext& rc) { const float aspect2 = ( (float) rc.viewport().width() / (float) rc.viewport().height() ) / aspect; const float zNear=1.0f; const float zFar=100.0f; - rc.pmv().perspectiveP(gamp::adeg_to_rad(fovy_deg), aspect2, zNear, zFar); + rc.pmv().perspectiveP(jau::adeg_to_rad(fovy_deg), aspect2, zNear, zFar); updatePMv(rc.pmv()); } @@ -232,7 +232,7 @@ void mainloop() { pmv.getMv().loadIdentity(); pmv.translateMv(0, 0, -10); - const float ang = gamp::adeg_to_rad(static_cast<float>(t_sum) * 360.0f) / 4000.0f; + const float ang = jau::adeg_to_rad(static_cast<float>(t_sum) * 360.0f) / 4000.0f; pmv.rotateMv(ang, 0, 0, 1); pmv.rotateMv(ang, 0, 1, 0); diff --git a/include/gamp/gamp.hpp b/include/gamp/gamp.hpp index 87065e5..5cd7ab5 100644 --- a/include/gamp/gamp.hpp +++ b/include/gamp/gamp.hpp @@ -41,6 +41,7 @@ #include <jau/environment.hpp> #include <jau/os/os_support.hpp> +#include <jau/float_math.hpp> #include <jau/math/vec2f.hpp> #include <jau/math/vec3f.hpp> @@ -60,25 +61,6 @@ * Basic computer graphics math and utilities helping with the framebuffer and I/O tooling. */ namespace gamp { - /** Returns the rounded float value cast to int. */ - inline constexpr int round_to_int(const float v) noexcept { - return (int)std::round(v); - } - /** Returns the rounded double value cast to int. */ - inline constexpr int round_to_int(const double v) noexcept { - return (int)std::round(v); - } - - /** Converts arc-degree to radians */ - inline constexpr float adeg_to_rad(const float arc_degree) noexcept { - return arc_degree * (float)M_PI / 180.0f; - } - - /** Converts radians to arc-degree */ - inline constexpr float rad_to_adeg(const float rad) noexcept { - return rad * 180.0f / (float)M_PI; - } - /** Width of the window, coordinate in window units. */ extern int win_width; /** Height of the window, coordinate in window units. */ diff --git a/jaulib b/jaulib -Subproject a300f90f0c255c0b7c78466b57cf144195c4d01 +Subproject fb8f0cf61eaef999ffb835bac80153a5c549541 |