Skip to content

Commit

Permalink
Removed quest controller model because SteamVR 1.5.8 includes control…
Browse files Browse the repository at this point in the history
…ler model of RiftS.

Set Prop_RegisteredDeviceType_String "oculus_touch" on touch controller for some games like VRChat. #320
  • Loading branch information
polygraphene committed Jun 15, 2019
1 parent 4481186 commit f7e91d6
Show file tree
Hide file tree
Showing 31 changed files with 19 additions and 39,168 deletions.
24 changes: 10 additions & 14 deletions ALVR/ServerConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,12 @@ public bool Save(DeviceDescriptor device)
dynamic driverConfig = new DynamicJson();
if (device != null && device.HasTouchController)
{
driverConfig.serialNumber = "OculusRift-001";
driverConfig.serialNumber = "WMHD000X000XXX";
driverConfig.trackingSystemName = "oculus";
driverConfig.modelNumber = "Oculus Rift";
driverConfig.manufacturerName = "Oculus";
driverConfig.modelNumber = "Oculus Rift S";
driverConfig.manufacturerName = "Oculus driver 1.38.0";
driverConfig.renderModelName = "generic_hmd";
driverConfig.registeredDeviceType = "oculus_rifts";
}
else
{
Expand All @@ -129,6 +130,7 @@ public bool Save(DeviceDescriptor device)
driverConfig.modelNumber = "ALVR driver server";
driverConfig.manufacturerName = "HTC";
driverConfig.renderModelName = "generic_hmd";
driverConfig.registeredDeviceType = "vive";
}
driverConfig.adapterIndex = 0;
driverConfig.IPD = 0.063;
Expand Down Expand Up @@ -188,19 +190,12 @@ public bool Save(DeviceDescriptor device)
{
driverConfig.controllerTrackingSystemName = "oculus";
driverConfig.controllerManufacturerName = "Oculus";
driverConfig.controllerModelNumber = "Oculus Rift CV1";
if (!Directory.Exists(Utils.GetDriverPath() + "resources\\rendermodels\\oculus_quest_controller_left"))
{
driverConfig.controllerRenderModelNameLeft = "oculus_cv1_controller_left";
driverConfig.controllerRenderModelNameRight = "oculus_cv1_controller_right";
}
else
{
driverConfig.controllerRenderModelNameLeft = Utils.GetDriverPath() + "resources\\rendermodels\\oculus_quest_controller_left";
driverConfig.controllerRenderModelNameRight = Utils.GetDriverPath() + "resources\\rendermodels\\oculus_quest_controller_right";
}
driverConfig.controllerModelNumber = "Oculus Rift S";
driverConfig.controllerRenderModelNameLeft = "oculus_rifts_controller_left";
driverConfig.controllerRenderModelNameRight = "oculus_rifts_controller_right";
driverConfig.controllerSerialNumber = "WMHD000X000XXX_Controller";
driverConfig.controllerType = "oculus_touch";
driverConfig.controllerRegisteredDeviceType = "oculus_touch";
driverConfig.controllerLegacyInputProfile = "oculus_touch";
driverConfig.controllerInputProfilePath = "{alvr_server}/input/touch_profile.json";
}
Expand All @@ -213,6 +208,7 @@ public bool Save(DeviceDescriptor device)
driverConfig.controllerRenderModelNameRight = "vr_controller_vive_1_5";
driverConfig.controllerSerialNumber = "ALVR Remote Controller";
driverConfig.controllerType = "vive_controller";
driverConfig.controllerRegisteredDeviceType = "vive_controller";
driverConfig.controllerLegacyInputProfile = "vive_controller";
driverConfig.controllerInputProfilePath = "{alvr_server}/input/vive_controller_profile.json";
}
Expand Down
1 change: 1 addition & 0 deletions alvr_server/RemoteController.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class RemoteControllerServerDriver : public vr::ITrackedDeviceServerDriver

vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_SerialNumber_String, GetSerialNumber().c_str());
vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_AttachedDeviceId_String, GetSerialNumber().c_str());
vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_RegisteredDeviceType_String, Settings::Instance().mControllerRegisteredDeviceType.c_str());

uint64_t supportedButtons = 0xFFFFFFFFFFFFFFFFULL;
vr::VRProperties()->SetUint64Property(m_ulPropertyContainer, vr::Prop_SupportedButtons_Uint64, supportedButtons);
Expand Down
2 changes: 2 additions & 0 deletions alvr_server/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ void Settings::Load()
mModelNumber = v.get(k_pch_Settings_ModelNumber_String).get<std::string>();
mManufacturerName = v.get(k_pch_Settings_ManufacturerName_String).get<std::string>();
mRenderModelName = v.get(k_pch_Settings_RenderModelName_String).get<std::string>();
mRegisteredDeviceType = v.get(k_pch_Settings_RegisteredDeviceType_String).get<std::string>();

