Hey, Is there any built-in mechanism for figuring out if a device has lost tracking? (meaning the device usually jumps to 0,0,0). Any events perhaps? Thank you!
Bump. If there isn't a built-in solution for this then perhaps other developers could share their custom solutions to this problem. Maybe we can find a reliable solution together.
Hey, I don't know if you still need it, but there are a few ways to achieve this. If you need tracking lost information on controllers, you have it on the Steamvr_Behaviour_Pose, you have an event OnTrackingChanged containing an enum ETrackingResult. This enum will return if the controller is Uninitialized, Calibrating, OutOfRange, ... But this doesn't work for the head, to my knowledge. If you want data on the head, you have statics Boolean in SteamVR class. SteamVR.outOfRange, SteamVR.calibrating, etc. If you go deeper in SteamVR classes, you see that theses Boolean are just result of listening event in SteamVR_Events (SteamVR_Events.Calibrating and SteamVR_Events.OutOfRange). Hope it helps
Can you give an example of this being implemented? I can't for the life of me figure out how to subscribe to the event you mention and get the enum result back.
For anyone still looking for this: You can see it where the tracking data actually comes in, which is in the SteamVR_TrackedObject script. You can change it like so (see line 18 & 19): Code (CSharp): private void OnNewPoses(TrackedDevicePose_t[] poses) { if (index == EIndex.None) return; var i = (int)index; isValid = false; if (poses.Length <= i) return; if (!poses[i].bDeviceIsConnected) return; if (!poses[i].bPoseIsValid) return; if (poses[i].eTrackingResult != ETrackingResult.Running_OK) Debug.Log("tracking issue"); isValid = true; var pose = new SteamVR_Utils.RigidTransform(poses[i].mDeviceToAbsoluteTracking); if (origin != null) { transform.position = origin.transform.TransformPoint(pose.pos); transform.rotation = origin.rotation * pose.rot; } else { transform.localPosition = pose.pos; transform.localRotation = pose.rot; } //Debug.Log("Trackers: dt " + (Time.time - prevTime) + "position delta " + (transform.position - prevPos) * 100); //prevTime = Time.time; //prevPos = transform.position; }