TrinityCore
Loading...
Searching...
No Matches
MMapDefines.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef MMapDefines_h__
19#define MMapDefines_h__
20
21#include "Define.h"
22#include <DetourNavMesh.h>
23
24inline uint32 constexpr MMAP_MAGIC = 0x4d4d4150; // 'MMAP'
25inline uint32 constexpr MMAP_VERSION = 16;
26
34
35static_assert(sizeof(MmapNavMeshHeader) == 40);
36
38{
40 uint32 dtVersion = DT_NAVMESH_VERSION;
43 char usesLiquids = true;
44 char padding[3] = { };
45};
46
47// All padding fields must be handled and initialized to ensure mmaps_generator will produce binary-identical *.mmtile files
48static_assert(sizeof(MmapTileHeader) == 20, "MmapTileHeader size is not correct, adjust the padding field size");
49static_assert(sizeof(MmapTileHeader) == sizeof(MmapTileHeader::mmapMagic) +
52 sizeof(MmapTileHeader::size) +
54 sizeof(MmapTileHeader::padding), "MmapTileHeader has uninitialized padding fields");
55
57{
59 // areas 1-60 will be used for destructible areas (currently skipped in vmaps, WMO with flag 1)
60 // ground is the highest value to make recast choose ground over water when merging surfaces very close to each other (shallow water would be walkable)
64 NAV_AREA_MAGMA_SLIME = 8, // don't need to differentiate between them
67 NAV_AREA_ALL_MASK = 0x3F // max allowed value
68};
69
78
83
96
97#endif // MMapDefines_h__
uint8_t uint8
Definition Define.h:156
uint16_t uint16
Definition Define.h:155
uint32_t uint32
Definition Define.h:154
NavArea
Definition MMapDefines.h:57
@ NAV_AREA_MIN_VALUE
Definition MMapDefines.h:66
@ NAV_AREA_ALL_MASK
Definition MMapDefines.h:67
@ NAV_AREA_GROUND_STEEP
Definition MMapDefines.h:62
@ NAV_AREA_GROUND
Definition MMapDefines.h:61
@ NAV_AREA_MAGMA_SLIME
Definition MMapDefines.h:64
@ NAV_AREA_EMPTY
Definition MMapDefines.h:58
@ NAV_AREA_MAX_VALUE
Definition MMapDefines.h:65
@ NAV_AREA_WATER
Definition MMapDefines.h:63
uint32 constexpr MMAP_VERSION
Definition MMapDefines.h:25
OffMeshConnectionFlag
Definition MMapDefines.h:80
@ OFFMESH_CONNECTION_FLAG_BIDIRECTIONAL
Definition MMapDefines.h:81
uint32 constexpr MMAP_MAGIC
Definition MMapDefines.h:24
NavTerrainFlag
Definition MMapDefines.h:71
@ NAV_GROUND_STEEP
Definition MMapDefines.h:74
@ NAV_EMPTY
Definition MMapDefines.h:72
@ NAV_GROUND
Definition MMapDefines.h:73
@ NAV_WATER
Definition MMapDefines.h:75
@ NAV_MAGMA_SLIME
Definition MMapDefines.h:76
dtNavMeshParams params
Definition MMapDefines.h:31
uint32 offmeshConnectionCount
Definition MMapDefines.h:32
uint32 mmapVersion
Definition MMapDefines.h:41
char padding[3]
Definition MMapDefines.h:44
float From[3]
Definition MMapDefines.h:89
OffMeshConnectionFlag ConnectionFlags
Definition MMapDefines.h:92
uint32 MapId
Definition MMapDefines.h:86
uint32 TileX
Definition MMapDefines.h:87
NavTerrainFlag Flags
Definition MMapDefines.h:94
uint32 TileY
Definition MMapDefines.h:88
float To[3]
Definition MMapDefines.h:90