diff --git a/README.md b/README.md index 16cebf8..effdf1a 100644 --- a/README.md +++ b/README.md @@ -62,18 +62,6 @@ This will set up a camera with good defaults. Check out the [advanced example](https://github.com/Plonq/bevy_panorbit_camera/tree/master/examples/advanced.rs) to see all the possible configuration options. -## What are `alpha` and `beta`? - -Typically you don't need to worry about the inner workings of this plugin - the defaults work well and are suitable for -most use cases. However, if you want to customise the behaviour, for example restricting the camera movement or -adjusting sensitivity, you probably want to know what the `alpha` and `beta` values represent. - -While not strictly accurate, you can think of `alpha` as yaw and `beta` as tilt. More accurately, `alpha` represents the -angle around the _global_ Y axis, and `beta` represents the angle around the _local_ X axis (i.e. the X axis after Y -axis rotation has been applied). When both `alpha` and `beta` are `0.0`, the camera is pointing directly forward (-Z). -Thus, increasing `alpha` orbits around to the right (counter clockwise if looking from above), and increasing `beta` -orbits up and over (e.g. a `beta` value of 90 degrees (`PI / 2.0`) results in the camera looking straight down). - ## Cargo Features - `bevy_egui` (optional): Makes `PanOrbitCamera` ignore any input that `egui` uses, thus preventing moving the camera diff --git a/examples/advanced.rs b/examples/advanced.rs index ba55a3a..fff68c3 100644 --- a/examples/advanced.rs +++ b/examples/advanced.rs @@ -48,21 +48,21 @@ fn setup( }); // Camera commands.spawn(( - // Note we're setting the initial position below with alpha, beta, and radius, hence + // Note we're setting the initial position below with yaw, pitch, and radius, hence // we don't set transform on the camera. Camera3dBundle::default(), PanOrbitCamera { // Set focal point (what the camera should look at) focus: Vec3::new(0.0, 1.0, 0.0), // Set the starting position, relative to focus (overrides camera's transform). - alpha: Some(TAU / 8.0), - beta: Some(TAU / 8.0), + yaw: Some(TAU / 8.0), + pitch: Some(TAU / 8.0), radius: Some(5.0), // Set limits on rotation and zoom - alpha_upper_limit: Some(TAU / 4.0), - alpha_lower_limit: Some(-TAU / 4.0), - beta_upper_limit: Some(TAU / 3.0), - beta_lower_limit: Some(-TAU / 3.0), + yaw_upper_limit: Some(TAU / 4.0), + yaw_lower_limit: Some(-TAU / 4.0), + pitch_upper_limit: Some(TAU / 3.0), + pitch_lower_limit: Some(-TAU / 3.0), zoom_upper_limit: Some(5.0), zoom_lower_limit: Some(1.0), // Adjust sensitivity of controls diff --git a/examples/animate.rs b/examples/animate.rs index 983540d..76f6ebd 100644 --- a/examples/animate.rs +++ b/examples/animate.rs @@ -59,9 +59,9 @@ fn setup( // Animate the camera's position fn animate(time: Res