-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhouseplant.h
67 lines (53 loc) · 1.5 KB
/
houseplant.h
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef HOUSEPLANT_H
#define HOUSEPLANT_H
#include "renderableentity.h"
#include <QEntity>
#include <Qt3DExtras/QNormalDiffuseMapAlphaMaterial>
#include <Qt3DExtras/QNormalDiffuseMapMaterial>
#include <QTextureImage>
class HousePlant : public Qt3DCore::QEntity
{
Q_OBJECT
public:
explicit HousePlant(Qt3DCore::QNode *parent = 0);
~HousePlant();
enum PotShape {
Cross = 0,
Square,
Triangle,
Sphere
};
enum Plant {
Bamboo = 0,
Palm,
Pine,
Spikes,
Shrub
};
void setPotShape(PotShape shape);
void setPlantType(Plant plant);
PotShape potShape() const;
Plant plantType() const;
void setPosition(const QVector3D &pos);
void setScale(float scale);
QVector3D position() const;
float scale() const;
private:
RenderableEntity *m_pot;
RenderableEntity *m_plant;
RenderableEntity *m_cover;
Qt3DExtras::QNormalDiffuseMapMaterial *m_potMaterial;
Qt3DExtras::QNormalDiffuseMapAlphaMaterial *m_plantMaterial;
Qt3DExtras::QNormalDiffuseMapMaterial *m_coverMaterial;
Qt3DRender::QTextureImage *m_potImage;
Qt3DRender::QTextureImage *m_potNormalImage;
Qt3DRender::QTextureImage *m_plantImage;
Qt3DRender::QTextureImage *m_plantNormalImage;
Qt3DRender::QTextureImage *m_coverImage;
Qt3DRender::QTextureImage *m_coverNormalImage;
Plant m_plantType;
PotShape m_potShape;
void updatePotShape();
void updatePlantType();
};
#endif // HOUSEPLANT_H