Project SkyFire Core
SkyFire 5.4.8 server core API documentation
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
25class WMOInstance;
26class WMOManager;
27class MPQFile;
28
29/* for whatever reason a certain company just can't stick to one coordinate system... */
30static inline Vec3D fixCoords(const Vec3D &v){ return Vec3D(v.z, v.x, v.y); }
31
33{
34private:
35 std::string filename;
36public:
37 unsigned int col;
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
50{
52 float pos_x;
53 float pos_y;
54 float pos_z;
55 short type;
56};
57
64
66{
67private:
68 std::string filename;
69public:
70 // MOGP
71
72 char* MOPY;
75 float* MOVT;
77 int* MobaEx;
80 char* LiquBytes;
83 float bbcorn1[3] = { };
84 float bbcorn2[3] = { };
90
93 unsigned int nVertices; // number when loaded
94 int nTriangles; // number when loaded
96
97 WMOGroup(std::string const& filename);
98 ~WMOGroup();
99
100 bool open();
101 int ConvertToVMAPGroupWmo(FILE* output, WMORoot* rootWMO, bool preciseVectorData);
102};
103
105{
106 static std::set<int> ids;
107public:
108 std::string MapName;
109 int currx;
110 int curry;
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
std::uint32_t uint32
Definition Define.h:77
std::uint16_t uint16
Definition Define.h:78
Definition vec3d.h:13
float x
Definition vec3d.h:15
float y
Definition vec3d.h:15
float z
Definition vec3d.h:15
Definition wmo.h:66
uint32 nBatchC
Definition wmo.h:89
float * MOVT
Definition wmo.h:75
int moba_size
Definition wmo.h:91
WMOGroup(std::string const &filename)
Definition wmo.cpp:132
uint32 liquidType
Definition wmo.h:89
uint16 * MOVI
Definition wmo.h:73
uint16 nBatchA
Definition wmo.h:87
uint32 fogIdx
Definition wmo.h:89
uint16 moprIdx
Definition wmo.h:85
std::string filename
Definition wmo.h:68
int groupName
Definition wmo.h:81
int descGroupName
Definition wmo.h:81
int LiquEx_size
Definition wmo.h:92
uint32 groupWMOID
Definition wmo.h:89
uint16 nBatchB
Definition wmo.h:88
float bbcorn2[3]
Definition wmo.h:84
int mogpFlags
Definition wmo.h:82
int ConvertToVMAPGroupWmo(FILE *output, WMORoot *rootWMO, bool preciseVectorData)
Definition wmo.cpp:238
unsigned int nVertices
Definition wmo.h:93
WMOLiquidVert * LiquEx
Definition wmo.h:79
uint16 * MOBA
Definition wmo.h:76
uint32 liquflags
Definition wmo.h:95
char * MOPY
Definition wmo.h:72
int nTriangles
Definition wmo.h:94
bool open()
Definition wmo.cpp:143
char * LiquBytes
Definition wmo.h:80
int mopy_size
Definition wmo.h:91
~WMOGroup()
Definition wmo.cpp:469
int * MobaEx
Definition wmo.h:77
WMOLiquidHeader * hlq
Definition wmo.h:78
uint16 * MoviEx
Definition wmo.h:74
uint16 moprNItems
Definition wmo.h:86
float bbcorn1[3]
Definition wmo.h:83
uint32 d2
Definition wmo.h:115
Vec3D rot
Definition wmo.h:114
uint32 indx
Definition wmo.h:115
int doodadset
Definition wmo.h:112
static std::set< int > ids
Definition wmo.h:106
Vec3D pos
Definition wmo.h:113
WMOGroup * wmo
Definition wmo.h:111
uint32 id
Definition wmo.h:115
int curry
Definition wmo.h:110
Vec3D pos3
Definition wmo.h:114
uint32 d3
Definition wmo.h:115
std::string MapName
Definition wmo.h:108
Vec3D pos2
Definition wmo.h:114
WMOInstance(MPQFile &f, char const *WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile)
Definition wmo.cpp:480
static void reset()
int currx
Definition wmo.h:109
Definition wmo.h:33
uint32 liquidType
Definition wmo.h:38
float bbcorn1[3]
Definition wmo.h:39
uint32 nDoodadSets
Definition wmo.h:38
uint32 nLights
Definition wmo.h:38
uint32 nModels
Definition wmo.h:38
bool open()
Definition wmo.cpp:31
uint32 nDoodads
Definition wmo.h:38
~WMORoot()
Definition wmo.cpp:128
float bbcorn2[3]
Definition wmo.h:40
unsigned int col
Definition wmo.h:37
uint32 nGroups
Definition wmo.h:38
std::string filename
Definition wmo.h:35
bool ConvertToVMAPRootWmo(FILE *output)
Definition wmo.cpp:116
uint32 nP
Definition wmo.h:38
uint32 nTextures
Definition wmo.h:38
uint32 RootWMOID
Definition wmo.h:38
WMORoot(std::string &filename)
Definition wmo.cpp:21
float pos_z
Definition wmo.h:54
float pos_y
Definition wmo.h:53
short type
Definition wmo.h:55
int ytiles
Definition wmo.h:51
int xverts
Definition wmo.h:51
int yverts
Definition wmo.h:51
float pos_x
Definition wmo.h:52
int xtiles
Definition wmo.h:51
uint16 unk2
Definition wmo.h:61
uint16 unk1
Definition wmo.h:60
float height
Definition wmo.h:62
bool preciseVectorData
static Vec3D fixCoords(const Vec3D &v)
Definition wmo.h:30