当前位置: 首页>>代码示例>>C#>>正文


C# Controller.SetPolicy方法代码示例

本文整理汇总了C#中Leap.Controller.SetPolicy方法的典型用法代码示例。如果您正苦于以下问题:C# Controller.SetPolicy方法的具体用法?C# Controller.SetPolicy怎么用?C# Controller.SetPolicy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Leap.Controller的用法示例。


在下文中一共展示了Controller.SetPolicy方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnInitialize

 public void OnInitialize(CommunicationService com, int interval)
 {
     OnRelease();
     m_communication = com;
     m_interval = interval;
     m_timer = new Stopwatch();
     m_timer.Start();
     m_listener = new LeapListener(this);
     m_controller = new Controller();
     m_controller.SetPolicy(m_controller.PolicyFlags | Controller.PolicyFlag.POLICY_IMAGES | Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES);
     m_controller.AddListener(m_listener);
 }
开发者ID:PsichiX,项目名称:Aegis,代码行数:12,代码来源:LeapImagesService.cs

示例2: LeapMotionGestureControl

    public LeapMotionGestureControl()
    {
        // Set up listener and controller
        listener = new LeapMotionGestureControlListener();
        controller = new Controller();

        // Allow background frames, otherwise.. well, it's useless
        controller.SetPolicy(Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES);

        // Watch for circles
        controller.EnableGesture(Gesture.GestureType.TYPE_CIRCLE);
        controller.EnableGesture(Gesture.GestureType.TYPE_KEY_TAP);
        controller.EnableGesture(Gesture.GestureType.TYPE_SWIPE);

        // Add on the listener
        controller.AddListener(listener);
    }
开发者ID:govindraj513,项目名称:leap-motion-gesture-control,代码行数:17,代码来源:LeapMotionGestureControl.cs

示例3: OnConnect

 public override void OnConnect(Controller controller)
 {
     controller.SetPolicy(Controller.PolicyFlag.POLICY_IMAGES);
     controller.EnableGesture(Gesture.GestureType.TYPE_SWIPE);
     controller.EnableGesture(Gesture.GestureType.TYPE_CIRCLE);
     controller.EnableGesture(Gesture.GestureType.TYPE_KEY_TAP);
     controller.EnableGesture(Gesture.GestureType.TYPE_SCREEN_TAP);
     controller.Config.SetFloat("Gesture.ScreenTap.MinForwardVelocity", 30.0f);
     controller.Config.SetFloat("Gesture.ScreenTap.HistorySeconds", .5f);
     controller.Config.SetFloat("Gesture.ScreenTap.MinDistance", 1.0f);
     controller.Config.SetFloat("Gesture.Circle.MinRadius", 10.0f);
     controller.Config.SetFloat("Gesture.Circle.MinArc", .5f);
     controller.Config.SetFloat("Gesture.KeyTap.MinDownVelocity", 40.0f);
     controller.Config.SetFloat("Gesture.KeyTap.HistorySeconds", .2f);
     controller.Config.SetFloat("Gesture.KeyTap.MinDistance", 1.0f);
     controller.Config.Save();
     this.eventDelegate.LeapEventNotification("onConnect");
 }
开发者ID:LEECHHE,项目名称:LeapMotionKeyMapper,代码行数:18,代码来源:MainWindow.xaml.cs

示例4: Main

    public static void Main()
    {
        // Create a sample listener and controller
        SampleListener listener = new SampleListener();
        Controller controller = new Controller();

        controller.SetPolicy(Leap.Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES);

        // Have the sample listener receive events from the controller
        controller.AddListener(listener);

        //creating socket
        //   UdpClient sendingClient = new UdpClient();
        //sendingClient.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
        //sendingClient.Connect("localhost", 4200);

        //Socket sending_socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
        //   IPAddress send_to_address = IPAddress.Parse("127.0.0.1");//localhost, for broadcast use ("192.168.2.255");
        //   IPEndPoint sending_end_point = new IPEndPoint(send_to_address, 4200);

        /*
        while(true)
        {



           // String text_to_send = "VR_TRACKER_SENSOR_0 42 24 66 0 0 0 0 0 0 1 2 3 4";
            //byte[] send_buffer = Encoding.ASCII.GetBytes(text_to_send);

            //Console.WriteLine("sending to address: {0} port: {1}",  sending_end_point.Address, sending_end_point.Port);
        
        
            try
            {
                //sending_socket.SendTo(send_buffer, sending_end_point);
                //sendingClient.Send(send_buffer, send_buffer.Length, sending_end_point);
            }
            catch (Exception send_exception)
            {
                //exception_thrown = true;
                Console.WriteLine(" Exception {0}", send_exception.Message);
            }
          
            Console.ReadLine();
            //System.Threading.Thread.Sleep(1000);
        }
        */
        // Keep this process running until Enter is pressed
        Console.WriteLine("Press Enter to quit...");
        Console.ReadLine();

        // Remove the sample listener when done
        controller.RemoveListener(listener);
        controller.Dispose();
    }
开发者ID:GMDIT,项目名称:LeapChess,代码行数:55,代码来源:LMS.cs

