mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
refactored tests
This commit is contained in:
19
tests/general/UnitTestProjection.cpp
Normal file
19
tests/general/UnitTestProjection.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Created by Vlad on 27.08.2024.
|
||||
//
|
||||
#include <complex>
|
||||
#include <gtest/gtest.h>
|
||||
#include <omath/Matrix.hpp>
|
||||
#include <print>
|
||||
#include <omath/projection/Camera.hpp>
|
||||
|
||||
TEST(UnitTestProjection, Projection)
|
||||
{
|
||||
const omath::projection::Camera camera({0.f, 0.f, 0.f}, {0, 0.f, 0.f} , {1920.f, 1080.f}, 110.f, 0.375f, 5000.f, 1.335f);
|
||||
|
||||
const auto projected = camera.WorldToScreen({5000, 0, 0});
|
||||
|
||||
|
||||
EXPECT_TRUE(projected.has_value());
|
||||
EXPECT_EQ(projected->z, 1.f);
|
||||
}
|
||||
Reference in New Issue
Block a user