2 #include "openvr_driver.h" 3 #include "PSMoveClient_CAPI.h" 11 #define getcwd _getcwd // suppress "deprecation" warning 17 #define strcasecmp(a, b) stricmp(a,b) 18 #pragma warning (disable: 4996) // 'This function or variable may be unsafe': snprintf 19 #define snprintf _snprintf 26 static int find_index_of_string_in_table(
const char **string_table,
const int string_table_count,
const char *
string);
27 static std::string Path_StripFilename(
const std::string & sPath,
char slash);
28 static std::string Path_GetThisModulePath();
29 static std::string Path_GetHomeDirectory();
30 static std::string Path_GetPSMoveSteamVRBridgeInstallPath(
const class ServerDriverConfig *config);
31 static std::string Path_GetPSMoveSteamVRBridgeDriverRootPath(
const class ServerDriverConfig *config);
32 static std::string Path_GetPSMoveSteamVRBridgeDriverBinPath(
const class ServerDriverConfig *config);
33 static std::string Path_GetPSMoveSteamVRBridgeDriverResourcesPath(
const class ServerDriverConfig *config);
34 static std::string Path_GetPSMoveServiceInstallPath(
const class ServerDriverConfig *config);
35 static bool Path_CreateDirectory(
const std::string &path);
36 static bool Path_FileExists(
const std::string& filename);
37 static bool IsProcessRunning(
const std::string &processName);
38 static bool LaunchProcess(
const std::string &processPath,
const std::string &processName,
const std::vector<std::string> &args);
39 static bool GetHMDDeviceIndex(vr::TrackedDeviceIndex_t *out_hmd_device_index);
40 static bool GetTrackedDevicePose(
const vr::TrackedDeviceIndex_t device_index, PSMPosef *out_device_pose);
41 static PSMQuatf ExtractHMDYawQuaternion(
const PSMQuatf & q);
42 static PSMQuatf ExtractPSMoveYawQuaternion(
const PSMQuatf & q);
44 static void GetMetersPosInRotSpace(
const PSMQuatf * rotation, PSMVector3f * out_position,
const PSMPSMove & view);
48 static PSMPosef Utils::GetHMDPoseInMeters();
52 static PSMPosef Utils::RealignHMDTrackingSpace(PSMQuatf controllerOrientationInHmdSpaceQuat,
53 PSMVector3f controllerLocalOffsetFromHmdPosition,
54 PSMControllerID controllerId,
55 PSMPosef hmd_pose_meters,
56 bool useControllerOrientation);
57 static PSMQuatf openvrMatrixExtractPSMQuatf(
const vr::HmdMatrix34_t &openVRTransform);
58 static PSMQuatf psmMatrix3fToPSMQuatf(
const PSMMatrix3f &psmMat);
59 static float psmVector3fDistance(
const PSMVector3f &a,
const PSMVector3f &b);
60 static PSMVector3f psmVector3fLerp(
const PSMVector3f &a,
const PSMVector3f &b,
float u);
61 static PSMVector3f openvrMatrixExtractPSMVector3f(
const vr::HmdMatrix34_t &openVRTransform);
62 static PSMPosef openvrMatrixExtractPSMPosef(
const vr::HmdMatrix34_t &openVRTransform);
63 static std::string PSMVector3fToString(
const PSMVector3f& position);
64 static std::string PSMQuatfToString(
const PSMQuatf& rotation);
65 static std::string PSMPosefToString(
const PSMPosef& pose);
66 static void GenerateTrackerSerialNumber(
char *p,
int psize,
int tracker);
67 static void GenerateControllerSteamVRIdentifier(
char *p,
int psize,
int controller);
Provides printf-style line logging via the vr::IVRDriverLog interface provided by SteamVR during init...
Definition: config.cpp:18
Definition: settings_util.h:8