Files
TCPlayerbotCore/src/server/collision/Management/IVMapManager.h
T

107 lines
4.3 KiB
C++
Raw Normal View History

/*
2010-06-05 00:59:25 +02:00
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
2008-10-02 16:23:55 -05:00
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
2010-06-05 00:59:25 +02:00
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2008-10-02 16:23:55 -05:00
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
2010-06-05 00:59:25 +02:00
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2008-10-02 16:23:55 -05:00
*/
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
#ifndef _IVMAPMANAGER_H
#define _IVMAPMANAGER_H
2009-10-17 15:51:44 -07:00
2010-06-07 23:40:17 +02:00
#include <string>
#include "Define.h"
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
//===========================================================
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
/**
This is the minimum interface to the VMapMamager.
*/
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
namespace VMAP
{
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
enum VMAP_LOAD_RESULT
{
VMAP_LOAD_RESULT_ERROR,
VMAP_LOAD_RESULT_OK,
VMAP_LOAD_RESULT_IGNORED,
};
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
#define VMAP_INVALID_HEIGHT -100000.0f // for check
#define VMAP_INVALID_HEIGHT_VALUE -200000.0f // real assigned value in unknown height case
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
//===========================================================
class IVMapManager
{
private:
bool iEnableLineOfSightCalc;
bool iEnableHeightCalc;
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
public:
IVMapManager() : iEnableLineOfSightCalc(true), iEnableHeightCalc(true) {}
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
virtual ~IVMapManager(void) {}
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
virtual int loadMap(const char* pBasePath, unsigned int pMapId, int x, int y) = 0;
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
virtual bool existsMap(const char* pBasePath, unsigned int pMapId, int x, int y) = 0;
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
virtual void unloadMap(unsigned int pMapId, int x, int y) = 0;
virtual void unloadMap(unsigned int pMapId) = 0;
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
virtual bool isInLineOfSight(unsigned int pMapId, float x1, float y1, float z1, float x2, float y2, float z2) = 0;
2010-06-05 00:59:25 +02:00
virtual float getHeight(unsigned int pMapId, float x, float y, float z) = 0;
2008-10-02 16:23:55 -05:00
/**
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
return a position, that is pReduceDist closer to the origin
*/
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;
/**
send debug commands
*/
virtual bool processCommand(char *pCommand)= 0;
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
/**
Enable/disable LOS calculation
It is enabled by default. If it is enabled in mid game the maps have to loaded manualy
*/
void setEnableLineOfSightCalc(bool pVal) { iEnableLineOfSightCalc = pVal; }
/**
Enable/disable model height calculation
It is enabled by default. If it is enabled in mid game the maps have to loaded manualy
*/
void setEnableHeightCalc(bool pVal) { iEnableHeightCalc = pVal; }
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
bool isLineOfSightCalcEnabled() const { return(iEnableLineOfSightCalc); }
bool isHeightCalcEnabled() const { return(iEnableHeightCalc); }
bool isMapLoadingEnabled() const { return(iEnableLineOfSightCalc || iEnableHeightCalc ); }
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
virtual std::string getDirFileName(unsigned int pMapId, int x, int y) const =0;
/**
Block maps from being used.
parameter: String of map ids. Delimiter = ","
e.g.: "0,1,530"
*/
virtual void preventMapsFromBeingUsed(const char* pMapIdString) =0;
2010-06-05 00:59:25 +02:00
/**
Query world model area info.
\param z gets adjusted to the ground height for which this are info is valid
*/
virtual bool getAreaInfo(unsigned int pMapId, float x, float y, float &z, uint32 &flags, int32 &adtId, int32 &rootId, int32 &groupId) const=0;
virtual bool GetLiquidLevel(uint32 pMapId, float x, float y, float z, uint8 ReqLiquidType, float &level, float &floor, uint32 &type) const=0;
2008-10-02 16:23:55 -05:00
};
2009-10-17 15:51:44 -07:00
2008-10-02 16:23:55 -05:00
}
#endif