mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
Note: This is not compatible with current assembler, wait for upcoming commits * Now also supports Linux (CMake) and Visual Studio 2010, see README for build and use instructions * Uses libmpq for now, since at project start stormlib did not work properly on 64bit linux. * Should be a lot faster, a few badly written lines ate most CPU time for nothing... Special thanks to arrai and faramir118 for additional code and fixes
53 lines
877 B
C++
53 lines
877 B
C++
#ifndef MODEL_H
|
|
#define MODEL_H
|
|
|
|
#include "loadlib/loadlib.h"
|
|
#include "vec3d.h"
|
|
//#include "mpq.h"
|
|
#include "modelheaders.h"
|
|
#include <vector>
|
|
|
|
class Model;
|
|
class WMOInstance;
|
|
class MPQFile;
|
|
|
|
Vec3D fixCoordSystem(Vec3D v);
|
|
|
|
class Model
|
|
{
|
|
public:
|
|
ModelHeader header;
|
|
uint32 offsBB_vertices, offsBB_indices;
|
|
Vec3D *BB_vertices, *vertices;
|
|
uint16 *BB_indices, *indices;
|
|
size_t nIndices;
|
|
|
|
bool open();
|
|
bool ConvertToVMAPModel(char * outfilename);
|
|
|
|
bool ok;
|
|
|
|
Model(std::string &filename);
|
|
~Model();
|
|
|
|
private:
|
|
std::string filename;
|
|
char outfilename;
|
|
};
|
|
|
|
class ModelInstance
|
|
{
|
|
public:
|
|
Model *model;
|
|
|
|
uint32 id;
|
|
Vec3D pos, rot;
|
|
unsigned int d1, scale;
|
|
float w,sc;
|
|
|
|
ModelInstance() {}
|
|
ModelInstance(MPQFile &f,const char* ModelInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile);
|
|
|
|
};
|
|
|
|
#endif
|