googlevr / gvr-android-sdk

Google VR SDK for Android
http://developers.google.com/vr/android/
Other
3.28k stars 1.28k forks source link

SDK doesn't expose user handedness preference for UX-C2 #571

Closed rawnsley closed 6 years ago

rawnsley commented 6 years ago

The SDK doesn't seem to have a way to access UserPrefs.ControllerHandedness. It's only accessible from the NDK if you use GvrLayout, which has a [GvrApi property](https://developers.google.com/vr/reference/android/com/google/vr/ndk/base/GvrLayout.html#getGvrApi()). However, SDK apps use GvrView, which provides no such option.

This prevents us from complying with UX-C2: App uses hand preference

sigmaxipi commented 6 years ago

The ndk/base/GvrLayout.getGvrApi() method should be fully usable from a pure Java application without adding NDK support to your app. The ndk.base vs sdk.base is a historical artifact of how the APIs evolved rather than a limit on which functions can be used from what type of code.

rawnsley commented 6 years ago

@sigmaxipi I use GvrView rather than GvrLayout so I don't have that option. For example, how would you get GvrApi in the Treasure Hunt sample?

sigmaxipi commented 6 years ago

It looks like there is no easy way to get the GvrApi from GvrView. We'll add an API for this.

One short-term option is to switch from GvrView to GvrLayout like the videoplayer sample. The general code would be the same. The GvrView.StereoRenderer.onDrawEye code would be replaced with the VideoSceneRenderer.drawScene and VideoSceneRenderer.drawEye code since the NDK API is slightly lower level than the SDK API.

rawnsley commented 6 years ago

Thanks @sigmaxipi . I'll try the suggested workaround.

sigmaxipi commented 6 years ago

This is fixed in v1.170