From b9693565a4ccbf8767ab5fba931f4efa89082c83 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Fri, 20 Oct 2023 21:30:40 -0400 Subject: checkpoint - physics is working but messy --- src/game.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/game.cpp') diff --git a/src/game.cpp b/src/game.cpp index e921b2f..a1ba28b 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -247,7 +247,7 @@ void ParseInstance(std::ifstream &stream) { const auto &et = GlobalEntityTypes[existingEntityTypeIndex]; auto entityHandle = ECS_CreateEntity(); ECS_CreateInstance(entityHandle, et.entityHandle); - ECS_UpdateInstance(entityHandle, comp.instPos); + ECS_UpdateInstance(entityHandle, comp.instPos, true); break; } if (strstr(readLine, PKE_FILE_INSTANCE_ENTITY_HANDLE)) { @@ -422,6 +422,7 @@ void Game_Tick(double delta) { EntityHandle newEntity = ECS_CreateEntity(); ECS_CreateInstance(newEntity, createInfo.entityTypeEntityHandle); } + PkeInput_Tick(delta); PkeInputEventHolder holder = PkeInput_Query(dbgCtrl_UnlockCamera); if (holder.type != InputEventHash{0}) { @@ -573,6 +574,7 @@ void RecordImGuiEditorWrapper() { } if (ImGui::BeginMenu("Debug")) { ImGui::Checkbox("Show Debug Hitboxes", &pkeSettings.isRenderingDebug); + ImGui::Checkbox("Pause Physics Simulation", &pkeSettings.isSimulationPaused); if (ImGui::Checkbox("Uncap Framerate", &pkeSettings.graphicsSettings.isFramerateUnlocked)) { shouldRecreateSwapchain = true; } @@ -815,7 +817,7 @@ void RecordImGui_CompInstPos(bool readonly, CompInstance *component) { changed = ImGui::InputScalarN("scale", ImGuiDataType_Float, &component->instPos.scale, 3, nullptr, nullptr, nullptr, inputTextFlags) || changed; if (changed) { - ECS_UpdateInstance(component->entHandle, component->instPos); + ECS_UpdateInstance(component->entHandle, component->instPos, true); } ImGui::Spacing(); -- cgit v1.2.3