Skip to content

Commit

Permalink
[VisionGlass] Add position capabilities to the WebXR controller
Browse files Browse the repository at this point in the history
The controller was not shown in WebXR sessions. It was actually not
possible to interact with any experience. The problem was that
we were not setting position capabilities to the controller and
thus we were not passing that information to the engine (even if
the position is emulated as the phone is a 3DoF device).
After this change the controller can be seen in WebXR.

Also we're setting the number of buttons in the controller to 1
to let experiences adapt to a controller with just one button.
  • Loading branch information
svillar committed May 8, 2024
1 parent 6d86e3a commit 4c4faf7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/visionglass/cpp/DeviceDelegateVisionGlass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,14 @@ DeviceDelegateVisionGlass::SetControllerDelegate(ControllerDelegatePtr& aControl
m.controller = aController;
m.controller->CreateController(kControllerIndex, kControllerIndex, "Vision Glass Controller");
m.controller->SetEnabled(kControllerIndex, true);
m.controller->SetCapabilityFlags(kControllerIndex, device::Orientation);
m.controller->SetTargetRayMode(kControllerIndex, device::TargetRayMode::TrackedPointer);
m.controller->SetControllerType(kControllerIndex, device::VisionGlass);
m.controller->SetMode(kControllerIndex, ControllerMode::Device);
m.controller->SetAimEnabled(kControllerIndex, true);
m.controller->SetCapabilityFlags(kControllerIndex, device::Orientation);
m.controller->SetCapabilityFlags(kControllerIndex, device::Orientation | device::PositionEmulated | device::GripSpacePosition);

m.controller->SetButtonCount(kControllerIndex, 5);
m.controller->SetButtonCount(kControllerIndex, 1);
m.controller->SetButtonState(kControllerIndex, ControllerDelegate::BUTTON_TRIGGER, device::kImmersiveButtonTrigger, false, false);
}

void
Expand Down

0 comments on commit 4c4faf7

Please sign in to comment.