Code Monkey home page Code Monkey logo

Comments (10)

beniwtv avatar beniwtv commented on July 26, 2024 1

Yep, can confirm axis work now - but as you said, they're mapped weirdly.
Button situation still the same tough.

from godot_openvr.

BastiaanOlij avatar BastiaanOlij commented on July 26, 2024

Hey Ben,

Thanks for testing. I did do some changes yesterday and just realised I haven't commited them yet. I'll do that in the morning. I don't have controllers atm so its very possible I made a mistake. I did order some touch controllers yesterday so once they are in I can test myself :)

just have a look if you can see anything out of whack here:
https://github.com/BastiaanOlij/godot_openvr/blob/master/src/godot_openvr.cpp#L450

But note that code is about to change :)

from godot_openvr.

BastiaanOlij avatar BastiaanOlij commented on July 26, 2024

I don't know if you had any more time to look at things but I did commit those changes I talked about. Whether they make any difference, no idea.

fingers cross my controllers should be arriving today and I can debug this

from godot_openvr.

beniwtv avatar beniwtv commented on July 26, 2024

I didn't have time yet - but hopefully this evening I can test it.

from godot_openvr.

BastiaanOlij avatar BastiaanOlij commented on July 26, 2024

I haven't tested the button events yet but the axis are working for me on my touch controllers. The mapping is really weird though.

I think on the vive the trigger will probably be axis 4, not 2. I loop through 4 of the 5 axis and each has an x and y component, so x on axis 1, becomes axis 1 in Godot,
y on axis 1 becomes axis 2,
x on axis 2 becomes axis 3,
y on axis 2 becomes axis 4,
Etc.

Since the second axis on a vive controller is a trigger it only has a y which would become axis 4.

I might need to add in some more smarts and do some sort of axis mapping..

from godot_openvr.

BastiaanOlij avatar BastiaanOlij commented on July 26, 2024

I think this is our problem:
https://github.com/BastiaanOlij/godot/blob/master/scene/3d/arvr_nodes.cpp#L207

Should be:
bool was_pressed = (button_states & mask) == mask;

I'll try it tonight

from godot_openvr.

BastiaanOlij avatar BastiaanOlij commented on July 26, 2024

This seems to fix it:

godotengine/godot#12230

from godot_openvr.

beniwtv avatar beniwtv commented on July 26, 2024

Yep, that fixes it for me too.

I thought a bit about the axis mapping issue, what do you think about using an approach similar to Godot's controller mappings?

https://github.com/godotengine/godot/blob/5303efb2fabd668bef18b7ac7606426692e5d6bb/main/input_default.cpp#L529

This way we could have the buttons and axis a bit standardized, and easily add new mappings. Not sure how "similar" VR controllers are though...

from godot_openvr.

BastiaanOlij avatar BastiaanOlij commented on July 26, 2024

@beniwtv where you still testing this on linux? I'm planning on putting a package together this weekend, it would be nice to confirm if the linux build is now working and maybe include a build in it as well.

Btw, I don't know if you hang out on IRC/Matrix but we created a channel on freenode + room on matrix: #godotengine-vr

from godot_openvr.

beniwtv avatar beniwtv commented on July 26, 2024

Yep, was planning on testing the rumble PR sometime this weekend. As far as this issue - apart from the weird axis mapping, things work now.

Will look into Matrix (have been wanting to test it anyway).

from godot_openvr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.