diff --git a/driver_Amethyst/BodyTracker.cpp b/driver_Amethyst/BodyTracker.cpp index 9c1c260..79bac17 100644 --- a/driver_Amethyst/BodyTracker.cpp +++ b/driver_Amethyst/BodyTracker.cpp @@ -66,7 +66,7 @@ void BodyTracker::update() if (_index != vr::k_unTrackedDeviceIndexInvalid && _activated) { // If _active is false, then disconnect the tracker - _pose.poseIsValid = _active; + _pose.poseIsValid = _valid; _pose.deviceIsConnected = _active; vr::VRServerDriverHost()->TrackedDevicePoseUpdated(_index, _pose, sizeof _pose); @@ -81,6 +81,7 @@ bool BodyTracker::set_pose(dTrackerBase const& tracker) _pose.vecPosition[0] = tracker.Position.X; _pose.vecPosition[1] = tracker.Position.Y; _pose.vecPosition[2] = tracker.Position.Z; + _valid = tracker.TrackingState; // Rotation _pose.qRotation.w = tracker.Orientation.W; diff --git a/driver_Amethyst/BodyTracker.h b/driver_Amethyst/BodyTracker.h index 016c355..bba831b 100644 --- a/driver_Amethyst/BodyTracker.h +++ b/driver_Amethyst/BodyTracker.h @@ -172,7 +172,7 @@ class BodyTracker : public vr::ITrackedDeviceServerDriver private: // Is tracker added/active - bool _added = false, _active = false; + bool _added = false, _active = false, _valid = false; bool _activated = false; // Stores the openvr supplied device index. diff --git a/driver_Amethyst/DataContract.idl b/driver_Amethyst/DataContract.idl index 7ba009d..ebb9491 100644 --- a/driver_Amethyst/DataContract.idl +++ b/driver_Amethyst/DataContract.idl @@ -41,6 +41,7 @@ struct dQuaternion struct dTrackerBase { boolean ConnectionState; + boolean TrackingState; [string] char* Serial; enum dTrackerType Role; diff --git a/driver_Amethyst/driver_Amethyst.vcxproj b/driver_Amethyst/driver_Amethyst.vcxproj index 89377ea..e8e0ecd 100644 --- a/driver_Amethyst/driver_Amethyst.vcxproj +++ b/driver_Amethyst/driver_Amethyst.vcxproj @@ -1,8 +1,8 @@ - + + - {e759084f-6445-400d-8f43-a64a6e276659} DynamicLibrary @@ -123,16 +123,16 @@ xcopy /y /d /e "$(OutDir)*" "$(SolutionDir)plugin_OpenVR\bin\$(Configuration)\ne This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - + + + + - - + + \ No newline at end of file diff --git a/driver_Amethyst/packages.config b/driver_Amethyst/packages.config index f8cbf9a..c5b2556 100644 --- a/driver_Amethyst/packages.config +++ b/driver_Amethyst/packages.config @@ -1,8 +1,7 @@  - - - - - + + + + \ No newline at end of file diff --git a/plugin_OpenVR/OpenVR.cs b/plugin_OpenVR/OpenVR.cs index 37ce293..4f8cef3 100644 --- a/plugin_OpenVR/OpenVR.cs +++ b/plugin_OpenVR/OpenVR.cs @@ -1388,6 +1388,7 @@ public static dTrackerBase ComTracker(this TrackerBase tracker) return new dTrackerBase { ConnectionState = Convert.ToSByte(tracker.ConnectionState), + TrackingState = Convert.ToSByte(tracker.TrackingState != TrackedJointState.StateNotTracked), Serial = tracker.Serial, Role = (dTrackerType)tracker.Role, Position = tracker.Position.ComVector(), diff --git a/plugin_OpenVR/plugin_OpenVR.csproj b/plugin_OpenVR/plugin_OpenVR.csproj index 56206da..3a9d7e1 100644 --- a/plugin_OpenVR/plugin_OpenVR.csproj +++ b/plugin_OpenVR/plugin_OpenVR.csproj @@ -20,13 +20,13 @@ - + - - - + + +