@@ -33,7 +33,7 @@ static const int32_t kMaxControllerCount = 2;
33
33
static const int32_t kNumButtons = 6 ;
34
34
static const int32_t kNumG2Buttons = 2 ;
35
35
static const int32_t kNumAxes = 2 ;
36
- static const int32_t kTypeNeo2 = 1 ;
36
+ static const int32_t k6DofHeadSet = 1 ;
37
37
static const int32_t kButtonApp = 1 ;
38
38
static const int32_t kButtonTrigger = 1 << 1 ;
39
39
static const int32_t kButtonTouchPad = 1 << 2 ;
@@ -179,7 +179,7 @@ struct DeviceDelegatePicoVR::State {
179
179
touchPadPressed);
180
180
controllerDelegate->SetButtonState (i, ControllerDelegate::BUTTON_TRIGGER, 1 , triggerPressed,
181
181
triggerPressed);
182
- if (type == kTypeNeo2 ) {
182
+ if (type == k6DofHeadSet ) {
183
183
controllerDelegate->SetButtonState (i, ControllerDelegate::BUTTON_OTHERS, 2 , gripPressed,
184
184
gripPressed, gripPressed ? 20 .0f : 0 .0f );
185
185
controllerDelegate->SetButtonState (i,
@@ -197,7 +197,7 @@ struct DeviceDelegatePicoVR::State {
197
197
controllerDelegate->SetAxes (i, axes, kNumAxes );
198
198
199
199
200
- if (type == kTypeNeo2 ) {
200
+ if (type == k6DofHeadSet ) {
201
201
if (!triggerPressed) {
202
202
controllerDelegate->SetScrolledDelta (i, -controller.axisX , controller.axisY );
203
203
}
@@ -211,7 +211,7 @@ struct DeviceDelegatePicoVR::State {
211
211
212
212
vrb::Matrix transform = controller.transform ;
213
213
if (renderMode == device::RenderMode::StandAlone) {
214
- if (type == kTypeNeo2 ) {
214
+ if (type == k6DofHeadSet ) {
215
215
transform.TranslateInPlace (headOffset);
216
216
} else {
217
217
vrb::Matrix head = vrb::Matrix::Rotation (orientation);
@@ -264,7 +264,11 @@ DeviceDelegatePicoVR::RegisterImmersiveDisplay(ImmersiveDisplayPtr aDisplay) {
264
264
}
265
265
266
266
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);
268
272
m.immersiveDisplay ->SetEyeResolution (m.renderWidth / 2 , m.renderHeight / 2 );
269
273
m.immersiveDisplay ->CompleteEnumeration ();
270
274
}
@@ -288,7 +292,7 @@ DeviceDelegatePicoVR::GetReorientTransform() const {
288
292
289
293
void
290
294
DeviceDelegatePicoVR::SetReorientTransform (const vrb::Matrix& aMatrix) {
291
- if (m.type == kTypeNeo2 ) {
295
+ if (m.type == k6DofHeadSet ) {
292
296
m.reorientMatrix = aMatrix;
293
297
}
294
298
}
@@ -311,7 +315,7 @@ DeviceDelegatePicoVR::SetControllerDelegate(ControllerDelegatePtr& aController)
311
315
for (State::Controller& controller: m.controllers ) {
312
316
const int32_t index = controller.index ;
313
317
314
- if (m.type == kTypeNeo2 ) {
318
+ if (m.type == k6DofHeadSet ) {
315
319
vrb::Matrix beam = vrb::Matrix::Rotation (vrb::Vector (1 .0f , 0 .0f , 0 .0f ), -vrb::PI_FLOAT / 11 .5f );
316
320
beam.TranslateInPlace (vrb::Vector (0 .0f , 0 .012f , -0 .06f ));
317
321
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() {
335
339
336
340
int32_t
337
341
DeviceDelegatePicoVR::GetControllerModelCount () const {
338
- return m.type == kTypeNeo2 ? 2 : 1 ;
342
+ return m.type == k6DofHeadSet ? 2 : 1 ;
339
343
}
340
344
341
345
const std::string
342
346
DeviceDelegatePicoVR::GetControllerModelName (const int32_t aModelIndex) const {
343
- if (m.type == kTypeNeo2 ) {
347
+ if (m.type == k6DofHeadSet ) {
344
348
if (aModelIndex == 0 ) {
345
349
return " left_controller.obj" ;
346
350
} else if (aModelIndex == 1 ) {
0 commit comments