Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos, grammar, and spelling mistakes #16273

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci-comment-failures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: 'The generated `examples/README.md` is out of sync with the example metadata in `Cargo.toml` or the example readme template. Please run `cargo run -p build-templated-pages -- update examples` to update it, and commit the file change.'
body: 'The generated `examples/README.md` is out of sync with the example metadata in `Cargo.toml` or the example readme template. Please run `cargo run -p build-templated-pages -- update examples` to update it. Then, commit and push the file change.'
});
}

Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: 'You added a new feature but didn\'t update the readme. Please run `cargo run -p build-templated-pages -- update features` to update it, and commit the file change.'
body: 'You added a new feature but didn\'t update the readme. Please run `cargo run -p build-templated-pages -- update features` to update it. Then, commit and push the file change.'
});
}

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1678,7 +1678,7 @@ path = "examples/asset/multi_asset_sync.rs"
doc-scrape-examples = true

[package.metadata.example.multi_asset_sync]
name = "Mult-asset synchronization"
name = "Multi-asset synchronization"
description = "Demonstrates how to wait for multiple assets to be loaded."
category = "Assets"
wasm = true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ If you'd like to help build Bevy, check out the **[Contributor's Guide](https://
For simple problems, feel free to [open an issue](https://github.com/bevyengine/bevy/issues) or
[PR](https://github.com/bevyengine/bevy/pulls) and tackle it yourself!

For more complex architecture decisions and experimental mad science, please open an [RFC](https://github.com/bevyengine/rfcs) (Request For Comments) so we can brainstorm together effectively!
For more complex architecture decisions and experimental mad science, please open an [RFC](https://github.com/bevyengine/rfcs) (Request For Comments) so that we can brainstorm together effectively!

## Getting Started

Expand Down
4 changes: 2 additions & 2 deletions assets/shaders/custom_material.frag
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ layout(set = 2, binding = 2) uniform sampler CustomMaterial_sampler;

// wgsl modules can be imported and used in glsl
// FIXME - this doesn't work any more ...
// #import bevy_pbr::pbr_functions as PbrFuncs
// #import bevy_pbr::pbr_functions as PbrFunctions

void main() {
// o_Target = PbrFuncs::tone_mapping(Color * texture(sampler2D(CustomMaterial_texture,CustomMaterial_sampler), v_Uv));
// o_Target = PbrFunctions::tone_mapping(Color * texture(sampler2D(CustomMaterial_texture,CustomMaterial_sampler), v_Uv));
o_Target = CustomMaterial_color * texture(sampler2D(CustomMaterial_texture,CustomMaterial_sampler), v_Uv);
}
8 changes: 4 additions & 4 deletions assets/shaders/specialized_mesh_pipeline.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
//! between the vertex and fragment shader. Also shows the custom vertex layout.

// First we import everything we need from bevy_pbr
// A 2d shader would be vevry similar but import from bevy_sprite instead
// A 2D shader would be very similar but import from bevy_sprite instead
#import bevy_pbr::{
mesh_functions,
view_transformations::position_world_to_clip
}

struct Vertex {
// This is needed if you are using batching and/or gpu preprocessing
// It's a built in so you don't need to define it in the vertex layout
// It's a built in, so you don't need to define it in the vertex layout
@builtin(instance_index) instance_index: u32,
// Like we defined for the vertex layout
// position is at location 0
Expand All @@ -30,7 +30,7 @@ struct VertexOutput {
fn vertex(vertex: Vertex) -> VertexOutput {
var out: VertexOutput;
// This is how bevy computes the world position
// The vertex.instance_index is very important. Esepecially if you are using batching and gpu preprocessing
// The vertex.instance_index is very important, especially if you are using batching and gpu preprocessing
var world_from_local = mesh_functions::get_world_from_local(vertex.instance_index);
out.world_position = mesh_functions::mesh_position_local_to_world(world_from_local, vec4(vertex.position, 1.0));
out.clip_position = position_world_to_clip(out.world_position.xyz);
Expand All @@ -45,4 +45,4 @@ fn vertex(vertex: Vertex) -> VertexOutput {
fn fragment(in: VertexOutput) -> @location(0) vec4<f32> {
// output the color directly
return vec4(in.color, 1.0);
}
}
10 changes: 5 additions & 5 deletions assets/shaders/tonemapping_test_patterns.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
forward_io::VertexOutput,
}

#import bevy_render::maths::PI
#import bevy_render::math::PI

#ifdef TONEMAP_IN_SHADER
#import bevy_core_pipeline::tonemapping::tone_mapping
#endif

// Sweep across hues on y axis with value from 0.0 to +15EV across x axis
// Sweep across hues on y axis with value from 0.0 to +15EV across x axis
// quantized into 24 steps for both axis.
fn color_sweep(uv_input: vec2<f32>) -> vec3<f32> {
var uv = uv_input;
let steps = 24.0;
uv.y = uv.y * (1.0 + 1.0 / steps);
let ratio = 2.0;

let h = PI * 2.0 * floor(1.0 + steps * uv.y) / steps;
let L = floor(uv.x * steps * ratio) / (steps * ratio) - 0.5;

var color = vec3(0.0);
if uv.y < 1.0 {
if uv.y < 1.0 {
color = cos(h + vec3(0.0, 1.0, 2.0) * PI * 2.0 / 3.0);
let maxRGB = max(color.r, max(color.g, color.b));
let minRGB = min(color.r, min(color.g, color.b));
Expand Down
2 changes: 1 addition & 1 deletion benches/benches/bevy_ecs/scheduling/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub fn build_schedule(criterion: &mut Criterion) {
// Benchmark graphs of different sizes.
for graph_size in [100, 500, 1000] {
// Basic benchmark without constraints.
group.bench_function(format!("{graph_size}_schedule_noconstraints"), |bencher| {
group.bench_function(format!("{graph_size}_schedule_no_constraints"), |bencher| {
bencher.iter(|| {
let mut app = App::new();
for _ in 0..graph_size {
Expand Down
4 changes: 2 additions & 2 deletions benches/benches/bevy_ecs/world/despawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ pub fn world_despawn(criterion: &mut Criterion) {
world.spawn((A(Mat4::default()), B(Vec4::default())));
}

let ents = world.iter_entities().map(|e| e.id()).collect::<Vec<_>>();
let entities = world.iter_entities().map(|e| e.id()).collect::<Vec<_>>();
group.bench_function(format!("{}_entities", entity_count), |bencher| {
bencher.iter(|| {
ents.iter().for_each(|e| {
entities.iter().for_each(|e| {
world.despawn(*e);
});
});
Expand Down
4 changes: 2 additions & 2 deletions benches/benches/bevy_ecs/world/despawn_recursive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ pub fn world_despawn_recursive(criterion: &mut Criterion) {
});
}

let ents = world.iter_entities().map(|e| e.id()).collect::<Vec<_>>();
let entities = world.iter_entities().map(|e| e.id()).collect::<Vec<_>>();
group.bench_function(format!("{}_entities", entity_count), |bencher| {
bencher.iter(|| {
ents.iter().for_each(|e| {
entities.iter().for_each(|e| {
despawn_with_children_recursive(&mut world, *e, true);
});
});
Expand Down
2 changes: 1 addition & 1 deletion benches/benches/bevy_ecs/world/entity_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn make_entity(rng: &mut impl Rng, size: usize) -> Entity {
let x: f64 = rng.gen();
let gen = 1.0 + -(1.0 - x).log2() * 2.0;

// this is not reliable, but we're internal so a hack is ok
// this is not reliable, but we're internal, so a hack is ok
let bits = ((gen as u64) << 32) | (id as u64);
let e = Entity::from_bits(bits);
assert_eq!(e.index(), id as u32);
Expand Down
4 changes: 2 additions & 2 deletions benches/benches/bevy_picking/ray_mesh_intersection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use bevy_math::{Dir3, Mat4, Ray3d, Vec3};
use bevy_picking::mesh_picking::ray_cast;
use criterion::{black_box, criterion_group, criterion_main, Criterion};

fn ptoxznorm(p: u32, size: u32) -> (f32, f32) {
fn p_to_xz_norm(p: u32, size: u32) -> (f32, f32) {
let ij = (p / (size), p % (size));
(ij.0 as f32 / size as f32, ij.1 as f32 / size as f32)
}
Expand All @@ -17,7 +17,7 @@ fn mesh_creation(vertices_per_side: u32) -> SimpleMesh {
let mut positions = Vec::new();
let mut normals = Vec::new();
for p in 0..vertices_per_side.pow(2) {
let xz = ptoxznorm(p, vertices_per_side);
let xz = p_to_xz_norm(p, vertices_per_side);
positions.push([xz.0 - 0.5, 0.0, xz.1 - 0.5]);
normals.push([0.0, 1.0, 0.0]);
}
Expand Down
8 changes: 4 additions & 4 deletions crates/bevy_animation/src/animatable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct BlendInput<T> {

/// An animatable value type.
pub trait Animatable: Reflect + Sized + Send + Sync + 'static {
/// Interpolates between `a` and `b` with a interpolation factor of `time`.
/// Interpolates between `a` and `b` with an interpolation factor of `time`.
///
/// The `time` parameter here may not be clamped to the range `[0.0, 1.0]`.
fn interpolate(a: &Self, b: &Self, time: f32) -> Self;
Expand Down Expand Up @@ -211,9 +211,9 @@ where
// (additive) blending and linear interpolation.
//
// Evaluating a Bézier curve via repeated linear interpolation when the
// control points are known is straightforward via [de Casteljau
// subdivision]. So the only remaining problem is to get the two off-curve
// control points. The [derivative of the cubic Bézier curve] is:
// control points are known is straightforward via [de Casteljau subdivision].
// The only remaining problem is to get the two off-curve control points.
// The [derivative of the cubic Bézier curve] is:
//
// B′(t) = 3(1 - t)²(P₁ - P₀) + 6(1 - t)t(P₂ - P₁) + 3t²(P₃ - P₂)
//
Expand Down
10 changes: 5 additions & 5 deletions crates/bevy_animation/src/gltf_curves.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,11 @@ fn cubic_spline_interpolation<T>(
where
T: VectorSpace,
{
let coeffs = (vec4(2.0, 1.0, -2.0, 1.0) * lerp + vec4(-3.0, -2.0, 3.0, -1.0)) * lerp;
value_start * (coeffs.x * lerp + 1.0)
+ tangent_out_start * step_duration * lerp * (coeffs.y + 1.0)
+ value_end * lerp * coeffs.z
+ tangent_in_end * step_duration * lerp * coeffs.w
let coefficients = (vec4(2.0, 1.0, -2.0, 1.0) * lerp + vec4(-3.0, -2.0, 3.0, -1.0)) * lerp;
value_start * (coefficients.x * lerp + 1.0)
+ tangent_out_start * step_duration * lerp * (coefficients.y + 1.0)
+ value_end * lerp * coefficients.z
+ tangent_in_end * step_duration * lerp * coefficients.w
}

fn cubic_spline_interpolate_slices<'a, T: VectorSpace>(
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_animation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ impl ActiveAnimation {
///
/// Note that any events between the current time and `seek_time`
/// will be triggered on the next update.
/// Use [`set_seek_time`](Self::set_seek_time) if this is undisered.
/// Use [`set_seek_time`](Self::set_seek_time) if this is undesired.
pub fn seek_to(&mut self, seek_time: f32) -> &mut Self {
self.last_seek_time = Some(self.seek_time);
self.seek_time = seek_time;
Expand All @@ -755,7 +755,7 @@ impl ActiveAnimation {
///
/// Note that any events between the current time and `0.0`
/// will be triggered on the next update.
/// Use [`set_seek_time`](Self::set_seek_time) if this is undisered.
/// Use [`set_seek_time`](Self::set_seek_time) if this is undesired.
pub fn rewind(&mut self) -> &mut Self {
self.last_seek_time = Some(self.seek_time);
self.seek_time = 0.0;
Expand Down
8 changes: 4 additions & 4 deletions crates/bevy_app/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ impl App {
self
}

/// Registers a system and returns a [`SystemId`] so it can later be called by [`World::run_system`].
/// Registers a system and returns a [`SystemId`] so that it can later be called by [`World::run_system`].
///
/// It's possible to register the same systems more than once, they'll be stored separately.
///
Expand Down Expand Up @@ -1320,7 +1320,7 @@ pub enum AppExit {
}

impl AppExit {
/// Creates a [`AppExit::Error`] with a error code of 1.
/// Creates a [`AppExit::Error`] with an error code of 1.
#[must_use]
pub const fn error() -> Self {
Self::Error(NonZero::<u8>::MIN)
Expand Down Expand Up @@ -1695,8 +1695,8 @@ mod tests {

#[test]
fn app_exit_size() {
// There wont be many of them so the size isn't a issue but
// it's nice they're so small let's keep it that way.
// There wont be many of them, so the size isn't an issue;
// however, it's nice they're so small let's keep it that way.
assert_eq!(size_of::<AppExit>(), size_of::<u8>());
}

Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_app/src/main_schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ pub enum RunFixedMainLoopSystem {
/// [`Time<Virtual>`] and [`Time::overstep`].
///
/// Don't place systems here, use [`FixedUpdate`] and friends instead.
/// Use this system instead to order your systems to run specifically inbetween the fixed update logic and all
/// Use this system instead to order your systems to run specifically in-between the fixed update logic and all
/// other systems that run in [`RunFixedMainLoopSystem::BeforeFixedMainLoop`] or [`RunFixedMainLoopSystem::AfterFixedMainLoop`].
///
/// [`Time<Virtual>`]: https://docs.rs/bevy/latest/bevy/prelude/struct.Virtual.html
Expand Down
6 changes: 3 additions & 3 deletions crates/bevy_asset/src/io/android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ impl AssetReader for AndroidAssetReader {
// The solution here was to first use `open_dir` to eliminate the case
// when the path does not exist at all, and then to use `open` to
// see if that path is a file or a directory
let cpath = CString::new(path.to_str().unwrap()).unwrap();
let c_path = CString::new(path.to_str().unwrap()).unwrap();
let _ = asset_manager
.open_dir(&cpath)
.open_dir(&c_path)
.ok_or(AssetReaderError::NotFound(path.to_path_buf()))?;
Ok(asset_manager.open(&cpath).is_none())
Ok(asset_manager.open(&c_path).is_none())
}
}
2 changes: 1 addition & 1 deletion crates/bevy_asset/src/io/file/file_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ pub(crate) fn new_asset_event_debouncer(
}
(true, false) => {
error!(
"Asset metafile {old_path:?} was changed to asset file {new_path:?}, which is not supported. Try restarting your app to see if configuration is still valid"
"Asset meta file {old_path:?} was changed to asset file {new_path:?}, which is not supported. Try restarting your app to see if configuration is still valid"
);
}
(false, true) => {
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_asset/src/io/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ pub mod test {
let dir = Dir::default();
let a_path = Path::new("a.txt");
let a_data = "a".as_bytes().to_vec();
let a_meta = "ameta".as_bytes().to_vec();
let a_meta = "a meta".as_bytes().to_vec();

dir.insert_asset(a_path, a_data.clone());
let asset = dir.get_asset(a_path).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_asset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ impl Plugin for AssetPlugin {
.configure_sets(PreUpdate, TrackAssets.after(handle_internal_asset_events))
// `handle_internal_asset_events` requires the use of `&mut World`,
// and as a result has ambiguous system ordering with all other systems in `PreUpdate`.
// This is virtually never a real problem: asset loading is async and so anything that interacts directly with it
// This is virtually never a real problem: asset loading is async, thus anything that interacts directly with it
// needs to be robust to stochastic delays anyways.
.add_systems(PreUpdate, handle_internal_asset_events.ambiguous_with_all())
.register_type::<AssetPath>();
Expand Down Expand Up @@ -910,7 +910,7 @@ mod tests {
}

// Allow "a" to load ... wait for it to finish loading and validate results
// Dependencies are still gated so they should not be loaded yet
// Dependencies are still gated, so they should not be loaded yet
gate_opener.open(a_path);
run_app_until(&mut app, |world| {
let a_text = get::<CoolText>(world, a_id)?;
Expand Down
10 changes: 5 additions & 5 deletions crates/bevy_asset/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ impl<'a> AssetPath<'a> {
// It's a label only
Ok(self.clone_owned().with_label(label.to_owned()))
} else {
let (source, rpath, rlabel) = AssetPath::parse_internal(path)?;
let (source, r_path, r_label) = AssetPath::parse_internal(path)?;
let mut base_path = PathBuf::from(self.path());
if replace && !self.path.to_str().unwrap().ends_with('/') {
// No error if base is empty (per RFC 1808).
Expand All @@ -420,20 +420,20 @@ impl<'a> AssetPath<'a> {

// Strip off leading slash
let mut is_absolute = false;
let rpath = match rpath.strip_prefix("/") {
let r_path = match r_path.strip_prefix("/") {
Ok(p) => {
is_absolute = true;
p
}
_ => rpath,
_ => r_path,
};

let mut result_path = if !is_absolute && source.is_none() {
base_path
} else {
PathBuf::new()
};
result_path.push(rpath);
result_path.push(r_path);
result_path = normalize_path(result_path.as_path());

Ok(AssetPath {
Expand All @@ -442,7 +442,7 @@ impl<'a> AssetPath<'a> {
None => self.source.clone_owned(),
},
path: CowArc::Owned(result_path.into()),
label: rlabel.map(|l| CowArc::Owned(l.into())),
label: r_label.map(|l| CowArc::Owned(l.into())),
})
}
}
Expand Down
Loading
Loading