Leafwing-Studios / leafwing-input-manager

A straightforward stateful input manager for the Bevy game engine.
Apache License 2.0
711 stars 108 forks source link

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

Open Tam opened 1 month ago

Tam commented 1 month ago

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:

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:

Shute052 commented 1 month ago

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

Should we release a 0.15.2 patch to include this?

Shute052 commented 1 month ago

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 commented 1 month ago

Thanks, @Shute052!

Just tried out the main branch and it works 👍

alice-i-cecile commented 1 month ago

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