Showing the changes to interface/src/scripting/ControllerScriptingInterface.h (1 of 12 files). Show all
Unified · Split
| @@ -25,38 +25,6 @@ · 24 unmodified lines | |||
| 25 | #include <WheelEvent.h> | 25 | #include <WheelEvent.h> |
| 26 | class ScriptEngine; | 26 | class ScriptEngine; |
| 27 | 27 | ||
| 28 | class PalmData; | ||
| 29 | |||
| 30 | class InputController : public controller::InputController { | ||
| 31 | Q_OBJECT | ||
| 32 | |||
| 33 | public: | ||
| 34 | InputController(int deviceTrackerId, int subTrackerId, QObject* parent = NULL); | ||
| 35 | |||
| 36 | virtual void update() override; | ||
| 37 | virtual Key getKey() const override; | ||
| 38 | |||
| 39 | public slots: | ||
| 40 | |||
| 41 | virtual bool isActive() const override { return _isActive; } | ||
| 42 | virtual glm::vec3 getAbsTranslation() const override { return _eventCache.absTranslation; } | ||
| 43 | virtual glm::quat getAbsRotation() const override { return _eventCache.absRotation; } | ||
| 44 | virtual glm::vec3 getLocTranslation() const override { return _eventCache.locTranslation; } | ||
| 45 | virtual glm::quat getLocRotation() const override { return _eventCache.locRotation; } | ||
| 46 | |||
| 47 | private: | ||
| 48 | |||
| 49 | int _deviceTrackerId; | ||
| 50 | uint _subTrackerId; | ||
| 51 | |||
| 52 | // cache for the spatial | ||
| 53 | SpatialEvent _eventCache; | ||
| 54 | bool _isActive; | ||
| 55 | |||
| 56 | signals: | ||
| 57 | }; | ||
| 58 | |||
| 59 | |||
| 60 | /// handles scripting of input controller commands from JS | 28 | /// handles scripting of input controller commands from JS |
| 61 | class ControllerScriptingInterface : public controller::ScriptingInterface { | 29 | class ControllerScriptingInterface : public controller::ScriptingInterface { |
| 62 | Q_OBJECT | 30 | Q_OBJECT |
| @@ -86,8 +54,6 @@ public: · 23 unmodified lines | |||
| 86 | bool isJoystickCaptured(int joystickIndex) const; | 54 | bool isJoystickCaptured(int joystickIndex) const; |
| 87 | bool areEntityClicksCaptured() const; | 55 | bool areEntityClicksCaptured() const; |
| 88 | 56 | ||
| 89 | void updateInputControllers(); | ||
| 90 | |||
| 91 | public slots: | 57 | public slots: |
| 92 | 58 | ||
| 93 | virtual void captureKeyEvents(const KeyEvent& event); | 59 | virtual void captureKeyEvents(const KeyEvent& event); |
| @@ -102,10 +68,6 @@ public slots: · 8 unmodified lines | |||
| 102 | virtual glm::vec2 getViewportDimensions() const; | 68 | virtual glm::vec2 getViewportDimensions() const; |
| 103 | virtual QVariant getRecommendedOverlayRect() const; | 69 | virtual QVariant getRecommendedOverlayRect() const; |
| 104 | 70 | ||
| 105 | /// Factory to create an InputController | ||
| 106 | virtual controller::InputController* createInputController(const QString& deviceName, const QString& tracker); | ||
| 107 | virtual void releaseInputController(controller::InputController* input); | ||
| 108 | |||
| 109 | signals: | 71 | signals: |
| 110 | void keyPressEvent(const KeyEvent& event); | 72 | void keyPressEvent(const KeyEvent& event); |
| 111 | void keyReleaseEvent(const KeyEvent& event); | 73 | void keyReleaseEvent(const KeyEvent& event); |
| @@ -135,8 +97,6 @@ private: · 23 unmodified lines | |||
| 135 | bool _captureEntityClicks; | 97 | bool _captureEntityClicks; |
| 136 | 98 | ||
| 137 | using InputKey = controller::InputController::Key; | 99 | using InputKey = controller::InputController::Key; |
| 138 | using InputControllerMap = std::map<InputKey, controller::InputController::Pointer>; | ||
| 139 | InputControllerMap _inputControllers; | ||
| 140 | }; | 100 | }; |
| 141 | 101 | ||
| 142 | const int NUMBER_OF_SPATIALCONTROLS_PER_PALM = 2; // the hand and the tip | 102 | const int NUMBER_OF_SPATIALCONTROLS_PER_PALM = 2; // the hand and the tip |