@@ -33,7 +33,7 @@ static const int32_t kMaxControllerCount = 2;
3333static const int32_t kNumButtons = 6 ;
3434static const int32_t kNumG2Buttons = 2 ;
3535static const int32_t kNumAxes = 2 ;
36- static const int32_t kTypeNeo2 = 1 ;
36+ static const int32_t k6DofHeadSet = 1 ;
3737static const int32_t kButtonApp = 1 ;
3838static const int32_t kButtonTrigger = 1 << 1 ;
3939static const int32_t kButtonTouchPad = 1 << 2 ;
@@ -179,7 +179,7 @@ struct DeviceDelegatePicoVR::State {
179179 touchPadPressed);
180180 controllerDelegate->SetButtonState (i, ControllerDelegate::BUTTON_TRIGGER, 1 , triggerPressed,
181181 triggerPressed);
182- if (type == kTypeNeo2 ) {
182+ if (type == k6DofHeadSet ) {
183183 controllerDelegate->SetButtonState (i, ControllerDelegate::BUTTON_OTHERS, 2 , gripPressed,
184184 gripPressed, gripPressed ? 20 .0f : 0 .0f );
185185 controllerDelegate->SetButtonState (i,
@@ -197,7 +197,7 @@ struct DeviceDelegatePicoVR::State {
197197 controllerDelegate->SetAxes (i, axes, kNumAxes );
198198
199199
200- if (type == kTypeNeo2 ) {
200+ if (type == k6DofHeadSet ) {
201201 if (!triggerPressed) {
202202 controllerDelegate->SetScrolledDelta (i, -controller.axisX , controller.axisY );
203203 }
@@ -211,7 +211,7 @@ struct DeviceDelegatePicoVR::State {
211211
212212 vrb::Matrix transform = controller.transform ;
213213 if (renderMode == device::RenderMode::StandAlone) {
214- if (type == kTypeNeo2 ) {
214+ if (type == k6DofHeadSet ) {
215215 transform.TranslateInPlace (headOffset);
216216 } else {
217217 vrb::Matrix head = vrb::Matrix::Rotation (orientation);
@@ -264,7 +264,11 @@ DeviceDelegatePicoVR::RegisterImmersiveDisplay(ImmersiveDisplayPtr aDisplay) {
264264 }
265265
266266 m.immersiveDisplay ->SetDeviceName (" Pico" );
267- m.immersiveDisplay ->SetCapabilityFlags (device::Position | device::Orientation | device::Present | device::ImmersiveVRSession | device::InlineSession);
267+ device::CapabilityFlags flags = device::Orientation | device::Present | device::ImmersiveVRSession | device::InlineSession;
268+ if (m.type == k6DofHeadSet) {
269+ flags |= device::Position;
270+ }
271+ m.immersiveDisplay ->SetCapabilityFlags (flags);
268272 m.immersiveDisplay ->SetEyeResolution (m.renderWidth / 2 , m.renderHeight / 2 );
269273 m.immersiveDisplay ->CompleteEnumeration ();
270274}
@@ -288,7 +292,7 @@ DeviceDelegatePicoVR::GetReorientTransform() const {
288292
289293void
290294DeviceDelegatePicoVR::SetReorientTransform (const vrb::Matrix& aMatrix) {
291- if (m.type == kTypeNeo2 ) {
295+ if (m.type == k6DofHeadSet ) {
292296 m.reorientMatrix = aMatrix;
293297 }
294298}
@@ -311,7 +315,7 @@ DeviceDelegatePicoVR::SetControllerDelegate(ControllerDelegatePtr& aController)
311315 for (State::Controller& controller: m.controllers ) {
312316 const int32_t index = controller.index ;
313317
314- if (m.type == kTypeNeo2 ) {
318+ if (m.type == k6DofHeadSet ) {
315319 vrb::Matrix beam = vrb::Matrix::Rotation (vrb::Vector (1 .0f , 0 .0f , 0 .0f ), -vrb::PI_FLOAT / 11 .5f );
316320 beam.TranslateInPlace (vrb::Vector (0 .0f , 0 .012f , -0 .06f ));
317321 m.controllerDelegate ->CreateController (index, int32_t (controller.hand ), controller.IsRightHand () ? " Pico Neo 2 (Right)" : " Pico Neo 2 (LEFT)" , beam);
@@ -335,12 +339,12 @@ DeviceDelegatePicoVR::ReleaseControllerDelegate() {
335339
336340int32_t
337341DeviceDelegatePicoVR::GetControllerModelCount () const {
338- return m.type == kTypeNeo2 ? 2 : 1 ;
342+ return m.type == k6DofHeadSet ? 2 : 1 ;
339343}
340344
341345const std::string
342346DeviceDelegatePicoVR::GetControllerModelName (const int32_t aModelIndex) const {
343- if (m.type == kTypeNeo2 ) {
347+ if (m.type == k6DofHeadSet ) {
344348 if (aModelIndex == 0 ) {
345349 return " left_controller.obj" ;
346350 } else if (aModelIndex == 1 ) {
0 commit comments