public override void UpdateComponent() { if (OculusDevice.GetRotationalConfidence(sensorId) == 0) { status = OculusDevice.IsPresent(0) ? Status.Present : Status.Unavailable; positionConfidence = 0; rotationConfidence = 0; gameObject.SetActive(false); return; } status = Status.Tracking; Vector3 localPosition = Target.ToVector3(OculusDevice.GetPosition(sensorId)); Quaternion localRotation = Target.ToQuaternion(OculusDevice.GetRotation(sensorId)); transform.position = trackerTransform.TransformPoint(localPosition); transform.rotation = trackerTransform.rotation * localRotation; positionConfidence = OculusDevice.GetPositionalConfidence(sensorId); rotationConfidence = OculusDevice.GetRotationalConfidence(sensorId); gameObject.SetActive(true); FuseWithUnityCamera(); }
public override bool IsPresent() { #if hOCULUS return(OculusDevice.IsPresent(Sensor.ID.Tracker1 + subTrackerId)); #else return(false); #endif }
public static int GetCount() { int count = 0; for (int i = 0; i < (int)OculusDevice.Tracker.Count; ++i) { if (OculusDevice.IsPresent(Sensor.ID.Tracker1 + i)) { count++; } } return(count); }