History

Support for LeapMotion and worklist 19734

- 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

samcake committed 12 years ago

Commit 3ce455a1 parent fe0374333 files · +7810 −197Browse files

Showing the changes to libraries/script-engine/src/AbstractControllerScriptingInterface.h (1 of 33 files). Show all

Unified · Split

libraries/script-engine/src/AbstractControllerScriptingInterface.h+25−0
@@ -19,6 +19,28 @@ · 18 unmodified lines
1919
2020 #include "EventTypes.h"
2121
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+};
2244
2345 /// handles scripting of input controller commands from JS
2446 class AbstractControllerScriptingInterface : public QObject {
@@ -60,6 +82,9 @@ public slots: · 35 unmodified lines
6082
6183 virtual glm::vec2 getViewportDimensions() const = 0;
6284
85+
86+ virtual AbstractInputController* createInputController( const QString& category, const QString& tracker ) = 0;
87+
6388 signals:
6489 void keyPressEvent(const KeyEvent& event);
6590 void keyReleaseEvent(const KeyEvent& event);