2 #include "trackable_device.h" 4 #include "controller.h" 5 #include "PSMoveClient_CAPI.h" 6 #include <openvr_driver.h> 13 static const int CONFIG_VERSION;
17 , thumbstick_deadzone(k_defaultThumbstickDeadZoneRadius)
21 configuru::Config WriteToJSON()
override;
22 bool ReadFromJSON(
const configuru::Config &pt)
override;
25 float thumbstick_deadzone;
34 PSNaviController(PSMControllerID psmControllerID, vr::ETrackedControllerRole trackedControllerRole,
const char *psmSerialNo);
39 void AttachToController(
Controller *parent_controller);
42 vr::EVRInitError Activate(vr::TrackedDeviceIndex_t unObjectId)
override;
43 void Deactivate()
override;
46 vr::ETrackedDeviceClass GetTrackedDeviceClass()
const override {
return vr::TrackedDeviceClass_Controller; }
47 void Update()
override;
48 void RefreshWorldFromDriverPose()
override;
51 const char *GetControllerSettingsPrefix()
const override {
return "playstation_navi"; }
52 bool HasPSMControllerId(
int ControllerID)
const override {
return ControllerID == m_nPSMControllerId; }
53 const PSMController * GetPSMControllerView()
const override {
return m_PSMServiceController; }
54 std::string GetPSMControllerSerialNo()
const override {
return m_strPSMControllerSerialNo; }
55 PSMControllerType GetPSMControllerType()
const override {
return PSMController_Virtual; }
60 std::string fnamebase= std::string(
"psnavi_") + m_strPSMControllerSerialNo;
65 void UpdateThumbstick();
66 void UpdateEmulatedTrackpad();
67 void UpdateControllerState();
68 void UpdateTrackingState();
74 int m_nPSMControllerId;
75 PSMController *m_PSMServiceController;
76 std::string m_strPSMControllerSerialNo;
79 vr::ETrackingResult m_trackingStatus;
82 int m_nPoseSequenceNumber;
84 std::chrono::time_point<std::chrono::high_resolution_clock> m_lastTouchpadPressTime;
85 bool m_touchpadDirectionsUsed;
87 std::chrono::time_point<std::chrono::high_resolution_clock> m_resetPoseButtonPressTime;
88 bool m_bResetPoseRequestSent;
89 std::chrono::time_point<std::chrono::high_resolution_clock> m_resetAlignButtonPressTime;
90 bool m_bResetAlignRequestSent;
93 float m_lastSanitizedThumbstick_X;
94 float m_lastSanitizedThumbstick_Y;
97 static void start_controller_response_callback(
const PSMResponseMessage *response,
void *userdata);
Definition: controller.h:39
Definition: ps_navi_controller.h:30
Provides printf-style line logging via the vr::IVRDriverLog interface provided by SteamVR during init...
Definition: config.cpp:18
Definition: controller.h:14
Definition: ps_navi_controller.h:10