-
Notifications
You must be signed in to change notification settings - Fork 35
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
Button and axis info #4
Comments
Hi, this is how the HTC Vive controller is mapped Axis 0 = Left/Right on the touchpad
|
Interesting. I'm using the alpha linked in one of your videos. Watching the openvr event handlers (_on_OVRController_button_pressed) the button events trigger, but none of the axis or button events via the godot input map seem to do anything for me on an oculus cv1/touch |
@blamarche hmmm, its possible that was a bug at the time but I must admit that I've been using mostly the events and access methods i added on ARVRController so there may be an issue there. That said, I am using the input map to define movement actions which are purely working through Godots internal joystick handling and they react fine to the top axis. Worth investigating further for sure. I hope to finish off the changes related to the feature freeze and imminent release of Godot 3 beta 1 and have new builds available. |
Awesome, can't wait to try it out! |
@zoiba I'm not super familiar with how Git works with pull requests and stuff, so I'll post some code here: To get the touchpad click I added some stuff to process SteamVR events (ARVRInterface.cpp line 277):
Then I commented out the "if (was_pressed != is_pressed)" block (around line 352 after adding the above code). And now I've got all the buttons reporting. You have to do the reassignment because k_EButton_SteamVR_Touchpad is actually index 32, and Godot only supports 16 discreet buttons. You could probably do the same re-assignment trick with vr::k_EButton_SteamVR_Trigger (which is index 33) if you want the trigger to also behave as a button instead of purely an axis. I tried to do the re-assignment in the iterator loop but it just froze when I tried to launch (and capturing the event may be more performant than looping 16 times on each controller to get their button states). |
Sweet! Thanks man! I will get these changes sorted out tonight or tomorrow (I might go and see starwars tonight). I'll probably change the code to use button 15 and 16 (or 14 and 15) for touchpad and trigger respectively. That way controllers with more buttons won't suddenly get into trouble. The events are definitely a better way to implement this. |
Cool! that works like a charm! Even on the rift 15 is now trigger and 14 is pushing down on the analog stick |
Shouldn't the trigger be axis 6 or 7 to not contradict the regular gamepad API? Axis 2 normally is `JOY_ANALOG_RX', so I think it's quite unexpected for this to mean the trigger in VR. |
Also, someone on discord mentioned that the WMR Controller uses axes 4 and 5 for the joystick. |
@Hinsbart I use the mapping as I get it from OpenVR and OpenVR already dictates what the joystick axis should be. If WMR deviates from that I feel thats a problem that needs to be solved in the OpenVR driver, not on our side. For us, it is just an OpenVR controller. It doesn't make sense anyway because the whole idea about OpenVR is that any game works with any HMD/controller that supports OpenVR. No other game is going to change their controller mappings just for WMR if it is WMR that doesn't follow the guidelines. If this is really and issue, i'm pretty sure WMR will fix its mappings or none of the SteamVR games will properly work with it. Now if we would be able to create native WMR drivers, thats a whole other story :) |
That said, remixing the axis to align with the JOY_constants I do agree with, I'm just worried its a little late for that change as it'll be a breaking change. Then again, it's still early days so better late then never I guess... |
At the microsoft store, figured out the issue, the microsoft vr controllers
have a touchpad and joystick, since the vive wands only have the touchpad
those mappings overlap
On Wed, 21 Mar 2018 at 6:28 am, Andreas Haas ***@***.***> wrote:
Also, someone on discord mentioned that the WMR Controller uses axes 4 and
5 for the joystick.
So I think ideally we should make use of the remapping system to get
consistent behaviour across different device types.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://github.com/BastiaanOlij/godot_openvr/issues/4#issuecomment-374726818>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB2vacFU-htOtAZQ3nY2aT74MM-Avw-6ks5tgVhugaJpZM4QOANL>
.
|
Hi, this may be of interest. Godot has added the ability for actions to provide analog values. Although it's not quite like an Axis system, values are on 0 to 1, not -1 to 1. godotengine/godot#16902 |
@aaronfranke as the controller logic is build ontop of the joystick logic, controller input will tie into the action system. The biggest issue that you have here is that you generally have multiple controllers in VR and the one that becomes the first "joystick" is the one that is turned on first. (off course if you update the input map after you know which joystick relates to the left hand and which to the right hand it will all work splendidly) |
I made a little singleton script to hold some of the button constants to make reading code easier for now: extends Node
const BUTTON_B = 1
const BUTTON_A = 7
const BUTTON_GRIP = 2
const BUTTON_STICK = 14
const BUTTON_TRIGGER = 15
const AXIS_X = 0
const AXIS_Y = 1
const AXIS_TRIGGER = 2
const AXIS_GRIP = 4 In case anyone else was looking for something similar and stumbled upon this thread |
Official constants are coming : godotengine/godot#29754 |
The aforementioned PR has now been merged into master :) |
Hey All,
We'll find a nicer place for this soon but just wanted to share some info. I'll be checking in some changes soon where I've added some boxes and codes to the demo controllers so we can visualise the inputs.
I found out the inputs are mapped as follows on Oculus touch controllers.
Axis 0 = Left/Right on the joystick
Axis 1 = Forward/Backward on the joystick
Axis 2 = Front trigger
Axis 4 = Side trigger
Button 1 = B / Y
Button 2 = Side trigger
Button 7 = A / X
Button 14 = Press down analog stick
Button 15 = Front trigger (on/off version of Axis 2)
The menu/home buttons don't give feedback as they are already actions in OpenVR itself.
The text was updated successfully, but these errors were encountered: