Fixing debug display with depth test enabled
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
#include <Core/HAL/Mouse/Mouse.h>
|
||||
#include <Graphics/Camera.h>
|
||||
#include <imgui.h>
|
||||
#include <math.h>
|
||||
|
||||
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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user