Added Screen space reflections and Editor UI refactoring
This commit is contained in:
@@ -1,16 +1,21 @@
|
||||
#include <Engine.h>
|
||||
#include "src/Core/Maths.h"
|
||||
#include <src/Scene/Entities/Entity.h>
|
||||
#include <src/Core/Maths.h>
|
||||
#include "src/Core/Input.h"
|
||||
|
||||
#include <src/Scene/Scene.h>
|
||||
#include <src/Scene/Entities/Entity.h>
|
||||
#include <src/Scene/Components/Components.h>
|
||||
|
||||
#include "src/Windows/EditorInterface.h"
|
||||
|
||||
|
||||
|
||||
#include <src/Scene/Components/QuakeMap.h>
|
||||
#include <src/Vendors/imgui/imgui.h>
|
||||
#include <src/Vendors/imgui/ImGuizmo.h>
|
||||
#include <src/Scene/Components/Components.h>
|
||||
#include <src/Core/Physics/PhysicsManager.h>
|
||||
#include "src/Scene/Components/BoxCollider.h"
|
||||
#include "src/EditorInterface.h"
|
||||
#include "src/Core/Input.h"
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <src/Vendors/glm/trigonometric.hpp>
|
||||
#include <src/Scripting/ScriptingEngine.h>
|
||||
@@ -20,6 +25,7 @@
|
||||
#include "src/UI/UserInterface.h"
|
||||
#include "src/NewEditor.h"
|
||||
#include <src/Scene/Components/BSPBrushComponent.h>
|
||||
#include "src/Actions/EditorSelection.h"
|
||||
|
||||
std::string WindowTitle = "Nuake Engine";
|
||||
|
||||
@@ -38,13 +44,6 @@ void OpenProject()
|
||||
|
||||
project->FullPath = projectPath;
|
||||
Nuake::Engine::LoadProject(project);
|
||||
|
||||
// Create new interface named test.
|
||||
//userInterface = UI::UserInterface::New("test");
|
||||
|
||||
|
||||
// Set current interface running.
|
||||
//Engine::GetCurrentScene()->AddInterface(userInterface);
|
||||
}
|
||||
|
||||
std::vector<Nuake::LineVertex> vertices
|
||||
@@ -168,10 +167,10 @@ int main()
|
||||
ditherShader->SetUniform1f("u_Time", Nuake::Engine::GetTime());
|
||||
ditherShader->SetUniform4f("u_Color", 252.0 / 255.0, 3.0 / 255.0, 65.0 / 255.0, 1.0);
|
||||
|
||||
if (editor.m_IsEntitySelected && editor.m_SelectedEntity.HasComponent<Nuake::BSPBrushComponent>())
|
||||
if (editor.Selection.Type == EditorSelectionType::Entity && editor.Selection.Entity.HasComponent<Nuake::BSPBrushComponent>())
|
||||
{
|
||||
for (auto& m : editor.m_SelectedEntity.GetComponent<Nuake::BSPBrushComponent>().Meshes)
|
||||
Nuake::Renderer::SubmitMesh(m, editor.m_SelectedEntity.GetComponent<Nuake::TransformComponent>().GetGlobalTransform());
|
||||
for (auto& m : editor.Selection.Entity.GetComponent<Nuake::BSPBrushComponent>().Meshes)
|
||||
Nuake::Renderer::SubmitMesh(m, editor.Selection.Entity.GetComponent<Nuake::TransformComponent>().GetGlobalTransform());
|
||||
|
||||
Nuake::Renderer::Flush(ditherShader, true);
|
||||
}
|
||||
@@ -179,10 +178,10 @@ int main()
|
||||
ditherShader->SetUniform1f("u_Time", Nuake::Engine::GetTime() / 10.0f);
|
||||
ditherShader->SetUniform4f("u_Color", 52.f / 255.f, 235.f / 255.f, 88.f / 255.f, 1);
|
||||
auto cubeCollidersView = currentScene->m_Registry.view<Nuake::TransformComponent, Nuake::BoxColliderComponent>();
|
||||
if (editor.m_IsEntitySelected && editor.m_SelectedEntity.HasComponent<Nuake::BoxColliderComponent>())
|
||||
if (editor.Selection.Type == EditorSelectionType::Entity && editor.Selection.Entity.HasComponent<Nuake::BoxColliderComponent>())
|
||||
{
|
||||
auto transformComponent = editor.m_SelectedEntity.GetComponent<Nuake::TransformComponent>();
|
||||
auto colliderComponent = editor.m_SelectedEntity.GetComponent<Nuake::BoxColliderComponent>();
|
||||
auto transformComponent = editor.Selection.Entity.GetComponent<Nuake::TransformComponent>();
|
||||
auto colliderComponent = editor.Selection.Entity.GetComponent<Nuake::BoxColliderComponent>();
|
||||
Nuake::Matrix4 transform = transformComponent.GetGlobalTransform();
|
||||
transform = glm::scale(transform, colliderComponent.Size);
|
||||
Nuake::Renderer::SubmitCube(transform);
|
||||
@@ -194,9 +193,9 @@ int main()
|
||||
sceneFramebuffer->Unbind();
|
||||
|
||||
editor.Draw();
|
||||
|
||||
Nuake::Engine::EndDraw();
|
||||
}
|
||||
|
||||
Nuake::Engine::Close();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user