TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
model.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef MODEL_H
20 #define MODEL_H
21 
22 #include "vec3d.h"
23 #include "modelheaders.h"
24 #include <vector>
25 
26 class MPQFile;
27 
29 
30 class Model
31 {
32 private:
33  void _unload()
34  {
35  delete[] vertices;
36  delete[] indices;
37  vertices = NULL;
38  indices = NULL;
39  }
40  std::string filename;
41 public:
45 
46  bool open();
47  bool ConvertToVMAPModel(char const* outfilename);
48 
49  Model(std::string& filename);
50  ~Model() { _unload(); }
51 };
52 
54 {
55 public:
59  float sc;
60 
61  ModelInstance() : id(0), scale(0), flags(0), sc(0.0f) {}
62  ModelInstance(MPQFile& f, char const* ModelInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile);
63 
64 };
65 
66 #endif
Definition: model.h:53
~Model()
Definition: model.h:50
Definition: modelheaders.h:26
ModelInstance()
Definition: model.h:61
Vec3D fixCoordSystem(Vec3D v)
Definition: model.cpp:137
arena_t NULL
Definition: jemalloc_internal.h:624
bool open()
Definition: model.cpp:34
Definition: mpqfile.h:32
Vec3D pos
Definition: model.h:57
uint32 id
Definition: model.h:56
bool ConvertToVMAPModel(char const *outfilename)
Definition: model.cpp:72
Vec3D rot
Definition: model.h:57
Vec3D * vertices
Definition: model.h:43
ModelHeader header
Definition: model.h:42
std::string filename
Definition: model.h:40
uint32_t uint32
Definition: Define.h:150
uint16_t uint16
Definition: Define.h:151
Definition: model.h:30
uint16 flags
Definition: model.h:58
float sc
Definition: model.h:59
uint16 * indices
Definition: model.h:44
void _unload()
Definition: model.h:33
Model(std::string &filename)
Definition: model.cpp:29
Definition: vec3d.h:25
uint16 scale
Definition: model.h:58