Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow resetbutton to be moved - issue #114 #115

Closed

Conversation

JeffBail
Copy link
Contributor

ResetButton needs to update its position cache when the button is pressed in case the host object has been moved since the cache was initially created in Start(). This is a fix for issue #114.

lawwong and others added 15 commits August 29, 2017 18:23
* New features
  - Add notification when new version released on [Github](https://github.com/ViveSoftware/ViveInputUtility-Unity/releases).
  - Add **VRModule** class to bridge various VR SDK. It currently supports SteamVR plugin, Oculus VR plugin and Unity native VR/XR interface.
    - **void VRModule.Initialize()**: Create and initilize VRModule manager instance.
    - **VRModuleActiveEnum VRModule.activeModule**: Returns the activated module.
    - **IVRModuleDeviceState VRModule.GetCurrentDeviceState(uint deviceIndex)**: Returns the virtual VR device status.
    - **event NewPosesListener VRModule.onNewPoses**: Invoked after virtual VR device status is updated.
    - **event DeviceConnectedListener VRModule.onDeviceConnected**: Invoked after virtual VR device is connected/disconnected.
    - **event ActiveModuleChangedListener VRModule.onActiveModuleChanged**: Invoked when a VR module is activated.
  - New binding interface using overlay UI. By default, the binding interface can be enabled by pressing RightShift + B in play mode.
    - ![Binding UI](https://github.com/ViveSoftware/ViveInputUtility-Unity/blob/gh-pages/assets/img/binding_ui_preview_01.png)
    - ![Binding UI](https://github.com/ViveSoftware/ViveInputUtility-Unity/blob/gh-pages/assets/img/binding_ui_preview_02.png)
    - ![Binding UI](https://github.com/ViveSoftware/ViveInputUtility-Unity/blob/gh-pages/assets/img/binding_ui_preview_03.png)
  - Add define symbols
    - **VIU_PLUGIN**: Defined when Vive Input Utility plugin is imported in the project.
    - **VIU_STEAMVR**: Defined when SteamVR plugin is imported in the project.
    - **VIU_OCULUSVR**: Defined when OculusVR plugin (OVRPlugin) is imported in the project.
    - **VIU_BINDING_INTERFACE_SWITCH**: Define it to let the project be able to switch binding interface by pressing RightShift + B in play mode.
    - **VIU_EXTERNAL_CAMERA_SWITCH**: Define it to let the project be able to switch external camera quad view by pressing RightShift + M in play mode.
  - Add new role HandRole.ExternalCamera (Alias for HandRole.Controller3).
    - By default, it is mapping to the 3rd controller, if 3rd controller not available, then mapping to the first valid generic tracker.
    - ExternalCameraHook uses mapping as the default tracking target.

* New componts
  - [ViveInputVirtualButton] Use this helper component to combine multiple Vive inputs into one virtual button.

* Improvement
  - [ViveInput] Add more controller buttons, use ViveInput.GetPress(role, buttonEnum) to get device button stat
    - **System** (Only visible when sendSystemButtonToAllApps option is on)
    - **Menu**
    - **MenuTouch**
    - **Trigger**
    - **TriggerTouch**
    - **Pad**
    - **PadTouch**
    - **Grip**
    - **GripTouch**
    - **CapSenseGrip**
    - **CapSenseGripTouch**
    - **AKey**
    - **AKeyTouch**
    - **OuterFaceButton** (Alias for Menu)
    - **OuterFaceButtonTouch** (Alias for MenuTouch)
    - **InnerFaceButton** (Alias for Grip)
    - **InnerFaceButtonTouch** (Alias for GripTouch)
  - [ViveInput] Add controller axis enum, use ViveInput.GetAxis(role, axisEnum) to get device axis value
    - **PadX**
    - **PadY**
    - **Trigger**
    - **CapSenseGrip**
    - **IndexCurl**
    - **MiddleCurl**
    - **RingCurl**
    - **PinkyCurl**
  - [ViveRole] Role mapping/binding mechanism is improved and become more flexible.
    - Now different devices can bind to same role at the same time.
    - If a unconnected device is bound to a role, that role can still map to other connected device.
  - [ViveRole] Obsolete functions that retrieve device status and property, use static API in VRModule instead.
    - **ViveRole.TryGetDeviceIndexBySerialNumber**: Use VRModule.TryGetDeviceIndex instead.
    - **ViveRole.GetModelNumber**: Use VRModule.GetCurrentDeviceState(deviceIndex).modelNumber instead
    - **ViveRole.GetSerialNumber**: Use VRModule.GetCurrentDeviceState(deviceIndex).serialNumber instead
    - **ViveRole.GetDeviceClass**: Use VRModule.GetCurrentDeviceState(deviceIndex).deviceClass instead
  - [ViveRoleBindingsHelper] Now will automatically load bindings from "vive_role_bindings.cfg", no need to be in the scene to work.
  - [RenderModelHook] Add override model and shader option.
  - [ExternalCameraHook] Now ExternalCameraHook will track the HandRole.ExternalCamera by default.
  - [ExternalCameraHook] Now will be added into scene automatically if "externalcamera.cfg" exist when start playing, no need to add to scene manually.
  - [ExternalCameraHook] You can now enable static External Camera quad view (without tracking to a device) if
    1. VIU_EXTERNAL_CAMERA_SWITCH symbol is defined.
    2. externalcamera.cfg exist.
    3. RightShift + M pressed in play mode.
  - [BasicGrabbable, StickyGrabbable, Draggable] Add unblockable grab/drag option.

* Bug fix
  - [ViveRoleProperty] Fix not handling serialized data right in inspector.
  - [PoseEaser] Now use unscaled time instead to avoid from being effected by time scale.
* New features
  - [ExternalCameraHook] Add externalcamera.cfg config interface
    - The interface is built into project when VIU_EXTERNAL_CAMERA_SWITCH symbol is defined.
    - It is automatically activated with the external camera quad view.

![External Camera Config Interface](https://github.com/ViveSoftware/ViveInputUtility-Unity/blob/gh-pages/assets/img/external_camera_config_interface.png)

* Changes
  - Now you can fully disable the binding interface switch by removing the VIU_BINDING_INTERFACE_SWITCH symbol
    - That means nologer

* Bug fix
  - [ViveRole] Fix HandRole.ExternalCamera not mapping to tracker in some cases
  - [ViveRole] Fix ViveRole.IMap.UnbindAll() to work correctly
  - [BindingInterface] Fix some info updating and animation issue
  - [VivePose] Now GetPose returns Pose.identity instead of default(Pose) for invalid device
* New features
  - Add recommended VR project settings notification window

* Bug fix
  - Fix compile error in Unity 5.5/5.6
  - [VRModule] Fix UnityEngineVRModule not removing disappeared device correctly
    - In Unity 2017.2, InputTracking.GetNodeStates sometimes returns ghost nodes at the beginning of play mode.
  - [Teleportable] Remove a potential null reference
    - This happens when SteamVR plugin is imported and no SteamVR_Camera exist.

* Improvement
  - [Pointer3D] Now Pointer3DInputModule shows status in EventSystem's inspector preview window
  - [Pointer3D] Let Pointer3DInputModule behave more consistent with StandaloneInputModule
    - Now IPointerEnterHandler / IPointerExitHandler only triggered once for each pointer, pressing buttons won't trigger Enter/Exit anymore.
  - [Pointer3D] Add IPointer3DPressEnterHandler / IPointer3DPressExitHandler
    - Their behaviours are like IPointerEnterHandler/IPointerExitHandler, but press enter happend when the button is pressed and moved in, and press exit on button released or pointer moved out.
  - [SteamVRCameraHook] Fix not expending head-eye-ear correctly
  - [VRModule] Fix update timing issue
    - This fix VivePoseTracker tracking is delayed in editor playing mode.
* Bug fix
  - [VRModule] Fix compile error in OculusVRModule.cs ViveSoftware#14
  - [Pointer3D] Fix **IPointerExit** not handled correctly when disabling a raycaster ViveSoftware#16
  - [Pointer3D] Fix **IPointerExit**/**IPointerPressExit**/**IPointerUp** doesn't execute in some cases
    - Add **Pointer3DEventData.pressProcessed** flag to ensure Down/Up processed correctly

* Improvement
  - Add new struct type **HTC.UnityPlugin.Utility.RigidPose** to replace **HTC.UnityPlugin.PoseTracker.Pose**
    - Utility.RigidPose inherit all members in PoseTracker.Pose
    - Add forward, up, right property getter
  - Obsolete struct **HTC.UnityPlugin.PoseTracker.Pose** (will be removed in future version) to avoid type ambiguous with UnityEngine.Pose (new type in Unity 2017.2)
    - If you somehow want to using HTC.UnityPlugin.PoseTracker and UnityEngine.Pose in your script at the same time, please use full type name or add type alias to avoid ambiguous compile error
  ``` csharp
  using HTC.UnityPlugin.PoseTracker;
  using UnityEngine;
  using Pose = UnityEngine.Pose;

  public class MyPoseTracker : BasePoseTracker
  {
      public Pose m_pose;
      ...
  }
  ```
  - Change some recommended setting value
    - Now binding interface switch is recommended as enable only if Steam VR plugin is imported
    - Now external camera interface switch is recommended as enable only if Steam VR plugin is imported
  - Now VIU system game object will be auto generated only if nessary
* New features
  - Daydream Support
  - Simulator
  - New VIU Settings to easy setup project supporting device
    - Open from Editor -> Preferences -> VIU Settings
![VIUSettings in Preference window](https://github.com/ViveSoftware/ViveInputUtility-Unity/blob/gh-pages/assets/img/viusettings_preview_01.png)

* Improvement
  - Now compatible with SteamVR v1.1.1~v1.2.3
  - Move some properties into VIU Settings
    - Removed:
      - ViveRoleBindingHelper.OverrideConfigPath
      - ViveRoleBindingHelper.BindingConfig.apply_bindings_on_load
      - ViveRoleBindingHelper.BindingConfig.toggle_interface_key_code
      - ViveRoleBindingHelper.BindingConfig.toggle_interface_modifier
      - ViveRoleBindingHelper.BindingConfig.interface_prefab
    - Replaced with:
      - VIUSettings.bindingConfigFilePath
      - VIUSettings.autoLoadBindingConfigOnStart
      - VIUSettings.bindingInterfaceSwitchKey
      - VIUSettings.bindingInterfaceSwitchKeyModifier
      - VIUSettings.bindingInterfaceObject

* Bug fix
  - Fix compiler error caused by wrong define symbols.

* VIU Settings
  - Setting changes is saved in project resource folder named VIUSettings.asset.
  - VIU Settings will load default setting automatically if VIUSettings.asset resource not found.

* Daydream Support
  - Requires Android platform support, Unity 5.6 or later and GoogleVR plugin.
  - Requires checking the Daydream support toggle in Edit -> Preferences -> VIUSettings
  - Beware of Daydream controller have less buttons.
  - Remember to define and give the VR origin a headset height for Daydream device user.

* Simulator
  - Simulator is a fake VRModule that spawn/remove fake devices, create fake tracking and fake input events.
  - Requires checking the Simulator support toggle in Edit -> Preferences -> VIUSettings
  - Simulator only enabled when no VR device detected.
  - There are 2 ways to manipulate the fake devices
      - Handle events by script manually
        - HTC.UnityPlugin.VRModuleManagement.VRModule.Simulator.onUpdateDeviceState
          - Invoked each frame when VRModule performs a device state update
          - Write device state into currState argument to manipulate devices
          - Read-only argument prefState preserved device state in last frame
      - Use Keyboard-Mouse control (can be disabled in VIUSettings)
        - Add/Remove/Select devices
          - [0~9] Add and select device N if device N is not selected, otherwise, deselect it
          - [` + 0~5] Add and select device 10+N if device 10+N is not selected, otherwise, deselect it
          - [Shift + 0~9] Remove and deselect device N
          - [Shift + ` + 0~5] Remove and deselect device 10+N
        - Control selected device
          - [W] Move selected device forward
          - [S] Move selected device backward
          - [D] Move selected device right
          - [A] Move selected device left
          - [E] Move selected device up
          - [Q] Move selected device down
          - [C] Roll+ selected device
          - [Z] Roll- selected device
          - [X ] Reset selected device roll
          - [ArrowUp] Pitch+ selected device
          - [ArrowDown] Pitch- selected device
          - [ArrowRight] Yaw+ selected device
          - [ArrowLeft] Yaw- selected device
          - [MouseMove] Pitch/Yaw selected device
          - [MouseLeft] Press Trigger on selected device
          - [MouseRight] Press Trackpad on selected device
          - [MouseMiddle] Press Grip on selected device
          - [Hold Shift + MouseMove] Touch Trackpad on selected device
        - Control HMD
          - [T] Move hmd forward
          - [G] Move hmd backward
          - [H] Move hmd right
          - [F] Move hmd left
          - [Y] Move hmd up
          - [R] Move hmd down
          - [N] Roll+ hmd
          - [V] Roll- hmd
          - [B] Reset hmd roll
          - [I] Pitch+ hmd
          - [K] Pitch- hmd
          - [L] Yaw+ hmd
          - [J] Yaw- hmd
  - Notice that when the simulator is enabled, it is started with 3 fake device
    - [0] HMD (selected)
    - [1] Right Controller
    - [2] Left Controller
* New features
  - VIVE Focus Support
    - Required Unity 5.6 or later version
    - Download and install WaveVR SDK Unity plugin from https://hub.vive.com/profile/material-download
    - Enable VIVE Focus support under Edit > Preference > VIU Settings

* Bug fix
  - Fix no tracking devices dectected when SteamVR plugin v1.2.3 is installed
  - Fix compile error in Unity 2018.1
  - Fix VIUSettings changes not saved into asset data file
* Bug fix
  - Fix define symbols sometimes not handle correctly when switching build target
  - Disable vr support if device list is empty
  - Add code to avoid NullReferenceException in VRModule
  - Add SetValueByIndex method to IndexedTable
  - Fix StickyGrabbable not working in certain cases
* Improvement
  - Improve simulator module
    - Add instruction UI
    - Add group control (devices move alone with camera)
    - See [Simulator](https://github.com/ViveSoftware/ViveInputUtility-Unity/wiki/Simulator) for more detail
![VIUSettings in Preference window](https://github.com/ViveSoftware/ViveInputUtility-Unity/blob/gh-pages/assets/img/simulator_01.png)
  - Add ReticlePose.IReticleMaterialChanger interface, better way to indicate different type of pointing object
    - Now you can setup default reticle material in ReticlePose property
![VIUSettings in Preference window](https://github.com/ViveSoftware/ViveInputUtility-Unity/blob/gh-pages/assets/img/retical_mat_changer_default_setup.png)
    - Setup reticle material property in component that implement IReticleMaterialChanger
![VIUSettings in Preference window](https://github.com/ViveSoftware/ViveInputUtility-Unity/blob/gh-pages/assets/img/retical_mat_changer_walkable_setup.png)
  - Add support for WaveVR SDK v2.0.37

* Bug fix
  - Fix tracking device pose not applying scale from the origin transform
  - Fix SteamVRModule reporting wrong input-focus state
  - Fix ViveRigidPoseTracker broke after re-enabled
  - Fix PoseModifier not work correctly ordered by priority value
* New Features
  - Wave VR Plugin v2.1.0 support
  - Add Oculus Go support (requires Oculus VR plugin)

* Improvement
  - [WaveVRModule] Add 6 DoF Controller Simulator (Experimental)
    - [More...](https://github.com/ViveSoftware/ViveInputUtility-Unity/wiki/Wave-VR-6-DoF-Controller-Simulator)
  - [RenderModelHook] Now able to load Wave VR generic controller model
  - [Example2] Add drop area that using physics collider
  - [Example3] Make scroll delta tunable from the Editor
    - [issue#49](ViveSoftware#49)
  - [VIUSettings] Add WVR virtual arms properties
  - [BindingUI] Make un-recognized device visible in the device view (shown in VIVE device icon)
    - [issue#51](ViveSoftware#51)

* Bug Fix
  - [VRModule] Fix sometimes SteamVRModule activated but not polling any device pose/input
* New Features
  - SteamVR Plugin v2.0/v2.1 support
  - [SteamVR New Input System support](https://github.com/ViveSoftware/ViveInputUtility-Unity/wiki/SteamVR-Input-System-Support)

* Improvement
  - Now compatible with Google VR SDK v1.170.0
  - Add ControllerAxis.Joystick for Windows Mixed Reality Motion Controller
  - Extend ControllerButton alias
    - BKey (Menu)
    - BkeyTouch (MenuTouch)
    - Bumper (Axis3)
    - BumperTouch (Axis3Touch)
  - Add ControllerButton.DPadXXX virtual buttons (simulated from trackpad/thumbstick values)
    - DPadLeft
    - DPadLeftTouch
    - DPadUp
    - DPadUpTouch
    - DPadRight
    - DPadRightTouch
    - DPadDown
    - DPadDownTouch
    - DPadUpperLeft
    - DPadUpperLeftTouch
    - DPadUpperRight
    - DPadUpperRightTouch
    - DPadLowerRight
    - DPadLowerRightTouch
    - DPadLowerLeft
    - DPadLowerLeftTouch

* Known Issues
  - When working with SteamVR Plugin v2, VIU can get poses or send vibration pulses for all connected devices, but only able to connect button inputs from up to 2 Vive Controllers or 10 Vive Trackers (due to the limitation of SteamVR input sources). If you know how to work around, please let us know.
* New Features
  - SteamVR Plugin v2.0/v2.1 support
  - SteamVR New Input System support ([Guide](https://github.com/ViveSoftware/ViveInputUtility-Unity/wiki/SteamVR-Input-System-Support))

* Improvement
  - Now compatible with Google VR SDK v1.170.0
  - Add ControllerAxis.Joystick for Windows Mixed Reality Motion Controller
  - Extend ControllerButton (DPadXXX are virtual buttons simulated from trackpad/thumbstick values)
    - BKey (Menu)
    - BkeyTouch (MenuTouch)
    - Bumper (Axis3)
    - BumperTouch (Axis3Touch)
    - ProximitySensor
    - DPadLeft
    - DPadLeftTouch
    - DPadUp
    - DPadUpTouch
    - DPadRight
    - DPadRightTouch
    - DPadDown
    - DPadDownTouch
    - DPadUpperLeft
    - DPadUpperLeftTouch
    - DPadUpperRight
    - DPadUpperRightTouch
    - DPadLowerRight
    - DPadLowerRightTouch
    - DPadLowerLeft
    - DPadLowerLeftTouch

* Known Issue
  - When working with SteamVR Plugin v2, VIU can get poses or send vibration pulses for all connected devices, but only able to connect button inputs from up to 2 Vive Controllers or 10 Vive Trackers (due to the limitation of SteamVR input sources). If you know how to work around, please let us know.
* Improvement
  - [ViveInput] Add new procedure vibration API (only works with SteamVR v2)
```csharp
using HTC.UnityPlugin.Vive;
ViveInput.TriggerHapticVibrationEx<TRole>(
      TRole role,
      float durationSeconds = 0.01f,
      float frequency = 85f,
      float amplitude = 0.125f,
      float startSecondsFromNow = 0f)
```

* Bug Fix
  - [ViveInput] Fix issue that TriggerHapticPulse is not working
  - [Utility] Fix bug in IndexedSet indexer setter.
  - [WaveVRModule] Fix VIU example freezes after launched
  - [OculusVRModule] Fix OculusVRModule not recognizing GearVR or OculusGO correctly
  - [ExternalCamera] Fix not working with SteamVR v2
  - [ExternalCamera] Fix SteamVR_ExternalCamera setting sceneResolutionScale incorrectly in some cases
  - [ExternalCamera] Fix potential RenderTexture created by SteamVR_ExternalCamera having incorrect ColorSpace
* Improvement
  - [WaveVRModule] Support WaveVR simulator (Enable VIVE Focus support in Editor mode)

* Bug Fix
  - [WaveVRModule] Fix WaveVR tracking glitter issue
  - [WaveVRModule] Fix VIU simulator cannot launch (ONLY enable VIU simulator)
CachePositions() was created to allow the buttonObject and effectTargets position caches to be updated from OnColliderEventPressEnter. This allows the host of the ResetButton to be moved at runtime. If the cache is not updated the objects would end up getting moved to their start position in the scene after a button press. This is a fix for issue ViveSoftware#114.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants