bevy/examples/2d
Cameron Hart ac63c491fb Simple 2d rotation example (#3065)
# Objective

Some new bevy users are unfamiliar with quaternions and have trouble working with rotations in 2D.

There has been an [issue](https://github.com/bitshifter/glam-rs/issues/226) raised with glam to add helpers to better support these users, however for now I feel could be better to provide examples of how to do this in Bevy as a starting point for new users.

## Solution

I've added a 2d_rotation example which demonstrates 3 different rotation examples to try help get people started:

- Rotating and translating a player ship based on keyboard input
- An enemy ship type that rotates to face the player ship immediately
- An enemy ship type that rotates to face the player at a fixed angular velocity

I also have a standalone version of this example here https://github.com/bitshifter/bevy-2d-rotation-example but I think it would be more discoverable if it's included with Bevy.
2022-01-25 22:10:11 +00:00
..
contributors.rs Replace old renderer with new renderer (#3312) 2021-12-14 03:58:23 +00:00
many_sprites.rs Fix doc_markdown lints in examples (#3486) 2021-12-29 17:25:34 +00:00
mesh2d.rs Add 2d meshes and materials (#3460) 2022-01-08 01:29:08 +00:00
mesh2d_manual.rs Add 2d meshes and materials (#3460) 2022-01-08 01:29:08 +00:00
rect.rs Add an example to draw a rectangle (#2957) 2021-12-18 00:52:37 +00:00
rotation.rs Simple 2d rotation example (#3065) 2022-01-25 22:10:11 +00:00
sprite.rs Replace old renderer with new renderer (#3312) 2021-12-14 03:58:23 +00:00
sprite_flipping.rs Replace old renderer with new renderer (#3312) 2021-12-14 03:58:23 +00:00
sprite_sheet.rs Replace old renderer with new renderer (#3312) 2021-12-14 03:58:23 +00:00
text2d.rs Implement and require #[derive(Component)] on all component structs (#2254) 2021-10-03 19:23:44 +00:00
texture_atlas.rs Replace old renderer with new renderer (#3312) 2021-12-14 03:58:23 +00:00