Beispiel #1
0
        //-----------------------------------------------------------------------

        /*
         * public object CreateGlobal() {
         *
         * var globals = new HydraPluginGlobal[2];
         * globals[0] = new HydraPluginGlobal(0, this);
         * globals[1] = new HydraPluginGlobal(1, this);
         * return globals;
         * }
         */
        //-----------------------------------------------------------------------
        public void Start()
        {
            int r = Sixense.Init();

            if (r == Sixense.SUCCESS)
            {
                int attempts   = 0;
                int base_found = 0;
                while (base_found == 0 && attempts < 2)
                {
                    Thread.Sleep(1000);
                    base_found = Sixense.IsBaseConnected(0);
                }

                if (base_found == 0)
                {
                    Sixense.Exit();
                    throw new Exception("Hydra not attached");
                }

                Controller    = new Sixense.ControllerData[2];
                Controller[0] = new Sixense.ControllerData();
                Controller[1] = new Sixense.ControllerData();

                Angles    = new Sixense.ControllerAngles[2];
                Angles[0] = new Sixense.ControllerAngles();
                Angles[1] = new Sixense.ControllerAngles();

                r = Sixense.SetActiveBase(0);
                //return null;
            }
            else
            {
                throw new Exception("Failed to initialize Hydra");
            }
        }
Beispiel #2
0
 //-----------------------------------------------------------------------
 public void Stop()
 {
     Sixense.Exit();
 }