passthru FB_face_tracking2

This commit is contained in:
galister
2024-08-19 16:35:26 +02:00
committed by xytovl
parent 7f1289bbb0
commit e6f3ae0113
18 changed files with 478 additions and 10 deletions
+11
View File
@@ -197,12 +197,15 @@ void scenes::stream::tracking()
for (XrDuration Δt = 0; Δt <= prediction; Δt += std::max<XrDuration>(1, prediction))
{
from_headset::hand_tracking hands{};
from_headset::fb_face2 fb_face2{};
packet.production_timestamp = t0;
hands.production_timestamp = t0;
fb_face2.production_timestamp = t0;
packet.timestamp = t0 + Δt;
hands.timestamp = t0 + Δt;
fb_face2.timestamp = t0 + Δt;
try
{
@@ -243,6 +246,14 @@ void scenes::stream::tracking()
t.resume();
}
if (application::get_fb_face_tracking2_supported())
{
application::get_fb_face_tracker2().get_weights(t0 + Δt, &fb_face2);
t.pause();
network_session->send_stream(fb_face2);
t.resume();
}
XrDuration busy_time = t.count();
// Target: polling between 1 and 5ms, with 20% busy time
tracking_period = std::clamp<XrDuration>(std::lerp(tracking_period, busy_time * 5, 0.2), 1'000'000, 5'000'000);