542 lines · 21.9 KB · C++
RawDownload
     // TODO for now the InputController is only supporting a JointTracker from a MotionTracker    MotionTracker* motionTracker = dynamic_cast< MotionTracker*> (DeviceTracker::getDevice(_deviceTrackerId));    if (motionTracker) {        if ((int)_subTrackerId < motionTracker->numJointTrackers()) {            const MotionTracker::JointTracker* joint = motionTracker->getJointTracker(_subTrackerId);             if (joint->isActive()) {                joint->getAbsFrame().getTranslation(_eventCache.absTranslation);                joint->getAbsFrame().getRotation(_eventCache.absRotation);                joint->getLocFrame().getTranslation(_eventCache.locTranslation);                joint->getLocFrame().getRotation(_eventCache.locRotation);                 _isActive = true;                //emit spatialEvent(_eventCache);            }        }    }} const unsigned int INPUTCONTROLLER_KEY_DEVICE_OFFSET = 16;const unsigned int INPUTCONTROLLER_KEY_DEVICE_MASK = 16; InputController::Key InputController::getKey() const {    return (((_deviceTrackerId & INPUTCONTROLLER_KEY_DEVICE_MASK) << INPUTCONTROLLER_KEY_DEVICE_OFFSET) | _subTrackerId);}  void ControllerScriptingInterface::emitKeyPressEvent(QKeyEvent* event) { emit keyPressEvent(KeyEvent(*event)); }void ControllerScriptingInterface::emitKeyReleaseEvent(QKeyEvent* event) { emit keyReleaseEvent(KeyEvent(*event)); } void ControllerScriptingInterface::emitMouseMoveEvent(QMouseEvent* event, unsigned int deviceID) { emit mouseMoveEvent(MouseEvent(*event, deviceID)); }void ControllerScriptingInterface::emitMousePressEvent(QMouseEvent* event, unsigned int deviceID) { emit mousePressEvent(MouseEvent(*event, deviceID)); }void ControllerScriptingInterface::emitMouseDoublePressEvent(QMouseEvent* event, unsigned int deviceID) { emit mouseDoublePressEvent(MouseEvent(*event, deviceID)); }void ControllerScriptingInterface::emitMouseReleaseEvent(QMouseEvent* event, unsigned int deviceID) { emit mouseReleaseEvent(MouseEvent(*event, deviceID)); } void ControllerScriptingInterface::emitTouchBeginEvent(const TouchEvent& event) { emit touchBeginEvent(event); }void ControllerScriptingInterface::emitTouchEndEvent(const TouchEvent& event) { emit touchEndEvent(event); }void ControllerScriptingInterface::emitTouchUpdateEvent(const TouchEvent& event) { emit touchUpdateEvent(event); } void ControllerScriptingInterface::emitWheelEvent(QWheelEvent* event) { emit wheelEvent(*event); } 

Lines 501–542 of 542. Previous lines