Core/Vmaps: Expose loaded gameobject collision models in RegularGrid2D

This commit is contained in:
Shauren
2025-11-06 18:34:58 +01:00
parent a9c752af97
commit 556505d59a
3 changed files with 12 additions and 0 deletions

View File

@@ -19,6 +19,7 @@
#define TRINITYCORE_BOUNDING_INTERVAL_HIERARCHY_WRAPPER_H
#include "BoundingIntervalHierarchy.h"
#include <span>
#include <unordered_map>
template<class T, class BoundsFunc = BoundsTrait<T> >
@@ -115,6 +116,8 @@ public:
MDLCallback<IsectCallback> callback(intersectCallback, m_objects.data(), m_objects.size());
m_tree.intersectPoint(point, callback);
}
std::span<T const* const> getObjects() const { return m_objects; }
};
#endif // TRINITYCORE_BOUNDING_INTERVAL_HIERARCHY_WRAPPER_H

View File

@@ -280,3 +280,9 @@ bool DynamicMapTree::getAreaAndLiquidData(float x, float y, float z, PhaseShift
}
return false;
}
std::span<GameObjectModel const* const> DynamicMapTree::getModelsInGrid(uint32 gx, uint32 gy) const
{
// convert from map tile X/Y to RegularGrid internal representation
return impl->getObjects(63 - int32(gx), 63 - int32(gy));
}

View File

@@ -21,6 +21,7 @@
#include "Define.h"
#include "Optional.h"
#include <memory>
#include <span>
namespace G3D
{
@@ -59,6 +60,8 @@ public:
void balance();
void update(uint32 diff);
std::span<GameObjectModel const* const> getModelsInGrid(uint32 gx, uint32 gy) const;
};
#endif // _DYNTREE_H