-
Notifications
You must be signed in to change notification settings - Fork 330
NEW: Add generic RacingWheel class. #1430
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
base: develop
Are you sure you want to change the base?
Conversation
| /// Base class for racing wheels. | ||
| /// </summary> | ||
| [InputControlLayout(stateType = typeof(RacingWheelState), displayName = "Racing Wheel", isGenericTypeOfDevice = true)] | ||
| public class RacingWheel : InputDevice |
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.
Biggest question for me is how we want this to relate to Gamepad. I think pretty much any wheel out there has controls (such as the face and shoulder buttons) to allow it to function mostly like a gamepad. But not every API (same GameInput) defines wheels that way.
So, guess the question is how much we want to put in here in the abstract definition.
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.
Likely shouldn't be a gamepad, but rather dpad from racing wheel should participate in navigation.
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.
Wondering about additional controls, though. Seems most sensible to add them here, too. Don't think the wheel should separately be represented as a gamepad but it should probably have ABXY face buttons and shoulder buttons instead of just the narrow set that's currently on the device.
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.
I agree any additional face buttons should exist with the race wheel device.
| /// </code> | ||
| /// </example> | ||
| /// </remarks> | ||
| public struct RacingWheelState : IInputStateTypeInfo |
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.
We likely don't need state struct, rather only RacingWheel device class, so users can write code against that, as device structs will come with platform specific devices. And HID already has it's own thing anyway.
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.
My experience has been that every time we tried to hide the state struct or do away with this, it just ended up being painful because you had no way to send input to the device without using the tedious APIs that write values through individual controls.
It's like GamepadState. Gamepad has many different variations and possible states but just being able to spawn a gamepad and directly feed it input is quite useful. IMO better to treat all devices the same way there.
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.
So let's say PS4/PS5 code will need more state, e.g. it will be like DualShock gamepad vs Gamepad, how would that work?
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.
Same as for the current DualShock support. I.e. it'd just come up with its own state format.
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.
Ok but then it's questionable, e.g. you will not able to queue RacingWheelState into device that is racing wheel but implements it's own state format.
| /// <summary> | ||
| /// Button to shift gears up. | ||
| /// </summary> | ||
| public ButtonControl gearUp { get; protected set; } |
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.
Any idea how https://www.logitechg.com/en-us/products/driving/driving-force-shifter.941-000119.html is exposed on HID layer? Not sure if gear lever needs more work here or not
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.
My assumption is this would use the gear control and not the gearUp/gearDown button controls corresponding to the commonly found levers/buttons on the wheel. But not sure.
Also not sure how it's exposed at the HID layer. My very limited experience so far with Logitech wheels has been that they masquerade as plain XInput devices and have no interesting properties whatsoever as HIDs and need interfacing through the Logitech SDK to get to the advanced stuff. But no clue about the gear shifters.
|
How will the haptics (Force Feedback) side of things be handled? Will it be similar to how Gamepad derives from IDualMotorRumble, maybe having IRaceWheelHaptics? |
Good question. My assumption is that wheel effects will not as readily fit into as simple a box as gamepad rumble. I'm thinking the best way might be to ignore them for now and then take it on as part of the bigger discussion around what to do with haptics. Without some more sophisticated API in place, trying to cast wheel haptics into some |
Agreed. IDualMotorRumble isn't doing too well for controllers with more than 2 motors atm. |
|
Probably makes sense to close this one. |
|
Rene Damm seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
If work would be resumed on this PR it needs to updated with latest changes from develop to not cause CI issues. |
Description
Add a new
RacingWheelgeneric device class.Checklist
Before review:
Changed,Fixed,Addedsections.([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.