public void Evaluate(int SpreadMax) { if (leapcontroller != null && leapcontroller.IsConnected && leapcontroller.IsServiceConnected && leapcontroller.Devices.Count > 0) { FDevice.SliceCount = 1; FController.SliceCount = 1; FFrame.SliceCount = 1; FDevice[0] = leapdevice; FController[0] = leapcontroller; FFrame[0] = leapcontroller.Frame(0); leapdevice = leapcontroller.Devices[0]; } else { FDevice.SliceCount = 0; FController.SliceCount = 0; FFrame.SliceCount = 0; } if (FReinit[0] || FirstFrame) { if (leapcontroller != null) { leapcontroller.Dispose(); } leapinit(); FirstFrame = false; } GlobalScale = FScale[0]; GlobalZMul = (FMirror[0]) ? -1 : 1; AgeCorrectionThreshold = FAgeThreshold[0]; }
private void leapinit() { leapcontroller = new Controller(); leapcontroller.StopConnection(); Controller.PolicyFlag flags = Controller.PolicyFlag.POLICY_DEFAULT | Controller.PolicyFlag.POLICY_IMAGES; if (FBckgFrames[0]) { flags = flags | Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES; } if (FHMD[0]) { flags = flags | Controller.PolicyFlag.POLICY_OPTIMIZE_HMD; } leapcontroller.SetPolicy(flags); leapcontroller.StartConnection(); try { leapdevice = leapcontroller.Devices[0]; } catch (Exception e) { } }
public DeviceEventArgs(Device device) : base(LeapEvent.EVENT_DEVICE) { this.Device = device; }
public void Update(Device updatedDevice) { _horizontalViewAngle = updatedDevice.HorizontalViewAngle; _verticalViewAngle = updatedDevice.VerticalViewAngle; _range = updatedDevice.Range; _baseline = updatedDevice.Baseline; _isValid = updatedDevice.IsValid; _isEmbedded = updatedDevice.IsEmbedded; _isStreaming = updatedDevice.IsStreaming; _serialNumber = updatedDevice.SerialNumber; }
/** * Compare Device object equality. * * \include Device_operator_equals.txt * * Two Device objects are equal if and only if both Device objects represent the * exact same Device and both Devices are valid. * @since 1.0 */ public bool Equals(Device other) { return this.SerialNumber == other.SerialNumber; }
private void leapinit() { leapcontroller = new Controller(); Controller.PolicyFlag flags = Controller.PolicyFlag.POLICY_DEFAULT; if (FBckgFrames[0]) flags = flags | Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES; if (FHMD[0]) flags = flags | Controller.PolicyFlag.POLICY_OPTIMIZE_HMD; leapcontroller.SetPolicy(flags); leapdevice = leapcontroller.Devices[0]; }
public void Evaluate(int SpreadMax) { if(leapcontroller!=null) { FDevice.SliceCount = 1; FController.SliceCount = 1; FFrame.SliceCount = 1; FDevice[0] = leapdevice; FController[0] = leapcontroller; FFrame[0] = leapcontroller.Frame(0); leapdevice = leapcontroller.Devices[0]; } else { FDevice.SliceCount = 0; FController.SliceCount = 0; FFrame.SliceCount = 0; } if (FReinit[0] || FirstFrame) { if (leapcontroller != null) leapcontroller.Dispose(); leapinit(); } GlobalScale = FScale[0]; GlobalZMul = (FMirror[0]) ? -1 : 1; AgeCorrectionThreshold = FAgeThreshold[0]; FirstFrame = false; }
public static void Update() { if( m_controller != null ) { Frame lastFrame = m_Frame == null ? Frame.Invalid : m_Frame; m_Frame = m_controller.Frame(); m_device = m_controller.Devices[0]; DispatchLostEvents(Frame, lastFrame); DispatchFoundEvents(Frame, lastFrame); DispatchUpdatedEvents(Frame, lastFrame); } }