From c98693c6bc7377bdc9b39c1fdef3c9891c391774 Mon Sep 17 00:00:00 2001 From: Diren D Bharwani Date: Sun, 13 Nov 2022 17:57:46 +0800 Subject: [PATCH] missing change from last commit --- .../src/Physics/System/SHPhysicsSystem.cpp | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/SHADE_Engine/src/Physics/System/SHPhysicsSystem.cpp b/SHADE_Engine/src/Physics/System/SHPhysicsSystem.cpp index 5763e2ea..34f0c698 100644 --- a/SHADE_Engine/src/Physics/System/SHPhysicsSystem.cpp +++ b/SHADE_Engine/src/Physics/System/SHPhysicsSystem.cpp @@ -128,15 +128,15 @@ namespace SHADE void SHPhysicsSystem::AddCollisionShape(EntityID eid, int shapeIndex) { - static const auto ADD_SHAPE = [&] + static const auto ADD_SHAPE = [&](EntityID entityID, int index) { - objectManager.AddCollisionShape(eid, shapeIndex); + objectManager.AddCollisionShape(entityID, index); const SHPhysicsColliderAddedEvent COLLIDER_ADDED_EVENT_DATA { - .entityID = eid - , .colliderType = SHComponentManager::GetComponent(eid)->GetCollisionShape(shapeIndex).GetType() - , .colliderIndex = shapeIndex + .entityID = entityID + , .colliderType = SHComponentManager::GetComponent(entityID)->GetCollisionShape(index).GetType() + , .colliderIndex = index }; SHEventManager::BroadcastEvent(COLLIDER_ADDED_EVENT_DATA, SH_PHYSICS_COLLIDER_ADDED_EVENT); @@ -144,27 +144,27 @@ namespace SHADE #ifdef SHEDITOR - auto* editor = SHSystemManager::GetSystem(); - if (editor && editor->editorState != SHEditor::State::STOP) - ADD_SHAPE(); + const auto* EDITOR = SHSystemManager::GetSystem(); + if (EDITOR && EDITOR->editorState != SHEditor::State::STOP) + ADD_SHAPE(eid, shapeIndex); #else - ADD_SHAPE(); + ADD_SHAPE(eid, shapeIndex); #endif } void SHPhysicsSystem::RemoveCollisionShape(EntityID eid, int shapeIndex) { - static const auto REMOVE_SHAPE = [&] + static const auto REMOVE_SHAPE = [&](EntityID entityID, int index) { - objectManager.RemoveCollisionShape(eid, shapeIndex); + objectManager.RemoveCollisionShape(entityID, index); const SHPhysicsColliderRemovedEvent COLLIDER_REMOVED_EVENT_DATA { - .entityID = eid - , .colliderIndex = shapeIndex + .entityID = entityID + , .colliderIndex = index }; SHEventManager::BroadcastEvent(COLLIDER_REMOVED_EVENT_DATA, SH_PHYSICS_COLLIDER_REMOVED_EVENT); @@ -172,13 +172,13 @@ namespace SHADE #ifdef SHEDITOR - auto* editor = SHSystemManager::GetSystem(); - if (editor && editor->editorState != SHEditor::State::STOP) - REMOVE_SHAPE(); + const auto* EDITOR = SHSystemManager::GetSystem(); + if (EDITOR && EDITOR->editorState != SHEditor::State::STOP) + REMOVE_SHAPE(eid, shapeIndex); #else - REMOVE_SHAPE(); + REMOVE_SHAPE(eid, shapeIndex); #endif }