Exemple #1
0
    private void FindController()
    {
        LeapProvider provider = GameObject.FindObjectOfType <LeapProvider>() as LeapProvider;

        if (provider != null)
        {
            m_controller = provider.GetLeapController();
        }
    }
 void OnEnable()
 {
     provider.GetLeapController().DistortionChange += onDistortionChange;
     provider.GetLeapController().Connect          += delegate {
         provider.GetLeapController().Config.Get("images_mode", (Int32 enabled) => {
             this.ImagesEnabled = enabled == 0 ? false : true;
         });
     };
     StartCoroutine(CheckImageMode());
 }
    private void updateHistory()
    {
        long leapNow = provider.GetLeapController().Now();

        _history.Add(new TransformData()
        {
            leapTime      = leapNow,
            localPosition = InputTracking.GetLocalPosition(VRNode.CenterEye),
            localRotation = InputTracking.GetLocalRotation(VRNode.CenterEye)
        });

        // Reduce history length
        while (_history.Count > 0 &&
               MAX_LATENCY < leapNow - _history[0].leapTime)
        {
            _history.RemoveAt(0);
        }
    }
 void OnEnable()
 {
     provider.GetLeapController().DistortionChange += onDistortionChange;
 }