bevy/crates/bevy_math/src
Alice Cecile cca4fc76de
Add compass direction constants to Dir2 (#13636)
# Objective

When working on `leafwing-input-manager` and in my games, I've found
these compass directions to be both clear and useful when attempting to
describe angles in 2 dimensions.

This was directly used when mapping gamepad inputs into 4-way movement
as a virtual dpad, and I expect other uses are common in games.

## Solution

- Add constants corresponding to the 4 cardinal and 4 semi-cardinal
directions.

## Testing

- I've validated the quadrants of each of the directions through
self-review.

---------

Co-authored-by: Alice Cecile <alice.i.cecil@gmail.com>
2024-06-03 15:14:13 +00:00
..
bounding Implemented Reflect for (almost) all bevy_math types (#13537) 2024-05-27 18:18:10 +00:00
primitives Clarify cone position (#13568) 2024-05-29 20:19:58 +00:00
rects Move bevy_math Reflect impls (#13520) 2024-05-27 14:15:22 +00:00
sampling Implement ShapeSample for Extrusion<T> (#13567) 2024-05-30 12:08:28 +00:00
affine3.rs Implemented Reflect for (almost) all bevy_math types (#13537) 2024-05-27 18:18:10 +00:00
aspect_ratio.rs Implemented Reflect for (almost) all bevy_math types (#13537) 2024-05-27 18:18:10 +00:00
common_traits.rs Remove VectorSpace impl on Quat (#12796) 2024-03-30 17:18:52 +00:00
cubic_splines.rs Implemented Reflect for (almost) all bevy_math types (#13537) 2024-05-27 18:18:10 +00:00
direction.rs Add compass direction constants to Dir2 (#13636) 2024-06-03 15:14:13 +00:00
float_ord.rs Implemented Reflect for (almost) all bevy_math types (#13537) 2024-05-27 18:18:10 +00:00
lib.rs Random sampling of directions and quaternions (#12857) 2024-04-04 23:13:00 +00:00
ray.rs Implemented Reflect for (almost) all bevy_math types (#13537) 2024-05-27 18:18:10 +00:00
rotation2d.rs Add compass direction constants to Dir2 (#13636) 2024-06-03 15:14:13 +00:00