mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-22 06:15:58 +00:00
fix: harden Quest VR compatibility
This commit is contained in:
1 parent
92f2696a0c
commit
5e9ebbc7df
17 files changed
+377
-55
No files matched your search
@@ -4,6 +4,22 @@
|
||||
|
||||
int main() {
|
||||
DroidDeckXrPose head{{0, 0, 0, 1}, {2, 1.6f, -3}, 15};
|
||||
XrChaperoneOrigin deferred;
|
||||
DroidDeckXrTracking tracking{};
|
||||
tracking.active = 1; tracking.period_ns = 11111111; tracking.sampled_ns = XrTrackingFile::Now();
|
||||
tracking.eyes[0].width = tracking.eyes[0].height = 4;
|
||||
unsigned publications = 0;
|
||||
auto publish = [&](const auto &pose) { publications++; assert(pose.position[1] == 1.6f); return true; };
|
||||
deferred.Update(tracking, publish); assert(publications == 0);
|
||||
tracking.head = head; tracking.head.flags = 0;
|
||||
deferred.Update(tracking, publish); assert(publications == 0);
|
||||
tracking.head = head;
|
||||
deferred.Update(tracking, publish); assert(publications == 1);
|
||||
tracking.head.position[1] = 2;
|
||||
deferred.Update(tracking, publish); assert(publications == 1);
|
||||
deferred.Reset(); tracking.head = head;
|
||||
deferred.Update(tracking, [&](const auto &) { publications++; return false; });
|
||||
deferred.Update(tracking, publish); assert(publications == 3);
|
||||
auto origin = xr_seated_origin(head);
|
||||
assert(origin.translation[0] == -2 && std::abs(origin.translation[1] + 1.6) < 1e-6 && origin.translation[2] == 3);
|
||||
head.orientation[1] = head.orientation[3] = std::sqrt(0.5f);
|
||||
|
||||
Reference in new issue
Block a user