Add velocity for htc_body
This commit is contained in:
@@ -73,7 +73,9 @@ static wivrn::from_headset::htc_body::pose locate_space(XrSpace space, XrSpace r
|
|||||||
|
|
||||||
wivrn::from_headset::htc_body::pose res{
|
wivrn::from_headset::htc_body::pose res{
|
||||||
.pose = location.pose,
|
.pose = location.pose,
|
||||||
.flags = wivrn::from_headset::to_pose_flags(location.locationFlags),
|
.linear_velocity = velocity.linearVelocity,
|
||||||
|
.angular_velocity = velocity.angularVelocity,
|
||||||
|
.flags = wivrn::from_headset::to_pose_flags(location.locationFlags, velocity.velocityFlags),
|
||||||
};
|
};
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
@@ -100,10 +102,7 @@ xr::htc_body_tracker::packet_type xr::htc_body_tracker::locate_spaces(XrTime tim
|
|||||||
for (size_t i = 0; i < trackers.size(); i++)
|
for (size_t i = 0; i < trackers.size(); i++)
|
||||||
{
|
{
|
||||||
auto & tracker = trackers[i];
|
auto & tracker = trackers[i];
|
||||||
wivrn::from_headset::htc_body::pose pose{
|
wivrn::from_headset::htc_body::pose pose{};
|
||||||
.pose = {},
|
|
||||||
.flags = 0,
|
|
||||||
};
|
|
||||||
if (tracker.get_active())
|
if (tracker.get_active())
|
||||||
pose = locate_space(tracker.get_space(), reference, time);
|
pose = locate_space(tracker.get_space(), reference, time);
|
||||||
|
|
||||||
|
|||||||
@@ -522,12 +522,13 @@ struct bd_body
|
|||||||
|
|
||||||
struct htc_body
|
struct htc_body
|
||||||
{
|
{
|
||||||
inline static const size_t max_tracked_poses = 16;
|
static constexpr size_t max_tracked_poses = 16;
|
||||||
struct pose
|
struct pose
|
||||||
{
|
{
|
||||||
XrPosef pose{};
|
XrPosef pose;
|
||||||
// maybe add velocity?
|
XrVector3f linear_velocity;
|
||||||
uint8_t flags{0};
|
XrVector3f angular_velocity;
|
||||||
|
uint8_t flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
XrTime production_timestamp;
|
XrTime production_timestamp;
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ void tracker_pose_list::update_tracking(XrTime produced_timestamp, XrTime timest
|
|||||||
xrt_space_relation rel{
|
xrt_space_relation rel{
|
||||||
.relation_flags = from_pose_flags(pose.flags),
|
.relation_flags = from_pose_flags(pose.flags),
|
||||||
.pose = xrt_cast(pose.pose),
|
.pose = xrt_cast(pose.pose),
|
||||||
|
.linear_velocity = xrt_cast(pose.linear_velocity),
|
||||||
|
.angular_velocity = xrt_cast(pose.angular_velocity),
|
||||||
};
|
};
|
||||||
add_sample(produced_timestamp, timestamp, rel, offset);
|
add_sample(produced_timestamp, timestamp, rel, offset);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user