mirror of
https://github.com/mangosfour/server.git
synced 2025-12-30 01:37:03 +00:00
[Tools] Extraction Project Sync
This commit is contained in:
parent
94916ef635
commit
95f98ca7a5
23 changed files with 1288 additions and 693 deletions
|
|
@ -2,7 +2,7 @@
|
|||
* MaNGOS is a full featured server for World of Warcraft, supporting
|
||||
* the following clients: 1.12.x, 2.4.3, 3.3.5a, 4.3.4a and 5.4.8
|
||||
*
|
||||
* Copyright (C) 2005-2015 MaNGOS project <http://getmangos.eu>
|
||||
* Copyright (C) 2005-2016 MaNGOS project <http://getmangos.eu>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -22,21 +22,22 @@
|
|||
* and lore are copyrighted by Blizzard Entertainment, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _MAP_BUILDER_H
|
||||
#define _MAP_BUILDER_H
|
||||
#ifndef MANGOS_H_MAP_BUILDER
|
||||
#define MANGOS_H_MAP_BUILDER
|
||||
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <map>
|
||||
|
||||
#include <Recast.h>
|
||||
#include <DetourNavMesh.h>
|
||||
|
||||
#include "TerrainBuilder.h"
|
||||
#include "IntermediateValues.h"
|
||||
|
||||
#include "IVMapManager.h"
|
||||
#include "WorldModel.h"
|
||||
|
||||
#include "Recast.h"
|
||||
#include "DetourNavMesh.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace VMAP;
|
||||
|
|
@ -44,10 +45,26 @@ using namespace VMAP;
|
|||
|
||||
namespace MMAP
|
||||
{
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
*/
|
||||
typedef map<uint32, set<uint32>*> TileList;
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
*/
|
||||
struct Tile
|
||||
{
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
*/
|
||||
Tile() : chf(NULL), solid(NULL), cset(NULL), pmesh(NULL), dmesh(NULL) {}
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
*/
|
||||
~Tile()
|
||||
{
|
||||
rcFreeCompactHeightfield(chf);
|
||||
|
|
@ -56,16 +73,32 @@ namespace MMAP
|
|||
rcFreePolyMesh(pmesh);
|
||||
rcFreePolyMeshDetail(dmesh);
|
||||
}
|
||||
rcCompactHeightfield* chf;
|
||||
rcHeightfield* solid;
|
||||
rcContourSet* cset;
|
||||
rcPolyMesh* pmesh;
|
||||
rcPolyMeshDetail* dmesh;
|
||||
rcCompactHeightfield* chf; /**< TODO */
|
||||
rcHeightfield* solid; /**< TODO */
|
||||
rcContourSet* cset; /**< TODO */
|
||||
rcPolyMesh* pmesh; /**< TODO */
|
||||
rcPolyMeshDetail* dmesh; /**< TODO */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
*/
|
||||
class MapBuilder
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param maxWalkableAngle
|
||||
* @param skipLiquid
|
||||
* @param skipContinents
|
||||
* @param skipJunkMaps
|
||||
* @param skipBattlegrounds
|
||||
* @param debugOutput
|
||||
* @param bigBaseUnit
|
||||
* @param offMeshFilePath
|
||||
*/
|
||||
MapBuilder(float maxWalkableAngle = 60.f,
|
||||
bool skipLiquid = false,
|
||||
bool skipContinents = false,
|
||||
|
|
@ -75,27 +108,77 @@ namespace MMAP
|
|||
bool bigBaseUnit = false,
|
||||
const char* offMeshFilePath = NULL);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
*/
|
||||
~MapBuilder();
|
||||
|
||||
// builds all mmap tiles for the specified map id (ignores skip settings)
|
||||
/**
|
||||
* @brief builds all mmap tiles for the specified map id (ignores skip settings)
|
||||
*
|
||||
* @param mapID
|
||||
*/
|
||||
void buildMap(uint32 mapID);
|
||||
|
||||
// builds an mmap tile for the specified map and its mesh
|
||||
/**
|
||||
* @brief builds an mmap tile for the specified map and its mesh
|
||||
*
|
||||
* @param mapID
|
||||
* @param tileX
|
||||
* @param tileY
|
||||
*/
|
||||
void buildSingleTile(uint32 mapID, uint32 tileX, uint32 tileY);
|
||||
|
||||
// builds list of maps, then builds all of mmap tiles (based on the skip settings)
|
||||
/**
|
||||
* @brief builds list of maps, then builds all of mmap tiles (based on the skip settings)
|
||||
*
|
||||
*/
|
||||
void buildAllMaps();
|
||||
|
||||
private:
|
||||
// detect maps and tiles
|
||||
void discoverTiles();
|
||||
set<uint32>* getTileList(uint32 mapID);
|
||||
|
||||
void buildNavMesh(uint32 mapID, dtNavMesh*& navMesh);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param mapID
|
||||
* @param tileX
|
||||
* @param tileY
|
||||
* @param navMesh
|
||||
*/
|
||||
void buildTile(uint32 mapID, uint32 tileX, uint32 tileY, dtNavMesh* navMesh);
|
||||
|
||||
// move map building
|
||||
private:
|
||||
/**
|
||||
* @brief detect maps and tiles
|
||||
*
|
||||
*/
|
||||
void discoverTiles();
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param mapID
|
||||
* @return set<uint32>
|
||||
*/
|
||||
set<uint32>* getTileList(uint32 mapID);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param mapID
|
||||
* @param navMesh
|
||||
*/
|
||||
void buildNavMesh(uint32 mapID, dtNavMesh*& navMesh);
|
||||
|
||||
/**
|
||||
* @brief move map building
|
||||
*
|
||||
* @param mapID
|
||||
* @param tileX
|
||||
* @param tileY
|
||||
* @param meshData
|
||||
* @param bmin[]
|
||||
* @param bmax[]
|
||||
* @param navMesh
|
||||
*/
|
||||
void buildMoveMapTile(uint32 mapID,
|
||||
uint32 tileX,
|
||||
uint32 tileY,
|
||||
|
|
@ -104,30 +187,57 @@ namespace MMAP
|
|||
float bmax[3],
|
||||
dtNavMesh* navMesh);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param tileX
|
||||
* @param tileY
|
||||
* @param verts
|
||||
* @param vertCount
|
||||
* @param bmin
|
||||
* @param bmax
|
||||
*/
|
||||
void getTileBounds(uint32 tileX, uint32 tileY,
|
||||
float* verts, int vertCount,
|
||||
float* bmin, float* bmax);
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param mapID
|
||||
* @param minX
|
||||
* @param minY
|
||||
* @param maxX
|
||||
* @param maxY
|
||||
*/
|
||||
void getGridBounds(uint32 mapID, uint32& minX, uint32& minY, uint32& maxX, uint32& maxY);
|
||||
|
||||
bool shouldSkipMap(uint32 mapID);
|
||||
bool isTransportMap(uint32 mapID);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param mapID
|
||||
* @param tileX
|
||||
* @param tileY
|
||||
* @return bool
|
||||
*/
|
||||
bool shouldSkipTile(uint32 mapID, uint32 tileX, uint32 tileY);
|
||||
|
||||
TerrainBuilder* m_terrainBuilder;
|
||||
TileList m_tiles;
|
||||
TerrainBuilder* m_terrainBuilder; /**< TODO */
|
||||
TileList m_tiles; /**< TODO */
|
||||
|
||||
bool m_debugOutput;
|
||||
bool m_debugOutput; /**< TODO */
|
||||
|
||||
const char* m_offMeshFilePath;
|
||||
bool m_skipContinents;
|
||||
bool m_skipJunkMaps;
|
||||
bool m_skipBattlegrounds;
|
||||
const char* m_offMeshFilePath; /**< TODO */
|
||||
bool m_skipContinents; /**< TODO */
|
||||
bool m_skipJunkMaps; /**< TODO */
|
||||
bool m_skipBattlegrounds; /**< TODO */
|
||||
|
||||
float m_maxWalkableAngle;
|
||||
bool m_bigBaseUnit;
|
||||
float m_maxWalkableAngle; /**< TODO */
|
||||
bool m_bigBaseUnit; /**< TODO */
|
||||
|
||||
// build performance - not really used for now
|
||||
rcContext* m_rcContext;
|
||||
rcContext* m_rcContext; /**< build performance - not really used for now */
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue