├── native_patcher
├── patcher.def
└── native_patcher.vcxproj.filters
├── Libs
├── Obi.dll
├── KK_FinalIK.dll
└── UnityEngine.UnityWebRequestAudioModule.dll
├── Images
├── cursor.png
├── icon_call.png
├── icon_hand.png
├── icon_play.png
├── icon_warp.png
├── icon_call_xz.png
├── icon_gripmove.png
├── icon_hand_1.png
├── icon_hand_2.png
├── icon_school.png
├── icon_school_1.png
├── icon_school_2.png
├── icon_settings.png
├── logo-github.gif
└── credits.txt
├── doc
└── img
│ ├── icon_hand.png
│ ├── icon_menu.png
│ ├── icon_warp.png
│ └── icon_school.png
├── Shared
├── Fixes
│ ├── Mirror
│ │ ├── mirror-shader
│ │ └── Manager.cs
│ ├── BepInExVrLogBackend.cs
│ ├── UnityPatches.cs
│ └── Util.cs
├── Obsolete
│ ├── Fixes
│ │ ├── topmostguishader
│ │ ├── OpenVRHelperTempfixHook.cs
│ │ ├── BepInExVrLogBackend.cs
│ │ ├── topmostgui.shader
│ │ ├── ReduceAssetUnloads.cs
│ │ └── TopmostToolIcons.cs
│ └── Controls
│ │ ├── BetterWarpTool.cs
│ │ ├── ToolUtil.cs
│ │ └── BetterMenuTool.cs
├── Features
│ ├── SFX
│ │ ├── Slap
│ │ │ └── Skin
│ │ │ │ ├── Rough
│ │ │ │ ├── Slaps A1.ogg
│ │ │ │ ├── Slaps A2.ogg
│ │ │ │ ├── Slaps B1.ogg
│ │ │ │ ├── Slaps B4.ogg
│ │ │ │ ├── sv_se_h_40.ogg
│ │ │ │ ├── sv_se_h_41.ogg
│ │ │ │ ├── sv_se_h_42.ogg
│ │ │ │ ├── sv_se_h_43.ogg
│ │ │ │ ├── sv_se_h_44.ogg
│ │ │ │ ├── MeidosSlap00.ogg
│ │ │ │ └── MeidosSlap01.ogg
│ │ │ │ └── Soft
│ │ │ │ ├── Slaps A2.ogg
│ │ │ │ ├── sv_se_h_40.ogg
│ │ │ │ ├── sv_se_h_42.ogg
│ │ │ │ └── sv_se_h_43.ogg
│ │ ├── Tap
│ │ │ ├── Cloth
│ │ │ │ ├── Rough
│ │ │ │ │ └── PAT DOWN COAT_1.ogg
│ │ │ │ └── Soft
│ │ │ │ │ └── SUFFLE AND TAPPING 47.ogg
│ │ │ └── Skin
│ │ │ │ ├── Soft
│ │ │ │ ├── SUFFLE AND TAPPING 35.ogg
│ │ │ │ ├── SUFFLE AND TAPPING 4.ogg
│ │ │ │ ├── SUFFLE AND TAPPING 49.ogg
│ │ │ │ ├── SUFFLE AND TAPPING 63.ogg
│ │ │ │ ├── SUFFLE AND TAPPING 8.ogg
│ │ │ │ ├── SUFFLE AND TAPPING 114.ogg
│ │ │ │ ├── SUFFLE AND TAPPING 115.ogg
│ │ │ │ ├── SUFFLE AND TAPPING 118.ogg
│ │ │ │ ├── SUFFLE AND TAPPING 5_1.ogg
│ │ │ │ └── SUFFLE AND TAPPING 118_1.ogg
│ │ │ │ └── Rough
│ │ │ │ ├── SUFFLE AND TAPPING 59.ogg
│ │ │ │ └── SUFFLE AND TAPPING 114_1.ogg
│ │ └── Traverse
│ │ │ └── Skin
│ │ │ └── Soft
│ │ │ └── SUFFLE AND TAPPING 5_1.ogg
│ ├── Voice
│ │ └── VoiceBundles.cs
│ └── PrivacyScreen.cs
├── Constants.cs
├── Interpreters
│ ├── Scenes
│ │ ├── CustomSceneInterpreter.cs
│ │ ├── OtherSceneInterpreter.cs
│ │ └── SceneInterpreter.cs
│ └── Input
│ │ └── InputWait.cs
├── IK
│ ├── Amplifier.cs
│ ├── NoPosBeforeIK.cs
│ ├── OffsetEffector.cs
│ ├── OffsetManipulator.cs
│ ├── LookAt.cs
│ ├── VRIKGuide.cs
│ ├── BeforeIK.cs
│ ├── VRIK.cs
│ └── OffsetModifier.cs
├── Grasp
│ ├── IK
│ │ └── SlapReaction.cs
│ ├── Parts
│ │ ├── BodyPartHead.cs
│ │ ├── VisualObject.cs
│ │ └── BendGoal.cs
│ ├── Translate
│ │ ├── Translate.cs
│ │ ├── TranslateCompensate.cs
│ │ └── TranslateMove.cs
│ └── Helpers
│ │ └── BaseHold.cs
├── AssemblyInfo.cs
├── Utils
│ ├── Extensions.cs
│ ├── WindowTools.cs
│ └── DebugHooks.cs
├── Shared.shproj
├── Handlers
│ ├── Helpers
│ │ ├── SmoothDamp.cs
│ │ └── ItemLag.cs
│ ├── Handler.cs
│ └── ForGrasp
│ │ └── HeadPartGuide.cs
├── Settings
│ └── KoikContext.cs
├── Camera
│ ├── CameraControlControl.cs
│ └── EffectorVFX.cs
├── Controls
│ ├── KoikMenuTool.cs
│ └── Locomotion.cs
└── Holders
│ └── VRBoop.cs
├── CharaStudioVR
├── Fixes
│ ├── topmostguishader
│ ├── OpenVRHelperTempfixHook.cs
│ ├── topmostgui.shader
│ ├── TopmostToolIcons.cs
│ ├── LoadFixHook.cs
│ └── SaveLoadSceneHook.cs
├── Util
│ ├── ColorZOrderShader
│ ├── MaterialHelper.cs
│ ├── BepInExVrLogBackend.cs
│ └── MoveableGUIObject.cs
├── StudioStandingMode.cs
├── Controls
│ ├── BetterWarpTool.cs
│ ├── ObjMoveHelper.cs
│ └── BetterMenuTool.cs
├── Settings
│ └── CharaStudioContext.cs
├── packages.config
└── Interpreters
│ ├── KKSCharaStudioActor.cs
│ └── TransientHead.cs
├── .gitmodules
├── SharedGame
├── Interpreters
│ ├── Patches
│ │ ├── ActionScenePatches.cs
│ │ ├── TalkScenePatches.cs
│ │ └── GraspPatches.cs
│ └── Extras
│ │ ├── InterpreterHooks.cs
│ │ └── IntegrationMaleBreath.cs
├── Caress
│ └── CaressUtil.cs
├── Handlers
│ ├── ForScenes
│ │ ├── ActionSceneHandler.cs
│ │ └── TalkSceneHandler.cs
│ └── Helpers
│ │ ├── AibuItemMover.cs
│ │ └── KissHelper.cs
├── SharedGame.shproj
├── GameStandingMode.cs
├── Features
│ └── HideMaleHead.cs
└── SharedGame.projitems
├── SharedStudio
├── Interpreters
│ └── KoikStudioInterpreter.cs
├── SharedStudio.projitems
├── SharedStudio.shproj
├── Settings
│ └── StudioSettings.cs
└── StudioStandingMode.cs
├── PatcherLoader
├── packages.config
├── Properties
│ └── AssemblyInfo.cs
├── Loader.cs
└── PatcherLoader.csproj
├── nuget.config
├── .gitignore
├── KK_VR
├── packages.config
└── VRPlugin.cs
├── KK_Studio
├── packages.config
└── VRPlugin.cs
├── LICENSE
├── KKS_VR
└── packages.config
└── release.ps1
/native_patcher/patcher.def:
--------------------------------------------------------------------------------
1 | EXPORTS
2 | setup_all
3 |
--------------------------------------------------------------------------------
/Libs/Obi.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Libs/Obi.dll
--------------------------------------------------------------------------------
/Images/cursor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Images/cursor.png
--------------------------------------------------------------------------------
/Libs/KK_FinalIK.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Libs/KK_FinalIK.dll
--------------------------------------------------------------------------------
/Images/icon_call.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Images/icon_call.png
--------------------------------------------------------------------------------
/Images/icon_hand.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Images/icon_hand.png
--------------------------------------------------------------------------------
/Images/icon_play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Images/icon_play.png
--------------------------------------------------------------------------------
/Images/icon_warp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Images/icon_warp.png
--------------------------------------------------------------------------------
/doc/img/icon_hand.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/doc/img/icon_hand.png
--------------------------------------------------------------------------------
/doc/img/icon_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/doc/img/icon_menu.png
--------------------------------------------------------------------------------
/doc/img/icon_warp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/doc/img/icon_warp.png
--------------------------------------------------------------------------------
/Images/icon_call_xz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Images/icon_call_xz.png
--------------------------------------------------------------------------------
/Images/icon_gripmove.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Images/icon_gripmove.png
--------------------------------------------------------------------------------
/Images/icon_hand_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Images/icon_hand_1.png
--------------------------------------------------------------------------------
/Images/icon_hand_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Images/icon_hand_2.png
--------------------------------------------------------------------------------
/Images/icon_school.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Images/icon_school.png
--------------------------------------------------------------------------------
/Images/icon_school_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Images/icon_school_1.png
--------------------------------------------------------------------------------
/Images/icon_school_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Images/icon_school_2.png
--------------------------------------------------------------------------------
/Images/icon_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Images/icon_settings.png
--------------------------------------------------------------------------------
/Images/logo-github.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Images/logo-github.gif
--------------------------------------------------------------------------------
/doc/img/icon_school.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/doc/img/icon_school.png
--------------------------------------------------------------------------------
/Shared/Fixes/Mirror/mirror-shader:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Fixes/Mirror/mirror-shader
--------------------------------------------------------------------------------
/CharaStudioVR/Fixes/topmostguishader:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/CharaStudioVR/Fixes/topmostguishader
--------------------------------------------------------------------------------
/CharaStudioVR/Util/ColorZOrderShader:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/CharaStudioVR/Util/ColorZOrderShader
--------------------------------------------------------------------------------
/Shared/Obsolete/Fixes/topmostguishader:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Obsolete/Fixes/topmostguishader
--------------------------------------------------------------------------------
/Images/credits.txt:
--------------------------------------------------------------------------------
1 | The hand icon is based on https://www.iconsdb.com/black-icons/stop-3-icon.html
2 | Gratefully copied under CC0.
3 |
--------------------------------------------------------------------------------
/Libs/UnityEngine.UnityWebRequestAudioModule.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Libs/UnityEngine.UnityWebRequestAudioModule.dll
--------------------------------------------------------------------------------
/Shared/Features/SFX/Slap/Skin/Rough/Slaps A1.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Slap/Skin/Rough/Slaps A1.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Slap/Skin/Rough/Slaps A2.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Slap/Skin/Rough/Slaps A2.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Slap/Skin/Rough/Slaps B1.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Slap/Skin/Rough/Slaps B1.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Slap/Skin/Rough/Slaps B4.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Slap/Skin/Rough/Slaps B4.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Slap/Skin/Soft/Slaps A2.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Slap/Skin/Soft/Slaps A2.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Slap/Skin/Soft/sv_se_h_40.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Slap/Skin/Soft/sv_se_h_40.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Slap/Skin/Soft/sv_se_h_42.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Slap/Skin/Soft/sv_se_h_42.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Slap/Skin/Soft/sv_se_h_43.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Slap/Skin/Soft/sv_se_h_43.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Slap/Skin/Rough/sv_se_h_40.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Slap/Skin/Rough/sv_se_h_40.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Slap/Skin/Rough/sv_se_h_41.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Slap/Skin/Rough/sv_se_h_41.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Slap/Skin/Rough/sv_se_h_42.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Slap/Skin/Rough/sv_se_h_42.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Slap/Skin/Rough/sv_se_h_43.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Slap/Skin/Rough/sv_se_h_43.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Slap/Skin/Rough/sv_se_h_44.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Slap/Skin/Rough/sv_se_h_44.ogg
--------------------------------------------------------------------------------
/Shared/Constants.cs:
--------------------------------------------------------------------------------
1 | namespace KK_VR
2 | {
3 | internal static class Constants
4 | {
5 | public const string Version = "2.6";
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Shared/Features/SFX/Slap/Skin/Rough/MeidosSlap00.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Slap/Skin/Rough/MeidosSlap00.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Slap/Skin/Rough/MeidosSlap01.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Slap/Skin/Rough/MeidosSlap01.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Tap/Cloth/Rough/PAT DOWN COAT_1.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Tap/Cloth/Rough/PAT DOWN COAT_1.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 35.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 35.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 4.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 4.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 49.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 49.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 63.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 63.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 8.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 8.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Tap/Cloth/Soft/SUFFLE AND TAPPING 47.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Tap/Cloth/Soft/SUFFLE AND TAPPING 47.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Tap/Skin/Rough/SUFFLE AND TAPPING 59.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Tap/Skin/Rough/SUFFLE AND TAPPING 59.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 114.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 114.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 115.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 115.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 118.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 118.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 5_1.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 5_1.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Tap/Skin/Rough/SUFFLE AND TAPPING 114_1.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Tap/Skin/Rough/SUFFLE AND TAPPING 114_1.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 118_1.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Tap/Skin/Soft/SUFFLE AND TAPPING 118_1.ogg
--------------------------------------------------------------------------------
/Shared/Features/SFX/Traverse/Skin/Soft/SUFFLE AND TAPPING 5_1.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IllusionMods/KKS_VR/HEAD/Shared/Features/SFX/Traverse/Skin/Soft/SUFFLE AND TAPPING 5_1.ogg
--------------------------------------------------------------------------------
/Shared/Interpreters/Scenes/CustomSceneInterpreter.cs:
--------------------------------------------------------------------------------
1 | namespace KK_VR.Interpreters
2 | {
3 | internal class CustomSceneInterpreter : SceneInterpreter
4 | {
5 |
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Shared/Interpreters/Scenes/OtherSceneInterpreter.cs:
--------------------------------------------------------------------------------
1 | namespace KK_VR.Interpreters
2 | {
3 | internal class OtherSceneInterpreter : SceneInterpreter
4 | {
5 |
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "VRGIN_OpenXR"]
2 | path = VRGIN_OpenXR
3 | url = https://github.com/ManlyMarco/VRGIN_OpenXR
4 | [submodule "VRGIN"]
5 | path = VRGIN
6 | url = https://github.com/lotsofbearsKoikatsu/VRGIN
7 |
--------------------------------------------------------------------------------
/Shared/IK/Amplifier.cs:
--------------------------------------------------------------------------------
1 | //using System;
2 | //using System.Collections.Generic;
3 | //using System.Linq;
4 | //using System.Text;
5 |
6 | //namespace KK_VR.IK
7 | //{
8 | // internal class Amplifier
9 | // {
10 | // }
11 | //}
12 |
--------------------------------------------------------------------------------
/Shared/Grasp/IK/SlapReaction.cs:
--------------------------------------------------------------------------------
1 | //using System;
2 | //using System.Collections.Generic;
3 | //using System.Linq;
4 | //using System.Text;
5 |
6 | //namespace KK_VR.Grasp
7 | //{
8 | // internal class SlapReaction
9 | // {
10 | // }
11 | //}
12 |
--------------------------------------------------------------------------------
/SharedGame/Interpreters/Patches/ActionScenePatches.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace KK_VR.Patches
7 | {
8 | internal class ActionScenePatches
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedStudio/Interpreters/KoikStudioInterpreter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using VRGIN.Core;
5 |
6 | namespace KK_VR.Interpreters
7 | {
8 | internal class KoikStudioInterpreter : GameInterpreter
9 | {
10 |
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/PatcherLoader/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Shared/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using KK_VR;
3 |
4 | [assembly: AssemblyTitle(VRPlugin.Name)]
5 | [assembly: AssemblyDescription("Adds VR support. Launch the game with running SteamVR.")]
6 | [assembly: AssemblyCompany("https://gitgoon.dev/IllusionMods/KKS_VR")]
7 | [assembly: AssemblyProduct(VRPlugin.Name)]
8 | [assembly: AssemblyCopyright("Copyright © 2020, 2021")]
9 | [assembly: AssemblyVersion(VRPlugin.Version)]
10 |
--------------------------------------------------------------------------------
/Shared/Utils/Extensions.cs:
--------------------------------------------------------------------------------
1 | namespace KK_VR
2 | {
3 | internal static class Extensions
4 | {
5 | ///
6 | /// Remove a prefix from the given string, if it exists.
7 | ///
8 | public static string StripPrefix(string prefix, string str)
9 | {
10 | if (str.StartsWith(prefix)) return str.Substring(prefix.Length);
11 | return null;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/SharedGame/Caress/CaressUtil.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using HarmonyLib;
4 |
5 | namespace KK_VR.Caress
6 | {
7 | public class CaressUtil
8 | {
9 | ///
10 | /// Send a synthetic click event to the hand controls.
11 | ///
12 | public static IEnumerator ClickCo()
13 | {
14 | var consumed = false;
15 | HandCtrlHooks.InjectMouseButtonDown(0, () => consumed = true);
16 | while (!consumed) yield return null;
17 | HandCtrlHooks.InjectMouseButtonUp(0);
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Shared/Grasp/Parts/BodyPartHead.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using KK_VR.IK;
5 | using static KK_VR.Grasp.GraspController;
6 | using UnityEngine;
7 |
8 | namespace KK_VR.Grasp
9 | {
10 | internal class BodyPartHead : BodyPart
11 | {
12 | internal readonly KK.RootMotion.FinalIK.FBBIKHeadEffector headEffector;
13 | internal BodyPartHead(
14 | PartName _name,
15 | ChaControl _chara,
16 | Transform _afterIK,
17 | Transform _beforeIK) : base(_name, _afterIK, _beforeIK)
18 | {
19 | headEffector = FBBIK.CreateHeadEffector(_chara, anchor);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Shared/IK/NoPosBeforeIK.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using UnityEngine;
5 |
6 | namespace KK_VR.IK
7 | {
8 | ///
9 | /// Component that assumes rotation of the target bone just before IK solver reads it.
10 | ///
11 | [DefaultExecutionOrder(9900)]
12 | internal class NoPosBeforeIK : MonoBehaviour
13 | {
14 | private Transform _bone;
15 | internal void Init(Transform bone)
16 | {
17 | _bone = bone;
18 | }
19 | internal void LateUpdate()
20 | {
21 | if (_bone == null) return;
22 | transform.rotation = _bone.rotation;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /[Ll]ibrary/
2 | /[Tt]emp/
3 | /[Oo]bj/
4 | /[Bb]uild/
5 | /[Bb]uilds/
6 | /Assets/AssetStoreTools*
7 |
8 | # Autogenerated VS/MD solution and project files
9 | ExportedObj/
10 | *.unityproj
11 | *.suo
12 | *.tmp
13 | *.user
14 | *.userprefs
15 | *.pidb
16 | *.booproj
17 | *.svd
18 |
19 |
20 | # Unity3D generated meta files
21 | *.pidb.meta
22 |
23 | # Unity3D Generated File On Crash Reports
24 | sysinfo.txt
25 |
26 | # Builds
27 | *.apk
28 | *.unitypackage
29 |
30 | *.exe
31 | *.suo
32 | */bin
33 | */obj
34 |
35 | # VSfile.
36 | .vs/
37 | /VRGIN.Template/Libs/*.dll
38 | packages/
39 | KoikatuVR/Libs
40 | PatcherLoader/Libs
41 | /bin
42 | /PostBuild.bat
43 | /_ReSharper.Caches
44 | /.editorconfig
45 |
46 | # rider
47 | .idea/
--------------------------------------------------------------------------------
/Shared/Grasp/Translate/Translate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using UnityEngine;
5 |
6 | namespace KK_VR.Grasp
7 | {
8 | internal abstract class Translate
9 | {
10 | internal Translate(Action onStep, Action onFinish)
11 | {
12 | _onStep = onStep;
13 | _onFinish = onFinish;
14 | }
15 |
16 | protected float _lerp;
17 | private readonly Action _onStep;
18 | private readonly Action _onFinish;
19 |
20 | internal virtual void DoStep()
21 | {
22 | _lerp += Time.deltaTime;
23 | _onStep?.Invoke();
24 |
25 | if (_lerp >= 1f)
26 | {
27 | _onFinish?.Invoke();
28 | }
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/SharedGame/Handlers/ForScenes/ActionSceneHandler.cs:
--------------------------------------------------------------------------------
1 | //using System;
2 | //using System.Collections.Generic;
3 | //using System.Linq;
4 | //using System.Text;
5 | //using UnityEngine;
6 | //using VRGIN.Controls;
7 |
8 | //namespace KK_VR.Handlers
9 | //{
10 | // // No real use for this one unless we'll get VRIK with custom animController.
11 | // // LF animation retargeting.
12 | // internal class ActionSceneHandler : MonoBehaviour
13 | // {
14 | // private Controller _controller;
15 | // private void Awake()
16 | // {
17 | // _controller = GetComponent();
18 | // }
19 | // internal float GetStickRotation()
20 | // {
21 | // var xy = _controller.Input.GetAxis();
22 | // return Mathf.Atan2(xy.y, xy.x) * Mathf.Rad2Deg + 90f;
23 | // }
24 |
25 | // }
26 | //}
27 |
--------------------------------------------------------------------------------
/SharedGame/Interpreters/Extras/InterpreterHooks.cs:
--------------------------------------------------------------------------------
1 | using KKAPI.MainGame;
2 | using KK_VR.Interpreters;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using UnityEngine;
8 | using static Illusion.Component.ShortcutKey;
9 |
10 | namespace KK_VR.Interpreters
11 | {
12 | // Because I'd much rather use neat hooks instead of re-inventing them.
13 | internal class InterpreterHooks : GameCustomFunctionController
14 | {
15 | protected override void OnStartH(MonoBehaviour proc, HFlag hFlag, bool vr)
16 | {
17 | KoikGameInterp.StartScene(KoikGameInterp.SceneType.HScene, proc);
18 | }
19 | protected override void OnEndH(MonoBehaviour proc, HFlag hFlag, bool vr)
20 | {
21 | KoikGameInterp.EndScene(KoikGameInterp.SceneType.HScene);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/CharaStudioVR/Fixes/OpenVRHelperTempfixHook.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using HarmonyLib;
3 | using Unity.XR.OpenVR;
4 |
5 | // Will break haptic feedback in KKS if enabled.
6 | namespace KK_VR.Fixes
7 | {
8 | ///
9 | /// No idea what exactly it does but it doesn't seem to hurt anything. Originally a part of KKS_CharaStudioVR
10 | ///
11 | public static class OpenVRHelperTempfixHook
12 | {
13 | public static void Patch()
14 | {
15 | new Harmony("OpenVRHelperTempfixHook").PatchAll(typeof(OpenVRHelperTempfixHook));
16 | }
17 |
18 | [HarmonyPrefix]
19 | [HarmonyPatch(typeof(OpenVRHelpers), "IsUsingSteamVRInput", new Type[] { })]
20 | public static bool PreIsUsingSteamVRInput(ref bool __result)
21 | {
22 | __result = true;
23 | return false;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/SharedStudio/SharedStudio.projitems:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
5 | true
6 | 9472fde9-73d0-4f62-adc0-8d0828ee2de6
7 |
8 |
9 | KK_VR
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Shared/Interpreters/Scenes/SceneInterpreter.cs:
--------------------------------------------------------------------------------
1 | using KK_VR.Camera;
2 | using UnityEngine.SceneManagement;
3 |
4 | namespace KK_VR.Interpreters
5 | {
6 | ///
7 | /// Scene based actions that don't correlate with the input
8 | ///
9 | abstract class SceneInterpreter
10 | {
11 | internal virtual void OnStart()
12 | {
13 | #if KKS
14 | // KKS swaps VFX all the time gotta keep up, KK doesn't seem like.
15 | EffectorVFX.Refresh();
16 | #endif
17 | }
18 | internal virtual void OnDisable()
19 | {
20 |
21 | }
22 | internal virtual void OnUpdate()
23 | {
24 |
25 | }
26 | internal virtual void OnLateUpdate()
27 | {
28 |
29 | }
30 | internal virtual void OnSceneLoaded(Scene scene, LoadSceneMode mode)
31 | {
32 |
33 | }
34 |
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Shared/Obsolete/Fixes/OpenVRHelperTempfixHook.cs:
--------------------------------------------------------------------------------
1 | //using System;
2 | //using HarmonyLib;
3 | //using Unity.XR.OpenVR;
4 |
5 | // Will break haptic feedback in KKS if enabled.
6 | //namespace KKS_VR.Fixes
7 | //{
8 | // ///
9 | // /// No idea what exactly it does but it doesn't seem to hurt anything. Originally a part of KKS_CharaStudioVR
10 | // ///
11 | // public static class OpenVRHelperTempfixHook
12 | // {
13 | // public static void Patch()
14 | // {
15 | // new Harmony("OpenVRHelperTempfixHook").PatchAll(typeof(OpenVRHelperTempfixHook));
16 | // }
17 |
18 | // [HarmonyPrefix]
19 | // [HarmonyPatch(typeof(OpenVRHelpers), "IsUsingSteamVRInput", new Type[] { })]
20 | // public static bool PreIsUsingSteamVRInput(ref bool __result)
21 | // {
22 | // __result = true;
23 | // return false;
24 | // }
25 | // }
26 | //}
27 |
--------------------------------------------------------------------------------
/CharaStudioVR/Util/MaterialHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using KKAPI.Utilities;
3 | using UnityEngine;
4 |
5 | namespace KK_VR.Util
6 | {
7 | internal class MaterialHelper
8 | {
9 | private static Shader _colorZOrderShader;
10 |
11 | public static Shader GetColorZOrderShader()
12 | {
13 | if (_colorZOrderShader == null)
14 | {
15 | try
16 | {
17 | var bundle = AssetBundle.LoadFromMemory(ResourceUtils.GetEmbeddedResource("ColorZOrderShader"));
18 | _colorZOrderShader = bundle.LoadAsset("ColorZOrder");
19 | bundle.Unload(false);
20 | }
21 | catch (Exception ex)
22 | {
23 | Console.WriteLine(ex.ToString());
24 | return null;
25 | }
26 | }
27 |
28 | return _colorZOrderShader;
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Shared/IK/OffsetEffector.cs:
--------------------------------------------------------------------------------
1 | //using UnityEngine;
2 | //using System.Collections;
3 | //using KK.RootMotion.FinalIK;
4 | //using System.Collections.Generic;
5 | //using KK_VR.Grasp;
6 | //using RootMotion.FinalIK;
7 |
8 | //namespace KK_VR.IK
9 | //{
10 |
11 | // ///
12 | // /// Custom positionOffset effector for FBBIK.
13 | // ///
14 | // internal class OffsetEffector : MonoBehaviour
15 | // {
16 | // // Main link.
17 | // private KK.RootMotion.FinalIK.IKEffector _effector;
18 | // //private readonly float weight = 1f;
19 |
20 | // internal void Init(KK.RootMotion.FinalIK.IKEffector effector)
21 | // {
22 | // //_ik = ik;
23 | // _effector = effector;
24 | // //_ik.solver.OnPreUpdate += ModifyOffset;
25 | // }
26 | // private void LateUpdate()
27 | // {
28 | // _effector.positionOffset += transform.position - _effector.bone.position;
29 | // }
30 | // }
31 | //}
32 |
--------------------------------------------------------------------------------
/Shared/Grasp/Translate/TranslateCompensate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using UnityEngine;
5 |
6 | namespace KK_VR.Grasp
7 | {
8 | internal class TranslateCompensate : Translate
9 | {
10 | internal TranslateCompensate(Action onStep, Action onFinish, Transform shouldMove, Transform shouldStay)
11 | : base(onStep: onStep, onFinish: onFinish)
12 | {
13 | _shouldMove = shouldMove;
14 | _shouldStay = shouldStay;
15 | _oldPos = _shouldStay.position;
16 | }
17 | // Part to compensate movement with.
18 | private readonly Transform _shouldMove;
19 |
20 | // Part that should stay put.
21 | private readonly Transform _shouldStay;
22 | private Vector3 _oldPos;
23 |
24 | internal override void DoStep()
25 | {
26 | base.DoStep();
27 | _shouldMove.position += _oldPos - _shouldStay.position;
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/KK_VR/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/KK_Studio/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Shared/Shared.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 447ca481-4806-48d1-8e95-d545d8294620
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/SharedGame/Interpreters/Patches/TalkScenePatches.cs:
--------------------------------------------------------------------------------
1 | #if KK
2 | using HarmonyLib;
3 | using KK_VR.Interpreters;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Text;
8 |
9 | namespace KK_VR.Patches
10 | {
11 | [HarmonyPatch]
12 | internal class TalkScenePatches
13 | {
14 | [HarmonyPostfix]
15 | [HarmonyPatch(typeof(TalkScene), nameof(TalkScene.Awake))]
16 | public static void TalkSceneAwakePrefix(TalkScene __instance)
17 | {
18 | // A cheap surefire way to differentiate between TalkScene/ADV.
19 | //VRPlugin.Logger.LogDebug($"TalkScene:Awake:{KoikGame.CurrentScene}");
20 | if (KoikGameInterp.CurrentScene == KoikGameInterp.SceneType.TalkScene)
21 | {
22 | ((TalkSceneInterp)KoikGameInterp.SceneInterpreter).OverrideAdv(__instance);
23 | }
24 | else
25 | {
26 | KoikGameInterp.StartScene(KoikGameInterp.SceneType.TalkScene, __instance);
27 | }
28 | }
29 | }
30 | }
31 | #endif
32 |
--------------------------------------------------------------------------------
/SharedGame/SharedGame.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 0aa55027-91a2-4fc5-b657-8c2a2b96f160
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/SharedStudio/SharedStudio.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 9472fde9-73d0-4f62-adc0-8d0828ee2de6
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Shared/Grasp/Translate/TranslateMove.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using ADV.Commands.Base;
5 | using UnityEngine;
6 |
7 | namespace KK_VR.Grasp
8 | {
9 | internal class TranslateMove : Translate
10 | {
11 | internal TranslateMove(Transform anchor, Action onStep, Action onFinish)
12 | : base(onStep: onStep, onFinish: onFinish)
13 | {
14 |
15 | _anchor = anchor;
16 | _offsetPos = anchor.localPosition;
17 | _offsetRot = anchor.localRotation;
18 | }
19 |
20 | private readonly Transform _anchor;
21 | private readonly Quaternion _offsetRot;
22 | private readonly Vector3 _offsetPos;
23 |
24 |
25 | internal override void DoStep()
26 | {
27 | base.DoStep();
28 | var step = Mathf.SmoothStep(0f, 1f, _lerp);
29 | _anchor.localPosition = Vector3.Lerp(_offsetPos, Vector3.zero, step);
30 | _anchor.localRotation = Quaternion.Lerp(_offsetRot, Quaternion.identity, step);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Shared/Handlers/Helpers/SmoothDamp.cs:
--------------------------------------------------------------------------------
1 | using ADV.Commands.Base;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using UnityEngine;
7 |
8 | namespace KK_VR.Handlers
9 | {
10 | ///
11 | /// Wrapped Mathf.SmoothDamp for comfy use
12 | ///
13 | internal class SmoothDamp
14 | {
15 | internal SmoothDamp(float smoothTime = 1f, float target = 1f)
16 | {
17 | _smoothTime = smoothTime;
18 | _target = target;
19 | }
20 | private float _current;
21 | private float _currentVelocity;
22 | private readonly float _target;
23 | private readonly float _smoothTime;
24 | internal float Current => _current;
25 | internal float Increase()
26 | {
27 | return _current = Mathf.SmoothDamp(_current, _target, ref _currentVelocity, _smoothTime);
28 | }
29 | internal float Decrease()
30 | {
31 | return _current = Mathf.SmoothDamp(_current, 0f, ref _currentVelocity, _smoothTime);
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/SharedGame/Handlers/Helpers/AibuItemMover.cs:
--------------------------------------------------------------------------------
1 | using KK_VR.Interpreters;
2 | using static HandCtrl;
3 | using UnityEngine;
4 |
5 | namespace KK_VR.Handlers
6 | {
7 | ///
8 | /// Feeds ~controller position to the hFlag.xy field
9 | ///
10 | internal class AibuItemMover
11 | {
12 | internal AibuItemMover(AibuColliderKind touch, Transform anchor)
13 | {
14 | _itemId = (int)touch - 2;
15 | _anchor = anchor;
16 | _lastPos = anchor.position;
17 | _item = HSceneInterp.handCtrl.useAreaItems[_itemId].obj.transform;
18 | }
19 | private readonly int _itemId;
20 | private readonly Transform _item;
21 | private readonly Transform _anchor;
22 | private Vector3 _lastPos;
23 |
24 |
25 | internal void Move()
26 | {
27 | var vec = (Vector2)_item.InverseTransformVector(_lastPos - _anchor.position);
28 | vec.y = 0f - vec.y;
29 | HSceneInterp.hFlag.xy[_itemId] += vec * 10f;
30 | _lastPos = _anchor.position;
31 | }
32 |
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/SharedStudio/Settings/StudioSettings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using BepInEx.Configuration;
5 | using VRGIN.Core;
6 |
7 | namespace KK_VR.Settings
8 | {
9 | public class StudioSettings
10 | {
11 | private const string SectionGeneral = "General";
12 |
13 | public static ConfigEntry NearClipPlane { get; private set; }
14 |
15 |
16 |
17 | public static VRSettings Create(ConfigFile config)
18 | {
19 | var settings = new VRSettings();
20 |
21 | var ipdScale = config.Bind(SectionGeneral, "IPD Scale", 0.9f,
22 | new ConfigDescription(
23 | "Scale of the camera. The lesser the bigger the world around appears",
24 | new AcceptableValueRange(0.25f, 4f)));
25 | Tie(ipdScale, v => settings.IPDScale = v);
26 |
27 | return settings;
28 | }
29 |
30 | private static void Tie(ConfigEntry entry, Action set)
31 | {
32 | set(entry.Value);
33 | entry.SettingChanged += (_, _1) => set(entry.Value);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/native_patcher/native_patcher.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 |
23 |
24 | Source Files
25 |
26 |
27 |
--------------------------------------------------------------------------------
/SharedStudio/StudioStandingMode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using KK_VR.Controls;
5 | using KK_VR.Features;
6 | using KK_VR.Settings;
7 | using UnityEngine.XR;
8 | using VRGIN.Controls;
9 | using VRGIN.Modes;
10 |
11 | namespace KK_VR
12 | {
13 | internal class StudioStandingMode : StandingMode
14 | {
15 | public override IEnumerable Tools { get; } = new[]
16 | {
17 | typeof(Controls.GameplayTool)
18 | };
19 |
20 | protected override IEnumerable CreateShortcuts()
21 | {
22 | // Disable all VRGIN shortcuts. We'll define necessary shortcuts
23 | // (if any) by ourselves.
24 | return Enumerable.Empty();
25 | }
26 | protected override Controller CreateLeftController()
27 | {
28 | var controller = base.CreateLeftController();
29 | controller.ToolIndex = 0;
30 | return controller;
31 | }
32 |
33 | protected override Controller CreateRightController()
34 | {
35 | var controller = base.CreateRightController();
36 | controller.ToolIndex = 0;
37 | return controller;
38 | }
39 |
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/CharaStudioVR/StudioStandingMode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using KK_VR.Controls;
4 | using KK_VR.Features;
5 | using KK_VR.Settings;
6 | using UnityEngine.XR;
7 | using VRGIN.Controls;
8 | using VRGIN.Modes;
9 |
10 | namespace KK_VR
11 | {
12 | internal class StudioStandingMode : StandingMode
13 | {
14 | public override IEnumerable Tools { get; } = new[]
15 | {
16 | typeof(BetterMenuTool),
17 | typeof(BetterWarpTool),
18 | typeof(GripMoveStudioNEOV2Tool)
19 | };
20 |
21 | protected override Controller CreateLeftController()
22 | {
23 | var controller = base.CreateLeftController();
24 | AddComponents(controller, EyeSide.Left);
25 | return controller;
26 | }
27 |
28 | protected override Controller CreateRightController()
29 | {
30 | var controller = base.CreateRightController();
31 | AddComponents(controller, EyeSide.Right);
32 | return controller;
33 | }
34 |
35 | private static void AddComponents(Controller controller, EyeSide controllerSide)
36 | {
37 | if (StudioSettings.EnableBoop.Value)
38 | VRBoopStudio.Initialize(controller, controllerSide);
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Shared/Fixes/Mirror/Manager.cs:
--------------------------------------------------------------------------------
1 | using KKAPI.Utilities;
2 | using UnityEngine;
3 | using VRGIN.Core;
4 | using Object = UnityEngine.Object;
5 |
6 | namespace KK_VR.Fixes.Mirror
7 | {
8 | ///
9 | /// Mirrors in the base game look very weird in VR. This object
10 | /// replaces components and materials to fix this issue.
11 | ///
12 | internal class Manager
13 | {
14 | private Material _material;
15 |
16 | public void Fix(MirrorReflection refl)
17 | {
18 | if (refl.GetComponent() != null) return;
19 | var mirror = refl.gameObject;
20 | Object.Destroy(refl);
21 | mirror.AddComponent();
22 | mirror.GetComponent().material = Material();
23 | }
24 |
25 | private Material Material()
26 | {
27 | if (_material == null)
28 | {
29 | var bundle = ResourceUtils.GetEmbeddedResource("mirror-shader");
30 | if (bundle == null) VRLog.Error("Failed to load shader bundle");
31 | var shader = VRGIN.Helpers.UnityHelper.LoadFromAssetBundle(bundle, "Assets/MirrorReflection.shader");
32 | if (shader == null) VRLog.Error("Failed to load shader");
33 | _material = new Material(shader);
34 | }
35 |
36 | return _material;
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/PatcherLoader/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("PatcherLoader")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("PatcherLoader")]
13 | [assembly: AssemblyCopyright("Copyright © 2021")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("7b4a46e3-629c-46cc-adf4-8fe8fced992d")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Shared/Fixes/BepInExVrLogBackend.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using BepInEx.Logging;
3 | using VRGIN.Core;
4 |
5 | namespace KK_VR.Fixes
6 | {
7 | public class BepInExVrLogBackend : ILoggerBackend
8 | {
9 | private static ManualLogSource _logger;
10 |
11 | public static void ApplyYourself()
12 | {
13 | _logger = BepInEx.Logging.Logger.CreateLogSource("VRLog");
14 |
15 | VRLog.Backend = new BepInExVrLogBackend();
16 | }
17 |
18 | public void Log(string text, object[] args, VRLog.LogMode severity)
19 | {
20 | var logText = args == null ? text : string.Format(text, args);
21 | _logger.Log(ConvertToBepinLogLevel(severity), Format(logText));
22 | }
23 |
24 | private static string Format(string text)
25 | {
26 | var frame = new StackTrace(4).GetFrame(0);
27 | return string.Format("[{0:0000}] [{2}.{3}] {1}", UnityEngine.Time.realtimeSinceStartup, text, frame.GetMethod().DeclaringType?.Name ?? "???", frame.GetMethod().Name);
28 | }
29 |
30 | private static LogLevel ConvertToBepinLogLevel(VRLog.LogMode severity)
31 | {
32 | return severity switch
33 | {
34 | VRLog.LogMode.Debug => LogLevel.Debug,
35 | VRLog.LogMode.Info => LogLevel.Info,
36 | VRLog.LogMode.Warning => LogLevel.Warning,
37 | VRLog.LogMode.Error => LogLevel.Error,
38 | _ => LogLevel.Message
39 | };
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/CharaStudioVR/Util/BepInExVrLogBackend.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using BepInEx.Logging;
3 | using VRGIN.Core;
4 |
5 | namespace KK_VR.Util
6 | {
7 | public class BepInExVrLogBackend : ILoggerBackend
8 | {
9 | private static ManualLogSource _logger;
10 |
11 | public static void ApplyYourself()
12 | {
13 | _logger = BepInEx.Logging.Logger.CreateLogSource("VRLog");
14 |
15 | VRLog.Backend = new BepInExVrLogBackend();
16 | }
17 |
18 | public void Log(string text, object[] args, VRLog.LogMode severity)
19 | {
20 | var logText = args == null ? text : string.Format(text, args);
21 | _logger.Log(ConvertToBepinLogLevel(severity), Format(logText));
22 | }
23 |
24 | private static string Format(string text)
25 | {
26 | var frame = new StackTrace(4).GetFrame(0);
27 | return string.Format("[{0:0000}] [{2}.{3}] {1}", UnityEngine.Time.realtimeSinceStartup, text, frame.GetMethod().DeclaringType?.Name ?? "???", frame.GetMethod().Name);
28 | }
29 |
30 | private static LogLevel ConvertToBepinLogLevel(VRLog.LogMode severity)
31 | {
32 | return severity switch
33 | {
34 | VRLog.LogMode.Debug => LogLevel.Debug,
35 | VRLog.LogMode.Info => LogLevel.Info,
36 | VRLog.LogMode.Warning => LogLevel.Warning,
37 | VRLog.LogMode.Error => LogLevel.Error,
38 | _ => LogLevel.Message
39 | };
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Shared/Obsolete/Fixes/BepInExVrLogBackend.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using BepInEx.Logging;
3 | using VRGIN.Core;
4 |
5 | namespace KKS_VR.Fixes
6 | {
7 | public class BepInExVrLogBackend : ILoggerBackend
8 | {
9 | private static ManualLogSource _logger;
10 |
11 | public static void ApplyYourself()
12 | {
13 | _logger = BepInEx.Logging.Logger.CreateLogSource("VRLog");
14 |
15 | VRLog.Backend = new BepInExVrLogBackend();
16 | }
17 |
18 | public void Log(string text, object[] args, VRLog.LogMode severity)
19 | {
20 | var logText = args == null ? text : string.Format(text, args);
21 | _logger.Log(ConvertToBepinLogLevel(severity), Format(logText));
22 | }
23 |
24 | private static string Format(string text)
25 | {
26 | var frame = new StackTrace(4).GetFrame(0);
27 | return string.Format("[{0:0000}] [{2}.{3}] {1}", UnityEngine.Time.realtimeSinceStartup, text, frame.GetMethod().DeclaringType?.Name ?? "???", frame.GetMethod().Name);
28 | }
29 |
30 | private static LogLevel ConvertToBepinLogLevel(VRLog.LogMode severity)
31 | {
32 | return severity switch
33 | {
34 | VRLog.LogMode.Debug => LogLevel.Debug,
35 | VRLog.LogMode.Info => LogLevel.Info,
36 | VRLog.LogMode.Warning => LogLevel.Warning,
37 | VRLog.LogMode.Error => LogLevel.Error,
38 | _ => LogLevel.Message
39 | };
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Shared/Interpreters/Input/InputWait.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using static VRGIN.Controls.Controller;
3 | using Valve.VR;
4 |
5 | namespace KK_VR.Interpreters
6 | {
7 | internal readonly struct InputWait
8 | {
9 | internal InputWait(int _index, TrackpadDirection _direction, bool _manipulateSpeed, float _duration)
10 | {
11 | index = _index;
12 | direction = _direction;
13 | manipulateSpeed = _manipulateSpeed;
14 |
15 | duration = _duration;
16 | timestamp = Time.time;
17 | finish = Time.time + _duration;
18 | }
19 | internal InputWait(int _index, TrackpadDirection _direction, float _duration)
20 | {
21 | index = _index;
22 | direction = _direction;
23 |
24 | duration = _duration;
25 | timestamp = Time.time;
26 | finish = Time.time + _duration;
27 | }
28 | internal InputWait(int _index, EVRButtonId _button, float _duration)
29 | {
30 | index = _index;
31 | button = _button;
32 |
33 | duration = _duration;
34 | timestamp = Time.time;
35 | finish = Time.time + _duration;
36 | }
37 | internal readonly int index;
38 | internal readonly TrackpadDirection direction;
39 | internal readonly EVRButtonId button;
40 | internal readonly bool manipulateSpeed;
41 | internal readonly float timestamp;
42 | internal readonly float duration;
43 | internal readonly float finish;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/SharedGame/Interpreters/Extras/IntegrationMaleBreath.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Reflection;
4 | using System.Text;
5 | using HarmonyLib;
6 | using static KK_VR.Fixes.Util;
7 |
8 | namespace KK_VR
9 | {
10 | internal static class IntegrationMaleBreath
11 | {
12 | internal static bool IsActive => _active;
13 | private static bool _active;
14 |
15 | ///
16 | /// Provides whatever personality was set in the config for male voice, so we can use it for male reaction.
17 | ///
18 | internal static Func GetMaleBreathPersonality;
19 |
20 | ///
21 | /// Synchronizes state of the plugin when PoV is used.
22 | ///
23 | internal static Action OnPov;
24 |
25 |
26 | internal static void Init()
27 | {
28 | var type = AccessTools.TypeByName("KK_MaleBreath.MaleBreath");
29 | if (type != null)
30 | {
31 | if (GetMethod(type, "GetPlayerPersonality", out var getPlayerPersonality))
32 | {
33 | GetMaleBreathPersonality = AccessTools.MethodDelegate>(getPlayerPersonality);
34 | }
35 |
36 | if (GetMethod(type, "OnPov", out var onPov))
37 | {
38 | OnPov = AccessTools.MethodDelegate>(onPov);
39 | }
40 | _active = GetMaleBreathPersonality != null && OnPov != null;
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/SharedGame/Interpreters/Patches/GraspPatches.cs:
--------------------------------------------------------------------------------
1 | using HarmonyLib;
2 | using KK_VR.Grasp;
3 |
4 | namespace KK_VR.Patches
5 | {
6 | [HarmonyPatch]
7 | internal class GraspPatches
8 | {
9 | [HarmonyPrefix]
10 | [HarmonyPatch(typeof(MotionIK), nameof(MotionIK.Calc))]
11 | public static void MotionIKCalcPrefix(string stateName, MotionIK __instance)
12 | {
13 | GraspHelper.SetDefaultState(__instance.info, stateName);
14 |
15 | }
16 | [HarmonyPostfix]
17 | [HarmonyPatch(typeof(MotionIK), nameof(MotionIK.Calc))]
18 | public static void MotionIKCalcPostfix(MotionIK __instance)
19 | {
20 | GraspHelper.SetWorkingState(__instance.info);
21 | }
22 |
23 |
24 | //[HarmonyPrefix]
25 | //[HarmonyPatch(typeof(HitReaction), nameof(HitReaction.HitsEffector))]
26 | //public static void HitsEffectorPrefix(int _nid, ref Vector3[] forces, HitReaction __instance)
27 | //{
28 | // var chara = __instance.ik.GetComponentInParent();
29 | // for (var i = 0; i < forces.Length; i++)
30 | // {
31 | // forces[i] = GraspController.Instance.HitReactionWorkaround(
32 | // forces[i],
33 | // chara,
34 | // __instance.effectorHit[_nid].effectorHitPoints[i].effectorLinks[0].effector);
35 | // }
36 | // foreach (var force in forces)
37 | // {
38 | // //VRPlugin.Logger.LogDebug($"{force}");
39 | // }
40 | //}
41 |
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Shared/Features/Voice/VoiceBundles.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace KK_VR.Features
7 | {
8 | public static class VoiceBundles
9 | {
10 |
11 | // Look up maleBreath, i do it way more eloquently there.
12 |
13 | // ** is a Stand-in for personality Id.
14 | // ^ is a Stand-in for experience level.
15 | public static List Shorts =
16 | [
17 | "h/h_ko_**_0^_005_00",
18 | "h/h_ko_**_0^_005_01",
19 | "h/h_ko_**_0^_005_02",
20 | "h/h_ko_**_0^_005_03",
21 | "h/h_ko_**_0^_005_04",
22 | "h/h_ko_**_0^_005_05",
23 | "h/h_ko_**_0^_005_06",
24 | "h/h_ko_**_0^_005_07",
25 | "h/h_ko_**_0^_005_08",
26 | "h/h_ko_**_0^_005_09",
27 | "h/h_ko_**_0^_006_00",
28 | "h/h_ko_**_0^_006_01",
29 | "h/h_ko_**_0^_006_02",
30 | "h/h_ko_**_0^_006_03",
31 | "h/h_ko_**_0^_006_04",
32 | "h/h_ko_**_0^_006_05",
33 | "h/h_ko_**_0^_006_06",
34 | "h/h_ko_**_0^_006_07",
35 | "h/h_ko_**_0^_006_08",
36 | "h/h_ko_**_0^_006_09",
37 | ];
38 |
39 | public static List Laughs =
40 | [
41 | "adv/com_ev_**_464_00",
42 | "adv/com_ev_**_464_01",
43 | //"adv/com_ev_**_464_02",
44 | "adv/com_ev_**_465_00",
45 | "adv/com_ev_**_465_01",
46 | "adv/com_ev_**_465_02",
47 | //"adm/adm_**_tanon_02"
48 | ];
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/SharedGame/GameStandingMode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using KK_VR.Features;
5 | using KK_VR.Settings;
6 | using VRGIN.Controls;
7 | using VRGIN.Modes;
8 |
9 | namespace KK_VR
10 | {
11 | ///
12 | /// Initialize controllers and custom tools
13 | ///
14 | internal class GameStandingMode : StandingMode
15 | {
16 | public override IEnumerable Tools { get; } =
17 | [
18 | typeof(Controls.GameplayTool)
19 | ];
20 |
21 | protected override IEnumerable CreateShortcuts()
22 | {
23 | // Disable all VRGIN shortcuts. We'll define necessary shortcuts
24 | // (if any) by ourselves.
25 | return Enumerable.Empty();
26 | }
27 |
28 | protected override Controller CreateLeftController()
29 | {
30 | var controller = base.CreateLeftController();
31 | controller.ToolIndex = 0;
32 | return controller;
33 | }
34 |
35 | protected override Controller CreateRightController()
36 | {
37 | var controller = base.CreateRightController();
38 | controller.ToolIndex = 0;
39 | return controller;
40 | }
41 |
42 | protected override void SyncCameras()
43 | {
44 | // Do nothing. CameraControlControl and friends take care of this.
45 | }
46 |
47 | protected override void InitializeScreenCapture()
48 | {
49 | // Don't enable CapturePanorama because it looks broken (throws an
50 | // exception).
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/CharaStudioVR/Controls/BetterWarpTool.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using HarmonyLib;
4 | using Valve.VR;
5 | using VRGIN.Controls;
6 | using VRGIN.Controls.Tools;
7 |
8 |
9 | // MainGame doesn't have warp tool no more.
10 | namespace KK_VR.Controls
11 | {
12 | ///
13 | /// WarpTool version that cancels teleporting when user tries grab moving
14 | ///
15 | ///
16 | internal class BetterWarpTool : WarpTool
17 | {
18 | protected override void OnUpdate()
19 | {
20 | // If current state is moving/rotating the teleport target, cancel it so that grab moving
21 | // can be done (by default it's stuck in teleport mode until you switch tools)
22 | if (Controller.GetPressDown(EVRButtonId.k_EButton_Grip))
23 | {
24 | var tv = Traverse.Create(this);
25 | var state = tv.Field("State");
26 | var stateVal = state.GetValue();
27 | if (stateVal == 1 || stateVal == 2)
28 | {
29 | state.SetValue(0);
30 | tv.Method("SetVisibility", new[] { typeof(bool) }).GetValue(false);
31 | }
32 | }
33 |
34 | base.OnUpdate();
35 | }
36 |
37 | //public override List GetHelpTexts()
38 | //{
39 | // return new List(new[]
40 | // {
41 | // ToolUtil.HelpTrackpadCenter(Owner, "Press to teleport"),
42 | // ToolUtil.HelpGrip(Owner, "Hold to move"),
43 | // }.Where(x => x != null));
44 | //}
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/Shared/Obsolete/Controls/BetterWarpTool.cs:
--------------------------------------------------------------------------------
1 | //using System.Collections.Generic;
2 | //using System.Linq;
3 | //using HarmonyLib;
4 | //using Valve.VR;
5 | //using VRGIN.Controls;
6 | //using VRGIN.Controls.Tools;
7 |
8 |
9 | // Warp tool is gone.
10 | //namespace KKS_VR.Controls
11 | //{
12 | // ///
13 | // /// WarpTool version that cancels teleporting when user tries grab moving
14 | // ///
15 | // ///
16 | // internal class BetterWarpTool : WarpTool
17 | // {
18 | // protected override void OnUpdate()
19 | // {
20 | // // If current state is moving/rotating the teleport target, cancel it so that grab moving
21 | // // can be done (by default it's stuck in teleport mode until you switch tools)
22 | // if (Controller.GetPressDown(EVRButtonId.k_EButton_Grip))
23 | // {
24 | // var tv = Traverse.Create(this);
25 | // var state = tv.Field("State");
26 | // var stateVal = state.GetValue();
27 | // if (stateVal == 1 || stateVal == 2)
28 | // {
29 | // state.SetValue(0);
30 | // tv.Method("SetVisibility", new[] { typeof(bool) }).GetValue(false);
31 | // }
32 | // }
33 |
34 | // base.OnUpdate();
35 | // }
36 |
37 | // public override List GetHelpTexts()
38 | // {
39 | // return new List(new[]
40 | // {
41 | // ToolUtil.HelpTrackpadCenter(Owner, "Press to teleport"),
42 | // ToolUtil.HelpGrip(Owner, "Hold to move"),
43 | // }.Where(x => x != null));
44 | // }
45 | // }
46 | //}
47 |
--------------------------------------------------------------------------------
/Shared/IK/OffsetManipulator.cs:
--------------------------------------------------------------------------------
1 | using KK_VR.Grasp;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using UnityEngine;
7 |
8 | namespace KK_VR.IK
9 | {
10 | // Simplified version from FinalIK scripts
11 | internal abstract class OffsetManipulator : OffsetModifier
12 | {
13 | protected class EffectorLink
14 | {
15 | internal EffectorLink(KK.RootMotion.FinalIK.IKEffector _effector, Vector3 _offset, float _weight)
16 | {
17 | effector = _effector;
18 | defaultWeight = _weight;
19 | weight = _weight;
20 | offset = _offset;
21 | }
22 | internal readonly KK.RootMotion.FinalIK.IKEffector effector;
23 | internal readonly Vector3 offset;
24 | internal readonly float defaultWeight;
25 | internal float weight;
26 | internal void MultiplyWeight(float multiplier) => weight = Mathf.Clamp01(weight * multiplier);
27 | }
28 | protected readonly List _linkList = [];
29 |
30 | protected void OnInit(KK.RootMotion.FinalIK.FullBodyBipedIK ik)
31 | {
32 | _ik = ik;
33 | _ik.solver.OnPreUpdate += ModifyOffset;
34 | }
35 | internal void Add(BodyPart bodyPart, float weight)
36 | {
37 | _linkList.Add(new EffectorLink(bodyPart.effector, this.transform.InverseTransformPoint(bodyPart.anchor.position), weight));
38 | }
39 | protected override void OnModifyOffset()
40 | {
41 | foreach (var link in _linkList)
42 | {
43 | link.effector.positionOffset += (transform.TransformPoint(link.offset) - (link.effector.bone.position + link.effector.positionOffset)) * link.weight;
44 | }
45 | }
46 |
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Shared/IK/LookAt.cs:
--------------------------------------------------------------------------------
1 | using KK.RootMotion.FinalIK;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using UnityEngine;
7 | using VRGIN.Core;
8 |
9 | namespace KK_VR.IK
10 | {
11 | // Requires proper implementation with added scripts to manage it in SensibleH (WIP).
12 | internal class LookAt
13 | {
14 | internal static LookAtController SetupLookAtIK(ChaControl chara)
15 | {
16 | return null;
17 | var fbbik = chara.objAnim.GetComponent();
18 | if (fbbik == null) return null;
19 | var lookAt = chara.objAnim.AddComponent();
20 | Transform[] spine =
21 | [
22 | fbbik.references.spine[0],
23 | fbbik.references.spine[1],
24 | fbbik.references.spine[1].Find("cf_j_spine03"),
25 | fbbik.references.spine[2]
26 | ];
27 | lookAt.solver.SetChain(spine, fbbik.references.head, null, fbbik.references.root);
28 | lookAt.solver.bodyWeight = 0.6f;
29 | lookAt.solver.headWeight = 0.8f;
30 | var lookAtController = chara.objAnim.AddComponent();
31 | lookAtController.ik = lookAt;
32 | lookAtController.weightSmoothTime = 1f;
33 | lookAtController.targetSwitchSmoothTime = 1f;
34 | lookAtController.maxRadiansDelta = 0.25f;
35 | lookAtController.maxMagnitudeDelta = 0.25f;
36 | lookAtController.slerpSpeed = 1f;
37 | lookAtController.maxRootAngle = 180f;
38 |
39 | //lookController.target = VR.Camera.Head;
40 | //_spine03 = fbbik.references.spine[1].Find("cf_j_spine03");
41 | lookAtController.target = VR.Camera.Head; //hFlag.ctrlCamera.transform;
42 | return lookAtController;
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Shared/Fixes/UnityPatches.cs:
--------------------------------------------------------------------------------
1 | using HarmonyLib;
2 | using UnityEngine;
3 | using UnityEngine.UI;
4 |
5 | // Collection of patches to Unity.
6 |
7 | namespace KK_VR.Fixes
8 | {
9 | ///
10 | /// GraphicRaycaster.sortOrderPriority and GraphicRaycaster.renderOrderPriority
11 | /// respect the render/sort order of the canvas only when the render mode
12 | /// is set to ScreenSpaceOverlay. This causes incorrect UI item to receive
13 | /// clicks (#40).
14 | ///
15 | /// This class defines patches to ensure that these properties remain
16 | /// referenced after the canvas is modified to render to the VRGIN GUI
17 | /// camera.
18 | ///
19 | [HarmonyPatch(typeof(GraphicRaycaster))]
20 | internal class GraphicRaycasterPatches
21 | {
22 | [HarmonyPatch(nameof(GraphicRaycaster.sortOrderPriority), MethodType.Getter)]
23 | [HarmonyPostfix]
24 | private static void PostGetSortOrderPriority(GraphicRaycaster __instance, ref Canvas ___m_Canvas, ref int __result)
25 | {
26 | ___m_Canvas = ___m_Canvas ?? __instance.GetComponent