✏️ Fix typos across bevy (#16702)
# Objective Fixes typos in bevy project, following suggestion in https://github.com/bevyengine/bevy-website/pull/1912#pullrequestreview-2483499337 ## Solution I used https://github.com/crate-ci/typos to find them. I included only the ones that feel undebatable too me, but I am not in game engine so maybe some terms are expected. I left out the following typos: - `reparametrize` => `reparameterize`: There are a lot of occurences, I believe this was expected - `semicircles` => `hemicircles`: 2 occurences, may mean something specific in geometry - `invertation` => `inversion`: may mean something specific - `unparented` => `parentless`: may mean something specific - `metalness` => `metallicity`: may mean something specific ## Testing - Did you test these changes? If so, how? I did not test the changes, most changes are related to raw text. I expect the others to be tested by the CI. - Are there any parts that need more testing? I do not think - How can other people (reviewers) test your changes? Is there anything specific they need to know? To me there is nothing to test - If relevant, what platforms did you test these changes on, and are there any important ones you can't test? --- ## Migration Guide > This section is optional. If there are no breaking changes, you can delete this section. (kept in case I include the `reparameterize` change here) - If this PR is a breaking change (relative to the last release of Bevy), describe how a user might need to migrate their code to support these changes - Simply adding new functionality is not a breaking change. - Fixing behavior that was definitely a bug, rather than a questionable design choice is not a breaking change. ## Questions - [x] Should I include the above typos? No (https://github.com/bevyengine/bevy/pull/16702#issuecomment-2525271152) - [ ] Should I add `typos` to the CI? (I will check how to configure it properly) This project looks awesome, I really enjoy reading the progress made, thanks to everyone involved.
This commit is contained in:
parent
48fb4aa6d5
commit
0707c0717b
@ -658,7 +658,7 @@ impl ActiveAnimation {
|
|||||||
///
|
///
|
||||||
/// Note that any events between the current time and `seek_time`
|
/// Note that any events between the current time and `seek_time`
|
||||||
/// will be triggered on the next update.
|
/// 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 {
|
pub fn seek_to(&mut self, seek_time: f32) -> &mut Self {
|
||||||
self.last_seek_time = Some(self.seek_time);
|
self.last_seek_time = Some(self.seek_time);
|
||||||
self.seek_time = seek_time;
|
self.seek_time = seek_time;
|
||||||
@ -669,7 +669,7 @@ impl ActiveAnimation {
|
|||||||
///
|
///
|
||||||
/// Note that any events between the current time and `0.0`
|
/// Note that any events between the current time and `0.0`
|
||||||
/// will be triggered on the next update.
|
/// 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 {
|
pub fn rewind(&mut self) -> &mut Self {
|
||||||
self.last_seek_time = Some(self.seek_time);
|
self.last_seek_time = Some(self.seek_time);
|
||||||
self.seek_time = 0.0;
|
self.seek_time = 0.0;
|
||||||
|
@ -1384,7 +1384,7 @@ impl AssetServer {
|
|||||||
/// asset from being dropped.
|
/// asset from being dropped.
|
||||||
/// If you have access to an asset's strong [`Handle`], you should prefer to call
|
/// If you have access to an asset's strong [`Handle`], you should prefer to call
|
||||||
/// [`AssetServer::wait_for_asset`]
|
/// [`AssetServer::wait_for_asset`]
|
||||||
/// or [`wait_for_assest_untyped`](Self::wait_for_asset_untyped) to ensure the asset finishes
|
/// or [`wait_for_asset_untyped`](Self::wait_for_asset_untyped) to ensure the asset finishes
|
||||||
/// loading.
|
/// loading.
|
||||||
///
|
///
|
||||||
/// # Errors
|
/// # Errors
|
||||||
|
@ -42,7 +42,7 @@ pub struct Camera3d {
|
|||||||
///
|
///
|
||||||
/// Roughly corresponds to how many “layers of transparency” are rendered for screen space
|
/// Roughly corresponds to how many “layers of transparency” are rendered for screen space
|
||||||
/// specular transmissive objects. Each step requires making one additional
|
/// specular transmissive objects. Each step requires making one additional
|
||||||
/// texture copy, so it's recommended to keep this number to a resonably low value. Defaults to `1`.
|
/// texture copy, so it's recommended to keep this number to a reasonably low value. Defaults to `1`.
|
||||||
///
|
///
|
||||||
/// ### Notes
|
/// ### Notes
|
||||||
///
|
///
|
||||||
|
@ -31,7 +31,7 @@ use crate::core_3d::{
|
|||||||
Camera3d,
|
Camera3d,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Module that defines the necesasry systems to resolve the OIT buffer and render it to the screen.
|
/// Module that defines the necessary systems to resolve the OIT buffer and render it to the screen.
|
||||||
pub mod resolve;
|
pub mod resolve;
|
||||||
|
|
||||||
/// Shader handle for the shader that draws the transparent meshes to the OIT layers buffer.
|
/// Shader handle for the shader that draws the transparent meshes to the OIT layers buffer.
|
||||||
@ -186,7 +186,7 @@ fn check_msaa(cameras: Query<&Msaa, With<OrderIndependentTransparencySettings>>)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Holds the buffers that contain the data of all OIT layers.
|
/// Holds the buffers that contain the data of all OIT layers.
|
||||||
/// We use one big buffer for the entire app. Each camaera will reuse it so it will
|
/// We use one big buffer for the entire app. Each camera will reuse it so it will
|
||||||
/// always be the size of the biggest OIT enabled camera.
|
/// always be the size of the biggest OIT enabled camera.
|
||||||
#[derive(Resource)]
|
#[derive(Resource)]
|
||||||
pub struct OitBuffers {
|
pub struct OitBuffers {
|
||||||
|
@ -298,7 +298,7 @@ impl<'scope, 'env: 'scope, 'sys> Context<'scope, 'env, 'sys> {
|
|||||||
|
|
||||||
fn tick_executor(&self) {
|
fn tick_executor(&self) {
|
||||||
// Ensure that the executor handles any events pushed to the system_completion queue by this thread.
|
// Ensure that the executor handles any events pushed to the system_completion queue by this thread.
|
||||||
// If this thread acquires the lock, the exector runs after the push() and they are processed.
|
// If this thread acquires the lock, the executor runs after the push() and they are processed.
|
||||||
// If this thread does not acquire the lock, then the is_empty() check on the other thread runs
|
// If this thread does not acquire the lock, then the is_empty() check on the other thread runs
|
||||||
// after the lock is released, which is after try_lock() failed, which is after the push()
|
// after the lock is released, which is after try_lock() failed, which is after the push()
|
||||||
// on this thread, so the is_empty() check will see the new events and loop.
|
// on this thread, so the is_empty() check will see the new events and loop.
|
||||||
|
@ -144,7 +144,7 @@ impl<T> ThinArrayPtr<T> {
|
|||||||
let ptr = unsafe { self.data.as_ptr().add(index) };
|
let ptr = unsafe { self.data.as_ptr().add(index) };
|
||||||
// SAFETY:
|
// SAFETY:
|
||||||
// - The pointer is properly aligned
|
// - The pointer is properly aligned
|
||||||
// - It is derefrancable (all in the same allocation)
|
// - It is dereferenceable (all in the same allocation)
|
||||||
// - `index` < `len` and the element is safe to write to, so its valid
|
// - `index` < `len` and the element is safe to write to, so its valid
|
||||||
// - We have a reference to self, so no other mutable accesses to the element can occur
|
// - We have a reference to self, so no other mutable accesses to the element can occur
|
||||||
unsafe {
|
unsafe {
|
||||||
@ -166,7 +166,7 @@ impl<T> ThinArrayPtr<T> {
|
|||||||
let ptr = unsafe { self.data.as_ptr().add(index) };
|
let ptr = unsafe { self.data.as_ptr().add(index) };
|
||||||
// SAFETY:
|
// SAFETY:
|
||||||
// - The pointer is properly aligned
|
// - The pointer is properly aligned
|
||||||
// - It is derefrancable (all in the same allocation)
|
// - It is dereferenceable (all in the same allocation)
|
||||||
// - `index` < `len` and the element is safe to write to, so its valid
|
// - `index` < `len` and the element is safe to write to, so its valid
|
||||||
// - We have a mutable reference to `self`
|
// - We have a mutable reference to `self`
|
||||||
unsafe {
|
unsafe {
|
||||||
@ -294,7 +294,7 @@ impl<T> ThinArrayPtr<T> {
|
|||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn as_slice(&self, slice_len: usize) -> &[T] {
|
pub unsafe fn as_slice(&self, slice_len: usize) -> &[T] {
|
||||||
// SAFETY:
|
// SAFETY:
|
||||||
// - the data is valid - allocated with the same allocater
|
// - the data is valid - allocated with the same allocator
|
||||||
// - non-null and well-aligned
|
// - non-null and well-aligned
|
||||||
// - we have a shared reference to self - the data will not be mutated during 'a
|
// - we have a shared reference to self - the data will not be mutated during 'a
|
||||||
unsafe { core::slice::from_raw_parts(self.data.as_ptr(), slice_len) }
|
unsafe { core::slice::from_raw_parts(self.data.as_ptr(), slice_len) }
|
||||||
|
@ -164,7 +164,7 @@ impl World {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// HACK: Only required for the `None`-case/`else`-branch, but it borrows `self`, which will
|
// HACK: Only required for the `None`-case/`else`-branch, but it borrows `self`, which will
|
||||||
// already be mutablyy borrowed by `self.get_mut_by_id()`, and I didn't find a way around it.
|
// already be mutably borrowed by `self.get_mut_by_id()`, and I didn't find a way around it.
|
||||||
let component_name = self
|
let component_name = self
|
||||||
.components()
|
.components()
|
||||||
.get_name(component_id)
|
.get_name(component_id)
|
||||||
|
@ -4,7 +4,7 @@ use bevy_math::{ops, Vec2};
|
|||||||
|
|
||||||
/// Calculates the `nth` coordinate of a circle.
|
/// Calculates the `nth` coordinate of a circle.
|
||||||
///
|
///
|
||||||
/// Given a circle's radiu and its resolution, this function computes the position
|
/// Given a circle's radius and its resolution, this function computes the position
|
||||||
/// of the `nth` point along the circumference of the circle. The rotation starts at `(0.0, radius)`
|
/// of the `nth` point along the circumference of the circle. The rotation starts at `(0.0, radius)`
|
||||||
/// and proceeds counter-clockwise.
|
/// and proceeds counter-clockwise.
|
||||||
pub(crate) fn single_circle_coordinate(radius: f32, resolution: u32, nth_point: u32) -> Vec2 {
|
pub(crate) fn single_circle_coordinate(radius: f32, resolution: u32, nth_point: u32) -> Vec2 {
|
||||||
|
@ -284,7 +284,7 @@ pub struct GltfSkin {
|
|||||||
pub name: String,
|
pub name: String,
|
||||||
/// All the nodes that form this skin.
|
/// All the nodes that form this skin.
|
||||||
pub joints: Vec<Handle<GltfNode>>,
|
pub joints: Vec<Handle<GltfNode>>,
|
||||||
/// Inverse-bind matricy of this skin.
|
/// Inverse-bind matrices of this skin.
|
||||||
pub inverse_bind_matrices: Handle<SkinnedMeshInverseBindposes>,
|
pub inverse_bind_matrices: Handle<SkinnedMeshInverseBindposes>,
|
||||||
/// Additional data.
|
/// Additional data.
|
||||||
pub extras: Option<GltfExtras>,
|
pub extras: Option<GltfExtras>,
|
||||||
|
@ -229,7 +229,7 @@ mod test {
|
|||||||
|
|
||||||
let image = Image::from_dynamic(initial.clone(), true, RenderAssetUsages::RENDER_WORLD);
|
let image = Image::from_dynamic(initial.clone(), true, RenderAssetUsages::RENDER_WORLD);
|
||||||
|
|
||||||
// NOTE: Fails if `is_srbg = false` or the dynamic image is of the type rgb8.
|
// NOTE: Fails if `is_srgb = false` or the dynamic image is of the type rgb8.
|
||||||
assert_eq!(initial, image.try_into_dynamic().unwrap());
|
assert_eq!(initial, image.try_into_dynamic().unwrap());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1502,7 +1502,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_ktx_levels() {
|
fn test_ktx_levels() {
|
||||||
// R8UnormSrgb textture with 4x4 pixels data and 3 levels of mipmaps
|
// R8UnormSrgb texture with 4x4 pixels data and 3 levels of mipmaps
|
||||||
let buffer = vec lobe,
|
/// Implemented as a second, flipped [Lambertian diffuse](https://en.wikipedia.org/wiki/Lambertian_reflectance) lobe,
|
||||||
/// which provides an inexpensive but plausible approximation of translucency for thin dieletric objects (e.g. paper,
|
/// which provides an inexpensive but plausible approximation of translucency for thin dielectric objects (e.g. paper,
|
||||||
/// leaves, some fabrics) or thicker volumetric materials with short scattering distances (e.g. porcelain, wax).
|
/// leaves, some fabrics) or thicker volumetric materials with short scattering distances (e.g. porcelain, wax).
|
||||||
///
|
///
|
||||||
/// For specular transmission usecases with refraction (e.g. glass) use the [`StandardMaterial::specular_transmission`] and
|
/// For specular transmission usecases with refraction (e.g. glass) use the [`StandardMaterial::specular_transmission`] and
|
||||||
@ -231,7 +231,7 @@ pub struct StandardMaterial {
|
|||||||
///
|
///
|
||||||
/// ## Performance
|
/// ## Performance
|
||||||
///
|
///
|
||||||
/// Specular transmission is implemented as a relatively expensive screen-space effect that allows ocluded objects to be seen through the material,
|
/// Specular transmission is implemented as a relatively expensive screen-space effect that allows occluded objects to be seen through the material,
|
||||||
/// with distortion and blur effects.
|
/// with distortion and blur effects.
|
||||||
///
|
///
|
||||||
/// - [`Camera3d::screen_space_specular_transmission_steps`](bevy_core_pipeline::core_3d::Camera3d::screen_space_specular_transmission_steps) can be used to enable transmissive objects
|
/// - [`Camera3d::screen_space_specular_transmission_steps`](bevy_core_pipeline::core_3d::Camera3d::screen_space_specular_transmission_steps) can be used to enable transmissive objects
|
||||||
@ -463,7 +463,7 @@ pub struct StandardMaterial {
|
|||||||
///
|
///
|
||||||
/// Note that, if a clearcoat normal map isn't specified, the main normal
|
/// Note that, if a clearcoat normal map isn't specified, the main normal
|
||||||
/// map, if any, won't be applied to the clearcoat. If you want a normal map
|
/// map, if any, won't be applied to the clearcoat. If you want a normal map
|
||||||
/// that applies to both the main materal and to the clearcoat, specify it
|
/// that applies to both the main material and to the clearcoat, specify it
|
||||||
/// in both [`StandardMaterial::normal_map_texture`] and this field.
|
/// in both [`StandardMaterial::normal_map_texture`] and this field.
|
||||||
///
|
///
|
||||||
/// As this is a non-color map, it must not be loaded as sRGB.
|
/// As this is a non-color map, it must not be loaded as sRGB.
|
||||||
|
@ -322,7 +322,7 @@ impl PointerState {
|
|||||||
.or_default()
|
.or_default()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Clears all the data assoceated with all of the buttons on a pointer. Does not free the underlying memory.
|
/// Clears all the data associated with all of the buttons on a pointer. Does not free the underlying memory.
|
||||||
pub fn clear(&mut self, pointer_id: PointerId) {
|
pub fn clear(&mut self, pointer_id: PointerId) {
|
||||||
for button in PointerButton::iter() {
|
for button in PointerButton::iter() {
|
||||||
if let Some(state) = self.pointer_buttons.get_mut(&(pointer_id, button)) {
|
if let Some(state) = self.pointer_buttons.get_mut(&(pointer_id, button)) {
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
//! .observe(|mut trigger: Trigger<Pointer<Click>>| {
|
//! .observe(|mut trigger: Trigger<Pointer<Click>>| {
|
||||||
//! // Get the underlying event type
|
//! // Get the underlying event type
|
||||||
//! let click_event: &Pointer<Click> = trigger.event();
|
//! let click_event: &Pointer<Click> = trigger.event();
|
||||||
//! // Stop the event from bubbling up the entity hierarchjy
|
//! // Stop the event from bubbling up the entity hierarchy
|
||||||
//! trigger.propagate(false);
|
//! trigger.propagate(false);
|
||||||
//! });
|
//! });
|
||||||
//! ```
|
//! ```
|
||||||
@ -288,7 +288,7 @@ impl PluginGroup for DefaultPickingPlugins {
|
|||||||
/// This plugin sets up the core picking infrastructure. It receives input events, and provides the shared
|
/// This plugin sets up the core picking infrastructure. It receives input events, and provides the shared
|
||||||
/// types used by other picking plugins.
|
/// types used by other picking plugins.
|
||||||
///
|
///
|
||||||
/// This plugin contains several settings, and is added to the wrold as a resource after initialization. You
|
/// This plugin contains several settings, and is added to the world as a resource after initialization. You
|
||||||
/// can configure picking settings at runtime through the resource.
|
/// can configure picking settings at runtime through the resource.
|
||||||
#[derive(Copy, Clone, Debug, Resource, Reflect)]
|
#[derive(Copy, Clone, Debug, Resource, Reflect)]
|
||||||
#[reflect(Resource, Default, Debug)]
|
#[reflect(Resource, Default, Debug)]
|
||||||
|
@ -38,7 +38,7 @@ pub enum ApplyError {
|
|||||||
},
|
},
|
||||||
|
|
||||||
#[error("attempted to apply type with {from_size} size to a type with {to_size} size")]
|
#[error("attempted to apply type with {from_size} size to a type with {to_size} size")]
|
||||||
/// Attempted to apply to types with mismatched sizez, e.g. a [u8; 4] to [u8; 3].
|
/// Attempted to apply to types with mismatched sizes, e.g. a [u8; 4] to [u8; 3].
|
||||||
DifferentSize { from_size: usize, to_size: usize },
|
DifferentSize { from_size: usize, to_size: usize },
|
||||||
|
|
||||||
#[error("variant with name `{variant_name}` does not exist on enum `{enum_name}`")]
|
#[error("variant with name `{variant_name}` does not exist on enum `{enum_name}`")]
|
||||||
|
@ -331,7 +331,7 @@ mod tests {
|
|||||||
.get::<Parent>()
|
.get::<Parent>()
|
||||||
.expect("something is wrong with this test, and the scene components don't have a parent/child relationship")
|
.expect("something is wrong with this test, and the scene components don't have a parent/child relationship")
|
||||||
.get(),
|
.get(),
|
||||||
"something is wrong with the this test or the code reloading scenes since the relationship between scene entities is broken"
|
"something is wrong with this test or the code reloading scenes since the relationship between scene entities is broken"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ impl DynamicTextureAtlasBuilder {
|
|||||||
///
|
///
|
||||||
/// # Arguments
|
/// # Arguments
|
||||||
///
|
///
|
||||||
/// * `altas_layout` - The atlas layout to add the texture to.
|
/// * `atlas_layout` - The atlas layout to add the texture to.
|
||||||
/// * `texture` - The source texture to add to the atlas.
|
/// * `texture` - The source texture to add to the atlas.
|
||||||
/// * `atlas_texture` - The destination atlas texture to copy the source texture to.
|
/// * `atlas_texture` - The destination atlas texture to copy the source texture to.
|
||||||
pub fn add_texture(
|
pub fn add_texture(
|
||||||
|
@ -275,7 +275,7 @@ impl UiSurface {
|
|||||||
|
|
||||||
/// Get the layout geometry for the taffy node corresponding to the ui node [`Entity`].
|
/// Get the layout geometry for the taffy node corresponding to the ui node [`Entity`].
|
||||||
/// Does not compute the layout geometry, `compute_window_layouts` should be run before using this function.
|
/// Does not compute the layout geometry, `compute_window_layouts` should be run before using this function.
|
||||||
/// On success returns a pair consisiting of the final resolved layout values after rounding
|
/// On success returns a pair consisting of the final resolved layout values after rounding
|
||||||
/// and the size of the node after layout resolution but before rounding.
|
/// and the size of the node after layout resolution but before rounding.
|
||||||
pub fn get_layout(&mut self, entity: Entity) -> Result<(taffy::Layout, Vec2), LayoutError> {
|
pub fn get_layout(&mut self, entity: Entity) -> Result<(taffy::Layout, Vec2), LayoutError> {
|
||||||
let Some(taffy_node) = self.entity_to_taffy.get(&entity) else {
|
let Some(taffy_node) = self.entity_to_taffy.get(&entity) else {
|
||||||
|
@ -158,7 +158,7 @@ adb uninstall org.bevyengine.example
|
|||||||
|
|
||||||
In its examples, Bevy targets the minimum Android API that Play Store <!-- markdown-link-check-disable -->
|
In its examples, Bevy targets the minimum Android API that Play Store <!-- markdown-link-check-disable -->
|
||||||
[requires](https://developer.android.com/distribute/best-practices/develop/target-sdk) to upload and update apps. <!-- markdown-link-check-enable -->
|
[requires](https://developer.android.com/distribute/best-practices/develop/target-sdk) to upload and update apps. <!-- markdown-link-check-enable -->
|
||||||
Users of older phones may want to use an older API when testing. By default, Bevy uses [`GameAvtivity`](https://developer.android.com/games/agdk/game-activity), which only works for Android API level 31 and higher, so if you want to use older API, you need to switch to `NativeActivity`.
|
Users of older phones may want to use an older API when testing. By default, Bevy uses [`GameActivity`](https://developer.android.com/games/agdk/game-activity), which only works for Android API level 31 and higher, so if you want to use older API, you need to switch to `NativeActivity`.
|
||||||
|
|
||||||
To use `NativeActivity`, you need to edit it in `cargo.toml` manually like this:
|
To use `NativeActivity`, you need to edit it in `cargo.toml` manually like this:
|
||||||
|
|
||||||
|
@ -44,4 +44,4 @@ Currently, this is not needed as the extension already disables the rule `MD013`
|
|||||||
|
|
||||||
### Other Linters provided by [super-linter](https://github.com/github/super-linter)
|
### Other Linters provided by [super-linter](https://github.com/github/super-linter)
|
||||||
|
|
||||||
All other linters not mentioned in the this file are not activated and can be seen [here](https://github.com/github/super-linter#supported-linters).
|
All other linters not mentioned in this file are not activated and can be seen [here](https://github.com/github/super-linter#supported-linters).
|
||||||
|
@ -469,7 +469,7 @@ fn handle_mouse_clicks(
|
|||||||
};
|
};
|
||||||
let plane_intersection = ray.origin + ray.direction.normalize() * ray_distance;
|
let plane_intersection = ray.origin + ray.direction.normalize() * ray_distance;
|
||||||
|
|
||||||
// Move all the main objeccts.
|
// Move all the main objects.
|
||||||
for mut transform in main_objects.iter_mut() {
|
for mut transform in main_objects.iter_mut() {
|
||||||
transform.translation = vec3(
|
transform.translation = vec3(
|
||||||
plane_intersection.x,
|
plane_intersection.x,
|
||||||
|
@ -102,7 +102,7 @@ fn cycle_scenes(
|
|||||||
mut scene_id: Local<usize>,
|
mut scene_id: Local<usize>,
|
||||||
) {
|
) {
|
||||||
if keyboard_input.just_pressed(KeyCode::KeyC) {
|
if keyboard_input.just_pressed(KeyCode::KeyC) {
|
||||||
// depsawn current scene
|
// despawn current scene
|
||||||
for e in &q {
|
for e in &q {
|
||||||
commands.entity(e).despawn_recursive();
|
commands.entity(e).despawn_recursive();
|
||||||
}
|
}
|
||||||
|
@ -626,7 +626,7 @@ adb uninstall org.bevyengine.example
|
|||||||
|
|
||||||
In its examples, Bevy targets the minimum Android API that Play Store <!-- markdown-link-check-disable -->
|
In its examples, Bevy targets the minimum Android API that Play Store <!-- markdown-link-check-disable -->
|
||||||
[requires](https://developer.android.com/distribute/best-practices/develop/target-sdk) to upload and update apps. <!-- markdown-link-check-enable -->
|
[requires](https://developer.android.com/distribute/best-practices/develop/target-sdk) to upload and update apps. <!-- markdown-link-check-enable -->
|
||||||
Users of older phones may want to use an older API when testing. By default, Bevy uses [`GameAvtivity`](https://developer.android.com/games/agdk/game-activity), which only works for Android API level 31 and higher, so if you want to use older API, you need to switch to `NativeActivity`.
|
Users of older phones may want to use an older API when testing. By default, Bevy uses [`GameActivity`](https://developer.android.com/games/agdk/game-activity), which only works for Android API level 31 and higher, so if you want to use older API, you need to switch to `NativeActivity`.
|
||||||
|
|
||||||
To use `NativeActivity`, you need to edit it in `cargo.toml` manually like this:
|
To use `NativeActivity`, you need to edit it in `cargo.toml` manually like this:
|
||||||
|
|
||||||
|
@ -275,12 +275,12 @@ fn simulate_particles(
|
|||||||
time: Res<Time>,
|
time: Res<Time>,
|
||||||
) {
|
) {
|
||||||
for (entity, mut transform, mut particle) in &mut query {
|
for (entity, mut transform, mut particle) in &mut query {
|
||||||
if particle.lifeteime_timer.tick(time.delta()).just_finished() {
|
if particle.lifetime_timer.tick(time.delta()).just_finished() {
|
||||||
commands.entity(entity).despawn();
|
commands.entity(entity).despawn();
|
||||||
} else {
|
} else {
|
||||||
transform.translation += particle.velocity * time.delta_secs();
|
transform.translation += particle.velocity * time.delta_secs();
|
||||||
transform.scale =
|
transform.scale =
|
||||||
Vec3::splat(particle.size.lerp(0.0, particle.lifeteime_timer.fraction()));
|
Vec3::splat(particle.size.lerp(0.0, particle.lifetime_timer.fraction()));
|
||||||
particle
|
particle
|
||||||
.velocity
|
.velocity
|
||||||
.smooth_nudge(&Vec3::ZERO, 4.0, time.delta_secs());
|
.smooth_nudge(&Vec3::ZERO, 4.0, time.delta_secs());
|
||||||
@ -299,7 +299,7 @@ fn spawn_particle<M: Material>(
|
|||||||
move |world: &mut World| {
|
move |world: &mut World| {
|
||||||
world.spawn((
|
world.spawn((
|
||||||
Particle {
|
Particle {
|
||||||
lifeteime_timer: Timer::from_seconds(lifetime, TimerMode::Once),
|
lifetime_timer: Timer::from_seconds(lifetime, TimerMode::Once),
|
||||||
size,
|
size,
|
||||||
velocity,
|
velocity,
|
||||||
},
|
},
|
||||||
@ -316,7 +316,7 @@ fn spawn_particle<M: Material>(
|
|||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
struct Particle {
|
struct Particle {
|
||||||
lifeteime_timer: Timer,
|
lifetime_timer: Timer,
|
||||||
size: f32,
|
size: f32,
|
||||||
velocity: Vec3,
|
velocity: Vec3,
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ fn setup(mut commands: Commands) {
|
|||||||
// As such, we cannot use curves in these spaces.
|
// As such, we cannot use curves in these spaces.
|
||||||
// However, we can still mix these colors and animate that way. In fact, mixing colors works in any color space.
|
// However, we can still mix these colors and animate that way. In fact, mixing colors works in any color space.
|
||||||
|
|
||||||
// Spawn a spritre using the provided colors for mixing.
|
// Spawn a sprite using the provided colors for mixing.
|
||||||
spawn_mixed_sprite(&mut commands, -75., colors.map(Hsla::from));
|
spawn_mixed_sprite(&mut commands, -75., colors.map(Hsla::from));
|
||||||
|
|
||||||
spawn_mixed_sprite(&mut commands, -175., colors.map(Srgba::from));
|
spawn_mixed_sprite(&mut commands, -175., colors.map(Srgba::from));
|
||||||
@ -110,7 +110,7 @@ fn animate_mixed<T: MixedColor>(
|
|||||||
// For four colors, there are three intervals between those colors;
|
// For four colors, there are three intervals between those colors;
|
||||||
let intervals = (mixed.0.len() - 1) as f32;
|
let intervals = (mixed.0.len() - 1) as f32;
|
||||||
|
|
||||||
// Next we determine the index of the first of the two colorts to mix.
|
// Next we determine the index of the first of the two colors to mix.
|
||||||
let start_i = (t * intervals).floor().min(intervals - 1.);
|
let start_i = (t * intervals).floor().min(intervals - 1.);
|
||||||
|
|
||||||
// Lastly we determine the 'local' value of t in this interval.
|
// Lastly we determine the 'local' value of t in this interval.
|
||||||
|
@ -154,7 +154,7 @@ type DrawSpecializedPipelineCommands = (
|
|||||||
/// rendered entity.
|
/// rendered entity.
|
||||||
type WithCustomRenderedEntity = With<CustomRenderedEntity>;
|
type WithCustomRenderedEntity = With<CustomRenderedEntity>;
|
||||||
|
|
||||||
// This contains the state needed to speciazlize a mesh pipeline
|
// This contains the state needed to specialize a mesh pipeline
|
||||||
#[derive(Resource)]
|
#[derive(Resource)]
|
||||||
struct CustomMeshPipeline {
|
struct CustomMeshPipeline {
|
||||||
/// The base mesh pipeline defined by bevy
|
/// The base mesh pipeline defined by bevy
|
||||||
|
@ -505,7 +505,7 @@ header_message = \"Examples (WebGL2)\"
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This beautifys the category name
|
// This beautifies the category name
|
||||||
// to make it a good looking URL
|
// to make it a good looking URL
|
||||||
// rather than having weird whitespace
|
// rather than having weird whitespace
|
||||||
// and other characters that don't
|
// and other characters that don't
|
||||||
|
Loading…
Reference in New Issue
Block a user