mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
Configures project IDE settings and improves gitignore
Adds project-specific IDE settings to improve code style consistency and development environment. Removes the .idea directory from the .gitignore file, as these files are now intended to be part of the project for consistent IDE configuration across contributors.
This commit is contained in:
@@ -20,20 +20,20 @@ TEST(unit_test_angles, degrees_to_radians)
|
||||
|
||||
TEST(unit_test_angles, horizontal_fov_to_verical)
|
||||
{
|
||||
constexpr float hFov = 90;
|
||||
constexpr float aspectRation = 16.0f / 9.0f;
|
||||
const auto verticalFov = omath::angles::horizontal_fov_to_vertical(hFov, aspectRation);
|
||||
constexpr float h_fov = 90;
|
||||
constexpr float aspect_ration = 16.0f / 9.0f;
|
||||
const auto vertical_fov = omath::angles::horizontal_fov_to_vertical(h_fov, aspect_ration);
|
||||
|
||||
EXPECT_NEAR(verticalFov, 58.71f, 0.01f);
|
||||
EXPECT_NEAR(vertical_fov, 58.71f, 0.01f);
|
||||
}
|
||||
|
||||
TEST(unit_test_angles, vertical_to_horizontal)
|
||||
{
|
||||
constexpr float vFov = 58.71;
|
||||
constexpr float aspectRation = 16.0f / 9.0f;
|
||||
const auto horizontalFov = omath::angles::vertical_fov_to_horizontal(vFov, aspectRation);
|
||||
constexpr float v_fov = 58.71;
|
||||
constexpr float aspect_ration = 16.0f / 9.0f;
|
||||
const auto horizontal_fov = omath::angles::vertical_fov_to_horizontal(v_fov, aspect_ration);
|
||||
|
||||
EXPECT_NEAR(horizontalFov, 89.99f, 0.01f);
|
||||
EXPECT_NEAR(horizontal_fov, 89.99f, 0.01f);
|
||||
}
|
||||
TEST(unit_test_angles, wrap_angle)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ TEST_F(unit_test_color, Constructor_Float)
|
||||
TEST_F(unit_test_color, Constructor_Vector4)
|
||||
{
|
||||
constexpr omath::Vector4 vec(0.2f, 0.4f, 0.6f, 0.8f);
|
||||
Color color(vec);
|
||||
constexpr Color color(vec);
|
||||
EXPECT_FLOAT_EQ(color.x, 0.2f);
|
||||
EXPECT_FLOAT_EQ(color.y, 0.4f);
|
||||
EXPECT_FLOAT_EQ(color.z, 0.6f);
|
||||
@@ -62,16 +62,16 @@ TEST_F(unit_test_color, FromHSV)
|
||||
// Test HSV conversion
|
||||
TEST_F(unit_test_color, ToHSV)
|
||||
{
|
||||
Hsv hsv = color1.to_hsv(); // Red color
|
||||
EXPECT_FLOAT_EQ(hsv.hue, 0.0f);
|
||||
EXPECT_FLOAT_EQ(hsv.saturation, 1.0f);
|
||||
EXPECT_FLOAT_EQ(hsv.value, 1.0f);
|
||||
const auto [hue, saturation, value] = color1.to_hsv(); // Red color
|
||||
EXPECT_FLOAT_EQ(hue, 0.0f);
|
||||
EXPECT_FLOAT_EQ(saturation, 1.0f);
|
||||
EXPECT_FLOAT_EQ(value, 1.0f);
|
||||
}
|
||||
|
||||
// Test color blending
|
||||
TEST_F(unit_test_color, Blend)
|
||||
{
|
||||
Color blended = color1.blend(color2, 0.5f);
|
||||
const Color blended = color1.blend(color2, 0.5f);
|
||||
EXPECT_FLOAT_EQ(blended.x, 0.5f);
|
||||
EXPECT_FLOAT_EQ(blended.y, 0.5f);
|
||||
EXPECT_FLOAT_EQ(blended.z, 0.0f);
|
||||
|
||||
Reference in New Issue
Block a user