forked from noodlecollie/calliper
-
Notifications
You must be signed in to change notification settings - Fork 1
/
sceneobjectmanipulator.h
49 lines (35 loc) · 1.06 KB
/
sceneobjectmanipulator.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
#ifndef SCENEOBJECTMANIPULATOR_H
#define SCENEOBJECTMANIPULATOR_H
#include <QVector3D>
#include "eulerangle.h"
class SceneObject;
class SceneObjectManipulator
{
public:
SceneObjectManipulator(SceneObject* obj, bool updateOnDestroy = true);
~SceneObjectManipulator();
SceneObject* sceneObject() const;
void resetTranslation();
void resetAngles();
void resetScale();
void resetAll();
QVector3D translation() const;
void setTranslation(const QVector3D &vec);
EulerAngle angles() const;
void setAngles(const EulerAngle &angles);
QVector3D scale() const;
void setScale(const QVector3D &scale);
void apply();
private:
void updateCachedProperties();
void updateObjectSoft();
SceneObject* m_pSceneObject;
bool m_bUpdateOnDestroy;
QVector3D m_vecCachedPosition;
EulerAngle m_angCachedAngles;
QVector3D m_vecCachedScale;
QVector3D m_vecTranslation;
EulerAngle m_angAngles;
QVector3D m_vecScale;
};
#endif // SCENEOBJECTMANIPULATOR_H