Core/Collisions: Reverted a commit about M2 models.

closes #5312 and probably others
This commit is contained in:
Subv
2012-03-04 08:23:19 -05:00
parent c443b03010
commit 4029c23547
5 changed files with 4 additions and 9 deletions
@@ -245,7 +245,7 @@ namespace VMAP
return false; return false;
} }
WorldModel* VMapManager2::acquireModelInstance(const std::string& basepath, const std::string& filename, uint32 flags/* Only used when creating the model */) WorldModel* VMapManager2::acquireModelInstance(const std::string& basepath, const std::string& filename)
{ {
//! Critical section, thread safe access to iLoadedModelFiles //! Critical section, thread safe access to iLoadedModelFiles
TRINITY_GUARD(ACE_Thread_Mutex, LoadedModelFilesLock); TRINITY_GUARD(ACE_Thread_Mutex, LoadedModelFilesLock);
@@ -261,7 +261,6 @@ namespace VMAP
return NULL; return NULL;
} }
sLog->outDebug(LOG_FILTER_MAPS, "VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str()); sLog->outDebug(LOG_FILTER_MAPS, "VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str());
worldmodel->Flags = flags;
model = iLoadedModelFiles.insert(std::pair<std::string, ManagedModel>(filename, ManagedModel())).first; model = iLoadedModelFiles.insert(std::pair<std::string, ManagedModel>(filename, ManagedModel())).first;
model->second.setModel(worldmodel); model->second.setModel(worldmodel);
} }
@@ -103,7 +103,7 @@ namespace VMAP
bool getAreaInfo(unsigned int pMapId, float x, float y, float& z, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const; bool getAreaInfo(unsigned int pMapId, float x, float y, float& z, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const;
bool GetLiquidLevel(uint32 pMapId, float x, float y, float z, uint8 reqLiquidType, float& level, float& floor, uint32& type) const; bool GetLiquidLevel(uint32 pMapId, float x, float y, float z, uint8 reqLiquidType, float& level, float& floor, uint32& type) const;
WorldModel* acquireModelInstance(const std::string& basepath, const std::string& filename, uint32 flags = 0); WorldModel* acquireModelInstance(const std::string& basepath, const std::string& filename);
void releaseModelInstance(const std::string& filename); void releaseModelInstance(const std::string& filename);
// what's the use of this? o.O // what's the use of this? o.O
+2 -2
View File
@@ -309,7 +309,7 @@ namespace VMAP
#endif #endif
if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn)) if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn))
{ {
WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name, spawn.flags); WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name);
sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : loading %s", spawn.name.c_str()); sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : loading %s", spawn.name.c_str());
if (model) if (model)
{ {
@@ -380,7 +380,7 @@ namespace VMAP
if (result) if (result)
{ {
// acquire model instance // acquire model instance
WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name, spawn.flags); WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name);
if (!model) if (!model)
sLog->outError("StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u, %u]", tileX, tileY); sLog->outError("StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u, %u]", tileX, tileY);
@@ -421,9 +421,6 @@ namespace VMAP
bool WorldModel::IntersectRay(const G3D::Ray &ray, float &distance, bool stopAtFirstHit) const bool WorldModel::IntersectRay(const G3D::Ray &ray, float &distance, bool stopAtFirstHit) const
{ {
// M2 models are not taken into account for LoS calculation
if (Flags & MOD_M2)
return false;
// small M2 workaround, maybe better make separate class with virtual intersection funcs // small M2 workaround, maybe better make separate class with virtual intersection funcs
// in any case, there's no need to use a bound tree if we only have one submodel // in any case, there's no need to use a bound tree if we only have one submodel
if (groupModels.size() == 1) if (groupModels.size() == 1)
-1
View File
@@ -113,7 +113,6 @@ namespace VMAP
bool GetLocationInfo(const G3D::Vector3 &p, const G3D::Vector3 &down, float &dist, LocationInfo &info) const; bool GetLocationInfo(const G3D::Vector3 &p, const G3D::Vector3 &down, float &dist, LocationInfo &info) const;
bool writeFile(const std::string &filename); bool writeFile(const std::string &filename);
bool readFile(const std::string &filename); bool readFile(const std::string &filename);
uint32 Flags;
protected: protected:
uint32 RootWMOID; uint32 RootWMOID;
std::vector<GroupModel> groupModels; std::vector<GroupModel> groupModels;