# big-haptic-driver

Initial OpenVR driver scaffold in Rust.

## Current capabilities

- Exports `HmdDriverFactory` with minimal interface-name validation
- Exposes DLL-callable haptics test exports:
  - `BigHapticDriver_SendAmplitude(float)`
  - `BigHapticDriver_Stop()`
- Sends packets to firmware through shared `hid-bridge`

## Build

From workspace root:

- `cargo build -p big-haptic-driver --release`

Output DLL path:

- `target/release/big_haptic_driver.dll`

## Build + deploy (one command)

From workspace root:

- `./tools/scripts/build_and_deploy_openvr_driver.ps1`

This builds the crate and copies the DLL to:

- `openvr-driver/big-haptic-driver/bin/win64/driver_big_haptic_driver.dll`

## SteamVR layout

Driver folder should include:

- `driver.vrdrivermanifest`
- `resources/`
- `resources/input/big_haptic_profile.json`
- `resources/localization/en_us.json`
- `bin/win64/driver_big_haptic_driver.dll`

## Register with SteamVR

PowerShell command (note the `&` call operator before the quoted exe path):

- `& "C:\Program Files (x86)\Steam\steamapps\common\SteamVR\bin\win64\vrpathreg.exe" adddriver "C:\Users\decid\Documents\projects\qt-py-haptics\openvr-driver\big-haptic-driver"`

To verify registration:

- `& "C:\Program Files (x86)\Steam\steamapps\common\SteamVR\bin\win64\vrpathreg.exe"`

To remove registration:

- `& "C:\Program Files (x86)\Steam\steamapps\common\SteamVR\bin\win64\vrpathreg.exe" removedriver "C:\Users\decid\Documents\projects\qt-py-haptics\openvr-driver\big-haptic-driver"`

## Next implementation step

Implement concrete C++ ABI-compatible vtables for:

- `IServerTrackedDeviceProvider`
- `ITrackedDeviceServerDriver`

and route `TriggerHapticVibration` events to `BigHapticDriver_SendAmplitude` logic.

## Testing status (important)

The driver currently registers with SteamVR, but it does **not** yet create a fully usable tracked controller/input device in SteamVR bindings UI.

So, end-to-end OpenVR binding-triggered haptics is not available yet.

Temporary direct test (bypasses SteamVR input bindings):

- `./tools/scripts/test_big_haptic_driver_exports.ps1 -Amplitude 0.35 -DurationSeconds 0.20 -Frequency 160`

Stop command:

- `./tools/scripts/test_big_haptic_driver_exports.ps1 -Stop`
