TrinityCore
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 "vec3d.h"
22#include "modelheaders.h"
23#include <vector>
24
25class CASCFile;
26struct ADTOutputCache;
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:
48
49 bool open();
50 bool ConvertToVMAPModel(char const* outfilename);
51
52 Model(std::string& filename);
53 ~Model() { _unload(); }
54};
55
56namespace Doodad
57{
58 void Extract(ADT::MDDF const& doodadDef, char const* ModelInstName, uint32 mapID, uint32 originalMapId,
59 FILE* pDirfile, std::vector<ADTOutputCache>* dirfileCache);
60
61 void ExtractSet(WMODoodadData const& doodadData, ADT::MODF const& wmo, bool isGlobalWmo, uint32 mapID, uint32 originalMapId,
62 FILE* pDirfile, std::vector<ADTOutputCache>* dirfileCache);
63}
64
65#endif
uint32_t uint32
Definition: Define.h:142
Definition: vec3d.h:135
Definition: model.h:33
Vec3D * vertices
Definition: model.h:45
ModelHeader header
Definition: model.h:44
std::string filename
Definition: model.h:42
bool open()
Definition: model.cpp:37
void _unload()
Definition: model.h:35
AaBox3D bounds
Definition: model.h:47
uint32 * indices
Definition: model.h:46
~Model()
Definition: model.h:53
Model(std::string &filename)
Definition: model.cpp:33
bool ConvertToVMAPModel(char const *outfilename)
Definition: model.cpp:88
Definition: vec3d.h:25
Vec3D fixCoordSystem(Vec3D const &v)
Definition: model.cpp:155
Definition: adtfile.h:27
Definition: model.h:57
void Extract(ADT::MDDF const &doodadDef, char const *ModelInstName, uint32 mapID, uint32 originalMapId, FILE *pDirfile, std::vector< ADTOutputCache > *dirfileCache)
Definition: model.cpp:160
void ExtractSet(WMODoodadData const &doodadData, ADT::MODF const &wmo, bool isGlobalWmo, uint32 mapID, uint32 originalMapId, FILE *pDirfile, std::vector< ADTOutputCache > *dirfileCache)
Definition: model.cpp:226