Skip to content

Commit

Permalink
Add new builders for input processors and extensions for those implem…
Browse files Browse the repository at this point in the history
…enting `WithInputProcessorExt` traits (#625)

* new methods

* new processor methods

* minor

* minor
  • Loading branch information
Shute052 authored Sep 18, 2024
1 parent 63ebdb2 commit 36441c7
Show file tree
Hide file tree
Showing 6 changed files with 840 additions and 52 deletions.
10 changes: 10 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@

- Reflect `Component` and `Resource`, which enables accessing the data in the type registry

#### Input Processors

- allowed creating `DualAxisBounds`, `DualAxisExclusion`, and `DualAxisDeadZone` from their struct definitions directly.
- added `at_least` and `at_most` methods for those implementing `WithAxisProcessorExt` trait.
- added `at_least`, `at_least_only_x`, `at_least_only_y`, `at_most`, `at_most_only_x`, and `at_most_only_y` methods for those implementing `WithDualAxisProcessorExt` trait.
- added `only_positive` and `only_negative` builders for `AxisDeadZone` and `AxisExclusion`.
- added corresponding extension methods for those implementing `WithAxisProcessorExt` trait.
- added `only_positive`, `only_positive_x`, `only_positive_y`, `only_negative`, `only_negative_x`, and `only_negative_y` builders for `DualAxisDeadZone` and `DualAxisExclusion`.
- added corresponding extension methods for those implementing `WithDualAxisProcessorExt` trait.

#### ActionDiffEvent

- Implement `MapEntities`, which lets networking crates translate owner entity IDs between ECS worlds
Expand Down
8 changes: 4 additions & 4 deletions src/input_processing/dual_axis/circle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ impl CircleBounds {
///
/// # Requirements
///
/// - `threshold` >= `0.0`.
/// - `max` >= `0.0`.
///
/// # Panics
///
/// Panics if the requirements aren't met.
#[doc(alias = "magnitude")]
#[doc(alias = "from_radius")]
#[inline]
pub fn new(threshold: f32) -> Self {
assert!(threshold >= 0.0);
Self { radius: threshold }
pub fn new(max: f32) -> Self {
assert!(max >= 0.0);
Self { radius: max }
}

/// Returns the radius of the bounds.
Expand Down
Loading

0 comments on commit 36441c7

Please sign in to comment.