Skip to content
Snippets Groups Projects
Commit b2283a97 authored by Nils Petter Skålerud's avatar Nils Petter Skålerud
Browse files

Various work in preparation for university assignment.

Updated CMakeLists.txt to acommodate new include directories.
Updated submodule DTex to newest commit.
Updated submdoule DMath to newest commit.
Moved plenty of headers that should be global into the include directory.
Added mouse functionality to Application system, was removed when switched from SDL2 to GLFW3.
Removed some responsibilities of AssetManager now that DTex is used as primary texture loader for the project.
Moved all Transform functionality into SceneObject class.
Added SceneObject::GetRightVector(), GetForwardVector(), GetUpVector()
Updated .cpp files to use new include folder for headers.

Signed-off-by: default avatarNils Petter Skålerud <np_skalerud@hotmail.com>
parent e2b8fab8
No related branches found
No related tags found
No related merge requests found
Showing
with 57 additions and 60 deletions
......@@ -2,14 +2,16 @@ cmake_minimum_required(VERSION 3.12)
project(DEngine)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
if(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/build")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/build")
endif()
file(GLOB_RECURSE SOURCE_FILES "${CMAKE_SOURCE_DIR}/src/*.cpp" "${CMAKE_SOURCE_DIR}/src/*.hpp" "${CMAKE_SOURCE_DIR}/src/*.inl")
file(GLOB_RECURSE SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/*.inl")
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include")
add_subdirectory(external)
target_link_libraries(${PROJECT_NAME} external::external)
......
{
"configurations": [
{
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": []
},
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": []
}
]
}
\ No newline at end of file
File moved
File added
01 - Uncompressed 2D image, no mips, no layers, no cubemap
02 - BC7 RGBA compressed 2D image, mips, no layers, no cubemap
\ No newline at end of file
File deleted
File deleted
Subproject commit a86909a7b37084c09c867efefa59faec47686128
Subproject commit 5c97c86c9e4b8f0a033a694c236da505478a4806
Subproject commit 9a0b7e18d9d774e85c8a15a7204b4da7815ba082
Subproject commit 0cd6cbee1b47224a3b734b27f6e6197da213f5b6
......@@ -7,7 +7,7 @@
#include <string_view>
#include <optional>
#include "../Renderer/MeshDocument.hpp"
#include "DRenderer/MeshDocument.hpp"
namespace Engine
{
......
#pragma once
#include "Components.hpp"
#include "../Enum.hpp"
#include "DEngine/Components/Components.hpp"
#include "DEngine/Enum.hpp"
#include "DMath/Vector/Vector.hpp"
#include "DMath/Matrix/Matrix.hpp"
......@@ -23,9 +23,9 @@ namespace Engine
Math::Matrix2x2 GetRotationModel2D(Space space) const;
Math::Matrix3x3 GetRotationModel2D_Homo(Space space) const;
Math::Vector2D position;
float rotation;
Math::Vector2D size;
Math::Vector2D position{};
float rotation{};
Math::Vector2D size{ 1, 1 };
};
}
}
\ No newline at end of file
#pragma once
#include "Components.hpp"
#include "../Enum.hpp"
#include "DEngine/Components/Components.hpp"
#include "DEngine/Enum.hpp"
#include "DMath/Vector/Vector.hpp"
#include "../Renderer/Renderer.hpp"
#include "DMath/Matrix/Matrix.hpp"
#include "DMath/UnitQuaternion.hpp"
namespace Engine
{
......@@ -31,20 +31,19 @@ namespace Engine
explicit Camera(SceneObject& owningObject);
~Camera();
Math::Vector3D positionOffset;
Math::Vector3D forward;
Math::Vector3D up;
float fov;
float orthographicWidth;
float zNear;
float zFar;
ProjectionMode projectionMode;
Math::Vector3D positionOffset{};
Math::UnitQuaternion<> rotation{};
float fov = defaultFovY;
float orthographicWidth = defaultOrtographicWidth;
float zNear = defaultZNear;
float zFar = defaultZFar;
ProjectionMode projectionMode = ProjectionMode::Perspective;
void LookAt(const Math::Vector3D& newTarget);
void LookAt(const Math::Vector3D& newTarget, Space space);
[[nodiscard]] Math::Matrix<4, 3, float> GetModel_Reduced(Space space) const;
Renderer::CameraInfo GetRendererCameraInfo() const;
[[nodiscard]] Math::Matrix<4, 4, float> GetModel(Space space) const;
[[nodiscard]] Math::Matrix<4, 4, float> GetViewModel(Space space) const;
};
}
}
\ No newline at end of file
#pragma once
#include "Components.hpp"
#include "../Enum.hpp"
#include "DEngine/Components/Components.hpp"
#include "DEngine/Enum.hpp"
#include "DMath/Vector/Vector.hpp"
......
#pragma once
#include "Components.hpp"
#include "../Enum.hpp"
#include "DEngine/Components/Components.hpp"
#include "DEngine/Enum.hpp"
#include "DMath/Vector/Vector.hpp"
......@@ -19,8 +19,8 @@ namespace Engine
Math::Matrix<3, 2> GetModel2D_Reduced(Space space) const;
Math::Vector2D positionOffset;
float radius;
Math::Vector2D positionOffset{};
float radius{ 0.5 };
};
}
}
\ No newline at end of file
#pragma once
#include "DEngine/Components/ScriptBase.hpp"
namespace Engine
{
namespace Components
{
class FreeLook : public ScriptBase
{
public:
using ParentType = ScriptBase;
explicit FreeLook(SceneObject& owningObject);
protected:
void SceneStart() override;
void Tick() override;
};
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment