mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 17:49:27 +02:00
commit
a1e6fdc4b2
10 changed files with 1393 additions and 1 deletions
38
cmake/modules/FindconnexionClient.cmake
Normal file
38
cmake/modules/FindconnexionClient.cmake
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
#
|
||||||
|
# FindconnexionClient.cmake
|
||||||
|
#
|
||||||
|
# Once done this will define
|
||||||
|
#
|
||||||
|
# 3DCONNEXIONCLIENT_INCLUDE_DIRS
|
||||||
|
#
|
||||||
|
# Created on 10/06/2015 by Marcel Verhagen
|
||||||
|
# Copyright 2015 High Fidelity, Inc.
|
||||||
|
#
|
||||||
|
# Distributed under the Apache License, Version 2.0.
|
||||||
|
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
#
|
||||||
|
|
||||||
|
# setup hints for 3DCONNEXIONCLIENT search
|
||||||
|
include("${MACRO_DIR}/HifiLibrarySearchHints.cmake")
|
||||||
|
hifi_library_search_hints("connexionclient")
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
find_library(3DconnexionClient 3DconnexionClient)
|
||||||
|
if(EXISTS ${3DconnexionClient})
|
||||||
|
set(CONNEXIONCLIENT_FOUND true)
|
||||||
|
set(CONNEXIONCLIENT_INCLUDE_DIR ${3DconnexionClient})
|
||||||
|
set(CONNEXIONCLIENT_LIBRARY ${3DconnexionClient})
|
||||||
|
set_target_properties(${TARGET_NAME} PROPERTIES LINK_FLAGS "-weak_framework 3DconnexionClient")
|
||||||
|
message(STATUS "Found 3Dconnexion")
|
||||||
|
mark_as_advanced(CONNEXIONCLIENT_INCLUDE_DIR CONNEXIONCLIENT_LIBRARY)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
find_path(CONNEXIONCLIENT_INCLUDE_DIRS I3dMouseParams.h PATH_SUFFIXES Inc HINTS ${CONNEXIONCLIENT_SEARCH_DIRS})
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(connexionClient DEFAULT_MSG CONNEXIONCLIENT_INCLUDE_DIRS)
|
||||||
|
|
||||||
|
mark_as_advanced(CONNEXIONCLIENT_INCLUDE_DIRS CONNEXIONCLIENT_SEARCH_DIRS)
|
||||||
|
endif()
|
|
@ -2,7 +2,7 @@ set(TARGET_NAME interface)
|
||||||
project(${TARGET_NAME})
|
project(${TARGET_NAME})
|
||||||
|
|
||||||
# set a default root dir for each of our optional externals if it was not passed
|
# set a default root dir for each of our optional externals if it was not passed
|
||||||
set(OPTIONAL_EXTERNALS "Faceshift" "Sixense" "LeapMotion" "RtMidi" "SDL2" "RSSDK")
|
set(OPTIONAL_EXTERNALS "Faceshift" "Sixense" "LeapMotion" "RtMidi" "SDL2" "RSSDK" "connexionClient")
|
||||||
foreach(EXTERNAL ${OPTIONAL_EXTERNALS})
|
foreach(EXTERNAL ${OPTIONAL_EXTERNALS})
|
||||||
string(TOUPPER ${EXTERNAL} ${EXTERNAL}_UPPERCASE)
|
string(TOUPPER ${EXTERNAL} ${EXTERNAL}_UPPERCASE)
|
||||||
if (NOT ${${EXTERNAL}_UPPERCASE}_ROOT_DIR)
|
if (NOT ${${EXTERNAL}_UPPERCASE}_ROOT_DIR)
|
||||||
|
|
79
interface/external/connexionclient/Inc/I3dMouseParams.h
vendored
Normal file
79
interface/external/connexionclient/Inc/I3dMouseParams.h
vendored
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
//
|
||||||
|
// 3DConnexion.cpp
|
||||||
|
// hifi
|
||||||
|
//
|
||||||
|
// Created by MarcelEdward Verhagen on 09-06-15.
|
||||||
|
// Copyright 2015 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef I3D_MOUSE_PARAMS_H
|
||||||
|
#define I3D_MOUSE_PARAMS_H
|
||||||
|
|
||||||
|
// Parameters for the 3D mouse based on the SDK from 3Dconnexion
|
||||||
|
|
||||||
|
class I3dMouseSensor {
|
||||||
|
public:
|
||||||
|
enum Speed {
|
||||||
|
SPEED_LOW = 0,
|
||||||
|
SPEED_MID,
|
||||||
|
SPEED_HIGH
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual bool IsPanZoom() const = 0;
|
||||||
|
virtual bool IsRotate() const = 0;
|
||||||
|
virtual Speed GetSpeed() const = 0;
|
||||||
|
|
||||||
|
virtual void SetPanZoom(bool isPanZoom) = 0;
|
||||||
|
virtual void SetRotate(bool isRotate) = 0;
|
||||||
|
virtual void SetSpeed(Speed speed) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual ~I3dMouseSensor() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
class I3dMouseNavigation {
|
||||||
|
public:
|
||||||
|
enum Pivot {
|
||||||
|
PIVOT_MANUAL = 0,
|
||||||
|
PIVOT_AUTO,
|
||||||
|
PIVOT_AUTO_OVERRIDE
|
||||||
|
};
|
||||||
|
|
||||||
|
enum Navigation {
|
||||||
|
NAVIGATION_OBJECT_MODE = 0,
|
||||||
|
NAVIGATION_CAMERA_MODE,
|
||||||
|
NAVIGATION_FLY_MODE,
|
||||||
|
NAVIGATION_WALK_MODE,
|
||||||
|
NAVIGATION_HELICOPTER_MODE
|
||||||
|
};
|
||||||
|
|
||||||
|
enum PivotVisibility {
|
||||||
|
PIVOT_HIDE = 0,
|
||||||
|
PIVOT_SHOW,
|
||||||
|
PIVOT_SHOW_MOVING
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual Navigation GetNavigationMode() const = 0;
|
||||||
|
virtual Pivot GetPivotMode() const = 0;
|
||||||
|
virtual PivotVisibility GetPivotVisibility() const = 0;
|
||||||
|
virtual bool IsLockHorizon() const = 0;
|
||||||
|
|
||||||
|
virtual void SetLockHorizon(bool bOn) = 0;
|
||||||
|
virtual void SetNavigationMode(Navigation navigation) = 0;
|
||||||
|
virtual void SetPivotMode(Pivot pivot) = 0;
|
||||||
|
virtual void SetPivotVisibility(PivotVisibility visibility) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual ~I3dMouseNavigation(){}
|
||||||
|
};
|
||||||
|
|
||||||
|
class I3dMouseParam : public I3dMouseSensor, public I3dMouseNavigation {
|
||||||
|
public:
|
||||||
|
virtual ~I3dMouseParam() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
4
interface/external/connexionclient/readme.txt
vendored
Normal file
4
interface/external/connexionclient/readme.txt
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
The mac version does not require any files here. 3D connexion should be installed from
|
||||||
|
http://www.3dconnexion.eu/service/drivers.html
|
||||||
|
|
||||||
|
For windows a header file is required Inc/I3dMouseParams.h
|
|
@ -115,6 +115,7 @@
|
||||||
#include "devices/MIDIManager.h"
|
#include "devices/MIDIManager.h"
|
||||||
#include "devices/OculusManager.h"
|
#include "devices/OculusManager.h"
|
||||||
#include "devices/TV3DManager.h"
|
#include "devices/TV3DManager.h"
|
||||||
|
#include "devices/3Dconnexion.h"
|
||||||
|
|
||||||
#include "scripting/AccountScriptingInterface.h"
|
#include "scripting/AccountScriptingInterface.h"
|
||||||
#include "scripting/AudioDeviceScriptingInterface.h"
|
#include "scripting/AudioDeviceScriptingInterface.h"
|
||||||
|
@ -639,6 +640,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
||||||
connect(applicationUpdater.data(), &AutoUpdater::newVersionIsAvailable, dialogsManager.data(), &DialogsManager::showUpdateDialog);
|
connect(applicationUpdater.data(), &AutoUpdater::newVersionIsAvailable, dialogsManager.data(), &DialogsManager::showUpdateDialog);
|
||||||
applicationUpdater->checkForUpdate();
|
applicationUpdater->checkForUpdate();
|
||||||
|
|
||||||
|
// the 3Dconnexion device wants to be initiliazed after a window is displayed.
|
||||||
|
ConnexionClient::init();
|
||||||
|
|
||||||
auto& packetReceiver = nodeList->getPacketReceiver();
|
auto& packetReceiver = nodeList->getPacketReceiver();
|
||||||
packetReceiver.registerListener(PacketType::DomainConnectionDenied, this, "handleDomainConnectionDeniedPacket");
|
packetReceiver.registerListener(PacketType::DomainConnectionDenied, this, "handleDomainConnectionDeniedPacket");
|
||||||
}
|
}
|
||||||
|
@ -750,6 +754,7 @@ Application::~Application() {
|
||||||
|
|
||||||
Leapmotion::destroy();
|
Leapmotion::destroy();
|
||||||
RealSense::destroy();
|
RealSense::destroy();
|
||||||
|
ConnexionClient::destroy();
|
||||||
|
|
||||||
qInstallMessageHandler(NULL); // NOTE: Do this as late as possible so we continue to get our log messages
|
qInstallMessageHandler(NULL); // NOTE: Do this as late as possible so we continue to get our log messages
|
||||||
}
|
}
|
||||||
|
@ -1480,6 +1485,7 @@ void Application::focusOutEvent(QFocusEvent* event) {
|
||||||
_keyboardMouseDevice.focusOutEvent(event);
|
_keyboardMouseDevice.focusOutEvent(event);
|
||||||
SixenseManager::getInstance().focusOutEvent();
|
SixenseManager::getInstance().focusOutEvent();
|
||||||
SDL2Manager::getInstance()->focusOutEvent();
|
SDL2Manager::getInstance()->focusOutEvent();
|
||||||
|
ConnexionData::getInstance().focusOutEvent();
|
||||||
|
|
||||||
// synthesize events for keys currently pressed, since we may not get their release events
|
// synthesize events for keys currently pressed, since we may not get their release events
|
||||||
foreach (int key, _keysPressed) {
|
foreach (int key, _keysPressed) {
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "devices/Faceshift.h"
|
#include "devices/Faceshift.h"
|
||||||
#include "devices/RealSense.h"
|
#include "devices/RealSense.h"
|
||||||
#include "devices/SixenseManager.h"
|
#include "devices/SixenseManager.h"
|
||||||
|
#include "devices/3Dconnexion.h"
|
||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
#include "scripting/MenuScriptingInterface.h"
|
#include "scripting/MenuScriptingInterface.h"
|
||||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
||||||
|
@ -447,6 +448,11 @@ Menu::Menu() {
|
||||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::RenderLookAtVectors, 0, false);
|
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::RenderLookAtVectors, 0, false);
|
||||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::RenderFocusIndicator, 0, false);
|
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::RenderFocusIndicator, 0, false);
|
||||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::ShowWhosLookingAtMe, 0, false);
|
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::ShowWhosLookingAtMe, 0, false);
|
||||||
|
addCheckableActionToQMenuAndActionHash(avatarDebugMenu,
|
||||||
|
MenuOption::Connexion,
|
||||||
|
0, false,
|
||||||
|
&ConnexionClient::getInstance(),
|
||||||
|
SLOT(toggleConnexion(bool)));
|
||||||
|
|
||||||
MenuWrapper* handOptionsMenu = developerMenu->addMenu("Hands");
|
MenuWrapper* handOptionsMenu = developerMenu->addMenu("Hands");
|
||||||
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::AlignForearmsWithWrists, 0, false);
|
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::AlignForearmsWithWrists, 0, false);
|
||||||
|
|
|
@ -160,6 +160,7 @@ namespace MenuOption {
|
||||||
const QString CenterPlayerInView = "Center Player In View";
|
const QString CenterPlayerInView = "Center Player In View";
|
||||||
const QString Chat = "Chat...";
|
const QString Chat = "Chat...";
|
||||||
const QString Collisions = "Collisions";
|
const QString Collisions = "Collisions";
|
||||||
|
const QString Connexion = "Activate 3D Connexion Devices";
|
||||||
const QString Console = "Console...";
|
const QString Console = "Console...";
|
||||||
const QString ControlWithSpeech = "Control With Speech";
|
const QString ControlWithSpeech = "Control With Speech";
|
||||||
const QString CopyAddress = "Copy Address to Clipboard";
|
const QString CopyAddress = "Copy Address to Clipboard";
|
||||||
|
|
1013
interface/src/devices/3Dconnexion.cpp
Executable file
1013
interface/src/devices/3Dconnexion.cpp
Executable file
File diff suppressed because it is too large
Load diff
244
interface/src/devices/3Dconnexion.h
Executable file
244
interface/src/devices/3Dconnexion.h
Executable file
|
@ -0,0 +1,244 @@
|
||||||
|
// 3DConnexion.h
|
||||||
|
// hifi
|
||||||
|
//
|
||||||
|
// Created by Marcel Verhagen on 09-06-15.
|
||||||
|
// Copyright 2015 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef hifi_ConnexionClient_h
|
||||||
|
#define hifi_ConnexionClient_h
|
||||||
|
|
||||||
|
#include <qobject.h>
|
||||||
|
#include <qlibrary.h>
|
||||||
|
#include "InterfaceLogging.h"
|
||||||
|
#include "Application.h"
|
||||||
|
|
||||||
|
#include "ui/UserInputMapper.h"
|
||||||
|
|
||||||
|
#ifndef HAVE_CONNEXIONCLIENT
|
||||||
|
class ConnexionClient : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
static ConnexionClient& getInstance();
|
||||||
|
static void init() {};
|
||||||
|
static void destroy() {};
|
||||||
|
static bool Is3dmouseAttached() { return false; };
|
||||||
|
public slots:
|
||||||
|
void toggleConnexion(bool shouldEnable) {};
|
||||||
|
};
|
||||||
|
#endif // NOT_HAVE_CONNEXIONCLIENT
|
||||||
|
|
||||||
|
#ifdef HAVE_CONNEXIONCLIENT
|
||||||
|
// the windows connexion rawinput
|
||||||
|
#ifdef _WIN32
|
||||||
|
|
||||||
|
#include "I3dMouseParams.h"
|
||||||
|
#include <QAbstractNativeEventFilter>
|
||||||
|
#include <QAbstractEventDispatcher>
|
||||||
|
#include <Winsock2.h>
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
// windows rawinput parameters
|
||||||
|
class MouseParameters : public I3dMouseParam {
|
||||||
|
public:
|
||||||
|
MouseParameters();
|
||||||
|
~MouseParameters();
|
||||||
|
|
||||||
|
// I3dmouseSensor interface
|
||||||
|
bool IsPanZoom() const;
|
||||||
|
bool IsRotate() const;
|
||||||
|
Speed GetSpeed() const;
|
||||||
|
|
||||||
|
void SetPanZoom(bool isPanZoom);
|
||||||
|
void SetRotate(bool isRotate);
|
||||||
|
void SetSpeed(Speed speed);
|
||||||
|
|
||||||
|
// I3dmouseNavigation interface
|
||||||
|
Navigation GetNavigationMode() const;
|
||||||
|
Pivot GetPivotMode() const;
|
||||||
|
PivotVisibility GetPivotVisibility() const;
|
||||||
|
bool IsLockHorizon() const;
|
||||||
|
|
||||||
|
void SetLockHorizon(bool bOn);
|
||||||
|
void SetNavigationMode(Navigation navigation);
|
||||||
|
void SetPivotMode(Pivot pivot);
|
||||||
|
void SetPivotVisibility(PivotVisibility visibility);
|
||||||
|
|
||||||
|
static bool Is3dmouseAttached();
|
||||||
|
|
||||||
|
private:
|
||||||
|
MouseParameters(const MouseParameters&);
|
||||||
|
const MouseParameters& operator = (const MouseParameters&);
|
||||||
|
|
||||||
|
Navigation fNavigation;
|
||||||
|
Pivot fPivot;
|
||||||
|
PivotVisibility fPivotVisibility;
|
||||||
|
bool fIsLockHorizon;
|
||||||
|
|
||||||
|
bool fIsPanZoom;
|
||||||
|
bool fIsRotate;
|
||||||
|
Speed fSpeed;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ConnexionClient : public QObject, public QAbstractNativeEventFilter {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
ConnexionClient();
|
||||||
|
~ConnexionClient();
|
||||||
|
|
||||||
|
static ConnexionClient& getInstance();
|
||||||
|
|
||||||
|
ConnexionClient* client;
|
||||||
|
static void init();
|
||||||
|
static void destroy();
|
||||||
|
|
||||||
|
static bool Is3dmouseAttached();
|
||||||
|
|
||||||
|
I3dMouseParam& MouseParams();
|
||||||
|
const I3dMouseParam& MouseParams() const;
|
||||||
|
|
||||||
|
virtual void Move3d(HANDLE device, std::vector<float>& motionData);
|
||||||
|
virtual void On3dmouseKeyDown(HANDLE device, int virtualKeyCode);
|
||||||
|
virtual void On3dmouseKeyUp(HANDLE device, int virtualKeyCode);
|
||||||
|
|
||||||
|
virtual bool nativeEventFilter(const QByteArray& eventType, void* message, long* result) Q_DECL_OVERRIDE
|
||||||
|
{
|
||||||
|
MSG* msg = static_cast< MSG * >(message);
|
||||||
|
return ConnexionClient::RawInputEventFilter(message, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void toggleConnexion(bool shouldEnable);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void Move3d(std::vector<float>& motionData);
|
||||||
|
void On3dmouseKeyDown(int virtualKeyCode);
|
||||||
|
void On3dmouseKeyUp(int virtualKeyCode);
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool InitializeRawInput(HWND hwndTarget);
|
||||||
|
|
||||||
|
static bool RawInputEventFilter(void* msg, long* result);
|
||||||
|
|
||||||
|
void OnRawInput(UINT nInputCode, HRAWINPUT hRawInput);
|
||||||
|
UINT GetRawInputBuffer(PRAWINPUT pData, PUINT pcbSize, UINT cbSizeHeader);
|
||||||
|
bool TranslateRawInputData(UINT nInputCode, PRAWINPUT pRawInput);
|
||||||
|
void On3dmouseInput();
|
||||||
|
|
||||||
|
class TInputData {
|
||||||
|
public:
|
||||||
|
TInputData() : fAxes(6) {}
|
||||||
|
|
||||||
|
bool IsZero() {
|
||||||
|
return (0.0f == fAxes[0] && 0.0f == fAxes[1] && 0.0f == fAxes[2] &&
|
||||||
|
0.0f == fAxes[3] && 0.0f == fAxes[4] && 0.0f == fAxes[5]);
|
||||||
|
}
|
||||||
|
|
||||||
|
int fTimeToLive; // For telling if the device was unplugged while sending data
|
||||||
|
bool fIsDirty;
|
||||||
|
std::vector<float> fAxes;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
HWND fWindow;
|
||||||
|
|
||||||
|
// Data cache to handle multiple rawinput devices
|
||||||
|
std::map< HANDLE, TInputData> fDevice2Data;
|
||||||
|
std::map< HANDLE, unsigned long> fDevice2Keystate;
|
||||||
|
|
||||||
|
// 3dmouse parameters
|
||||||
|
MouseParameters f3dMouseParams; // Rotate, Pan Zoom etc.
|
||||||
|
|
||||||
|
// use to calculate distance traveled since last event
|
||||||
|
DWORD fLast3dmouseInputTime;
|
||||||
|
};
|
||||||
|
|
||||||
|
// the osx connexion api
|
||||||
|
#else
|
||||||
|
|
||||||
|
#include <glm/glm.hpp>
|
||||||
|
#include "3DconnexionClient/ConnexionClientAPI.h"
|
||||||
|
|
||||||
|
class ConnexionClient : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
static ConnexionClient& getInstance();
|
||||||
|
static bool Is3dmouseAttached();
|
||||||
|
static void init();
|
||||||
|
static void destroy();
|
||||||
|
public slots:
|
||||||
|
void toggleConnexion(bool shouldEnable);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __APPLE__
|
||||||
|
|
||||||
|
#endif // HAVE_CONNEXIONCLIENT
|
||||||
|
|
||||||
|
|
||||||
|
// connnects to the userinputmapper
|
||||||
|
class ConnexionData : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
static ConnexionData& getInstance();
|
||||||
|
ConnexionData();
|
||||||
|
|
||||||
|
enum PositionChannel {
|
||||||
|
POSITION_AXIS_X_POS = 1,
|
||||||
|
POSITION_AXIS_X_NEG = 2,
|
||||||
|
POSITION_AXIS_Y_POS = 3,
|
||||||
|
POSITION_AXIS_Y_NEG = 4,
|
||||||
|
POSITION_AXIS_Z_POS = 5,
|
||||||
|
POSITION_AXIS_Z_NEG = 6,
|
||||||
|
ROTATION_AXIS_X_POS = 7,
|
||||||
|
ROTATION_AXIS_X_NEG = 8,
|
||||||
|
ROTATION_AXIS_Y_POS = 9,
|
||||||
|
ROTATION_AXIS_Y_NEG = 10,
|
||||||
|
ROTATION_AXIS_Z_POS = 11,
|
||||||
|
ROTATION_AXIS_Z_NEG = 12
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ButtonChannel {
|
||||||
|
BUTTON_1 = 1,
|
||||||
|
BUTTON_2 = 2,
|
||||||
|
BUTTON_3 = 3
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef std::unordered_set<int> ButtonPressedMap;
|
||||||
|
typedef std::map<int, float> AxisStateMap;
|
||||||
|
|
||||||
|
float getButton(int channel) const;
|
||||||
|
float getAxis(int channel) const;
|
||||||
|
|
||||||
|
UserInputMapper::Input makeInput(ConnexionData::PositionChannel axis);
|
||||||
|
UserInputMapper::Input makeInput(ConnexionData::ButtonChannel button);
|
||||||
|
|
||||||
|
void registerToUserInputMapper(UserInputMapper& mapper);
|
||||||
|
void assignDefaultInputMapping(UserInputMapper& mapper);
|
||||||
|
|
||||||
|
void update();
|
||||||
|
void focusOutEvent();
|
||||||
|
|
||||||
|
int getDeviceID() { return _deviceID; }
|
||||||
|
void setDeviceID(int deviceID) { _deviceID = deviceID; }
|
||||||
|
|
||||||
|
QString _name;
|
||||||
|
|
||||||
|
glm::vec3 cc_position;
|
||||||
|
glm::vec3 cc_rotation;
|
||||||
|
int clientId;
|
||||||
|
|
||||||
|
void setButton(int lastButtonState);
|
||||||
|
void handleAxisEvent();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int _deviceID = 0;
|
||||||
|
|
||||||
|
ButtonPressedMap _buttonPressedMap;
|
||||||
|
AxisStateMap _axisStateMap;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // defined(hifi_ConnexionClient_h)
|
|
@ -106,6 +106,7 @@ public:
|
||||||
CachesSize,
|
CachesSize,
|
||||||
Chat,
|
Chat,
|
||||||
Collisions,
|
Collisions,
|
||||||
|
Connexion,
|
||||||
Console,
|
Console,
|
||||||
ControlWithSpeech,
|
ControlWithSpeech,
|
||||||
CopyAddress,
|
CopyAddress,
|
||||||
|
|
Loading…
Reference in a new issue