2 * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef _IVMAPMANAGER_H
20 #define _IVMAPMANAGER_H
24 //===========================================================
27 This is the minimum interface to the VMapMamager.
35 VMAP_LOAD_RESULT_ERROR
,
37 VMAP_LOAD_RESULT_IGNORED
,
40 #define VMAP_INVALID_HEIGHT -100000.0f // for check
41 #define VMAP_INVALID_HEIGHT_VALUE -200000.0f // real assigned value in unknown height case
43 //===========================================================
47 bool iEnableLineOfSightCalc
;
48 bool iEnableHeightCalc
;
51 IVMapManager() : iEnableLineOfSightCalc(true), iEnableHeightCalc(true) {}
53 virtual ~IVMapManager(void) {}
55 virtual int loadMap(const char* pBasePath
, unsigned int pMapId
, int x
, int y
) = 0;
57 virtual bool existsMap(const char* pBasePath
, unsigned int pMapId
, int x
, int y
) = 0;
59 virtual void unloadMap(unsigned int pMapId
, int x
, int y
) = 0;
60 virtual void unloadMap(unsigned int pMapId
) = 0;
62 virtual bool isInLineOfSight(unsigned int pMapId
, float x1
, float y1
, float z1
, float x2
, float y2
, float z2
) = 0;
63 virtual float getHeight(unsigned int pMapId
, float x
, float y
, float z
) = 0;
65 test if we hit an object. return true if we hit one. rx,ry,rz will hold the hit position or the dest position, if no intersection was found
66 return a position, that is pReduceDist closer to the origin
68 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;
72 virtual bool processCommand(char *pCommand
)= 0;
75 Enable/disable LOS calculation
76 It is enabled by default. If it is enabled in mid game the maps have to loaded manualy
78 void setEnableLineOfSightCalc(bool pVal
) { iEnableLineOfSightCalc
= pVal
; }
80 Enable/disable model height calculation
81 It is enabled by default. If it is enabled in mid game the maps have to loaded manualy
83 void setEnableHeightCalc(bool pVal
) { iEnableHeightCalc
= pVal
; }
85 bool isLineOfSightCalcEnabled() const { return(iEnableLineOfSightCalc
); }
86 bool isHeightCalcEnabled() const { return(iEnableHeightCalc
); }
87 bool isMapLoadingEnabled() const { return(iEnableLineOfSightCalc
|| iEnableHeightCalc
); }
89 virtual std::string
getDirFileName(unsigned int pMapId
, int x
, int y
) const =0;
91 Block maps from being used.
92 parameter: String of map ids. Delimiter = ","
95 virtual void preventMapsFromBeingUsed(const char* pMapIdString
) =0;