m_renderWidth = (int32_t)v.get(k_pch_Settings_RenderWidth_Int32).get<int64_t>();
m_renderHeight = (int32_t)v.get(k_pch_Settings_RenderHeight_Int32).get<int64_t>();
Expand Down Expand Up @@ -120,6 +121,7 @@ void Settings::Load()
m_controllerRenderModelNameRight = v.get(k_pch_Settings_ControllerRenderModelNameRight_String).get<std::string>();
m_controllerSerialNumber = v.get(k_pch_Settings_ControllerSerialNumber_String).get<std::string>();
m_controllerType = v.get(k_pch_Settings_ControllerType_String).get<std::string>();
mControllerRegisteredDeviceType = v.get(k_pch_Settings_ControllerRegisteredDeviceType_String).get<std::string>();
m_controllerLegacyInputProfile = v.get(k_pch_Settings_ControllerLegacyInputProfile_String).get<std::string>();
m_controllerInputProfilePath = v.get(k_pch_Settings_ControllerInputProfilePath_String).get<std::string>();

Expand Down
5 changes: 5 additions & 0 deletions alvr_server/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ static const char * const k_pch_Settings_TrackingSystemName_String = "trackingSy
static const char * const k_pch_Settings_ModelNumber_String = "modelNumber";
static const char * const k_pch_Settings_ManufacturerName_String = "manufacturerName";
static const char * const k_pch_Settings_RenderModelName_String = "renderModelName";
static const char * const k_pch_Settings_RegisteredDeviceType_String = "registeredDeviceType";

static const char * const k_pch_Settings_RefreshRate_Int32 = "refreshRate";
static const char * const k_pch_Settings_RenderWidth_Int32 = "renderWidth";
Expand Down Expand Up @@ -58,9 +59,11 @@ static const char * const k_pch_Settings_ControllerRenderModelNameLeft_String =
static const char * const k_pch_Settings_ControllerRenderModelNameRight_String = "controllerRenderModelNameRight";
static const char * const k_pch_Settings_ControllerSerialNumber_String = "controllerSerialNumber";
static const char * const k_pch_Settings_ControllerType_String = "controllerType";
static const char * const k_pch_Settings_ControllerRegisteredDeviceType_String = "controllerRegisteredDeviceType";
static const char * const k_pch_Settings_ControllerLegacyInputProfile_String = "controllerLegacyInputProfile";
static const char * const k_pch_Settings_ControllerInputProfilePath_String = "controllerInputProfilePath";


static const char * const k_pch_Settings_EnableController_Bool = "enableController";
static const char * const k_pch_Settings_ControllerTriggerMode_Int32 = "controllerTriggerMode";
static const char * const k_pch_Settings_ControllerTrackpadClickMode_Int32 = "controllerTrackpadClickMode";
Expand Down Expand Up @@ -116,6 +119,7 @@ class Settings
std::string mModelNumber;
std::string mManufacturerName;
std::string mRenderModelName;
std::string mRegisteredDeviceType;

int32_t m_nAdapterIndex;

Expand Down Expand Up @@ -165,6 +169,7 @@ class Settings
std::string m_controllerRenderModelNameRight;
std::string m_controllerSerialNumber;
std::string m_controllerType;
std::string mControllerRegisteredDeviceType;
std::string m_controllerLegacyInputProfile;
std::string m_controllerInputProfilePath;
bool m_enableController;
Expand Down
1 change: 1 addition & 0 deletions alvr_server/alvr_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,7 @@ class CRemoteHmd : public vr::ITrackedDeviceServerDriver
vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_ModelNumber_String, Settings::Instance().mModelNumber.c_str());
vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_ManufacturerName_String, Settings::Instance().mManufacturerName.c_str());
vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_RenderModelName_String, Settings::Instance().mRenderModelName.c_str());
vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_RegisteredDeviceType_String, Settings::Instance().mRegisteredDeviceType.c_str());
vr::VRProperties()->SetFloatProperty(m_ulPropertyContainer, vr::Prop_UserIpdMeters_Float, Settings::Instance().m_flIPD);
vr::VRProperties()->SetFloatProperty(m_ulPropertyContainer, vr::Prop_UserHeadToEyeDepthMeters_Float, 0.f);
vr::VRProperties()->SetFloatProperty(m_ulPropertyContainer, vr::Prop_DisplayFrequency_Float, static_cast<float>(Settings::Instance().m_refreshRate));
Expand Down

This file was deleted.

This file was deleted.

Binary file not shown.

This file was deleted.

Loading

0 comments on commit f7e91d6

Please sign in to comment.