2021-11-18 14:58:01 +00:00
|
|
|
#ifndef DUST3D_APPLICATION_GLB_FILE_H_
|
|
|
|
#define DUST3D_APPLICATION_GLB_FILE_H_
|
|
|
|
|
2022-10-18 09:35:04 +00:00
|
|
|
#include "document.h"
|
|
|
|
#include "json.hpp"
|
2018-04-30 11:31:09 +00:00
|
|
|
#include <QByteArray>
|
2022-10-18 09:35:04 +00:00
|
|
|
#include <QImage>
|
2018-04-30 11:31:09 +00:00
|
|
|
#include <QMatrix4x4>
|
2022-10-18 09:35:04 +00:00
|
|
|
#include <QObject>
|
2018-09-14 09:45:05 +00:00
|
|
|
#include <QQuaternion>
|
2022-10-18 09:35:04 +00:00
|
|
|
#include <QString>
|
2021-11-18 14:58:01 +00:00
|
|
|
#include <dust3d/base/object.h>
|
2022-10-18 09:35:04 +00:00
|
|
|
#include <vector>
|
2018-04-30 11:31:09 +00:00
|
|
|
|
2022-10-18 09:35:04 +00:00
|
|
|
class GlbFileWriter : public QObject {
|
2018-04-30 11:31:09 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2022-10-18 09:35:04 +00:00
|
|
|
GlbFileWriter(dust3d::Object& object,
|
|
|
|
const QString& filename,
|
|
|
|
QImage* textureImage = nullptr,
|
|
|
|
QImage* normalImage = nullptr,
|
|
|
|
QImage* ormImage = nullptr);
|
2018-05-07 16:08:19 +00:00
|
|
|
bool save();
|
2022-10-18 09:35:04 +00:00
|
|
|
|
2018-04-30 11:31:09 +00:00
|
|
|
private:
|
2018-05-07 16:08:19 +00:00
|
|
|
QString m_filename;
|
2020-12-19 08:12:50 +00:00
|
|
|
bool m_outputNormal = true;
|
|
|
|
bool m_outputUv = true;
|
2018-10-25 09:18:04 +00:00
|
|
|
QByteArray m_binByteArray;
|
|
|
|
QByteArray m_jsonByteArray;
|
2022-10-18 09:35:04 +00:00
|
|
|
|
2018-04-30 11:31:09 +00:00
|
|
|
private:
|
|
|
|
nlohmann::json m_json;
|
2022-10-18 09:35:04 +00:00
|
|
|
|
2018-06-01 04:38:16 +00:00
|
|
|
public:
|
|
|
|
static bool m_enableComment;
|
2018-04-30 11:31:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|