File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -144,9 +144,10 @@ void SlimeVRDriver::VRDriver::RunPoseRequestThread() {
144144 vr::PropertyContainerHandle_t prop_container = vr::VRProperties ()->TrackedDeviceToPropertyContainer (index);
145145 messages::ProtobufMessage* message = google::protobuf::Arena::CreateMessage<messages::ProtobufMessage>(&arena_);
146146
147- // Don't feed data about our own trackers, or Standable's fake ones.
148147 {
149148 vr::ETrackedPropertyError error{};
149+
150+ // Don't feed data about our own trackers and Standable's fake ones
150151 auto driver_name = vr::VRProperties ()->GetStringProperty (prop_container, vr::Prop_TrackingSystemName_String, &error);
151152 if (error != vr::TrackedProp_Success) {
152153 if (error != vr::TrackedProp_InvalidDevice && error != vr::TrackedProp_UnknownProperty)
@@ -155,6 +156,17 @@ void SlimeVRDriver::VRDriver::RunPoseRequestThread() {
155156 continue ;
156157 }
157158 if (driver_name == " slimevr" || driver_name == " standable" ) continue ;
159+
160+ auto device_class = (vr::ETrackedDeviceClass)vr::VRProperties ()->GetInt32Property (prop_container, vr::Prop_DeviceClass_Int32, &error);
161+ if (error != vr::TrackedProp_Success) {
162+ logger_->Log (" Failed to get Prop_DeviceClass_Int32 for device {}: {}" , index, vr::VRPropertiesRaw ()->GetPropErrorNameFromEnum (error));
163+ continue ;
164+ }
165+
166+ // Ignore devices that aren't HMD, controllers, or generic trackers
167+ if (device_class == vr::TrackedDeviceClass_Invalid || device_class >= vr::TrackedDeviceClass_TrackingReference) {
168+ continue ;
169+ }
158170 }
159171
160172 if (device.sent_add_message && !pose.bDeviceIsConnected ) {
You can’t perform that action at this time.
0 commit comments