Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

GVR SDK for Unity v1.150.0

Compare
Choose a tag to compare
@rusmaxham rusmaxham released this 03 Jul 23:54
· 8 commits to master since this release

Multiple controller support

  • New GvrControllerInputDevice class for accessing controllers, accessible via GvrControllerInput.GetDevice(GvrControllerHand hand).
  • New GvrControllerInput.OnDevicesChanged event to handle changes in GvrControllerInputDevice instances. Old instances will be marked invalid and error when used. When this event fires, re-fetch the desired GvrControllerInputDevice from GvrControllerInput.GetDevice(). New handlers added to this event will be called immediately upon adding.
  • New GvrControllerHand enum for specifying handedness.
    • Values: Right, Left, Dominant, NonDominant.
    • Dominant controller will always be present on single and multiple controller systems and will map to the Right or Left controller depending on the handedness system prefrerence setting (GvrSettings.Handedness).
  • New GvrControllerButton enum for specifying controller buttons. Values can be OR'ed together to create a multi-button mask.
  • New GvrTrackedController.ControllerHand property to specify which hand GvrTrackedController tracks.
  • New IGvrControllerInputDeviceReceiver interface. Script components that that implement this receiver interface and are children of GvrTrackedController or children of the object set in GvrTrackedController.ArmModel will receive callbacks when the tracked controller initializes or changes its device instance.
  • GvrControllerPointer prefab defaults to Dominant controller.
    • The prefab will automatically track the Daydream controller on devices that only support one controller.
    • To develop for devices that support two controllers, add a second prefab instance to your scene and change the hand property to NonDominant.
  • HelloVR scene now has two GvrControllerPointer game objects for Dominant and NonDominant hands.
    • On devices that only support a single controller, only the Dominant controller will be activated at runtime.
  • DemoSceneManager prefab updated for 2 controllers.
  • DemoInputManager's ControllerPointers property is now an array to handle multiple controllers. Since there can only be one pointer at a time, DemoInputManager activates the single pointer on the last controller the user clicked the App or TouchPadButton button.
  • Generally, when upgrading from obsolete GvrControllerInput methods to GvrControllerInputDevice methods, you will need to consider how best to get GvrControllerInputDevice instance updates. If your component will be a child of GvrTrackedController, then your component should implement the IGvrControllerInputDeviceReceiver interface to receive device instance updates from GvrTrackedController. This has the advantage that your component will automatically get the GvrControllerInputDevice of the hand for which the parent GvrTrackedController is configured. If your component lives outside of GvrTrackedController you can either fetch a device instance every time you need one from GvrControllerInput.GetDevice(), or register an event hander for GvrControllerInput.OnDevicesChanged to receive callbacks when device instances change and cache the result of a call to GvrControllerInput.GetDevice().

Breaking changes

None.

Deprecations

  • Most of the static GvrControllerInput methods and properties have been deprecated. Replacement methods and properties can be accessed on the new GvrControllerInputDevice instances:
    • The following static properties are available, with the same name, as GvrControllerInputDevice instance properties:
      • OnStateChanged
      • State
      • Orientation
      • Gyro
      • Accel
      • ErrorDetails
      • StatePtr
      • IsCharging
      • BatteryLevel
    • The following static properties have been deprecated and are replaced by a single TouchPos instance property on GvrControllerInputDevice that returns center relative touch coordinates:
      • GvrControllerInput.TouchPosCentered (center is (0, 0)) -> TouchPos (center is (0, 0))
      • GvrControllerInput.TouchPos (top-left is (0, 0)) -> TouchPos on GvrControllerInputDevice (center is (0, 0))
    • The following static methods have been replaced by similarly named GvrControllerInputDevice instance methods. Method names have been changed for consistency with Unity's Input API:
      • GvrControllerInput.IsTouching() -> GetButton(GvrControllerButton.TouchPadTouch)
      • GvrControllerInput.TouchDown() -> GetButtonDown(GvrControllerButton.TouchPadTouch)
      • GvrControllerInput.TouchUp() -> GetButtonUp(GvrControllerButton.TouchPadTouch)
      • GvrControllerInput.ClickButton() -> GetButton(GvrControllerButton.TouchPadButton)
      • GvrControllerInput.ClickButtonDown() -> GetButtonDown(GvrControllerButton.TouchPadButton)
      • GvrControllerInput.ClickButtonUp() -> GetButtonUp(GvrControllerButton.TouchPadButton)
      • GvrControllerInput.AppButton() -> GetButton(GvrControllerButton.App)
      • GvrControllerInput.AppButtonDown() -> GetButtonDown(GvrControllerButton.App)
      • GvrControllerInput.AppButton() -> GetButtonUp(GvrControllerButton.App)
      • GvrControllerInput.HomeButtonDown() -> GetButtonDown(GvrControllerButton.System)
      • GvrControllerInput.HomeButtonState() -> GetButton(GvrControllerButton.System)

Behavioral changes

  • HeadsetDemoManager debug logging of safety region and floor height is now off by default.

Other changes

  • Added support for positionally tracked headsets in Instant Preview.
  • Updated bundled lib GVR for Android to v1.150.0.
  • Fixed IPreprocessBuild and IPostrocessBuild obsolete warnings in Unity 2018.x.
  • Added null checks on safetyRing in HeadsetDemoManager.
  • Added source code for native libs gvr-exoplayersupport, gvr-keyboardsupport, gvr-permissionsupport, and video_plugin to the git repo. Addresses issues 437 and 556.

Experimental features

Bug fixes

  • Fixed issue 822 where the permission request could result in a crash after the permission had been granted.
  • Fixed issue 835. The GvrEditorEmulator was previously allocating memory every frame, and should now only allocate on Awake().
  • Fixed issue 865 where GvrVRHelpers.GetHeadRotation() didn't work with Instant Preview.
  • Fixed issue 888. Added a console warning when trying to use a GvrTrackedController without a GvrControllerInput.
  • Fixed issue 917 where using GVRKeyboard when building with IL2CPP would throw NotSupportedException.
  • Fixed issue 918 where adding a new GVRKeyboard component after destroying one will cause a crash.
  • Fixed the pointer reticle not showing up properly on all of the demo scenes that use the CubeRoom prefab.
  • Fixed missing Instant Preview newlines characters in standard output and standard error console messages.