SWBF2-Classic-Msh-Viewer/QtMeshViewer/Header/MshFile.h

50 lines
1.3 KiB
C
Raw Permalink Normal View History

#pragma once
#include "..\Header\FileInterface.h"
2017-02-02 13:44:48 +00:00
#include <QList>
struct ChunkHeader {
2017-02-02 13:44:48 +00:00
QString name;
quint32 size;
qint64 position;
};
enum ModelTyp {
null,
dynamicMesh,
cloth,
bone,
staticMesh,
shadowMesh = 6
};
class MshFile : public FileInterface
{
public:
explicit MshFile(QString path);
virtual ~MshFile();
private:
ModelTyp m_currentType = ModelTyp::null;
std::int32_t m_currentRenderFlag = -1;
virtual void import() Q_DECL_OVERRIDE Q_DECL_FINAL;
2017-02-02 13:44:48 +00:00
void loadChunks(QList<ChunkHeader*> &destination, qint64 start, const quint32 length);
2017-02-02 13:44:48 +00:00
void analyseMsh2Chunks(QList<ChunkHeader*> &chunkList);
2017-02-02 13:44:48 +00:00
void analyseMatdChunks(QList<ChunkHeader*> &chunkList);
2017-02-02 13:44:48 +00:00
void analyseModlChunks(Model* dataDestination, QList<ChunkHeader*> &chunkList);
void analyseGeomChunks(Model* dataDestination, QList<ChunkHeader*> &chunkList);
void analyseSegmChunks(Model* dataDestination, QList<ChunkHeader*> &chunkList);
void analyseClthChunks(Model* dataDestination, QList<ChunkHeader*> &chunkList);
2017-02-02 13:44:48 +00:00
void readVertex(Segment* dataDestination, qint64 position);
void readUV(Segment* dataDestination, qint64 position);
2016-12-31 12:04:03 +00:00
2017-01-23 11:29:10 +00:00
void loadTexture(QOpenGLTexture*& destination, QString filepath, QString& filename);
2017-02-02 13:44:48 +00:00
QMatrix4x4 getParentMatrix(QString parent) const;
QQuaternion getParentRotation(QString parent) const;
};