コード例 #1
0
        private void ControllerPoseDataEvent(HoloeverEmulatorClientSocket.ControllerPoseData data)
        {
            Loom.QueueOnMainThread((param) => {
                HoloeverEmulatorClientSocket.ControllerPoseData controllerPoseData = (HoloeverEmulatorClientSocket.ControllerPoseData)param;
                int ControllerButton = IsRightControllerConenct ? controllerPoseData.rightControllerButton : controllerPoseData.leftControllerButton;

                bool MenuDown     = (ControllerButton & (1 << (int)ControllerButtonID.Menu)) != 0;
                bool TouchPadDown = (ControllerButton & (1 << (int)ControllerButtonID.TouchPad)) != 0;
                if (MenuDown)
                {
                    KeyStateController3DOF[CKeyEvent.KEYCODE_CONTROLLER_MENU] = CKeyEvent.ACTION_DOWN;
                }
                else
                {
                    KeyStateController3DOF[CKeyEvent.KEYCODE_CONTROLLER_MENU] = CKeyEvent.ACTION_UP;
                }

                if (TouchPadDown)
                {
                    KeyStateController3DOF[CKeyEvent.KEYCODE_CONTROLLER_TOUCHPAD] = CKeyEvent.ACTION_DOWN;
                }
                else
                {
                    KeyStateController3DOF[CKeyEvent.KEYCODE_CONTROLLER_TOUCHPAD] = CKeyEvent.ACTION_UP;
                }
            }, data);
        }
コード例 #2
0
ファイル: EditorDevice.cs プロジェクト: Kong-W/HoloeverMR
 private void ControllerPoseDataEvent(HoloeverEmulatorClientSocket.ControllerPoseData data)
 {
     Loom.QueueOnMainThread((param) => {
         HoloeverEmulatorClientSocket.ControllerPoseData controllerPoseData = (HoloeverEmulatorClientSocket.ControllerPoseData)param;
         HoloeverEmulatorClientSocket.TrackingQuat quat = controllerPoseData.right_controller_Pose_Orientation;
         NxrPlayerCtrl.Instance.EditorRemoteQuat        = new Quaternion(quat.x, quat.y, quat.z, quat.w);
     }, data);
 }