Disabled debug line when dragging in 3D model

This commit is contained in:
Antoine Pilote
2024-08-28 00:29:10 -04:00
parent 50a0c1e810
commit a285fbb61c
4 changed files with 16 additions and 15 deletions

View File

@@ -215,7 +215,7 @@ namespace Nuake {
}
Engine::GetCurrentScene()->m_SceneRenderer->DrawDebugLine(dragnDropWorldPos, dragnDropWorldPos + Vector3{0, 5, 0}, Vector4(1, 0, 1, 1));
// Engine::GetCurrentScene()->m_SceneRenderer->DrawDebugLine(dragnDropWorldPos, dragnDropWorldPos + Vector3{0, 5, 0}, Vector4(1, 0, 1, 1), -1.0f);
}
gizmoBuffer->Unbind();
@@ -2370,7 +2370,6 @@ namespace Nuake {
{
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(2, 2));
ImGui::PushStyleColor(ImGuiCol_Button, IM_COL32(0, 0, 0, 0));
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 100);
bool selectedMode = CurrentOperation == ImGuizmo::OPERATION::TRANSLATE;

View File

@@ -78,18 +78,24 @@ namespace Nuake
{
}
void SceneRenderer::Update(const Timestep time)
void SceneRenderer::Update(const Timestep time, bool isEditorUpdate)
{
if (isEditorUpdate)
{
return;
}
// Delete debug shapes that are dead
std::erase_if(mDebugLines, [](const DebugLine& line)
{
return line.Life < 0.0f;
});
{
return line.Life < 0.0f;
});
std::erase_if(mDebugShapes, [](const DebugShape& shape)
{
return shape.Life < 0.0f;
});
{
return shape.Life < 0.0f;
});
for (auto& line : mDebugLines)
{
@@ -917,7 +923,6 @@ namespace Nuake
void SceneRenderer::PostProcessPass(const Scene& scene)
{
}
void SceneRenderer::DebugRendererPass(Scene& scene)

View File

@@ -47,7 +47,7 @@ namespace Nuake
void Init();
void Cleanup();
void Update(const Timestep time);
void Update(const Timestep time, bool isEditorUpdate = false);
void BeginRenderScene(const Matrix4& projection, const Matrix4& view, const Vector3& camPos);
void RenderScene(Scene& scene, FrameBuffer& framebuffer);

View File

@@ -266,10 +266,7 @@ namespace Nuake
system->Update(ts);
}
if (Engine::IsPlayMode())
{
m_SceneRenderer->Update(ts);
}
m_SceneRenderer->Update(ts, !Engine::IsPlayMode());
}
void Scene::FixedUpdate(Timestep ts)