Fixed various Physics bugs #217
|
@ -16,6 +16,7 @@
|
|||
// Project Headers
|
||||
#include "Physics/PhysicsObject/SHPhysicsObject.h"
|
||||
#include "Physics/System/SHPhysicsSystem.h"
|
||||
#include "Scene/SHSceneManager.h"
|
||||
|
||||
/*-------------------------------------------------------------------------------------*/
|
||||
/* Local Helper Functions */
|
||||
|
@ -80,10 +81,15 @@ namespace SHADE
|
|||
{
|
||||
for (auto eventIter = container.begin(); eventIter != container.end();)
|
||||
{
|
||||
const bool CLEAR_EVENT = eventIter->GetCollisionState() == SHCollisionInfo::State::EXIT
|
||||
|| eventIter->GetCollisionState() == SHCollisionInfo::State::INVALID;
|
||||
const SHCollisionInfo& C_INFO = *eventIter;
|
||||
|
||||
if (CLEAR_EVENT)
|
||||
const bool CLEAR_EVENT = C_INFO.GetCollisionState() == SHCollisionInfo::State::EXIT
|
||||
|| C_INFO.GetCollisionState() == SHCollisionInfo::State::INVALID;
|
||||
|
||||
const bool INACTIVE_OBJECT = !SHSceneManager::CheckNodeAndComponentsActive<SHColliderComponent>(C_INFO.GetEntityA())
|
||||
|| !SHSceneManager::CheckNodeAndComponentsActive<SHColliderComponent>(C_INFO.GetEntityB());
|
||||
|
||||
if (CLEAR_EVENT || INACTIVE_OBJECT)
|
||||
eventIter = container.erase(eventIter);
|
||||
else
|
||||
++eventIter;
|
||||
|
|
Loading…
Reference in New Issue