- Introduce the DeviceTracker class to abstract all the possible devices - Introduce the MotionTracker ( a DeviceTracker ) that contains a transform tree of joints - Add Leapmotion class as a MotionTracker and the support for the Leapmotion sdk in external - Add InputController as the abstraction of a MotionTracker/Joint for Javascript
Showing the changes to libraries/script-engine/src/AbstractControllerScriptingInterface.h (1 of 33 files). Show all
Unified · Split
| @@ -19,6 +19,28 @@ · 18 unmodified lines | |||
| 19 | 19 | ||
| 20 | #include "EventTypes.h" | 20 | #include "EventTypes.h" |
| 21 | 21 | ||
| 22 | class AbstractInputController : public QObject { | ||
| 23 | Q_OBJECT | ||
| 24 | |||
| 25 | public: | ||
| 26 | typedef unsigned int Key; | ||
| 27 | |||
| 28 | virtual void update() = 0; | ||
| 29 | |||
| 30 | virtual Key getKey() const = 0; | ||
| 31 | |||
| 32 | public slots: | ||
| 33 | |||
| 34 | virtual bool isActive() const = 0; | ||
| 35 | virtual glm::vec3 getAbsTranslation() const = 0; | ||
| 36 | virtual glm::quat getAbsRotation() const = 0; | ||
| 37 | virtual glm::vec3 getLocTranslation() const = 0; | ||
| 38 | virtual glm::quat getLocRotation() const = 0; | ||
| 39 | |||
| 40 | signals: | ||
| 41 | void spatialEvent(const SpatialEvent& event); | ||
| 42 | |||
| 43 | }; | ||
| 22 | 44 | ||
| 23 | /// handles scripting of input controller commands from JS | 45 | /// handles scripting of input controller commands from JS |
| 24 | class AbstractControllerScriptingInterface : public QObject { | 46 | class AbstractControllerScriptingInterface : public QObject { |
| @@ -60,6 +82,9 @@ public slots: · 35 unmodified lines | |||
| 60 | 82 | ||
| 61 | virtual glm::vec2 getViewportDimensions() const = 0; | 83 | virtual glm::vec2 getViewportDimensions() const = 0; |
| 62 | 84 | ||
| 85 | |||
| 86 | virtual AbstractInputController* createInputController( const QString& category, const QString& tracker ) = 0; | ||
| 87 | |||
| 63 | signals: | 88 | signals: |
| 64 | void keyPressEvent(const KeyEvent& event); | 89 | void keyPressEvent(const KeyEvent& event); |
| 65 | void keyReleaseEvent(const KeyEvent& event); | 90 | void keyReleaseEvent(const KeyEvent& event); |