This commit is contained in:
Sapphire committed 2026-05-22 22:27:07 -05:00
1 parent c10d536a6c
commit c208b7cda2
8 files changed
+48 -48

No files matched your search

@@ -34,8 +34,7 @@ import kotlinx.coroutines.awaitCancellation
import kotlinx.coroutines.runBlocking
fun main(args: Array<String>) = runBlocking<Unit> {
ContextDebug.enabled = System.getProperty("slimevr.debug.context") == "true" ||
System.getenv("SLIMEVR_DEBUG_CONTEXT") == "true"
ContextDebug.enabled = true
val configFolder = resolveConfigDirectory() ?: error("Unable to resolve config folder")
val storage = DesktopConfigStorage(configFolder.toFile())
@@ -105,22 +105,26 @@ suspend fun handleDriverConnection(
}
}
msg.tracker_added?.let { ta ->
bridge.inbound.emit(DriverBridgeInbound.TrackerAdded(
id = ta.tracker_id,
name = ta.tracker_name,
manufacturer = ta.manufacturer.ifEmpty { "OpenVR" },
serial = ta.tracker_serial
))
bridge.inbound.emit(
DriverBridgeInbound.TrackerAdded(
id = ta.tracker_id,
name = ta.tracker_name,
manufacturer = ta.manufacturer.ifEmpty { "OpenVR" },
serial = ta.tracker_serial,
),
)
}
msg.battery?.let { bat ->
bridge.inbound.emit(DriverBridgeInbound.TrackerBattery(id = bat.tracker_id, batteryLevel = bat.battery_level, charging = bat.is_charging))
}
msg.position?.let { pos ->
bridge.inbound.emit(DriverBridgeInbound.TrackerPosition(
id = pos.tracker_id,
rotation = Quaternion(w = pos.qw, x = pos.qx, y = pos.qy, z = pos.qz),
position = if (pos.x != null && pos.y != null && pos.z != null) Vector3(pos.x, pos.y, pos.z) else null,
))
bridge.inbound.emit(
DriverBridgeInbound.TrackerPosition(
id = pos.tracker_id,
rotation = Quaternion(w = pos.qw, x = pos.qx, y = pos.qy, z = pos.qz),
position = if (pos.x != null && pos.y != null && pos.z != null) Vector3(pos.x, pos.y, pos.z) else null,
),
)
}
}
} finally {