diff --git a/ProjectObsidian.csproj b/ProjectObsidian.csproj
index e6ed960..9738e67 100644
--- a/ProjectObsidian.csproj
+++ b/ProjectObsidian.csproj
@@ -41,7 +41,7 @@
$(ResonitePath)Resonite_Data/Managed/Elements.Assets.dll
- Resonite_Data/Managed/SteamVR.dll
+ $(ResonitePath)/Managed/SteamVR.dll
diff --git a/ProtoFlux/Hardware/OpenVR/TrackerBatteryBase.cs b/ProtoFlux/Hardware/OpenVR/TrackerBatteryBase.cs
index 5bb0dca..3f5816d 100644
--- a/ProtoFlux/Hardware/OpenVR/TrackerBatteryBase.cs
+++ b/ProtoFlux/Hardware/OpenVR/TrackerBatteryBase.cs
@@ -1,12 +1,46 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using FrooxEngine;
+using FrooxEngine.ProtoFlux;
+using ProtoFlux.Core;
+using ProtoFlux.Runtimes.Execution;
-namespace Project-Obsidian.ProtoFlux.Hardware.OpenVR
+namespace Obsidian
{
- internal class FileName
-{
-}
+ public abstract class TrackerBatteryBase : VoidNode
+ {
+ public ObjectArgument User;
+ public readonly ValueOutput BatteryLevel;
+ public readonly ValueOutput IsBatteryCharging;
+
+ private ViveTracker _lastTracker;
+ private SyncRef> _batteryLevelStream;
+ private SyncRef> _batteryChargingStream;
+
+ protected abstract ViveTracker GetViveTracker();
+
+ protected override void ComputeOutputs(FrooxEngineContext context)
+ {
+ User user = 0.ReadObject(context);
+ if (user != null && user.IsRemoved)
+ {
+ user = null;
+ }
+ ViveTracker device = GetViveTracker();
+ if (device != _lastTracker)
+ {
+ _batteryLevelStream.Target = device?.BatteryLevel.GetStream(context.World);
+ _batteryChargingStream.Target = device?.BatteryCharging.GetStream(context.World);
+ _lastTracker = device;
+ }
+
+ BatteryLevel.Write(_batteryLevelStream.Target?.Value ?? -1f, context);
+ IsBatteryCharging.Write(_batteryChargingStream.Target?.Value ?? false, context);
+ }
+
+ public TrackerBatteryBase()
+ {
+ BatteryLevel = new ValueOutput(this);
+ IsBatteryCharging = new ValueOutput(this);
+ }
+ }
}