Esempio n. 1
0
 void MoveUpdateCallback(int id, MoveWrapper.Vector3 position, MoveWrapper.Quaternion orientation, int trigger)
 {
     bool mbutton = MoveWrapper.getButtonState(id, MoveButton.B_MOVE);
     if (mbutton)
     {
         //UNCOMMENT if you want to see the position and orientation updates
         Console.WriteLine("UPDATE moveid: " + id +
             " position: " + position.x + " " + position.y + " " + position.z +
             " orientation:" + orientation.w + " " + orientation.x + " " + orientation.y + " " + orientation.z + " trigger: " + trigger);
     }
 }
Esempio n. 2
0
        void MoveUpdateCallback(int id, MoveWrapper.Vector3 pos, MoveWrapper.Quaternion rot, int trigger)
        {
            RawPosition = new Vector3D(pos.x, pos.y, pos.z);
            RawRotation = new Quaternion(rot.x, -rot.y, rot.z, -rot.w);

            if (MoveWrapper.getButtonState(0, MoveButton.B_START))
            {
                Dispatcher.Invoke((Action)(Calibrate));
            }

            Dispatcher.Invoke((Action)(UpdatePositionAndRotation));
        }
Esempio n. 3
0
        void MoveUpdateCallback(int id, MoveWrapper.Vector3 position, MoveWrapper.Quaternion orientation, int trigger)
        {
            bool mbutton = MoveWrapper.getButtonState(id, MoveButton.B_MOVE);

            if (mbutton)
            {
                //UNCOMMENT if you want to see the position and orientation updates
                Console.WriteLine("UPDATE moveid: " + id +
                                  " position: " + position.x + " " + position.y + " " + position.z +
                                  " orientation:" + orientation.w + " " + orientation.x + " " + orientation.y + " " + orientation.z + " trigger: " + trigger);
            }
        }
Esempio n. 4
0
        public void init()
        {
            MoveWrapper.init();

            int moveCount = MoveWrapper.getMovesCount();

            Console.WriteLine("Moves: " + moveCount);
            Console.WriteLine("Navs: " + MoveWrapper.getNavsCount());

            if (moveCount > 0)
            {
                bool buttonX             = MoveWrapper.getButtonState(0, MoveButton.B_CROSS);
                MoveWrapper.Quaternion q = MoveWrapper.getOrientation(0);
                MoveWrapper.Vector3    v = MoveWrapper.getPosition(0);
                int trigger = MoveWrapper.getTriggerValue(0);
                MoveWrapper.setRumble(0, 255);
                Thread.Sleep(40);
                MoveWrapper.setRumble(0, 0);
            }
            MoveWrapper.subscribeMoveUpdate(this.MoveUpdateCallback, this.MoveKeyDownCallback, this.MoveKeyUpCallback, this.NavUpdateCallback, this.NavKeyDownCallback, this.NavKeyUpCallback);

            Console.ReadKey();
            MoveWrapper.unsubscribeMove();
        }