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

DualAxis Directional Snapping #372

Open
100-TomatoJuice opened this issue Aug 6, 2023 · 1 comment
Open

DualAxis Directional Snapping #372

100-TomatoJuice opened this issue Aug 6, 2023 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@100-TomatoJuice
Copy link
Collaborator

100-TomatoJuice commented Aug 6, 2023

What problem does this solve?

While working on #370, it got me thinking about joysticks being used as a dpad or an input that requires the full 360° to be split up into snap-able angles.

What solution would you like?

Probably something like:

// `with_snapping()` could take a radians or degree depending on which more ergonamic.
// Using degree does require converting to radians though.
DualAxis::left_stick().with_snapping(PI / 2.0);

How could this be implemented?

In axis_like.rs

pub struct AxisSnapping {
    pub snap_radians: f32,
}

impl AxisSnapping {
    pub snap_input(&self) -> Vec2 {
        // snap code
    }
}

In input_streams.rs in extract_dual_axis_data(), the snapping can be applied to the creation of the DualAxisData.

@100-TomatoJuice 100-TomatoJuice added the enhancement New feature or request label Aug 6, 2023
@Shute052
Copy link
Collaborator

Shute052 commented May 2, 2024

@alice-i-cecile alice-i-cecile added this to the 0.15.1 milestone Aug 8, 2024
@alice-i-cecile alice-i-cecile added the good first issue Good for newcomers label Aug 25, 2024
@alice-i-cecile alice-i-cecile removed this from the 0.15.1 milestone Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants