1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 14:37:44 +00:00
sapphire/src/world/Navi/NaviProvider.h

52 lines
965 B
C
Raw Normal View History

2019-01-20 16:10:48 +01:00
#ifndef _NAVIPROVIDER_H_
#define _NAVIPROVIDER_H_
#include <Common.h>
#include "ForwardsZone.h"
#include <recastnavigation/Detour/Include/DetourNavMesh.h>
#include <recastnavigation/Detour/Include/DetourNavMeshQuery.h>
namespace Sapphire
{
class NaviProvider
{
static const int NAVMESHSET_MAGIC = 'M' << 24 | 'S' << 16 | 'E' << 8 | 'T'; //'MSET';
static const int NAVMESHSET_VERSION = 1;
struct NavMeshSetHeader
{
int magic;
int version;
int numTiles;
dtNavMeshParams params;
};
struct NavMeshTileHeader
{
dtTileRef tileRef;
int dataSize;
};
public:
NaviProvider( const ZonePtr pZone, Sapphire::FrameworkPtr pFw );
void init();
void LoadMesh( std::string path );
void InitQuery();
bool HasNaviMesh() const;
protected:
FrameworkPtr m_pFw;
ZonePtr m_pZone;
dtNavMesh* m_naviMesh;
dtNavMeshQuery* m_naviMeshQuery;
};
}
#endif