From 7d4cd26c31f64c51c0f6b6dba067dd6790451789 Mon Sep 17 00:00:00 2001 From: Dynamitos Date: Sun, 7 Sep 2025 20:13:26 +0200 Subject: [PATCH] Fixing perspective matrices --- src/Editor/main.cpp | 4 ++-- src/Engine/Math/Matrix.h | 2 +- src/Engine/Math/Vector.h | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Editor/main.cpp b/src/Editor/main.cpp index d7634d0..523d479 100644 --- a/src/Editor/main.cpp +++ b/src/Editor/main.cpp @@ -24,8 +24,8 @@ static Gfx::OGraphics graphics; int main() { std::string gameName = "MeshShadingDemo"; - std::filesystem::path outputPath = fmt::format("/Users/dynamitos/{0}Game/", gameName); - std::filesystem::path sourcePath = fmt::format("/Users/dynamitos/{0}/", gameName); + std::filesystem::path outputPath = fmt::format("/home/dynamitos/{0}Game/", gameName); + std::filesystem::path sourcePath = fmt::format("/home/dynamitos/{0}/", gameName); #ifdef WIN32 std::string libraryEnding = "dll"; #elif __APPLE__ diff --git a/src/Engine/Math/Matrix.h b/src/Engine/Math/Matrix.h index 91ca6ee..e2aada4 100644 --- a/src/Engine/Math/Matrix.h +++ b/src/Engine/Math/Matrix.h @@ -26,7 +26,7 @@ static Matrix4 perspectiveProjection(float fov, float aspect, float nearPlane, f { 0.0f, 0.0f, - nearPlane / (nearPlane - farPlane), + (nearPlane + farPlane) / (nearPlane - farPlane), -1.0f, }, { diff --git a/src/Engine/Math/Vector.h b/src/Engine/Math/Vector.h index 2d8204f..abf34af 100644 --- a/src/Engine/Math/Vector.h +++ b/src/Engine/Math/Vector.h @@ -1,6 +1,4 @@ #pragma once -#define GLM_FORCE_DEPTH_ZERO_TO_ONE -#define GLM_FORCE_LEFT_HANDED #ifdef WIN32 #pragma warning(push) #pragma warning(disable : 4201)