Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
wmo.h
Go to the documentation of this file.
1
/*
2
* This file is part of Project SkyFire https://www.projectskyfire.org.
3
* See LICENSE.md file for Copyright information
4
*/
5
6
#ifndef WMO_H
7
#define WMO_H
8
#define TILESIZE (533.33333f)
9
#define CHUNKSIZE ((TILESIZE) / 16.0f)
10
11
#include <string>
12
#include <set>
13
#include "
vec3d.h
"
14
#include "
mpqfile.h
"
15
16
// MOPY flags
17
#define WMO_MATERIAL_NOCAMCOLLIDE 0x01
18
#define WMO_MATERIAL_DETAIL 0x02
19
#define WMO_MATERIAL_NO_COLLISION 0x04
20
#define WMO_MATERIAL_HINT 0x08
21
#define WMO_MATERIAL_RENDER 0x10
22
#define WMO_MATERIAL_COLLIDE_HIT 0x20
23
#define WMO_MATERIAL_WALL_SURFACE 0x40
24
25
class
WMOInstance
;
26
class
WMOManager;
27
class
MPQFile
;
28
29
/* for whatever reason a certain company just can't stick to one coordinate system... */
30
static
inline
Vec3D
fixCoords
(
const
Vec3D
&v){
return
Vec3D
(v.
z
, v.
x
, v.
y
); }
31
32
class
WMORoot
33
{
34
private
:
35
std::string
filename
;
36
public
:
37
unsigned
int
col
;
38
uint32
nTextures
,
nGroups
,
nP
,
nLights
,
nModels
,
nDoodads
,
nDoodadSets
,
RootWMOID
,
liquidType
;
39
float
bbcorn1
[3];
40
float
bbcorn2
[3];
41
42
WMORoot
(std::string&
filename
);
43
~WMORoot
();
44
45
bool
open
();
46
bool
ConvertToVMAPRootWmo
(FILE* output);
47
};
48
49
struct
WMOLiquidHeader
50
{
51
int
xverts
,
yverts
,
xtiles
,
ytiles
;
52
float
pos_x
;
53
float
pos_y
;
54
float
pos_z
;
55
short
type
;
56
};
57
58
struct
WMOLiquidVert
59
{
60
uint16
unk1
;
61
uint16
unk2
;
62
float
height
;
63
};
64
65
class
WMOGroup
66
{
67
private
:
68
std::string
filename
;
69
public
:
70
// MOGP
71
72
char
*
MOPY
;
73
uint16
*
MOVI
;
74
uint16
*
MoviEx
;
75
float
*
MOVT
;
76
uint16
*
MOBA
;
77
int
*
MobaEx
;
78
WMOLiquidHeader
*
hlq
;
79
WMOLiquidVert
*
LiquEx
;
80
char
*
LiquBytes
;
81
int
groupName
,
descGroupName
;
82
int
mogpFlags
;
83
float
bbcorn1
[3] = { };
84
float
bbcorn2
[3] = { };
85
uint16
moprIdx
;
86
uint16
moprNItems
;
87
uint16
nBatchA
;
88
uint16
nBatchB
;
89
uint32
nBatchC
,
fogIdx
,
liquidType
,
groupWMOID
;
90
91
int
mopy_size
,
moba_size
;
92
int
LiquEx_size
;
93
unsigned
int
nVertices
;
// number when loaded
94
int
nTriangles
;
// number when loaded
95
uint32
liquflags
;
96
97
WMOGroup
(std::string
const
&
filename
);
98
~WMOGroup
();
99
100
bool
open
();
101
int
ConvertToVMAPGroupWmo
(FILE* output,
WMORoot
* rootWMO,
bool
preciseVectorData
);
102
};
103
104
class
WMOInstance
105
{
106
static
std::set<int>
ids
;
107
public
:
108
std::string
MapName
;
109
int
currx
;
110
int
curry
;
111
WMOGroup
*
wmo
;
112
int
doodadset
;
113
Vec3D
pos
;
114
Vec3D
pos2
,
pos3
,
rot
;
115
uint32
indx
,
id
,
d2
,
d3
;
116
117
WMOInstance
(
MPQFile
&f ,
char
const
* WmoInstName,
uint32
mapID,
uint32
tileX,
uint32
tileY, FILE* pDirfile);
118
119
static
void
reset
();
120
};
121
122
#endif
uint32
std::uint32_t uint32
Definition
Define.h:77
uint16
std::uint16_t uint16
Definition
Define.h:78
MPQFile
Definition
mpqfile.h:51
Vec3D
Definition
vec3d.h:13
Vec3D::x
float x
Definition
vec3d.h:15
Vec3D::y
float y
Definition
vec3d.h:15
Vec3D::z
float z
Definition
vec3d.h:15
WMOGroup
Definition
wmo.h:66
WMOGroup::nBatchC
uint32 nBatchC
Definition
wmo.h:89
WMOGroup::MOVT
float * MOVT
Definition
wmo.h:75
WMOGroup::moba_size
int moba_size
Definition
wmo.h:91
WMOGroup::WMOGroup
WMOGroup(std::string const &filename)
Definition
wmo.cpp:132
WMOGroup::liquidType
uint32 liquidType
Definition
wmo.h:89
WMOGroup::MOVI
uint16 * MOVI
Definition
wmo.h:73
WMOGroup::nBatchA
uint16 nBatchA
Definition
wmo.h:87
WMOGroup::fogIdx
uint32 fogIdx
Definition
wmo.h:89
WMOGroup::moprIdx
uint16 moprIdx
Definition
wmo.h:85
WMOGroup::filename
std::string filename
Definition
wmo.h:68
WMOGroup::groupName
int groupName
Definition
wmo.h:81
WMOGroup::descGroupName
int descGroupName
Definition
wmo.h:81
WMOGroup::LiquEx_size
int LiquEx_size
Definition
wmo.h:92
WMOGroup::groupWMOID
uint32 groupWMOID
Definition
wmo.h:89
WMOGroup::nBatchB
uint16 nBatchB
Definition
wmo.h:88
WMOGroup::bbcorn2
float bbcorn2[3]
Definition
wmo.h:84
WMOGroup::mogpFlags
int mogpFlags
Definition
wmo.h:82
WMOGroup::ConvertToVMAPGroupWmo
int ConvertToVMAPGroupWmo(FILE *output, WMORoot *rootWMO, bool preciseVectorData)
Definition
wmo.cpp:238
WMOGroup::nVertices
unsigned int nVertices
Definition
wmo.h:93
WMOGroup::LiquEx
WMOLiquidVert * LiquEx
Definition
wmo.h:79
WMOGroup::MOBA
uint16 * MOBA
Definition
wmo.h:76
WMOGroup::liquflags
uint32 liquflags
Definition
wmo.h:95
WMOGroup::MOPY
char * MOPY
Definition
wmo.h:72
WMOGroup::nTriangles
int nTriangles
Definition
wmo.h:94
WMOGroup::open
bool open()
Definition
wmo.cpp:143
WMOGroup::LiquBytes
char * LiquBytes
Definition
wmo.h:80
WMOGroup::mopy_size
int mopy_size
Definition
wmo.h:91
WMOGroup::~WMOGroup
~WMOGroup()
Definition
wmo.cpp:469
WMOGroup::MobaEx
int * MobaEx
Definition
wmo.h:77
WMOGroup::hlq
WMOLiquidHeader * hlq
Definition
wmo.h:78
WMOGroup::MoviEx
uint16 * MoviEx
Definition
wmo.h:74
WMOGroup::moprNItems
uint16 moprNItems
Definition
wmo.h:86
WMOGroup::bbcorn1
float bbcorn1[3]
Definition
wmo.h:83
WMOInstance
Definition
wmo.h:105
WMOInstance::d2
uint32 d2
Definition
wmo.h:115
WMOInstance::rot
Vec3D rot
Definition
wmo.h:114
WMOInstance::indx
uint32 indx
Definition
wmo.h:115
WMOInstance::doodadset
int doodadset
Definition
wmo.h:112
WMOInstance::ids
static std::set< int > ids
Definition
wmo.h:106
WMOInstance::pos
Vec3D pos
Definition
wmo.h:113
WMOInstance::wmo
WMOGroup * wmo
Definition
wmo.h:111
WMOInstance::id
uint32 id
Definition
wmo.h:115
WMOInstance::curry
int curry
Definition
wmo.h:110
WMOInstance::pos3
Vec3D pos3
Definition
wmo.h:114
WMOInstance::d3
uint32 d3
Definition
wmo.h:115
WMOInstance::MapName
std::string MapName
Definition
wmo.h:108
WMOInstance::pos2
Vec3D pos2
Definition
wmo.h:114
WMOInstance::WMOInstance
WMOInstance(MPQFile &f, char const *WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile)
Definition
wmo.cpp:480
WMOInstance::reset
static void reset()
WMOInstance::currx
int currx
Definition
wmo.h:109
WMORoot
Definition
wmo.h:33
WMORoot::liquidType
uint32 liquidType
Definition
wmo.h:38
WMORoot::bbcorn1
float bbcorn1[3]
Definition
wmo.h:39
WMORoot::nDoodadSets
uint32 nDoodadSets
Definition
wmo.h:38
WMORoot::nLights
uint32 nLights
Definition
wmo.h:38
WMORoot::nModels
uint32 nModels
Definition
wmo.h:38
WMORoot::open
bool open()
Definition
wmo.cpp:31
WMORoot::nDoodads
uint32 nDoodads
Definition
wmo.h:38
WMORoot::~WMORoot
~WMORoot()
Definition
wmo.cpp:128
WMORoot::bbcorn2
float bbcorn2[3]
Definition
wmo.h:40
WMORoot::col
unsigned int col
Definition
wmo.h:37
WMORoot::nGroups
uint32 nGroups
Definition
wmo.h:38
WMORoot::filename
std::string filename
Definition
wmo.h:35
WMORoot::ConvertToVMAPRootWmo
bool ConvertToVMAPRootWmo(FILE *output)
Definition
wmo.cpp:116
WMORoot::nP
uint32 nP
Definition
wmo.h:38
WMORoot::nTextures
uint32 nTextures
Definition
wmo.h:38
WMORoot::RootWMOID
uint32 RootWMOID
Definition
wmo.h:38
WMORoot::WMORoot
WMORoot(std::string &filename)
Definition
wmo.cpp:21
mpqfile.h
WMOLiquidHeader
Definition
wmo.h:50
WMOLiquidHeader::pos_z
float pos_z
Definition
wmo.h:54
WMOLiquidHeader::pos_y
float pos_y
Definition
wmo.h:53
WMOLiquidHeader::type
short type
Definition
wmo.h:55
WMOLiquidHeader::ytiles
int ytiles
Definition
wmo.h:51
WMOLiquidHeader::xverts
int xverts
Definition
wmo.h:51
WMOLiquidHeader::yverts
int yverts
Definition
wmo.h:51
WMOLiquidHeader::pos_x
float pos_x
Definition
wmo.h:52
WMOLiquidHeader::xtiles
int xtiles
Definition
wmo.h:51
WMOLiquidVert
Definition
wmo.h:59
WMOLiquidVert::unk2
uint16 unk2
Definition
wmo.h:61
WMOLiquidVert::unk1
uint16 unk1
Definition
wmo.h:60
WMOLiquidVert::height
float height
Definition
wmo.h:62
vec3d.h
preciseVectorData
bool preciseVectorData
Definition
vmapexport.cpp:110
fixCoords
static Vec3D fixCoords(const Vec3D &v)
Definition
wmo.h:30
src
tools
vmap4_extractor
wmo.h
Generated on
for Project SkyFire Core by
1.17.0