-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimpleobject3d.h
More file actions
46 lines (31 loc) · 1.17 KB
/
simpleobject3d.h
File metadata and controls
46 lines (31 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef SIMPLEOBJECT3D_H
#define SIMPLEOBJECT3D_H
#include <QOpenGLBuffer>
#include <QMatrix4x4>
#include <QVector2D>
#include "transformational.h"
#include "Model3D/vertexdata.h"
class SimpleObject3D : public Transformational
{
public:
SimpleObject3D();
SimpleObject3D(QVector<VertexData> &vertData, const QVector<GLuint> &indexes, const QImage &texture);
~SimpleObject3D();
void init(QVector<VertexData> &vertData, const QVector<GLuint> &indexes, const QImage &texture);
void draw(class QOpenGLShaderProgram *programm, class QOpenGLFunctions *functions);
void objectPicking(QOpenGLShaderProgram *programm, QOpenGLFunctions *functions) override {}
void rotate(const class QQuaternion &rotation);
void translate(const class QVector3D &translation);
void scale(const float scaleKoef);
void setGlobalTransform(const class QMatrix4x4 &transformMatrix);
QVector3D getPosition() const override;
private:
QOpenGLBuffer m_vertexBuffer;
QOpenGLBuffer m_indexBuffer;
class QOpenGLTexture *m_texture;
QQuaternion m_rotate;
QVector3D m_translate;
float m_scale;
QMatrix4x4 m_globalTransform;
};
#endif // SIMPLEOBJECT3D_H