2018-10-25 09:18:04 +00:00
|
|
|
#ifndef DUST3D_GLB_FILE_H
|
|
|
|
#define DUST3D_GLB_FILE_H
|
2018-04-30 11:31:09 +00:00
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <QMatrix4x4>
|
|
|
|
#include <vector>
|
2018-09-14 09:45:05 +00:00
|
|
|
#include <QQuaternion>
|
2018-10-25 09:18:04 +00:00
|
|
|
#include <QImage>
|
2018-10-25 00:19:38 +00:00
|
|
|
#include "outcome.h"
|
2018-04-30 11:31:09 +00:00
|
|
|
#include "json.hpp"
|
2018-10-25 00:19:38 +00:00
|
|
|
#include "document.h"
|
2018-04-30 11:31:09 +00:00
|
|
|
|
2018-10-25 09:18:04 +00:00
|
|
|
class GlbFileWriter : public QObject
|
2018-04-30 11:31:09 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2018-10-25 09:18:04 +00:00
|
|
|
GlbFileWriter(Outcome &outcome,
|
2018-10-26 23:04:45 +00:00
|
|
|
const std::vector<RiggerBone> *resultRigBones,
|
|
|
|
const std::map<int, RiggerVertexWeights> *resultRigWeights,
|
2018-10-25 09:18:04 +00:00
|
|
|
const QString &filename,
|
2018-10-27 02:29:51 +00:00
|
|
|
QImage *textureImage=nullptr,
|
|
|
|
const std::vector<std::pair<QString, std::vector<std::pair<float, JointNodeTree>>>> *motions=nullptr);
|
2018-05-07 16:08:19 +00:00
|
|
|
bool save();
|
2018-04-30 11:31:09 +00:00
|
|
|
private:
|
2018-05-07 16:08:19 +00:00
|
|
|
QString m_filename;
|
2018-06-01 04:38:16 +00:00
|
|
|
bool m_outputNormal;
|
2018-06-15 05:34:41 +00:00
|
|
|
bool m_outputAnimation;
|
|
|
|
bool m_outputUv;
|
2018-10-25 09:18:04 +00:00
|
|
|
QByteArray m_binByteArray;
|
|
|
|
QByteArray m_jsonByteArray;
|
2018-04-30 11:31:09 +00:00
|
|
|
private:
|
|
|
|
nlohmann::json m_json;
|
2018-06-01 04:38:16 +00:00
|
|
|
public:
|
|
|
|
static bool m_enableComment;
|
2018-04-30 11:31:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|