/// <summary> /// Set the current tracking to a container /// </summary> /// <param name="index"></param> /// <param name="position"></param> /// <param name="rot"></param> private void RegisterPosition(int indx, Vector3 position, Quaternion rot) { TimedPoseData currentPoseData = new TimedPoseData(); currentPoseData.timestamp = Time.time; currentPoseData.rotation = rot; currentPoseData.position = position; poseData[indx].Add(currentPoseData); }
/// <summary> /// Registers the position at a defined time /// </summary> /// <param name="index"></param> /// <param name="position"></param> /// <param name="rot"></param> private void RegisterPosition(int index, Vector3 position, Quaternion rot) { TimedPoseData currentPoseData = new TimedPoseData(); currentPoseData.timestamp = Time.time; currentPoseData.rotation = rot; currentPoseData.position = position; controllers[index].delays.Add(currentPoseData); }
/// <summary> /// Set the current tracking to a container (TimedPoseData) to be stored in poseData and retrieved/applied after the latency period. /// </summary> /// <param name="index">Key value in the dictionary.</param> /// <param name="position">Tracked object's position from the VR SDK.</param> /// <param name="rot">Tracked object's rotation from the VR SDK.</param> private void RegisterPosition(int keyindex, Vector3 position, Quaternion rot) { TimedPoseData currentPoseData = new TimedPoseData(); currentPoseData.timestamp = Time.time; currentPoseData.rotation = rot; currentPoseData.position = position; //Compensate for positional drift by measuring the distance between HMD and ZED rig root (the head's center). Vector3 zedhmdposoffset = zedRigRoot.position - UnityEngine.XR.InputTracking.GetLocalPosition(UnityEngine.XR.XRNode.Head); currentPoseData.position += zedhmdposoffset; poseData[keyindex].Add(currentPoseData); }