18#ifndef TRINITYCORE_VMAP_MANAGER2_H
19#define TRINITYCORE_VMAP_MANAGER2_H
28#include <unordered_map>
50 typedef std::unordered_map<uint32, std::unique_ptr<StaticMapTree>>
InstanceTreeMap;
51 typedef std::unordered_map<std::string, std::weak_ptr<ManagedModel>>
ModelFileMap;
70 #define VMAP_INVALID_HEIGHT -100000.0f
71 #define VMAP_INVALID_HEIGHT_VALUE -200000.0f
112 InstanceTreeMap::const_iterator GetMapTree(
uint32 mapId)
const;
116 static std::string getMapFileName(
uint32 mapId);
117 static std::string getTileFileName(
uint32 mapID,
uint32 tileX,
uint32 tileY, std::string_view extension);
129 void InitializeThreadUnsafe(std::unordered_map<
uint32, std::vector<uint32>>
const& mapData);
130 void InitializeThreadUnsafe(
uint32 mapId,
int32 parentMapId);
151 void unloadMap(
uint32 mapId);
153 bool isInLineOfSight(
uint32 mapId,
float x1,
float y1,
float z1,
float x2,
float y2,
float z2,
ModelIgnoreFlags ignoreFlags);
158 bool getObjectHitPos(
uint32 mapId,
float x1,
float y1,
float z1,
float x2,
float y2,
float z2,
float& rx,
float& ry,
float& rz,
float modifyDist);
159 float getHeight(
uint32 mapId,
float x,
float y,
float z,
float maxSearchDist);
166 std::shared_ptr<WorldModel> acquireModelInstance(std::string
const& basepath, std::string
const& filename);
167 void releaseModelInstance(std::string
const& filename);
172 return getTileFileName(mapId, x, y,
"vmtile");
176 std::span<ModelInstance const> getModelsOnMap(
uint32 mapId)
const;
std::optional< T > Optional
Optional helper class to wrap optional values within.
#define VMAP_INVALID_HEIGHT
bool iEnableLineOfSightCalc
static std::string getDirFileName(uint32 mapId, uint32 x, uint32 y)
bool isLineOfSightCalcEnabled() const
VMapManager(VMapManager &&)=delete
bool isHeightCalcEnabled() const
VMapManager & operator=(VMapManager &&)=delete
bool isMapLoadingEnabled() const
ModelFileMap iLoadedModelFiles
void setEnableLineOfSightCalc(bool enableLineOfSightCalc)
void setEnableHeightCalc(bool enableHeightCalc)
VMapManager(VMapManager const &)=delete
std::unordered_map< uint32, uint32 > iParentMapData
std::mutex LoadedModelFilesLock
VMapManager & operator=(VMapManager const &)=delete
GetLiquidFlagsFn GetLiquidFlagsPtr
InstanceTreeMap iInstanceMapTrees
bool thread_safe_environment
IsVMAPDisabledForFn IsVMAPDisabledForPtr
std::unordered_map< uint32, std::unique_ptr< StaticMapTree > > InstanceTreeMap
std::unordered_map< std::string, std::weak_ptr< ManagedModel > > ModelFileMap
@ VMAP_DISABLE_LIQUIDSTATUS
AreaInfo(int32 _groupId, int32 _adtId, int32 _rootId, uint32 _mogpFlags, uint32 _uniqueId)
LiquidInfo(uint32 _type, float _level)
Optional< AreaInfo > areaInfo
Optional< LiquidInfo > liquidInfo