Tiny logic alteration so we don't get false warnings in debug.
This commit is contained in:
@@ -34,9 +34,12 @@ void TriggerSystem::UpdateComponent(World* world, EntityWrapper& entity, Compone
|
|||||||
throwLeaveIfWasInTrigger(m_EntitiesCompletelyInTrigger[tId], pId, tId);
|
throwLeaveIfWasInTrigger(m_EntitiesCompletelyInTrigger[tId], pId, tId);
|
||||||
} else {
|
} else {
|
||||||
//Entity is at least touching the trigger.
|
//Entity is at least touching the trigger.
|
||||||
AABB completelyInsideBox = AABB::FromOriginSize((*triggerBox).Origin(), (*triggerBox).Size() - 2.0f * (*playerBox).Size());
|
AABB completelyInsideBox;
|
||||||
if (Collision::AABBVsAABB(completelyInsideBox, *playerBox) &&
|
bool playerFitsInTrigger = glm::all(glm::greaterThan((*triggerBox).Size(), (*playerBox).Size()));
|
||||||
glm::all(glm::greaterThan((*triggerBox).Size(), (*playerBox).Size()))) {
|
if (playerFitsInTrigger) {
|
||||||
|
completelyInsideBox = AABB::FromOriginSize((*triggerBox).Origin(), (*triggerBox).Size() - 2.0f * (*playerBox).Size());
|
||||||
|
}
|
||||||
|
if (playerFitsInTrigger && Collision::AABBVsAABB(completelyInsideBox, *playerBox)) {
|
||||||
//Entity is completely inside the trigger.
|
//Entity is completely inside the trigger.
|
||||||
//If it was only touching before, it is erased.
|
//If it was only touching before, it is erased.
|
||||||
m_EntitiesTouchingTrigger[tId].erase(pId);
|
m_EntitiesTouchingTrigger[tId].erase(pId);
|
||||||
|
|||||||
Reference in New Issue
Block a user