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

Triple axis not being mapped correctly from keyboard dpad 3d #643

Open
Tam opened this issue Oct 7, 2024 · 4 comments
Open

Triple axis not being mapped correctly from keyboard dpad 3d #643

Tam opened this issue Oct 7, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Tam
Copy link

Tam commented Oct 7, 2024

Version

0.15.1

Operating system & version

MacOS 15

What you did

Add a triple axis to an InputMap

im.insert_triple_axis(DebugActions::Move, KeyboardVirtualDPad3D::new(
	KeyCode::KeyE, // Up
	KeyCode::KeyQ, // Down
	KeyCode::KeyA, // Left
	KeyCode::KeyD, // Right
	KeyCode::KeyW, // Forward
	KeyCode::KeyS, // Backward
));

What you expected to happen

Values recieved from clamped_axis_triple should correctly map keys to floats. E.g:

  • 'A' = vec3(-1.0, 0.0, 0.0)
  • 'E' = vec3(0.0, 1.0, 0.0)
  • 'W' = vec3(0.0, 0.0, 1.0)

What actually happened

The Y axis is mapped correctly, but the X is mapped to both X and Z and the Z inputs are ignored entirely. So:

  • 'A' = vec3(-1.0, 0.0, -1.0)
  • 'E' = vec3(0.0, 1.0, 0.0)
  • 'W' = vec3(0.0, 0.0, 0.0)
@Tam Tam added the bug Something isn't working label Oct 7, 2024
@Shute052
Copy link
Collaborator

Shute052 commented Oct 8, 2024

Oops, that was a bug. I fixed it in pull request #623

Should we release a 0.15.2 patch to include this?

@Shute052
Copy link
Collaborator

Shute052 commented Oct 8, 2024

And forward is the negative direction of the Z-axis in Bevy, so it should be 'W' = vec3(0.0, 0.0, -1.0)

@Tam
Copy link
Author

Tam commented Oct 8, 2024

Thanks, @Shute052!

Just tried out the main branch and it works 👍

@alice-i-cecile
Copy link
Contributor

IMO we're close to a 0.16 launch for the new Bevy version: let's do that instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants