# TsingshuaVR **Repository Path**: sxy2069/tsingshua-vr ## Basic Information - **Project Name**: TsingshuaVR - **Description**: 欢迎使用和参与开发。。。。。。 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2022-02-18 - **Last Updated**: 2023-06-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # TsinghuaVR #### 介绍 此项目使用Unity软件和Steam平台,基于OpenVR开发VR游戏外围设备,实现与VR游戏的交互。此项目中包含Unity端的测试文件,安装在Stesm中的驱动程序以及外围交互设备测试代码。 本项目的目的在于丰富VR游戏交互体验,可定制化添加VR外围交互设备。 项目基础结构为:Unity运用程序+Steam(OpenVR)驱动程序+外围设备(单片机及外设)。 #### 软件架构 项目基础结构为:Unity运用程序+Steam(OpenVR)驱动程序+外围设备(单片机及外设)。 openVR驱动程序通过MQTT协议与外围设备进行通信,采用Json数据格式进行通信。可根据 需要自定义添加自己需要的外围设备。 #### 安装教程 1. 安装Unity应用程序 2. 安装node应用程序 3. 添加外设 #### 使用说明 1. 外为设备上电 2. 运行MQTT Broker 3. 运行Unity应用程序 ### 开发说明 - 更新组件的值 ``` void ControllerDriver::RunFrame(){ //Since we used VRScalarUnits_NormalizedTwoSided as the unit, the range is -1 to 1. VRDriverInput()->UpdateScalarComponent(joystickXHandle, 1, 0); VRDriverInput()->UpdateScalarComponent(joystickYHandle, 1, 0); VRDriverInput()->UpdateScalarComponent(trackpadXHandle, 1, 0); VRDriverInput()->UpdateScalarComponent(trackpadYHandle, 1, 0); VRDriverInput()->UpdateBooleanComponent(aBtnHandle, *aActionP, 0); VRDriverInput()->UpdateBooleanComponent(bBtnHandle, *bActionP, 0); VRDriverInput()->UpdateBooleanComponent(cBtnHandle, *cActionP, 0); VRDriverInput()->UpdateBooleanComponent(dBtnHandle, *dActionP, 0); } ```