mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 15:03:27 +00:00
added new class
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user