mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Vmaps: Expose loaded gameobject collision models in RegularGrid2D
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user