-
Notifications
You must be signed in to change notification settings - Fork 324
Fixed GetHapticCapabilitiesCommand always failing to execute #1776
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
Conversation
…d missing haptic capabilities properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find.
Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Haptics/GetHapticCapabilitiesCommand.cs
Show resolved
Hide resolved
Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Haptics/GetHapticCapabilitiesCommand.cs
Outdated
Show resolved
Hide resolved
The names won't match the UnityEngine.XR and IUnityXRInput.h names, but this is needed to avoid a breaking change. Renamed the optimal size field to more closely match the naming of maxBufferSize for consistency within Input System.
… API_MinorVersionsHaveNoBreakingChanges to fail. The value remains the same. The test could be updated in the future to recognize the value is the same, but for now it's easier to just revert the change.
Like @jamesmcgill I was getting failures of API_MinorVersionsHaveNoBreakingChanges when running locally on my computer, see #1763 (comment). I reverted the change of adding a redundant explicit field initialization to I also updated the branch to revert the obsolete and renaming I did previously. The names won't match the UnityEngine.XR namespace, but it seems we can't really do so without doing a breaking change. |
Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Haptics/GetHapticCapabilitiesCommand.cs
Show resolved
Hide resolved
# Conflicts: # Packages/com.unity.inputsystem/CHANGELOG.md
# Conflicts: # Packages/com.unity.inputsystem/CHANGELOG.md
Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Haptics/GetHapticCapabilitiesCommand.cs
Show resolved
Hide resolved
# Conflicts: # Packages/com.unity.inputsystem/CHANGELOG.md
# Conflicts: # Packages/com.unity.inputsystem/CHANGELOG.md
@chris-massie There is another PR about to land, so it's going to need another update soon I'm afraid. 😄 |
* Fixed GetHapticCapabilitiesCommand always failing to execute and added missing haptic capabilities properties * Added setter to make migration better if the user was setting the old field * Fixed API_MinorVersionsHaveNoBreakingChanges by reverting renames The names won't match the UnityEngine.XR and IUnityXRInput.h names, but this is needed to avoid a breaking change. Renamed the optimal size field to more closely match the naming of maxBufferSize for consistency within Input System. * Reverted redundant explicit field initialization since it was causing API_MinorVersionsHaveNoBreakingChanges to fail. The value remains the same. The test could be updated in the future to recognize the value is the same, but for now it's easier to just revert the change. * Added xml-doc to public fields and methods --------- Co-authored-by: James McGill <jamesmcgill@users.noreply.github.com>
Description
Fixed
GetHapticCapabilitiesCommand
always failing to execute.Changes made
Added new fields to the command to make the payload size in bytes match the expected size.
I modified the names of the command fields to match the names in Unity core and the XR module, and created deprecated properties that map to the new fields. The naming makes it more clear they only apply for buffered haptics. Though this is technically a breaking change, since the command never worked at all, I think this is acceptable.EDIT: I kept the old names to avoid API breaking.I also renamed the old properties inEDIT: Reverted since theHapticCapabilities
to match XR module with auto migration. This is not a breaking change.API_MinorVersionsHaveNoBreakingChanges
test isn't sophisticated enough to recognize this is allowed.Notes
Starting with Unity 2018.3, the
UnityXRHapticCapabilities
struct was modified to add new properties, which adjusted the size of the struct. TheXRInputSubsystem
verifies that the size of the buffer passed to the command matches. It was previously always failing because 12 bytes != 20 bytes.Checklist
Before review:
Changed
,Fixed
,Added
sections.([case %number%](https://issuetracker.unity3d.com/issues/...))
.Area_CanDoX
,Area_CanDoX_EvenIfYIsTheCase
,Area_WhenIDoX_AndYHappens_ThisIsTheResult
.During merge:
NEW: ___
.FIX: ___
.DOCS: ___
.CHANGE: ___
.RELEASE: 1.1.0-preview.3
.