Esempio n. 1
0
        private void ControllerPoseDataEvent(NibiruEmulatorClientSocket.ControllerPoseData data)
        {
            Loom.QueueOnMainThread((param) => {
                NibiruEmulatorClientSocket.ControllerPoseData controllerPoseData = (NibiruEmulatorClientSocket.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);
        }
Esempio n. 2
0
 private void ControllerPoseDataEvent(NibiruEmulatorClientSocket.ControllerPoseData data)
 {
     Loom.QueueOnMainThread((param) => {
         NibiruEmulatorClientSocket.ControllerPoseData controllerPoseData = (NibiruEmulatorClientSocket.ControllerPoseData)param;
         NibiruEmulatorClientSocket.TrackingQuat quat = controllerPoseData.right_controller_Pose_Orientation;
         NxrPlayerCtrl.Instance.EditorRemoteQuat      = new Quaternion(quat.x, quat.y, quat.z, quat.w);
     }, data);
 }