protected void OnDevice(object sender, DeviceEventArgs args) { deviceInfo = provider.GetDeviceInfo(); _shouldSetLocalPosition = true; //Get a callback right as rendering begins for this frame so we can update the history and warping. LeapVRCameraControl.OnValidCameraParams -= onValidCameraParams; //avoid multiple subscription LeapVRCameraControl.OnValidCameraParams += onValidCameraParams; }
void Start() { #if UNITY_EDITOR if (!Application.isPlaying) { return; } #endif _deviceInfo = new LeapDeviceInfo(LeapDeviceType.Peripheral); }
void Start() { #if UNITY_EDITOR if (!Application.isPlaying) { return; } #endif _deviceInfo = LeapDeviceInfo.GetLeapDeviceInfo(); }
protected void OnDevice(object sender, DeviceEventArgs args) { deviceInfo = provider.GetDeviceInfo(); if (deviceInfo.type == LeapDeviceType.Invalid) { Debug.LogWarning("Invalid Leap Device -> enabled = false"); enabled = false; return; } //Get a callback right as rendering begins for this frame so we can update the history and warping. LeapVRCameraControl.OnValidCameraParams -= onValidCameraParams; //avoid multiple subscription LeapVRCameraControl.OnValidCameraParams += onValidCameraParams; }
protected void Start() { //Get a callback right as rendering begins for this frame so we can update the history and warping. LeapVRCameraControl.OnValidCameraParams += onValidCameraParams; deviceInfo = provider.GetDeviceInfo(); if (deviceInfo.type == LeapDeviceType.Invalid) { Debug.LogWarning("Invalid Leap Device -> enabled = false"); enabled = false; return; } }
protected void Start() { if (provider.IsConnected()) { deviceInfo = provider.GetDeviceInfo(); _shouldSetLocalPosition = true; LeapVRCameraControl.OnValidCameraParams += onValidCameraParams; } else { StartCoroutine(waitForConnection()); Controller controller = provider.GetLeapController(); controller.Device += OnDevice; } }
/** Returns information describing the device hardware. */ public LeapDeviceInfo GetDeviceInfo() { //return new LeapDeviceInfo(); if (_overrideDeviceType) { return(new LeapDeviceInfo(_overrideDeviceTypeWith)); } DeviceList devices = GetLeapController().Devices; Debug.Log("Device count is: " + devices.Count); if (devices.Count == 1) { LeapDeviceInfo info = new LeapDeviceInfo(LeapDeviceType.Peripheral); // TODO: DeviceList does not tell us the device type. Dragonfly serial starts with "LE" and peripheral starts with "LP" if (devices[0].SerialNumber.Length >= 2) { switch (devices[0].SerialNumber.Substring(0, 2)) { case ("LP"): info = new LeapDeviceInfo(LeapDeviceType.Peripheral); break; case ("LE"): info = new LeapDeviceInfo(LeapDeviceType.Dragonfly); break; default: break; } } // TODO: Add baseline & offset when included in API // NOTE: Alternative is to use device type since all parameters are invariant info.isEmbedded = devices[0].IsEmbedded; info.horizontalViewAngle = devices[0].HorizontalViewAngle * Mathf.Rad2Deg; info.verticalViewAngle = devices[0].VerticalViewAngle * Mathf.Rad2Deg; info.trackingRange = devices[0].Range / 1000f; info.serialID = devices[0].SerialNumber; return(info); } else if (devices.Count > 1) { return(new LeapDeviceInfo(LeapDeviceType.Peripheral)); } return(new LeapDeviceInfo(LeapDeviceType.Invalid)); }
protected void Start() { if (provider.IsConnected()) { deviceInfo = provider.GetDeviceInfo(); LeapVRCameraControl.OnValidCameraParams += onValidCameraParams; if (deviceInfo.type == LeapDeviceType.Invalid) { Debug.LogWarning("Invalid Leap Device -> enabled = false"); enabled = false; return; } } else { Controller controller = provider.GetLeapController(); controller.Device += OnDevice; } }
protected void Start() { if (provider.IsConnected()) { deviceInfo = provider.GetDeviceInfo(); _shouldSetLocalPosition = true; LeapVRCameraControl.OnValidCameraParams += onValidCameraParams; if (deviceInfo.type == LeapDeviceType.Invalid) { Debug.LogWarning("Invalid Leap Device -> enabled = false"); enabled = false; return; } } else { StartCoroutine(waitForConnection()); Controller controller = provider.GetLeapController(); controller.Device += OnDevice; } }
protected void OnDevice(object sender, DeviceEventArgs args) { deviceInfo = provider.GetDeviceInfo(); _shouldSetLocalPosition = true; if (deviceInfo.type == LeapDeviceType.Invalid) { Debug.LogWarning("Invalid Leap Device -> enabled = false"); enabled = false; return; } //Get a callback right as rendering begins for this frame so we can update the history and warping. LeapVRCameraControl.OnValidCameraParams -= onValidCameraParams; //avoid multiple subscription LeapVRCameraControl.OnValidCameraParams += onValidCameraParams; }
/** Returns information describing the device hardware. */ public LeapDeviceInfo GetDeviceInfo() { if (_overrideDeviceType) { return new LeapDeviceInfo(_overrideDeviceTypeWith); } DeviceList devices = GetLeapController().Devices; if (devices.Count == 1) { LeapDeviceInfo info = new LeapDeviceInfo(LeapDeviceType.Peripheral); // TODO: DeviceList does not tell us the device type. Dragonfly serial starts with "LE" and peripheral starts with "LP" if (devices[0].SerialNumber.Length >= 2) { switch (devices[0].SerialNumber.Substring(0, 2)) { case ("LP"): info = new LeapDeviceInfo(LeapDeviceType.Peripheral); break; case ("LE"): info = new LeapDeviceInfo(LeapDeviceType.Dragonfly); break; default: break; } } // TODO: Add baseline & offset when included in API // NOTE: Alternative is to use device type since all parameters are invariant info.isEmbedded = devices[0].IsEmbedded; info.horizontalViewAngle = devices[0].HorizontalViewAngle * Mathf.Rad2Deg; info.verticalViewAngle = devices[0].VerticalViewAngle * Mathf.Rad2Deg; info.trackingRange = devices[0].Range / 1000f; info.serialID = devices[0].SerialNumber; return info; } else if (devices.Count > 1) { return new LeapDeviceInfo(LeapDeviceType.Peripheral); } return new LeapDeviceInfo(LeapDeviceType.Invalid); }
/** Returns information describing the device hardware. */ public LeapDeviceInfo GetDeviceInfo() { return(LeapDeviceInfo.GetLeapDeviceInfo()); }