diff options
Diffstat (limited to 'src/common/Collision')
-rw-r--r-- | src/common/Collision/DynamicTree.cpp | 46 | ||||
-rw-r--r-- | src/common/Collision/DynamicTree.h | 4 | ||||
-rw-r--r-- | src/common/Collision/Management/IVMapManager.h | 24 | ||||
-rw-r--r-- | src/common/Collision/Management/VMapManager2.cpp | 76 | ||||
-rw-r--r-- | src/common/Collision/Management/VMapManager2.h | 4 | ||||
-rw-r--r-- | src/common/Collision/Maps/MapDefines.h | 48 | ||||
-rw-r--r-- | src/common/Collision/Maps/MapTree.cpp | 32 | ||||
-rw-r--r-- | src/common/Collision/Maps/MapTree.h | 1 | ||||
-rw-r--r-- | src/common/Collision/Models/GameObjectModel.cpp | 21 | ||||
-rw-r--r-- | src/common/Collision/Models/GameObjectModel.h | 1 | ||||
-rw-r--r-- | src/common/Collision/Models/ModelInstance.cpp | 34 | ||||
-rw-r--r-- | src/common/Collision/Models/ModelInstance.h | 1 | ||||
-rw-r--r-- | src/common/Collision/Models/WorldModel.cpp | 19 | ||||
-rw-r--r-- | src/common/Collision/Models/WorldModel.h | 1 |
14 files changed, 84 insertions, 228 deletions
diff --git a/src/common/Collision/DynamicTree.cpp b/src/common/Collision/DynamicTree.cpp index 34c38d98fa7..ceddd740613 100644 --- a/src/common/Collision/DynamicTree.cpp +++ b/src/common/Collision/DynamicTree.cpp @@ -150,22 +150,6 @@ struct DynamicTreeIntersectionCallback bool didHit() const { return did_hit;} }; -struct DynamicTreeAreaInfoCallback -{ - DynamicTreeAreaInfoCallback(uint32 phaseMask) : _phaseMask(phaseMask) {} - - void operator()(G3D::Vector3 const& p, GameObjectModel const& obj) - { - obj.intersectPoint(p, _areaInfo, _phaseMask); - } - - VMAP::AreaInfo const& GetAreaInfo() const { return _areaInfo; } - -private: - uint32 _phaseMask; - VMAP::AreaInfo _areaInfo; -}; - struct DynamicTreeLocationInfoCallback { DynamicTreeLocationInfoCallback(uint32 phaseMask) : _phaseMask(phaseMask), _hitModel(nullptr) {} @@ -265,24 +249,7 @@ float DynamicMapTree::getHeight(float x, float y, float z, float maxSearchDist, return -G3D::finf(); } -bool DynamicMapTree::getAreaInfo(float x, float y, float& z, uint32 phasemask, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const -{ - G3D::Vector3 v(x, y, z + 0.5f); - DynamicTreeAreaInfoCallback intersectionCallBack(phasemask); - impl->intersectPoint(v, intersectionCallBack); - if (intersectionCallBack.GetAreaInfo().result) - { - flags = intersectionCallBack.GetAreaInfo().flags; - adtId = intersectionCallBack.GetAreaInfo().adtId; - rootId = intersectionCallBack.GetAreaInfo().rootId; - groupId = intersectionCallBack.GetAreaInfo().groupId; - z = intersectionCallBack.GetAreaInfo().ground_Z; - return true; - } - return false; -} - -void DynamicMapTree::getAreaAndLiquidData(float x, float y, float z, uint32 phasemask, uint8 reqLiquidType, VMAP::AreaAndLiquidData& data) const +bool DynamicMapTree::getAreaAndLiquidData(float x, float y, float z, uint32 phasemask, Optional<uint8> reqLiquidType, VMAP::AreaAndLiquidData& data) const { G3D::Vector3 v(x, y, z + 0.5f); DynamicTreeLocationInfoCallback intersectionCallBack(phasemask); @@ -292,13 +259,16 @@ void DynamicMapTree::getAreaAndLiquidData(float x, float y, float z, uint32 phas data.floorZ = intersectionCallBack.GetLocationInfo().ground_Z; uint32 liquidType = intersectionCallBack.GetLocationInfo().hitModel->GetLiquidType(); float liquidLevel; - if (!reqLiquidType || VMAP::VMapFactory::createOrGetVMapManager()->GetLiquidFlagsPtr(liquidType) & reqLiquidType) + if (!reqLiquidType || VMAP::VMapFactory::createOrGetVMapManager()->GetLiquidFlagsPtr(liquidType) & *reqLiquidType) if (intersectionCallBack.GetHitModel()->GetLiquidLevel(v, intersectionCallBack.GetLocationInfo(), liquidLevel)) data.liquidInfo.emplace(liquidType, liquidLevel); - data.areaInfo.emplace(0, + data.areaInfo.emplace(intersectionCallBack.GetLocationInfo().hitModel->GetWmoID(), + 0, intersectionCallBack.GetLocationInfo().rootId, - intersectionCallBack.GetLocationInfo().hitModel->GetWmoID(), - intersectionCallBack.GetLocationInfo().hitModel->GetMogpFlags()); + intersectionCallBack.GetLocationInfo().hitModel->GetMogpFlags(), + 0); + return true; } + return false; } diff --git a/src/common/Collision/DynamicTree.h b/src/common/Collision/DynamicTree.h index b62044b9544..0bcdbed4236 100644 --- a/src/common/Collision/DynamicTree.h +++ b/src/common/Collision/DynamicTree.h @@ -19,6 +19,7 @@ #define _DYNTREE_H #include "Define.h" +#include "Optional.h" namespace G3D { @@ -48,8 +49,7 @@ public: bool getIntersectionTime(uint32 phasemask, const G3D::Ray& ray, const G3D::Vector3& endPos, float& maxDist) const; - bool getAreaInfo(float x, float y, float& z, uint32 phasemask, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const; - void getAreaAndLiquidData(float x, float y, float z, uint32 phasemask, uint8 reqLiquidType, VMAP::AreaAndLiquidData& data) const; + bool getAreaAndLiquidData(float x, float y, float z, uint32 phasemask, Optional<uint8> reqLiquidType, VMAP::AreaAndLiquidData& data) const; bool getObjectHitPos(uint32 phasemask, const G3D::Vector3& pPos1, const G3D::Vector3& pPos2, G3D::Vector3& pResultHitPos, diff --git a/src/common/Collision/Management/IVMapManager.h b/src/common/Collision/Management/IVMapManager.h index b25d93bd9b4..e48b4f38b75 100644 --- a/src/common/Collision/Management/IVMapManager.h +++ b/src/common/Collision/Management/IVMapManager.h @@ -53,17 +53,21 @@ namespace VMAP { struct AreaInfo { - AreaInfo(int32 _adtId, int32 _rootId, int32 _groupId, uint32 _flags) : adtId(_adtId), rootId(_rootId), groupId(_groupId), mogpFlags(_flags) { } - int32 const adtId; - int32 const rootId; - int32 const groupId; - uint32 const mogpFlags; + AreaInfo() = default; + AreaInfo(int32 _groupId, int32 _adtId, int32 _rootId, uint32 _mogpFlags, uint32 _uniqueId) + : groupId(_groupId), adtId(_adtId), rootId(_rootId), mogpFlags(_mogpFlags), uniqueId(_uniqueId) { } + int32 groupId = 0; + int32 adtId = 0; + int32 rootId = 0; + uint32 mogpFlags = 0; + uint32 uniqueId = 0; }; struct LiquidInfo { + LiquidInfo() = default; LiquidInfo(uint32 _type, float _level) : type(_type), level(_level) { } - uint32 const type; - float const level; + uint32 type = 0; + float level = 0.0f; }; float floorZ = VMAP_INVALID_HEIGHT; @@ -117,14 +121,12 @@ namespace VMAP bool isMapLoadingEnabled() const { return(iEnableLineOfSightCalc || iEnableHeightCalc ); } virtual std::string getDirFileName(unsigned int pMapId, int x, int y) const =0; + /** Query world model area info. \param z gets adjusted to the ground height for which this are info is valid */ - virtual bool getAreaInfo(uint32 mapId, float x, float y, float &z, uint32 &flags, int32 &adtId, int32 &rootId, int32 &groupId) const=0; - virtual bool GetLiquidLevel(uint32 mapId, float x, float y, float z, uint8 reqLiquidType, float& level, float& floor, uint32& type, uint32& mogpFlags) const=0; - // get both area + liquid data in a single vmap lookup - virtual void getAreaAndLiquidData(unsigned int mapId, float x, float y, float z, uint8 reqLiquidType, AreaAndLiquidData& data) const=0; + virtual bool getAreaAndLiquidData(unsigned int mapId, float x, float y, float z, Optional<uint8> reqLiquidType, AreaAndLiquidData& data) const = 0; }; } diff --git a/src/common/Collision/Management/VMapManager2.cpp b/src/common/Collision/Management/VMapManager2.cpp index 9ee1d5a0b3f..4fed17787de 100644 --- a/src/common/Collision/Management/VMapManager2.cpp +++ b/src/common/Collision/Management/VMapManager2.cpp @@ -233,63 +233,8 @@ namespace VMAP return VMAP_INVALID_HEIGHT_VALUE; } - bool VMapManager2::getAreaInfo(uint32 mapId, float x, float y, float& z, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const + bool VMapManager2::getAreaAndLiquidData(unsigned int mapId, float x, float y, float z, Optional<uint8> reqLiquidType, AreaAndLiquidData& data) const { - if (!IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_AREAFLAG)) - { - InstanceTreeMap::const_iterator instanceTree = GetMapTree(mapId); - if (instanceTree != iInstanceMapTrees.end()) - { - Vector3 pos = convertPositionToInternalRep(x, y, z); - bool result = instanceTree->second->getAreaInfo(pos, flags, adtId, rootId, groupId); - // z is not touched by convertPositionToInternalRep(), so just copy - z = pos.z; - return result; - } - } - - return false; - } - - bool VMapManager2::GetLiquidLevel(uint32 mapId, float x, float y, float z, uint8 reqLiquidType, float& level, float& floor, uint32& type, uint32& mogpFlags) const - { - if (!IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_LIQUIDSTATUS)) - { - InstanceTreeMap::const_iterator instanceTree = GetMapTree(mapId); - if (instanceTree != iInstanceMapTrees.end()) - { - LocationInfo info; - Vector3 pos = convertPositionToInternalRep(x, y, z); - if (instanceTree->second->GetLocationInfo(pos, info)) - { - floor = info.ground_Z; - ASSERT(floor < std::numeric_limits<float>::max()); - ASSERT(info.hitModel); - type = info.hitModel->GetLiquidType(); // entry from LiquidType.dbc - mogpFlags = info.hitModel->GetMogpFlags(); - if (reqLiquidType && !(GetLiquidFlagsPtr(type) & reqLiquidType)) - return false; - ASSERT(info.hitInstance); - if (info.hitInstance->GetLiquidLevel(pos, info, level)) - return true; - } - } - } - - return false; - } - - void VMapManager2::getAreaAndLiquidData(unsigned int mapId, float x, float y, float z, uint8 reqLiquidType, AreaAndLiquidData& data) const - { - if (IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_LIQUIDSTATUS)) - { - data.floorZ = z; - int32 adtId, rootId, groupId; - uint32 flags; - if (getAreaInfo(mapId, x, y, data.floorZ, flags, adtId, rootId, groupId)) - data.areaInfo.emplace(adtId, rootId, groupId, flags); - return; - } InstanceTreeMap::const_iterator instanceTree = GetMapTree(mapId); if (instanceTree != iInstanceMapTrees.end()) { @@ -300,16 +245,23 @@ namespace VMAP ASSERT(info.hitModel); ASSERT(info.hitInstance); data.floorZ = info.ground_Z; - uint32 liquidType = info.hitModel->GetLiquidType(); - float liquidLevel; - if (!reqLiquidType || (GetLiquidFlagsPtr(liquidType) & reqLiquidType)) - if (info.hitInstance->GetLiquidLevel(pos, info, liquidLevel)) - data.liquidInfo.emplace(liquidType, liquidLevel); + if (!IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_LIQUIDSTATUS)) + { + uint32 liquidType = info.hitModel->GetLiquidType(); // entry from LiquidType.dbc + float liquidLevel; + if (!reqLiquidType || (GetLiquidFlagsPtr(liquidType) & *reqLiquidType)) + if (info.hitInstance->GetLiquidLevel(pos, info, liquidLevel)) + data.liquidInfo.emplace(liquidType, liquidLevel); + } if (!IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_AREAFLAG)) - data.areaInfo.emplace(info.hitInstance->adtId, info.rootId, info.hitModel->GetWmoID(), info.hitModel->GetMogpFlags()); + data.areaInfo.emplace(info.hitModel->GetWmoID(), info.hitInstance->adtId, info.rootId, info.hitModel->GetMogpFlags(), info.hitInstance->ID); + + return true; } } + + return false; } WorldModel* VMapManager2::acquireModelInstance(const std::string& basepath, const std::string& filename, uint32 flags/* Only used when creating the model */) diff --git a/src/common/Collision/Management/VMapManager2.h b/src/common/Collision/Management/VMapManager2.h index 10a357318ab..25f4257997f 100644 --- a/src/common/Collision/Management/VMapManager2.h +++ b/src/common/Collision/Management/VMapManager2.h @@ -115,9 +115,7 @@ namespace VMAP bool processCommand(char* /*command*/) override { return false; } // for debug and extensions - bool getAreaInfo(uint32 mapId, float x, float y, float& z, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const override; - bool GetLiquidLevel(uint32 mapId, float x, float y, float z, uint8 reqLiquidType, float& level, float& floor, uint32& type, uint32& mogpFlags) const override; - void getAreaAndLiquidData(uint32 mapId, float x, float y, float z, uint8 reqLiquidType, AreaAndLiquidData& data) const override; + bool getAreaAndLiquidData(uint32 mapId, float x, float y, float z, Optional<uint8> reqLiquidType, AreaAndLiquidData& data) const override; WorldModel* acquireModelInstance(const std::string& basepath, const std::string& filename, uint32 flags = 0); void releaseModelInstance(const std::string& filename); diff --git a/src/common/Collision/Maps/MapDefines.h b/src/common/Collision/Maps/MapDefines.h index 6e7aa4410e5..1877d3eec1c 100644 --- a/src/common/Collision/Maps/MapDefines.h +++ b/src/common/Collision/Maps/MapDefines.h @@ -19,7 +19,8 @@ #define _MAPDEFINES_H #include "Define.h" -#include "DetourNavMesh.h" +#include "Optional.h" +#include <DetourNavMesh.h> const uint32 MMAP_MAGIC = 0x4d4d4150; // 'MMAP' #define MMAP_VERSION 15 @@ -69,4 +70,47 @@ enum NavTerrainFlag NAV_MAGMA_SLIME = 1 << (NAV_AREA_MAX_VALUE - NAV_AREA_MAGMA_SLIME) }; -#endif /* _MAPDEFINES_H */ +enum ZLiquidStatus : uint32 +{ + LIQUID_MAP_NO_WATER = 0x00000000, + LIQUID_MAP_ABOVE_WATER = 0x00000001, + LIQUID_MAP_WATER_WALK = 0x00000002, + LIQUID_MAP_IN_WATER = 0x00000004, + LIQUID_MAP_UNDER_WATER = 0x00000008, +}; + +#define MAP_LIQUID_STATUS_SWIMMING (LIQUID_MAP_IN_WATER | LIQUID_MAP_UNDER_WATER) +#define MAP_LIQUID_STATUS_IN_CONTACT (MAP_LIQUID_STATUS_SWIMMING | LIQUID_MAP_WATER_WALK) + +struct LiquidData +{ + uint32 type_flags; + uint32 entry; + float level; + float depth_level; +}; + +struct WmoLocation +{ + WmoLocation() = default; + WmoLocation(int32 groupId, int32 nameSetId, int32 rootId, uint32 uniqueId) + : GroupId(groupId), NameSetId(nameSetId), RootId(rootId), UniqueId(uniqueId) { } + + int32 GroupId = 0; + int32 NameSetId = 0; + int32 RootId = 0; + uint32 UniqueId = 0; +}; + +struct PositionFullTerrainStatus +{ + PositionFullTerrainStatus() : areaId(0), floorZ(0.0f), outdoors(true), liquidStatus(LIQUID_MAP_NO_WATER) { } + uint32 areaId; + float floorZ; + bool outdoors; + ZLiquidStatus liquidStatus; + Optional<WmoLocation> wmoLocation; + Optional<LiquidData> liquidInfo; +}; + +#endif // _MAPDEFINES_H diff --git a/src/common/Collision/Maps/MapTree.cpp b/src/common/Collision/Maps/MapTree.cpp index b023e134cd3..55d33e7ee6c 100644 --- a/src/common/Collision/Maps/MapTree.cpp +++ b/src/common/Collision/Maps/MapTree.cpp @@ -50,22 +50,6 @@ namespace VMAP ModelIgnoreFlags flags; }; - class AreaInfoCallback - { - public: - AreaInfoCallback(ModelInstance* val): prims(val) { } - void operator()(Vector3 const& point, uint32 entry) - { -#ifdef VMAP_DEBUG - TC_LOG_DEBUG("maps", "AreaInfoCallback: trying to intersect '{}'", prims[entry].name); -#endif - prims[entry].intersectPoint(point, aInfo); - } - - ModelInstance* prims; - AreaInfo aInfo; - }; - class LocationInfoCallback { public: @@ -96,22 +80,6 @@ namespace VMAP return tilefilename.str(); } - bool StaticMapTree::getAreaInfo(Vector3 &pos, uint32 &flags, int32 &adtId, int32 &rootId, int32 &groupId) const - { - AreaInfoCallback intersectionCallBack(iTreeValues); - iTree.intersectPoint(pos, intersectionCallBack); - if (intersectionCallBack.aInfo.result) - { - flags = intersectionCallBack.aInfo.flags; - adtId = intersectionCallBack.aInfo.adtId; - rootId = intersectionCallBack.aInfo.rootId; - groupId = intersectionCallBack.aInfo.groupId; - pos.z = intersectionCallBack.aInfo.ground_Z; - return true; - } - return false; - } - bool StaticMapTree::GetLocationInfo(Vector3 const& pos, LocationInfo &info) const { LocationInfoCallback intersectionCallBack(iTreeValues, info); diff --git a/src/common/Collision/Maps/MapTree.h b/src/common/Collision/Maps/MapTree.h index c70e94a6352..9fed79314b4 100644 --- a/src/common/Collision/Maps/MapTree.h +++ b/src/common/Collision/Maps/MapTree.h @@ -79,7 +79,6 @@ namespace VMAP bool isInLineOfSight(const G3D::Vector3& pos1, const G3D::Vector3& pos2, ModelIgnoreFlags ignoreFlags) const; bool getObjectHitPos(const G3D::Vector3& pos1, const G3D::Vector3& pos2, G3D::Vector3& pResultHitPos, float pModifyDist) const; float getHeight(const G3D::Vector3& pPos, float maxSearchDist) const; - bool getAreaInfo(G3D::Vector3 &pos, uint32 &flags, int32 &adtId, int32 &rootId, int32 &groupId) const; bool GetLocationInfo(const G3D::Vector3 &pos, LocationInfo &info) const; bool InitMap(const std::string &fname, VMapManager2* vm); diff --git a/src/common/Collision/Models/GameObjectModel.cpp b/src/common/Collision/Models/GameObjectModel.cpp index 88357333e6b..1b3bb2ff092 100644 --- a/src/common/Collision/Models/GameObjectModel.cpp +++ b/src/common/Collision/Models/GameObjectModel.cpp @@ -183,27 +183,6 @@ bool GameObjectModel::intersectRay(const G3D::Ray& ray, float& MaxDist, bool Sto return hit; } -void GameObjectModel::intersectPoint(G3D::Vector3 const& point, VMAP::AreaInfo& info, uint32 ph_mask) const -{ - if (!(phasemask & ph_mask) || !owner->IsSpawned() || !isMapObject()) - return; - - if (!iBound.contains(point)) - return; - - // child bounds are defined in object space: - Vector3 pModel = iInvRot * (point - iPos) * iInvScale; - Vector3 zDirModel = iInvRot * Vector3(0.f, 0.f, -1.f); - float zDist; - if (iModel->IntersectPoint(pModel, zDirModel, zDist, info)) - { - Vector3 modelGround = pModel + zDist * zDirModel; - float world_Z = ((modelGround * iInvRot) * iScale + iPos).z; - if (info.ground_Z < world_Z) - info.ground_Z = world_Z; - } -} - bool GameObjectModel::GetLocationInfo(G3D::Vector3 const& point, VMAP::LocationInfo& info, uint32 ph_mask) const { if (!(phasemask & ph_mask) || !owner->IsSpawned() || !isMapObject()) diff --git a/src/common/Collision/Models/GameObjectModel.h b/src/common/Collision/Models/GameObjectModel.h index 78f17b75391..46de9bec4c3 100644 --- a/src/common/Collision/Models/GameObjectModel.h +++ b/src/common/Collision/Models/GameObjectModel.h @@ -71,7 +71,6 @@ public: bool isMapObject() const { return isWmo; } bool intersectRay(const G3D::Ray& Ray, float& MaxDist, bool StopAtFirstHit, uint32 ph_mask, VMAP::ModelIgnoreFlags ignoreFlags) const; - void intersectPoint(G3D::Vector3 const& point, VMAP::AreaInfo& info, uint32 ph_mask) const; bool GetLocationInfo(G3D::Vector3 const& point, VMAP::LocationInfo& info, uint32 ph_mask) const; bool GetLiquidLevel(G3D::Vector3 const& point, VMAP::LocationInfo& info, float& liqHeight) const; diff --git a/src/common/Collision/Models/ModelInstance.cpp b/src/common/Collision/Models/ModelInstance.cpp index 616488bd9a1..32415be8fc0 100644 --- a/src/common/Collision/Models/ModelInstance.cpp +++ b/src/common/Collision/Models/ModelInstance.cpp @@ -63,40 +63,6 @@ namespace VMAP return hit; } - void ModelInstance::intersectPoint(const G3D::Vector3& p, AreaInfo &info) const - { - if (!iModel) - { -#ifdef VMAP_DEBUG - std::cout << "<object not loaded>\n"; -#endif - return; - } - - // M2 files don't contain area info, only WMO files - if (flags & MOD_M2) - return; - if (!iBound.contains(p)) - return; - // child bounds are defined in object space: - Vector3 pModel = iInvRot * (p - iPos) * iInvScale; - Vector3 zDirModel = iInvRot * Vector3(0.f, 0.f, -1.f); - float zDist; - if (iModel->IntersectPoint(pModel, zDirModel, zDist, info)) - { - Vector3 modelGround = pModel + zDist * zDirModel; - // Transform back to world space. Note that: - // Mat * vec == vec * Mat.transpose() - // and for rotation matrices: Mat.inverse() == Mat.transpose() - float world_Z = ((modelGround * iInvRot) * iScale + iPos).z; - if (info.ground_Z < world_Z) - { - info.ground_Z = world_Z; - info.adtId = adtId; - } - } - } - bool ModelInstance::GetLocationInfo(const G3D::Vector3& p, LocationInfo &info) const { if (!iModel) diff --git a/src/common/Collision/Models/ModelInstance.h b/src/common/Collision/Models/ModelInstance.h index e984aa1065a..366f1eee97b 100644 --- a/src/common/Collision/Models/ModelInstance.h +++ b/src/common/Collision/Models/ModelInstance.h @@ -67,7 +67,6 @@ namespace VMAP ModelInstance(ModelSpawn const& spawn, WorldModel* model); void setUnloaded() { iModel = nullptr; } bool intersectRay(G3D::Ray const& pRay, float& pMaxDist, bool pStopAtFirstHit, ModelIgnoreFlags ignoreFlags) const; - void intersectPoint(G3D::Vector3 const& p, AreaInfo &info) const; bool GetLocationInfo(G3D::Vector3 const& p, LocationInfo &info) const; bool GetLiquidLevel(G3D::Vector3 const& p, LocationInfo &info, float &liqHeight) const; WorldModel* getWorldModel() { return iModel; } diff --git a/src/common/Collision/Models/WorldModel.cpp b/src/common/Collision/Models/WorldModel.cpp index 8b59bb49887..454b45c3490 100644 --- a/src/common/Collision/Models/WorldModel.cpp +++ b/src/common/Collision/Models/WorldModel.cpp @@ -529,25 +529,6 @@ namespace VMAP } }; - bool WorldModel::IntersectPoint(const G3D::Vector3 &p, const G3D::Vector3 &down, float &dist, AreaInfo &info) const - { - if (groupModels.empty()) - return false; - - WModelAreaCallback callback(groupModels, down); - groupTree.intersectPoint(p, callback); - if (callback.hit != groupModels.end()) - { - info.rootId = RootWMOID; - info.groupId = callback.hit->GetWmoID(); - info.flags = callback.hit->GetMogpFlags(); - info.result = true; - dist = callback.zDist; - return true; - } - return false; - } - bool WorldModel::GetLocationInfo(const G3D::Vector3& p, const G3D::Vector3& down, float& dist, GroupLocationInfo& info) const { if (groupModels.empty()) diff --git a/src/common/Collision/Models/WorldModel.h b/src/common/Collision/Models/WorldModel.h index 24954e57b68..10fa529f005 100644 --- a/src/common/Collision/Models/WorldModel.h +++ b/src/common/Collision/Models/WorldModel.h @@ -113,7 +113,6 @@ namespace VMAP void setGroupModels(std::vector<GroupModel> &models); void setRootWmoID(uint32 id) { RootWMOID = id; } bool IntersectRay(const G3D::Ray &ray, float &distance, bool stopAtFirstHit, ModelIgnoreFlags ignoreFlags) const; - bool IntersectPoint(const G3D::Vector3 &p, const G3D::Vector3 &down, float &dist, AreaInfo &info) const; bool GetLocationInfo(const G3D::Vector3 &p, const G3D::Vector3 &down, float &dist, GroupLocationInfo& info) const; bool writeFile(const std::string &filename); bool readFile(const std::string &filename); |