Fixed collision listener bug & incorrect transform forward. Added collision tags to raycasts. #274

Merged
direnbharwani merged 5 commits from SP3-2-Physics into main 2022-11-24 15:15:33 +08:00
1 changed files with 18 additions and 5 deletions
Showing only changes of commit f6c74ad3d2 - Show all commits

View File

@ -84,14 +84,27 @@ namespace SHADE
{
const SHCollisionInfo& C_INFO = *eventIter;
const bool CLEAR_EVENT = C_INFO.GetCollisionState() == SHCollisionInfo::State::EXIT || C_INFO.GetCollisionState() == SHCollisionInfo::State::INVALID;
const bool INVALID_ENTITY = !SHEntityManager::IsValidEID(C_INFO.GetEntityA()) || !SHEntityManager::IsValidEID(C_INFO.GetEntityB());
const bool INACTIVE_OBJECT = !SHSceneManager::CheckNodeAndComponentsActive<SHColliderComponent>(C_INFO.GetEntityA()) || !SHSceneManager::CheckNodeAndComponentsActive<SHColliderComponent>(C_INFO.GetEntityB());
if (CLEAR_EVENT || INVALID_ENTITY || INACTIVE_OBJECT)
if (INVALID_ENTITY)
{
eventIter = container.erase(eventIter);
continue;
}
else
++eventIter;
{
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);
continue;
}
}
++eventIter;
}
};