diff --git a/Game/Controller/DebugCameraController.cpp b/Game/Controller/DebugCameraController.cpp index 82f0c08..6ef2207 100644 --- a/Game/Controller/DebugCameraController.cpp +++ b/Game/Controller/DebugCameraController.cpp @@ -6,7 +6,6 @@ #include #include #include -#include namespace { @@ -14,11 +13,11 @@ namespace bool gIsDebugCameraActive = false; index_t gPreviousCameraIndex = 0; - float gPitch = 0.0f; - float gYaw = 0.0f; - bool gFirstUpdate = true; - bool gIsFpsModeActive = false; - bool gWasRightMouseButtonDown = false; + float gPitch = 0.0f; + float gYaw = 0.0f; + bool gFirstUpdate = true; + bool gIsFpsModeActive = false; + bool gWasRightMouseButtonDown = false; } // namespace void ActivateDebugController() @@ -63,9 +62,9 @@ void UpdateDebugController(float dt) gFirstUpdate = false; Juliet::Vector3 forward; - forward.x = cosf(gPitch) * cosf(gYaw); - forward.y = cosf(gPitch) * sinf(gYaw); - forward.z = sinf(gPitch); + forward.x = cosf(gPitch) * cosf(gYaw); + forward.y = cosf(gPitch) * sinf(gYaw); + forward.z = sinf(gPitch); Juliet::Vector3 right = Juliet::Normalize(Juliet::Cross(Juliet::Vector3{ 0.0f, 0.0f, 1.0f }, forward)); currentCam->Target = currentCam->Position + forward; currentCam->Up = Juliet::Cross(forward, right); @@ -89,14 +88,8 @@ void UpdateDebugController(float dt) gYaw += mouseDelta.X * sensitivity; gPitch -= mouseDelta.Y * sensitivity; - if (gPitch > 1.5f) - { - gPitch = 1.5f; - } - if (gPitch < -1.5f) - { - gPitch = -1.5f; - } + gPitch = std::min(gPitch, 1.5f); + gPitch = std::max(gPitch, -1.5f); if (Juliet::IsKeyDown(Juliet::ScanCode::Q)) { diff --git a/Juliet/src/Graphics/DebugDisplayRenderer.cpp b/Juliet/src/Graphics/DebugDisplayRenderer.cpp index ed5fab3..865ad1d 100644 --- a/Juliet/src/Graphics/DebugDisplayRenderer.cpp +++ b/Juliet/src/Graphics/DebugDisplayRenderer.cpp @@ -300,6 +300,8 @@ namespace Juliet // Render depth-tested primitives (vertices at offset 0 in buffer) if (g_DebugState.DepthTestedVertexCount > 0 && g_DebugState.DepthTestedPipeline && g_DebugState.VertexBuffer) { + BindGraphicsPipeline(renderPass, g_DebugState.DepthTestedPipeline); + // Pack VP matrix + buffer index into push constants PushData pushData = {}; pushData.ViewProjection = Camera_GetViewProjectionMatrix(camera);