TrinityCore
Loading...
Searching...
No Matches
model.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 MODEL_H
19#define MODEL_H
20
21#include "loadlib/loadlib.h"
22#include "vec3d.h"
23#include "modelheaders.h"
24#include <vector>
25
26class MPQFile;
27struct WMODoodadData;
28namespace ADT { struct MDDF; struct MODF; }
29
30Vec3D fixCoordSystem(Vec3D const& v);
31
32class Model
33{
34private:
35 void _unload()
36 {
37 delete[] vertices;
38 delete[] indices;
39 vertices = nullptr;
40 indices = nullptr;
41 }
42 std::string filename;
43public:
47
48 bool open();
49 bool ConvertToVMAPModel(char const* outfilename);
50
51 Model(std::string& filename);
52 ~Model() { _unload(); }
53};
54
55namespace Doodad
56{
57 void Extract(ADT::MDDF const& doodadDef, char const* ModelInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile);
58
59 void ExtractSet(WMODoodadData const& doodadData, ADT::MODF const& wmo, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile);
60}
61
62#endif
uint16_t uint16
Definition Define.h:134
uint32_t uint32
Definition Define.h:133
Extract
Definition System.cpp:62
Definition model.h:33
Vec3D * vertices
Definition model.h:45
ModelHeader header
Definition model.h:44
uint16 * indices
Definition model.h:46
std::string filename
Definition model.h:42
bool open()
Definition model.cpp:35
void _unload()
Definition model.h:35
~Model()
Definition model.h:52
bool ConvertToVMAPModel(char const *outfilename)
Definition model.cpp:73
Definition vec3d.h:25
Vec3D fixCoordSystem(Vec3D const &v)
Definition model.cpp:137
Definition adtfile.h:27
Definition model.h:56
void ExtractSet(WMODoodadData const &doodadData, ADT::MODF const &wmo, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile)
Definition model.cpp:184