From deeaffd5bac9141a4cde25a0ad56f4035f03cd70 Mon Sep 17 00:00:00 2001 From: A3 Date: Mon, 3 Feb 2020 22:37:12 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88=E5=89=8A?= =?UTF-8?q?=E9=99=A4=E3=81=AA=E3=81=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ALVR/ServerConfig.cs | 30 ---------------- alvr_server/OvrController.cpp | 65 +++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 30 deletions(-) diff --git a/ALVR/ServerConfig.cs b/ALVR/ServerConfig.cs index 97ba49dfb1..89046a2d2c 100644 --- a/ALVR/ServerConfig.cs +++ b/ALVR/ServerConfig.cs @@ -203,16 +203,6 @@ public bool Save(DeviceDescriptor device) //driverConfig.controllerInputProfilePath = "{oculus}/input/touch_profile.json"; //driverConfig.controllerType = "oculus_touch"; - //driverConfig.controllerTrackingSystemName = "ALVR Remote Controller"; - //driverConfig.controllerSerialNumber = "ALVR Remote Controller"; - //driverConfig.controllerModelNumber = "ALVR Remote Controller"; - //driverConfig.controllerManufacturerName = "ALVR"; - //driverConfig.controllerRenderModelNameLeft = "valve_controller_knu_ev2_0_left"; - //driverConfig.controllerRenderModelNameRight = "valve_controller_knu_ev2_0_right"; - //driverConfig.controllerRegisteredDeviceType = "soft_knuckles"; - //driverConfig.controllerInputProfilePath = "{alvr_server}/input/soft_knuckles_profile.json"; - //driverConfig.controllerType = "soft_knuckles"; - driverConfig.controllerTrackingSystemName = "indexcontroller"; driverConfig.controllerSerialNumber = "ALVR Remote Controller"; driverConfig.controllerModelNumber = "ALVR Remote Controller"; @@ -223,26 +213,6 @@ public bool Save(DeviceDescriptor device) driverConfig.controllerInputProfilePath = "{indexcontroller}/input/index_controller_profile.json"; driverConfig.controllerType = "knuckles"; - //driverConfig.emulated_controller = "index"; - //driverConfig.rightHand = true; - //driverConfig.leftHand = true; - //driverConfig.offsetX = 0.0f; - //driverConfig.offsetY = 0.0f; - //driverConfig.offsetZ = 0.0f; - //driverConfig.trackingLevel = "full"; - //driverConfig.input = true; - //driverConfig.menu = true; - //driverConfig.appMenu = true; - //driverConfig.trigger = true; - //driverConfig.grip = true; - //driverConfig.touchpad = true; - //driverConfig.touchpadTouch = true; - //driverConfig.touchpadPress = true; - //driverConfig.touchpadAxes = true; - //driverConfig.buttonA = true; - //driverConfig.buttonB = true; - //driverConfig.thumbstick = true; - driverConfig.controllerTriggerMode = c.controllerTriggerMode; driverConfig.controllerTrackpadClickMode = c.controllerTrackpadClickMode; diff --git a/alvr_server/OvrController.cpp b/alvr_server/OvrController.cpp index d78a8467a4..da5ec9e5df 100644 --- a/alvr_server/OvrController.cpp +++ b/alvr_server/OvrController.cpp @@ -52,6 +52,71 @@ vr::EVRInitError OvrController::Activate(vr::TrackedDeviceIndex_t unObjectId) m_unObjectId = unObjectId; m_ulPropertyContainer = vr::VRProperties()->TrackedDeviceToPropertyContainer(m_unObjectId); + //vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_TrackingSystemName_String, Settings::Instance().m_controllerTrackingSystemName.c_str()); + //vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_ManufacturerName_String, Settings::Instance().m_controllerManufacturerName.c_str()); + //vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_ModelNumber_String, m_isLeftHand ? (Settings::Instance().m_controllerModelNumber + " (Left Controller)").c_str() : (Settings::Instance().m_controllerModelNumber + " (Right Controller)").c_str()); + // + //vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_RenderModelName_String, m_isLeftHand ? Settings::Instance().m_controllerRenderModelNameLeft.c_str() : Settings::Instance().m_controllerRenderModelNameRight.c_str()); + // + //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, m_isLeftHand ? (Settings::Instance().mControllerRegisteredDeviceType + "_Left").c_str() : (Settings::Instance().mControllerRegisteredDeviceType + "_Right").c_str()); + // + //uint64_t supportedButtons = 0xFFFFFFFFFFFFFFFFULL; + //vr::VRProperties()->SetUint64Property(m_ulPropertyContainer, vr::Prop_SupportedButtons_Uint64, supportedButtons); + // + //vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_DeviceProvidesBatteryStatus_Bool, true); + // + // + //vr::VRProperties()->SetInt32Property(m_ulPropertyContainer, vr::Prop_Axis0Type_Int32, vr::k_eControllerAxis_Joystick); + // + //vr::VRProperties()->SetInt32Property(m_ulPropertyContainer, vr::Prop_ControllerRoleHint_Int32, m_isLeftHand ? vr::TrackedControllerRole_LeftHand : vr::TrackedControllerRole_RightHand); + // + //vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_ControllerType_String, Settings::Instance().m_controllerType.c_str()); + //vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_InputProfilePath_String, Settings::Instance().m_controllerInputProfilePath.c_str()); + //int i = 0; + // + // + //vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/system/click", &m_handles[ALVR_INPUT_SYSTEM_CLICK]); + //vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/application_menu/click", &m_handles[ALVR_INPUT_APPLICATION_MENU_CLICK]); + //vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/grip/click", &m_handles[ALVR_INPUT_GRIP_CLICK]); + //vr::VRDriverInput()->CreateScalarComponent(m_ulPropertyContainer, "/input/grip/value", &m_handles[ALVR_INPUT_GRIP_VALUE], vr::VRScalarType_Absolute, vr::VRScalarUnits_NormalizedOneSided); + //vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/grip/touch", &m_handles[ALVR_INPUT_GRIP_TOUCH]); + // + //if (!m_isLeftHand) { + // // A,B for right hand. + // vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/a/click", &m_handles[ALVR_INPUT_A_CLICK]); + // vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/a/touch", &m_handles[ALVR_INPUT_A_TOUCH]); + // vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/b/click", &m_handles[ALVR_INPUT_B_CLICK]); + // vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/b/touch", &m_handles[ALVR_INPUT_B_TOUCH]); + // + // //vr::VRDriverInput()->CreateSkeletonComponent(m_ulPropertyContainer, "/input/skeleton/right", "/skeleton/hand/right", "/pose/raw", nullptr, SKELTON_BONE_COUNT, &m_compSkeleton); + //} + //else { + // // X,Y for left hand. + // vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/x/click", &m_handles[ALVR_INPUT_X_CLICK]); + // vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/x/touch", &m_handles[ALVR_INPUT_X_TOUCH]); + // vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/y/click", &m_handles[ALVR_INPUT_Y_CLICK]); + // vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/y/touch", &m_handles[ALVR_INPUT_Y_TOUCH]); + // + // //vr::VRDriverInput()->CreateSkeletonComponent(m_ulPropertyContainer, "/input/skeleton/left", "/skeleton/hand/left", "/pose/raw", nullptr, SKELTON_BONE_COUNT, &m_compSkeleton); + //} + // + //vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/joystick/click", &m_handles[ALVR_INPUT_JOYSTICK_CLICK]); + //vr::VRDriverInput()->CreateScalarComponent(m_ulPropertyContainer, "/input/joystick/x", &m_handles[ALVR_INPUT_JOYSTICK_X], vr::VRScalarType_Absolute, vr::VRScalarUnits_NormalizedTwoSided); + //vr::VRDriverInput()->CreateScalarComponent(m_ulPropertyContainer, "/input/joystick/y", &m_handles[ALVR_INPUT_JOYSTICK_Y], vr::VRScalarType_Absolute, vr::VRScalarUnits_NormalizedTwoSided); + //vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/joystick/touch", &m_handles[ALVR_INPUT_JOYSTICK_TOUCH]); + // + //vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/back/click", &m_handles[ALVR_INPUT_BACK_CLICK]); + //vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/guide/click", &m_handles[ALVR_INPUT_GUIDE_CLICK]); + //vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/start/click", &m_handles[ALVR_INPUT_START_CLICK]); + // + //vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/trigger/click", &m_handles[ALVR_INPUT_TRIGGER_CLICK]); + //vr::VRDriverInput()->CreateScalarComponent(m_ulPropertyContainer, "/input/trigger/value", &m_handles[ALVR_INPUT_TRIGGER_VALUE], vr::VRScalarType_Absolute, vr::VRScalarUnits_NormalizedOneSided); + //vr::VRDriverInput()->CreateBooleanComponent(m_ulPropertyContainer, "/input/trigger/touch", &m_handles[ALVR_INPUT_TRIGGER_TOUCH]); + // + //vr::VRDriverInput()->CreateHapticComponent(m_ulPropertyContainer, "/output/haptic", &m_compHaptic); + vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_WillDriftInYaw_Bool, false); vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_DeviceIsWireless_Bool, false); vr::VRProperties()->SetInt32Property(m_ulPropertyContainer, vr::Prop_DeviceClass_Int32, vr::TrackedDeviceClass_Controller);