TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
IVMapManager.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef _IVMAPMANAGER_H
20 #define _IVMAPMANAGER_H
21 
22 #include <string>
23 #include "Define.h"
24 
25 //===========================================================
26 
31 namespace VMAP
32 {
33 
35  {
39  };
40 
41  #define VMAP_INVALID_HEIGHT -100000.0f // for check
42  #define VMAP_INVALID_HEIGHT_VALUE -200000.0f // real assigned value in unknown height case
43 
44  //===========================================================
46  {
47  private:
50 
51  public:
52  IVMapManager() : iEnableLineOfSightCalc(true), iEnableHeightCalc(true) { }
53 
54  virtual ~IVMapManager(void) { }
55 
56  virtual int loadMap(const char* pBasePath, unsigned int pMapId, int x, int y) = 0;
57 
58  virtual bool existsMap(const char* pBasePath, unsigned int pMapId, int x, int y) = 0;
59 
60  virtual void unloadMap(unsigned int pMapId, int x, int y) = 0;
61  virtual void unloadMap(unsigned int pMapId) = 0;
62 
63  virtual bool isInLineOfSight(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2) = 0;
64  virtual float getHeight(unsigned int pMapId, float x, float y, float z, float maxSearchDist) = 0;
69  virtual bool getObjectHitPos(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2, float& rx, float &ry, float& rz, float pModifyDist) = 0;
73  virtual bool processCommand(char *pCommand)= 0;
74 
79  void setEnableLineOfSightCalc(bool pVal) { iEnableLineOfSightCalc = pVal; }
84  void setEnableHeightCalc(bool pVal) { iEnableHeightCalc = pVal; }
85 
86  bool isLineOfSightCalcEnabled() const { return(iEnableLineOfSightCalc); }
87  bool isHeightCalcEnabled() const { return(iEnableHeightCalc); }
88  bool isMapLoadingEnabled() const { return(iEnableLineOfSightCalc || iEnableHeightCalc ); }
89 
90  virtual std::string getDirFileName(unsigned int pMapId, int x, int y) const =0;
95  virtual bool getAreaInfo(unsigned int pMapId, float x, float y, float &z, uint32 &flags, int32 &adtId, int32 &rootId, int32 &groupId) const=0;
96  virtual bool GetLiquidLevel(uint32 pMapId, float x, float y, float z, uint8 ReqLiquidType, float &level, float &floor, uint32 &type) const=0;
97  };
98 
99 }
100 #endif
virtual ~IVMapManager(void)
Definition: IVMapManager.h:54
void setEnableLineOfSightCalc(bool pVal)
Definition: IVMapManager.h:79
IVMapManager()
Definition: IVMapManager.h:52
bool iEnableHeightCalc
Definition: IVMapManager.h:49
static Vector3int16 floor(const Vector3 &v)
Definition: IVMapManager.h:38
bool iEnableLineOfSightCalc
Definition: IVMapManager.h:48
Definition: IVMapManager.h:31
Definition: IVMapManager.h:36
VMAP_LOAD_RESULT
Definition: IVMapManager.h:34
#define true
Definition: CascPort.h:17
bool isLineOfSightCalcEnabled() const
Definition: IVMapManager.h:86
G3D::int16 z
Definition: Vector3int16.h:46
int32_t int32
Definition: Define.h:146
uint32_t uint32
Definition: Define.h:150
G3D::int16 y
Definition: Vector2int16.h:38
Definition: IVMapManager.h:45
#define TC_COMMON_API
Definition: Define.h:116
bool isHeightCalcEnabled() const
Definition: IVMapManager.h:87
void setEnableHeightCalc(bool pVal)
Definition: IVMapManager.h:84
bool isMapLoadingEnabled() const
Definition: IVMapManager.h:88
Definition: IVMapManager.h:37
uint8_t uint8
Definition: Define.h:152
uint8 flags
Definition: DisableMgr.cpp:44
G3D::int16 x
Definition: Vector2int16.h:37
static unsigned short getHeight(const float fx, const float fy, const float fz, const float, const float ics, const float ch, const rcHeightPatch &hp)
Definition: RecastMeshDetail.cpp:203