mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
added new class
This commit is contained in:
@@ -16,6 +16,7 @@ add_executable(unit-tests
|
||||
general/UnitTestVector4.cpp
|
||||
general/UnitTestLineTrace.cpp
|
||||
general/UnitTestAngles.cpp
|
||||
general/UnitTestViewAngles.cpp
|
||||
|
||||
engines/UnitTestOpenGL.cpp
|
||||
engines/UnitTestUnityEngine.cpp
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
#include <gtest/gtest.h>
|
||||
#include <omath/Angles.hpp>
|
||||
|
||||
#include <omath/Angle.hpp>
|
||||
|
||||
TEST(UnitTestAngles, RadiansToDeg)
|
||||
{
|
||||
@@ -35,4 +35,16 @@ TEST(UnitTestAngles, VerticalToHorizontal)
|
||||
const auto horizontalFov = omath::angles::VerticalFovToHorizontal(vFov, aspectRation);
|
||||
|
||||
EXPECT_NEAR(horizontalFov, 89.99f, 0.01f);
|
||||
}
|
||||
TEST(UnitTestAngles, WrapAngle)
|
||||
{
|
||||
const float wrapped = omath::angles::WrapAngle(361.f, 0.f, 360.f);
|
||||
|
||||
EXPECT_NEAR(wrapped, 1.f, 0.01f);
|
||||
}
|
||||
TEST(UnitTestAngles, WrapAngleNegativeRange)
|
||||
{
|
||||
const float wrapped = omath::angles::WrapAngle(-90.f, 0.f, 360.f);
|
||||
|
||||
EXPECT_NEAR(wrapped, 270.f, 0.01f);
|
||||
}
|
||||
4
tests/general/UnitTestViewAngles.cpp
Normal file
4
tests/general/UnitTestViewAngles.cpp
Normal file
@@ -0,0 +1,4 @@
|
||||
//
|
||||
// Created by Orange on 11/30/2024.
|
||||
//
|
||||
#include <omath/ViewAngles.hpp>
|
||||
Reference in New Issue
Block a user