bevy/crates/bevy_math/src
Bob Gardner 0db9fc92cd
Added CompassQuadrant and CompassOctant as per #13647 (#13653)
# Objective

Implements #13647 

## Solution

Created two enums, CompassQuadrant and CompassOctant inside compass.rs
with impls To and From Dir2. Used dir.to_angle().to_degrees() and
matched against the resulting value. I could have skipped to_degrees()
and matched against the radian value, but I thought this was more
readable. I'm probably wrong lol.

## Testing

Tested various dirs to compass variations.

---

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2024-06-03 19:46:50 +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
compass.rs Added CompassQuadrant and CompassOctant as per #13647 (#13653) 2024-06-03 19:46:50 +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 Added CompassQuadrant and CompassOctant as per #13647 (#13653) 2024-06-03 19:46:50 +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