diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 912b02ae71799..1efcb1d2633d2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -419,6 +419,8 @@ Bevy is actively open to code contributions from community members. If you're new to Bevy, here's the workflow we use: 1. Fork the `bevyengine/bevy` repository on GitHub. You'll need to create a GitHub account if you don't have one already. + 1. Copy `.cargo/config_fast_builds.toml` to `.cargo/config.toml`. Then update the file and follow the general + recommendations to [compile with performance optimizations](https://bevyengine.org/learn/quick-start/getting-started/setup/#compile-with-performance-optimizations). 2. Make your changes in a local clone of your fork, typically in its own new branch. 1. Try to split your work into separate commits, each with a distinct purpose. Be particularly mindful of this when responding to reviews so it's easy to see what's changed. 2. Tip: [You can set up a global `.gitignore` file](https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files#configuring-ignored-files-for-all-repositories-on-your-computer) to exclude your operating system/text editor's special/temporary files. (e.g. `.DS_Store`, `thumbs.db`, `*~`, `*.swp` or `*.swo`) This allows us to keep the `.gitignore` file in the repo uncluttered. diff --git a/examples/camera/2d_top_down_camera.rs b/examples/camera/2d_top_down_camera.rs index 3cb751c0fb74f..5d788f1c416d9 100644 --- a/examples/camera/2d_top_down_camera.rs +++ b/examples/camera/2d_top_down_camera.rs @@ -16,7 +16,8 @@ use bevy::math::{vec2, vec3}; use bevy::prelude::*; use bevy::sprite::{MaterialMesh2dBundle, Mesh2dHandle}; -static MOVE_SPEED: f32 = 10.; +static MOVE_SPEED: f32 = 100.; +static LERP_FACTOR: f32 = 3.; #[derive(Component, Debug)] struct Player; @@ -31,7 +32,7 @@ fn main() { let default_plugins = DefaultPlugins.set(LogPlugin { filter: "info,wgpu_core=warn,wgpu_hal=warn,2d_top_down=debug".into(), level: Level::INFO, - update_subscriber: None, + ..default() }); App::new() @@ -102,74 +103,39 @@ fn update_camera( let Vec3 { x, y, .. } = player.translation; let direction = Vec3::new(x, y, camera.translation.z); - let smooth_damp = smooth_damp( - camera.translation, - direction, - Vec3::ZERO, - 0.2, - f32::INFINITY, - time.delta_seconds(), - ); - - camera.translation = smooth_damp; + camera.translation = camera + .translation + .lerp(direction, time.delta_seconds() * LERP_FACTOR); } fn move_player( mut player: Query<&mut Transform, With>, time: Res