mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-09 20:08:57 +03:00
Added draw collision setting
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#include <dependencies/GLEW/include/GL/glew.h>
|
||||
|
||||
#include <Engine.h>
|
||||
|
||||
#include <src/Core/Input.h>
|
||||
@@ -28,6 +30,9 @@
|
||||
#include "src/Windows/FileSystemUI.h"
|
||||
|
||||
#include <src/Core/Maths.h>
|
||||
#include <src/Rendering/SceneRenderer.h>
|
||||
|
||||
|
||||
|
||||
const std::string WindowTitle = "Nuake Editor";
|
||||
|
||||
@@ -184,9 +189,24 @@ int main(int argc, char* argv[])
|
||||
camera = currentScene->m_EditorCamera;
|
||||
}
|
||||
|
||||
if (currentScene && !Nuake::Engine::IsPlayMode() && editor.ShouldDrawAxis())
|
||||
if (currentScene && !Nuake::Engine::IsPlayMode())
|
||||
{
|
||||
gizmoDrawer.DrawGizmos(currentScene);
|
||||
auto& gBuffer = currentScene->mSceneRenderer->GetGBuffer();
|
||||
auto& depthTexture = gBuffer.GetTexture(GL_DEPTH_ATTACHMENT);
|
||||
|
||||
float nearZ = 0.1f;
|
||||
float farZ = 1000.0f;
|
||||
gizmoDrawer.GetLineShader().SetUniformTex("u_Depth", depthTexture.get(), 3);
|
||||
gizmoDrawer.GetLineShader().SetUniformVec2("u_Resolution", depthTexture->GetSize());
|
||||
if (editor.ShouldDrawAxis())
|
||||
{
|
||||
gizmoDrawer.DrawAxis(currentScene);
|
||||
}
|
||||
|
||||
if (editor.ShouldDrawCollision())
|
||||
{
|
||||
gizmoDrawer.DrawGizmos(currentScene);
|
||||
}
|
||||
}
|
||||
}
|
||||
sceneFramebuffer->Unbind();
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Nuake
|
||||
bool m_DrawGrid = false;
|
||||
bool m_DrawAxis = true;
|
||||
bool m_ShowImGuiDemo = false;
|
||||
bool m_DebugCollisions = false;
|
||||
bool m_DebugCollisions = true;
|
||||
bool m_ShowOverlay = true;
|
||||
bool m_IsHoveringViewport = false;
|
||||
Vector2 m_ViewportPos = {0, 0};
|
||||
@@ -59,5 +59,6 @@ namespace Nuake
|
||||
void Overlay();
|
||||
|
||||
bool ShouldDrawAxis() const { return m_DrawAxis; }
|
||||
bool ShouldDrawCollision() const { return m_DebugCollisions; }
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user