feat: set solarxr feeder devices
This commit is contained in:
@@ -42,13 +42,6 @@ class wivrn_hmd : public xrt_device
|
|||||||
.name = XRT_INPUT_GENERIC_HEAD_POSE,
|
.name = XRT_INPUT_GENERIC_HEAD_POSE,
|
||||||
};
|
};
|
||||||
xrt_hmd_parts hmd_parts{};
|
xrt_hmd_parts hmd_parts{};
|
||||||
xrt_tracking_origin tracking_origin{
|
|
||||||
.name = "WiVRn origin",
|
|
||||||
.type = XRT_TRACKING_TYPE_OTHER,
|
|
||||||
.initial_offset = {
|
|
||||||
.orientation = {0, 0, 0, 1},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
view_list views;
|
view_list views;
|
||||||
from_headset::battery battery{};
|
from_headset::battery battery{};
|
||||||
@@ -66,6 +59,15 @@ class wivrn_hmd : public xrt_device
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
using base = xrt_device;
|
using base = xrt_device;
|
||||||
|
|
||||||
|
xrt_tracking_origin tracking_origin{
|
||||||
|
.name = "WiVRn origin",
|
||||||
|
.type = XRT_TRACKING_TYPE_OTHER,
|
||||||
|
.initial_offset = {
|
||||||
|
.orientation = {0, 0, 0, 1},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
wivrn_hmd(wivrn::wivrn_session * cnx,
|
wivrn_hmd(wivrn::wivrn_session * cnx,
|
||||||
const from_headset::headset_info_packet & info);
|
const from_headset::headset_info_packet & info);
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if WIVRN_FEATURE_SOLARXR
|
#if WIVRN_FEATURE_SOLARXR
|
||||||
#include "solarxr_device.h"
|
#include "solarxr_interface.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace wivrn
|
namespace wivrn
|
||||||
@@ -269,15 +269,13 @@ wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if WIVRN_FEATURE_SOLARXR
|
#if WIVRN_FEATURE_SOLARXR
|
||||||
xrt_device * solar_devs[XRT_SYSTEM_MAX_DEVICES];
|
uint32_t num_devs = solarxr_device_create_xdevs(&hmd.tracking_origin, &xdevs[xdev_count], ARRAY_SIZE(xdevs) - xdev_count);
|
||||||
uint32_t solar_devs_cap = XRT_SYSTEM_MAX_DEVICES - xdev_count;
|
if (num_devs != 0)
|
||||||
uint32_t num_devs = solarxr_device_create_xdevs(&hmd, solar_devs, XRT_SYSTEM_MAX_DEVICES - xdev_count);
|
|
||||||
for (int i = 0; i < num_devs; i++)
|
|
||||||
{
|
{
|
||||||
xdevs[xdev_count++] = solar_devs[i];
|
static_roles.body = xdevs[xdev_count];
|
||||||
if (i == 0)
|
solarxr_device_set_feeder_devices(static_roles.body, xdevs, xdev_count);
|
||||||
static_roles.body = solar_devs[i];
|
|
||||||
}
|
}
|
||||||
|
xdev_count += num_devs;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (roles.left >= 0)
|
if (roles.left >= 0)
|
||||||
@@ -296,6 +294,10 @@ wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection
|
|||||||
|
|
||||||
wivrn_session::~wivrn_session()
|
wivrn_session::~wivrn_session()
|
||||||
{
|
{
|
||||||
|
#if WIVRN_FEATURE_SOLARXR
|
||||||
|
solarxr_device_set_feeder_devices(static_roles.body, nullptr, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
for (size_t i = 0; i < ARRAY_SIZE(xdevs); i++)
|
for (size_t i = 0; i < ARRAY_SIZE(xdevs); i++)
|
||||||
{
|
{
|
||||||
xrt_device_destroy(&xdevs[i]);
|
xrt_device_destroy(&xdevs[i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user