missing change from last commit
This commit is contained in:
parent
c953931f4f
commit
c98693c6bc
|
@ -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<SHColliderComponent>(eid)->GetCollisionShape(shapeIndex).GetType()
|
||||
, .colliderIndex = shapeIndex
|
||||
.entityID = entityID
|
||||
, .colliderType = SHComponentManager::GetComponent<SHColliderComponent>(entityID)->GetCollisionShape(index).GetType()
|
||||
, .colliderIndex = index
|
||||
};
|
||||
|
||||
SHEventManager::BroadcastEvent<SHPhysicsColliderAddedEvent>(COLLIDER_ADDED_EVENT_DATA, SH_PHYSICS_COLLIDER_ADDED_EVENT);
|
||||
|
@ -144,27 +144,27 @@ namespace SHADE
|
|||
|
||||
#ifdef SHEDITOR
|
||||
|
||||
auto* editor = SHSystemManager::GetSystem<SHEditor>();
|
||||
if (editor && editor->editorState != SHEditor::State::STOP)
|
||||
ADD_SHAPE();
|
||||
const auto* EDITOR = SHSystemManager::GetSystem<SHEditor>();
|
||||
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<SHPhysicsColliderRemovedEvent>(COLLIDER_REMOVED_EVENT_DATA, SH_PHYSICS_COLLIDER_REMOVED_EVENT);
|
||||
|
@ -172,13 +172,13 @@ namespace SHADE
|
|||
|
||||
#ifdef SHEDITOR
|
||||
|
||||
auto* editor = SHSystemManager::GetSystem<SHEditor>();
|
||||
if (editor && editor->editorState != SHEditor::State::STOP)
|
||||
REMOVE_SHAPE();
|
||||
const auto* EDITOR = SHSystemManager::GetSystem<SHEditor>();
|
||||
if (EDITOR && EDITOR->editorState != SHEditor::State::STOP)
|
||||
REMOVE_SHAPE(eid, shapeIndex);
|
||||
|
||||
#else
|
||||
|
||||
REMOVE_SHAPE();
|
||||
REMOVE_SHAPE(eid, shapeIndex);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue