refactored camera

This commit is contained in:
2024-12-04 04:58:29 +03:00
parent 9c0285e353
commit 0afa20b4e5
16 changed files with 262 additions and 194 deletions

View File

@@ -6,7 +6,6 @@
#include <omath/Matrix.hpp>
#include <print>
#include <omath/engines/OpenGL.hpp>
#include <omath/engines/Source.hpp>
// #include <glm/glm.hpp>
// #include "glm/ext/matrix_clip_space.hpp"

View File

@@ -2,7 +2,8 @@
// Created by Orange on 11/23/2024.
//
#include <gtest/gtest.h>
#include <omath/engines/Source.hpp>
#include <omath/engines/Source/Constants.h>
#include <omath/engines/Source/Formulas.hpp>

View File

@@ -4,14 +4,14 @@
#include <complex>
#include <gtest/gtest.h>
#include <omath/Matrix.hpp>
#include <omath/engines/Source.hpp>
#include <omath/engines/Source/Camera.hpp>
#include <omath/projection/Camera.hpp>
#include <print>
TEST(UnitTestProjection, Projection)
{
auto x = omath::Angle<float, 0.f, 180.f, omath::AngleFlags::Clamped>::FromDegrees(90.f);
auto cam = omath::source::CreateCamera({-10, 0, 0}, omath::source::ViewAngles{}, {1920.f, 1080.f}, x, 0.1f, 1000.f);
auto cam = omath::source::Camera({-10, 0, 0}, omath::source::ViewAngles{}, {1920.f, 1080.f}, x, 0.1f, 1000.f);
const auto projected = cam.WorldToScreen({10, 0, 0});
std::print("{} {} {}", projected->x, projected->y, projected->z);