Beispiel #1
0
        //アクションセットを更新する
        public void UpdateActionSetState(ActiveActionSets ActiveSets)
        {
            ReadyCheck(); //実行可能な状態かチェック

            EVRInputError inputError = EVRInputError.None;

            //サイズ取得
            var size = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VRActiveActionSet_t));

            //更新処理実行
            inputError = vrinput.UpdateActionState(ActiveSets.Get(), size);

            //ここでエラーになることはそうそうない
            if (inputError != EVRInputError.None)
            {
                //致命的エラー
                throw new IOException(inputError.ToString());
            }
            return;
        }
Beispiel #2
0
        //---------------アクション更新-------------------

        //VRActiveActionSetを生成する。これを配列に突っ込んでUpdateActionSetStateを呼び出す
        public void AddActiveActionSet(ActiveActionSets ActionSets, string ActionSetPath, string RestrictInputSourcePath = "", string SecondaryActionSetPath = "")
        {
            VRActiveActionSet_t sets = new VRActiveActionSet_t();

            sets.ulActionSet          = GetActionSetHandle(ActionSetPath);  //更新対象
            sets.ulRestrictedToDevice = OpenVR.k_ulInvalidInputValueHandle; //制限なし
            sets.ulSecondaryActionSet = OpenVR.k_ulInvalidActionSetHandle;  //無効値を設定

            //制約デバイスが指定されているならば適用
            if (RestrictInputSourcePath != "")
            {
                sets.ulRestrictedToDevice = GetInputSourceHandle(RestrictInputSourcePath); //制約デバイス
            }
            //セカンダリアクションセットが指定されているならば適用
            if (SecondaryActionSetPath != "")
            {
                sets.ulSecondaryActionSet = GetActionSetHandle(SecondaryActionSetPath); //無効値を設定
            }

            ActionSets.Add(sets);
        }