Changes to get visibility system working again in-game

This commit is contained in:
karlberg
2021-05-03 16:26:11 -07:00
parent a73d25dfe6
commit 822368ef01
46 changed files with 269 additions and 150 deletions
@@ -14,6 +14,7 @@
#include <AzCore/Console/Console.h>
#include <AzCore/Debug/Profiler.h>
#include <AzCore/Component/Entity.h>
#include <AzCore/Math/ShapeIntersection.h>
#include <AzFramework/Entity/EntityDebugDisplayBus.h>
#include <AzFramework/Visibility/IVisibilitySystem.h>
@@ -66,6 +67,7 @@ namespace AzFramework
octreeDebug.m_nodeBounds.push_back(nodeData.m_bounds);
}
visibleEntityIdsOut.reserve(visibleEntityIdsOut.size() + nodeData.m_entries.size());
for (const auto* visibilityEntry : nodeData.m_entries)
{
if (ed_visibility_showDebug)
@@ -88,8 +90,7 @@ namespace AzFramework
octreeDebug.m_entryAabbsInFrustum.push_back(visibilityEntry->m_boundingVolume);
}
AZ::EntityId entityId;
std::memcpy(&entityId, &visibilityEntry->m_userData, sizeof(AZ::EntityId));
AZ::EntityId entityId = static_cast<AZ::Entity*>(visibilityEntry->m_userData)->GetId();
visibleEntityIdsOut.push_back(entityId);
}
});