This commit is contained in:
2024-08-27 17:35:17 +03:00
parent 8fc9a54958
commit e5dbb78b15
2 changed files with 15 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
//
// Created by Vlad on 27.08.2024.
//
#include <complex>
#include <gtest/gtest.h>
#include <omath/Matrix.h>
#include <print>
@@ -8,8 +9,10 @@
TEST(UnitTestProjection, IsPointOnScreen)
{
const omath::projection::Camera camera({}, {90, 0.f, 0.f} , {1920.f, 1080.f, 0.f}, 120, 10, 100);
const omath::projection::Camera camera({0, 0, 0}, {0, 0.f, 0.f} , {1920.f, 1080.f, 0.f}, 110, 0.1, 500);
const auto proj = camera.WorldToScreen({0, 0, 20});
const auto proj = camera.WorldToScreen({5, 0, 0});
if (proj)
std::print("{} {} {}", proj->x, proj->z, proj->y);
EXPECT_TRUE(proj.has_value());
}