Skip to content

Commit

Permalink
feat(input): add finger tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
Xenira committed Mar 11, 2024
1 parent 17ae74e commit b345f0f
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 211 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ name: release-please
env:
MOD_NAME: "techtonica_vr"
PI_UTILS_VERSION: "0.2.0"
TTIK_VERSION: "0.1.4"
TTIK_VERSION: "0.2.0"
TOBEY_UNITY_AUDIO_VERSION: "2.0.2"

jobs:
Expand Down
8 changes: 5 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ifndef::env-github[]
endif::[]
:icons: font
:source-highlighter: highlightjs
:game-version: 0.2.1c
:game-version: 0.3.0-e
:repo: Xenira/TechtonicaVR

image:https://img.shields.io/github/v/release/{repo}["GitHub release (with filter)", link="https://github.com/{repo}/releases/latest"]
Expand Down Expand Up @@ -64,6 +64,8 @@ endif::[]

* Version {game-version} of the game. As the game is still in early access, this mod may not work with future versions of the game. If you encounter any issues, please create an https://github.com/{repo}/issues[Issue].
* https://github.com/BepInEx/BepInEx[BepInEx] version BepInEx Version
* https://github.com/Xenira/PiUtils[PiUtils] mod. Is included in the github release and as as an external dependency in the thunderstore release.
* https://github.com/Xenira/TTIK[TTIK] mod. Is included in the github release and as an external dependency in the thunderstore release.

== Setup

Expand Down Expand Up @@ -120,6 +122,7 @@ While the mod is in a playable state, it is still in early development. Some fea
- Controller haptics
- Smooth turning
- UI
- IK with coop support (https://github.com/Xenira/TTIK[TTIK])

=== Missing
- Gesture support (e.g. Mining using pickaxe motion)
Expand All @@ -137,7 +140,6 @@ While the mod is in a playable state, it is still in early development. Some fea

=== Cool stuff to try
- Tobii eye tracking for dynamic foveated rendering
- Enable ik (The game ships with `FinalIK` so it should be possible. Probably just not networked yet.)

== Configuration
The configuration file is located in `BepInEx/config/de.xenira.techtonicavr.cfg`. You can edit it using a text editor like Notepad.
Expand Down Expand Up @@ -223,7 +225,7 @@ I don't like NexusMods. I don't like their ToS and I don't like their mod manage
== License
This mod is licensed under the GNU General Public License v3.0 (GPL-3.0).

Contents of the `unity` and `libs` folders are licensed under their respective licenses.
Contents of the `unity`, `tools` and `libs` folders are licensed under their respective licenses.

== Disclaimer
This mod is not affiliated with the game's developers Fire Hose Games, Unity Technologies or Valve Corporation. All trademarks are the property of their respective owners.
201 changes: 0 additions & 201 deletions README.md

This file was deleted.

4 changes: 2 additions & 2 deletions plugin/TechtonicaVr.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<PackageReference Include="BepInEx.Core" Version="5.*" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="2.*" />
<PackageReference Include="techtonica-libs" Version="0.3.0-e" />
<PackageReference Include="PiUtils" Version="0.*" />
<PackageReference Include="TTIK" Version="0.*" />
<PackageReference Include="PiUtils" Version="0.2.0" />
<PackageReference Include="TTIK" Version="0.2.0" />
<!-- <PackageReference Include="UnityEngine.Modules" Version="5.6.0" IncludeAssets="compile" /> -->
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions plugin/src/TechtonicaVR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ namespace TechtonicaVR;

[BepInPlugin("de.xenira.techtonicavr", MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
[BepInProcess("Techtonica.exe")]
[BepInDependency("de.xenira.ttik")]
[BepInDependency("de.xenira.pi_utils")]
[BepInDependency("de.xenira.ttik", "0.2.0")]
[BepInDependency("de.xenira.pi_utils", "0.2.0")]
[BepInDependency("Tobey.UnityAudio", BepInDependency.DependencyFlags.SoftDependency)]
public class TechtonicaVR : BaseUnityPlugin
{
Expand Down
2 changes: 0 additions & 2 deletions plugin/src/ik/IkSetup.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using PiUtils.Objects.Behaviours;
using PiUtils.Util;
using TechtonicaVR.Input;
using TechtonicaVR.VRCamera;
using TTIK.Network;
using UnityEngine;
using Valve.VR;
using Valve.VR.InteractionSystem;

namespace TechtonicaVR.Ik;
Expand Down
33 changes: 33 additions & 0 deletions plugin/src/input/SteamvrInputMapper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System;
using PiUtils.Util;
using TTIK.Ik.FingerTracking;
using TTIK.Network;
using UnityEngine;
using Valve.VR;

Expand Down Expand Up @@ -82,6 +85,33 @@ public static void MapActions()

SteamVR_Actions._default.PoseLeft.AddOnUpdateListener(SteamVR_Input_Sources.Any, LeftHandUpdate);
SteamVR_Actions._default.PoseRight.AddOnUpdateListener(SteamVR_Input_Sources.Any, RightHandUpdate);

SteamVR_Actions._default.SkeletonLeftHand.AddOnChangeListener(UpdateLeftSkeleton);
SteamVR_Actions._default.SkeletonRightHand.AddOnChangeListener(UpdateRightSkeleton);
}

private static void UpdateLeftSkeleton(SteamVR_Action_Skeleton skeleton)
{
UpdateSkeleton(HandType.Left, skeleton);
}

private static void UpdateRightSkeleton(SteamVR_Action_Skeleton skeleton)
{
UpdateSkeleton(HandType.Right, skeleton);
}

private static void UpdateSkeleton(HandType left, SteamVR_Action_Skeleton skeleton)
{
if (NetworkIkPlayer.localInstance == null)
{
return;
}

var curls = skeleton.GetFingerCurls();
for (var i = 0; i < curls.Length; i++)
{
NetworkIkPlayer.localInstance.UpdateFingerCurl(left, (FingerType)i, curls[i]);
}
}

public static void UnmapActions()
Expand All @@ -94,6 +124,9 @@ public static void UnmapActions()

SteamVR_Actions._default.PoseLeft.RemoveOnUpdateListener(SteamVR_Input_Sources.Any, LeftHandUpdate);
SteamVR_Actions._default.PoseRight.RemoveOnUpdateListener(SteamVR_Input_Sources.Any, RightHandUpdate);

SteamVR_Actions._default.SkeletonLeftHand.RemoveOnChangeListener(UpdateLeftSkeleton);
SteamVR_Actions._default.SkeletonRightHand.RemoveOnChangeListener(UpdateRightSkeleton);
}

private static void HandleSteamVRMove(SteamVR_Action_Vector2 fromAction, SteamVR_Input_Sources fromSource, Vector2 axis, Vector2 delta)
Expand Down

0 comments on commit b345f0f

Please sign in to comment.