示例5: Start

  void Start ()
  {
    if (handController == null) {
      Debug.LogWarning ("Cannot use LeapImageRetriever if there is no HandController!");
      enabled = false;
      return;
    }

    _controller = handController.GetLeapController ();
    _controller.SetPolicy (Controller.PolicyFlag.POLICY_IMAGES);
  }
开发者ID:fufu70,项目名称:knighthacksoculeap,代码行数:11,代码来源:LeapImageRetriever.cs

示例6: Start

    void Start()
    {
        if (HandController.Main == null) {
          Debug.LogWarning("Could not find Main Hand Controller.  Cannot use LeapImageRetriever if there is no Main Hand Controller!");
          enabled = false;
          return;
        }

        float gamma = 1f;
        if (QualitySettings.activeColorSpace != ColorSpace.Linear) {
          gamma = -Mathf.Log10(Mathf.GammaToLinearSpace(0.1f));
        }
        Shader.SetGlobalFloat("_LeapGlobalColorSpaceGamma", gamma);

        _eyeTextureData[0] = new EyeTextureData();
        _eyeTextureData[1] = new EyeTextureData();

        _cachedCamera = GetComponent<Camera>();

        _controller = HandController.Main.GetLeapController();
        _controller.SetPolicy(Controller.PolicyFlag.POLICY_IMAGES);
    }
开发者ID:charlonyx,项目名称:3dSculpt,代码行数:22,代码来源:LeapImageRetriever.cs

示例7: leapinit

        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];
        }
开发者ID:microdee,项目名称:leappack,代码行数:10,代码来源:Devices.cs

示例8: OnConnect

 public override void OnConnect(Controller controller)
 {
     controller.SetPolicy(Controller.PolicyFlag.POLICY_IMAGES);
     controller.EnableGesture(Gesture.GestureType.TYPE_SWIPE);
     controller.EnableGesture(Gesture.GestureType.TYPE_CIRCLE);
     controller.EnableGesture(Gesture.GestureType.TYPE_SCREEN_TAP);
     controller.Config.SetFloat("Gesture.Swipe.minVelocity", 750f);
     this.eventDelegate.LeapEventNotification("onConnect");
 }
开发者ID:Sephiroth25896,项目名称:Projects,代码行数:9,代码来源:MainWindow.xaml.cs

示例9: StartController

	    /// <summary>
		/// Starts the controller.
		/// </summary>
		/// <param name="onFrameArrived">On frame arrived.</param>
        public void StartController(Action<Frame> onFrameArrived)
		{
		    _listener = new FrameListener(onFrameArrived);
            _leapController = new Controller(_listener);
            _leapController.SetPolicy(Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES);
        }
开发者ID:i2e-haw-hamburg,项目名称:trame,代码行数:10,代码来源:LeapAdapter.cs

示例10: MainWindow

 public MainWindow()
 {
     InitializeComponent();
     this.controller = new Controller();
     this.listener = new LeapEventListener(this);
     this.iBox = controller.Frame().InteractionBox;
     controller.AddListener(listener);
     controller.SetPolicy(Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES);
     Console.WriteLine("hi");
 }
开发者ID:LEECHHE,项目名称:LeapMotionKeyMapper,代码行数:10,代码来源:MainWindow.xaml.cs

示例11: OnConnect

 public override void OnConnect(Controller controller)
 {
     controller.SetPolicy(Controller.PolicyFlag.POLICY_IMAGES);
     controller.EnableGesture(Gesture.GestureType.TYPE_SWIPE);
     this.eventDelegate.LeapEventNotification("onConnect");
 }
开发者ID:frizensami,项目名称:LeapMotionDataCapture,代码行数:6,代码来源:MainWindow.xaml.cs

示例12: MainWindow

 public MainWindow()
 {
     InitializeComponent();
     this.controller = new Controller();
     this.listener = new LeapEventListener(this);
     controller.AddListener(listener);
     controller.SetPolicy(Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES);
 }
开发者ID:LEECHHE,项目名称:LeapMotionKeyMapper,代码行数:8,代码来源:MainWindow.xaml.cs

示例13: Window_Loaded

        private void Window_Loaded( object sender, RoutedEventArgs e )
        {
            leap = new Controller();
            leap.SetPolicy( Controller.PolicyFlag.POLICY_IMAGES );

            CompositionTarget.Rendering += CompositionTarget_Rendering;
        }
开发者ID:kaorun55,项目名称:LeapMotionIntroduction2,代码行数:7,代码来源:MainWindow.xaml.cs

示例14: Init

 static void Init()
 {
     var count = 0;
     var start = System.DateTime.Now;
     var con = new Controller(new FrameListener(x =>
     {
         count++;
         Console.SetCursorPosition(0, Console.CursorTop);
         Console.Write("Frames: " + count);
         var cur = System.DateTime.Now - start;
         Console.Write(" | FPS: " + (count / cur.TotalSeconds));
         OnFrameArrived(x);
     }));
     con.SetPolicy(Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES);
 }
开发者ID:i2e-haw-hamburg,项目名称:trame,代码行数:15,代码来源:Program.cs


注:本文中的Leap.Controller.SetPolicy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。