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 "modelheaders.h"
22#include <string>
23#include <vector>
24#include <cstdio> // for FILE*
25
26class CASCFile;
27struct ADTOutputCache;
28struct WMODoodadData;
29namespace ADT { struct MDDF; struct MODF; }
30
31Vec3D fixCoordSystem(Vec3D const& v);
32
33class Model
34{
35private:
36 void _unload()
37 {
38 delete[] vertices;
39 delete[] indices;
40 vertices = nullptr;
41 indices = nullptr;
42 }
43 std::string filename;
44public:
49
50 bool open();
51 bool ConvertToVMAPModel(char const* outfilename);
52
53 Model(std::string& filename);
54 ~Model() { _unload(); }
55};
56
57namespace Doodad
58{
59 void Extract(ADT::MDDF const& doodadDef, char const* ModelInstName, uint32 mapID, uint32 originalMapId,
60 FILE* pDirfile, std::vector<ADTOutputCache>* dirfileCache);
61
62 void ExtractSet(WMODoodadData const& doodadData, ADT::MODF const& wmo, bool isGlobalWmo, uint32 mapID, uint32 originalMapId,
63 FILE* pDirfile, std::vector<ADTOutputCache>* dirfileCache);
64}
65
66#endif
uint32_t uint32
Definition Define.h:154
Extract
Definition System.cpp:91
Definition model.h:34
Vec3D * vertices
Definition model.h:46
ModelHeader header
Definition model.h:45
std::string filename
Definition model.h:43
bool open()
Definition model.cpp:37
void _unload()
Definition model.h:36
AaBox3D bounds
Definition model.h:48
uint32 * indices
Definition model.h:47
~Model()
Definition model.h:54
bool ConvertToVMAPModel(char const *outfilename)
Definition model.cpp:88
Definition vec3d.h:22
Vec3D fixCoordSystem(Vec3D const &v)
Definition model.cpp:155
Definition adtfile.h:27
Definition model.h:58
void ExtractSet(WMODoodadData const &doodadData, ADT::MODF const &wmo, bool isGlobalWmo, uint32 mapID, uint32 originalMapId, FILE *pDirfile, std::vector< ADTOutputCache > *dirfileCache)
Definition model.cpp:211