|
Project SkyFire Core
SkyFire 5.4.8 server core API documentation
|
#include <MapTree.h>
Public Member Functions | |
| bool | getAreaInfo (G3D::Vector3 &pos, uint32 &flags, int32 &adtId, int32 &rootId, int32 &groupId) const |
| float | getHeight (const G3D::Vector3 &pPos, float maxSearchDist) const |
| bool | GetLocationInfo (const G3D::Vector3 &pos, LocationInfo &info) const |
| void | getModelInstances (ModelInstance *&models, uint32 &count) |
| bool | getObjectHitPos (const G3D::Vector3 &pos1, const G3D::Vector3 &pos2, G3D::Vector3 &pResultHitPos, float pModifyDist) const |
| bool | InitMap (const std::string &fname, VMapManager2 *vm) |
| bool | isInLineOfSight (const G3D::Vector3 &pos1, const G3D::Vector3 &pos2) const |
| bool | isTiled () const |
| bool | LoadMapTile (uint32 tileX, uint32 tileY, VMapManager2 *vm) |
| uint32 | numLoadedTiles () const |
| StaticMapTree (uint32 mapID, const std::string &basePath) | |
| void | UnloadMap (VMapManager2 *vm) |
| void | UnloadMapTile (uint32 tileX, uint32 tileY, VMapManager2 *vm) |
| ~StaticMapTree () | |
| Make sure to call unloadMap() to unregister acquired model references before destroying. | |
Static Public Member Functions | |
| static bool | CanLoadMap (const std::string &basePath, uint32 mapID, uint32 tileX, uint32 tileY) |
| static std::string | getTileFileName (uint32 mapID, uint32 tileX, uint32 tileY) |
| static uint32 | packTileID (uint32 tileX, uint32 tileY) |
| static void | unpackTileID (uint32 ID, uint32 &tileX, uint32 &tileY) |
Private Types | |
| typedef UNORDERED_MAP< uint32, uint32 > | loadedSpawnMap |
| typedef UNORDERED_MAP< uint32, bool > | loadedTileMap |
Private Member Functions | |
| bool | getIntersectionTime (const G3D::Ray &pRay, float &pMaxDist, bool pStopAtFirstHit) const |
| StaticMapTree & | operator= (StaticMapTree const &right)=delete |
| StaticMapTree (StaticMapTree const &right)=delete | |
Private Attributes | |
| std::string | iBasePath |
| bool | iIsTiled |
| loadedSpawnMap | iLoadedSpawns |
| loadedTileMap | iLoadedTiles |
| uint32 | iMapID |
| uint32 | iNTreeValues |
| BIH | iTree |
| ModelInstance * | iTreeValues |
|
private |
|
private |
| VMAP::StaticMapTree::StaticMapTree | ( | uint32 | mapID, |
| const std::string & | basePath ) |
Definition at line 109 of file MapTree.cpp.
References iBasePath, iIsTiled, iMapID, iNTreeValues, and iTreeValues.
Referenced by operator=(), and StaticMapTree().
| VMAP::StaticMapTree::~StaticMapTree | ( | ) |
Make sure to call unloadMap() to unregister acquired model references before destroying.
Definition at line 121 of file MapTree.cpp.
References iTreeValues.
|
privatedelete |
References StaticMapTree().
|
static |
Definition at line 229 of file MapTree.cpp.
References VMAP::VMapManager2::getMapFileName(), getTileFileName(), VMAP::readChunk(), and VMAP::VMAP_MAGIC.
Referenced by VMAP::VMapManager2::existsMap().
| bool VMAP::StaticMapTree::getAreaInfo | ( | G3D::Vector3 & | pos, |
| uint32 & | flags, | ||
| int32 & | adtId, | ||
| int32 & | rootId, | ||
| int32 & | groupId ) const |
Definition at line 86 of file MapTree.cpp.
References VMAP::AreaInfo::adtId, VMAP::AreaInfoCallback::aInfo, VMAP::AreaInfo::flags, VMAP::AreaInfo::ground_Z, VMAP::AreaInfo::groupId, iTree, iTreeValues, VMAP::AreaInfo::result, and VMAP::AreaInfo::rootId.
| float VMAP::StaticMapTree::getHeight | ( | const G3D::Vector3 & | pPos, |
| float | maxSearchDist ) const |
Definition at line 214 of file MapTree.cpp.
References getIntersectionTime().
|
private |
If intersection is found within pMaxDist, sets pMaxDist to intersection distance and returns true. Else, pMaxDist is not modified and returns false;
Definition at line 132 of file MapTree.cpp.
References VMAP::MapRayCallback::didHit(), iTree, and iTreeValues.
Referenced by getHeight(), getObjectHitPos(), and isInLineOfSight().
| bool VMAP::StaticMapTree::GetLocationInfo | ( | const G3D::Vector3 & | pos, |
| LocationInfo & | info ) const |
Definition at line 102 of file MapTree.cpp.
References iTree, iTreeValues, and VMAP::LocationInfoCallback::result.
| void VMAP::StaticMapTree::getModelInstances | ( | ModelInstance *& | models, |
| uint32 & | count ) |
Definition at line 18 of file VMapExtensions.cpp.
References iNTreeValues, and iTreeValues.
| bool VMAP::StaticMapTree::getObjectHitPos | ( | const G3D::Vector3 & | pos1, |
| const G3D::Vector3 & | pos2, | ||
| G3D::Vector3 & | pResultHitPos, | ||
| float | pModifyDist ) const |
When moving from pos1 to pos2 check if we hit an object. Return true and the position if we hit one Return the hit pos or the original dest pos
Definition at line 169 of file MapTree.cpp.
References ASSERT, and getIntersectionTime().
|
static |
Definition at line 76 of file MapTree.cpp.
Referenced by CanLoadMap(), LoadMapTile(), and UnloadMapTile().
| bool VMAP::StaticMapTree::InitMap | ( | const std::string & | fname, |
| VMapManager2 * | vm ) |
Definition at line 266 of file MapTree.cpp.
References VMAP::VMapManager2::acquireModelInstance(), iBasePath, iIsTiled, iLoadedSpawns, iNTreeValues, iTree, iTreeValues, VMAP::ModelSpawn::name, VMAP::readChunk(), VMAP::ModelSpawn::readFromFile(), SF_LOG_DEBUG, VMAP_DEBUG_LOG, VMAP_ERROR_LOG, and VMAP::VMAP_MAGIC.
Referenced by VMAP::VMapManager2::_loadMap().
| bool VMAP::StaticMapTree::isInLineOfSight | ( | const G3D::Vector3 & | pos1, |
| const G3D::Vector3 & | pos2 ) const |
Definition at line 143 of file MapTree.cpp.
References ASSERT, and getIntersectionTime().
|
inline |
| bool VMAP::StaticMapTree::LoadMapTile | ( | uint32 | tileX, |
| uint32 | tileY, | ||
| VMapManager2 * | vm ) |
Definition at line 331 of file MapTree.cpp.
References VMAP::VMapManager2::acquireModelInstance(), getTileFileName(), iBasePath, VMAP::ModelSpawn::ID, iIsTiled, iLoadedSpawns, iLoadedTiles, iMapID, iNTreeValues, iTreeValues, VMAP::ModelSpawn::name, packTileID(), VMAP::readChunk(), VMAP::ModelSpawn::readFromFile(), SF_LOG_DEBUG, VMAP_ERROR_LOG, and VMAP::VMAP_MAGIC.
|
inline |
Definition at line 69 of file MapTree.h.
References iLoadedTiles.
|
privatedelete |
References StaticMapTree().
Definition at line 51 of file MapTree.h.
Referenced by MMAP::MapBuilder::buildMap(), VMAP::TileAssembler::convertWorld2(), MMAP::MapBuilder::discoverTiles(), LoadMapTile(), VMAP::TileAssembler::readMapSpawns(), and UnloadMapTile().
| void VMAP::StaticMapTree::UnloadMap | ( | VMapManager2 * | vm | ) |
Definition at line 317 of file MapTree.cpp.
References iLoadedSpawns, iLoadedTiles, iTreeValues, and VMAP::VMapManager2::releaseModelInstance().
| void VMAP::StaticMapTree::UnloadMapTile | ( | uint32 | tileX, |
| uint32 | tileY, | ||
| VMapManager2 * | vm ) |
Definition at line 412 of file MapTree.cpp.
References getTileFileName(), iBasePath, VMAP::ModelSpawn::ID, iLoadedSpawns, iLoadedTiles, iMapID, iTreeValues, VMAP::ModelSpawn::name, packTileID(), VMAP::readChunk(), VMAP::ModelSpawn::readFromFile(), VMAP::VMapManager2::releaseModelInstance(), VMAP_ERROR_LOG, and VMAP::VMAP_MAGIC.
Definition at line 52 of file MapTree.h.
Referenced by MMAP::MapBuilder::buildMap(), MMAP::MapBuilder::buildNavMesh(), and VMAP::TileAssembler::convertWorld2().
|
private |
Definition at line 44 of file MapTree.h.
Referenced by InitMap(), LoadMapTile(), StaticMapTree(), and UnloadMapTile().
|
private |
Definition at line 33 of file MapTree.h.
Referenced by InitMap(), isTiled(), LoadMapTile(), and StaticMapTree().
|
private |
Definition at line 43 of file MapTree.h.
Referenced by InitMap(), LoadMapTile(), UnloadMap(), and UnloadMapTile().
|
private |
Definition at line 41 of file MapTree.h.
Referenced by LoadMapTile(), numLoadedTiles(), UnloadMap(), and UnloadMapTile().
|
private |
Definition at line 32 of file MapTree.h.
Referenced by LoadMapTile(), StaticMapTree(), and UnloadMapTile().
|
private |
Definition at line 36 of file MapTree.h.
Referenced by getModelInstances(), InitMap(), LoadMapTile(), and StaticMapTree().
|
private |
Definition at line 34 of file MapTree.h.
Referenced by getAreaInfo(), getIntersectionTime(), GetLocationInfo(), and InitMap().
|
private |
Definition at line 35 of file MapTree.h.
Referenced by getAreaInfo(), getIntersectionTime(), GetLocationInfo(), getModelInstances(), InitMap(), LoadMapTile(), StaticMapTree(), UnloadMap(), UnloadMapTile(), and ~StaticMapTree().