From bb582333d0348a883af0f9db96846395aa45c3ab Mon Sep 17 00:00:00 2001 From: Nilirad Date: Sat, 2 Sep 2023 15:23:40 +0200 Subject: [PATCH 1/3] Improve `SpatialBundle` docs --- crates/bevy_render/src/spatial_bundle.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/crates/bevy_render/src/spatial_bundle.rs b/crates/bevy_render/src/spatial_bundle.rs index 5287c3880460a..c64e86633e13f 100644 --- a/crates/bevy_render/src/spatial_bundle.rs +++ b/crates/bevy_render/src/spatial_bundle.rs @@ -3,16 +3,18 @@ use bevy_transform::prelude::{GlobalTransform, Transform}; use crate::view::{InheritedVisibility, ViewVisibility, Visibility}; -/// A [`Bundle`] with the following [`Component`](bevy_ecs::component::Component)s: -/// * [`Visibility`], and [`InheritedVisibility`], which describe the visibility of an entity -/// * [`Transform`] and [`GlobalTransform`], which describe the position of an entity +/// A [`Bundle`] that allows the correct positional rendering of an entity. /// -/// * To show or hide an entity, you should set its [`Visibility`]. -/// * To get the computed visibility of an entity, you should get its [`InheritedVisibility`] or [`ViewVisibility`] components. -/// * To place or move an entity, you should set its [`Transform`]. -/// * To get the global transform of an entity, you should get its [`GlobalTransform`]. -/// * For hierarchies to work correctly, you must have all four components. -/// * You may use the [`SpatialBundle`] to guarantee this. +/// It consists of transform components, +/// controlling position, rotation and scale of the entity, +/// but also visibility components, +/// which determine whether the entity is visible or not. +/// +/// Hierarchies of entities must contain +/// all the [`Component`]s in this `Bundle` +/// to work correctly. +/// +/// [`Component`]: bevy_ecs::component::Component #[derive(Bundle, Debug, Default)] pub struct SpatialBundle { /// The visibility of the entity. From e6aa8cb570df56f3bb1df1026084ec4e7c2d386f Mon Sep 17 00:00:00 2001 From: Federico Rinaldi Date: Sat, 2 Sep 2023 22:38:04 +0200 Subject: [PATCH 2/3] Update crates/bevy_render/src/spatial_bundle.rs Co-authored-by: Alice Cecile --- crates/bevy_render/src/spatial_bundle.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_render/src/spatial_bundle.rs b/crates/bevy_render/src/spatial_bundle.rs index c64e86633e13f..2d95c1cf3cebf 100644 --- a/crates/bevy_render/src/spatial_bundle.rs +++ b/crates/bevy_render/src/spatial_bundle.rs @@ -12,7 +12,7 @@ use crate::view::{InheritedVisibility, ViewVisibility, Visibility}; /// /// Hierarchies of entities must contain /// all the [`Component`]s in this `Bundle` -/// to work correctly. +/// to be rendered correctly. /// /// [`Component`]: bevy_ecs::component::Component #[derive(Bundle, Debug, Default)] From 42320396c2869772d5a952b19e84ebe19221cd3d Mon Sep 17 00:00:00 2001 From: Federico Rinaldi Date: Sat, 2 Sep 2023 22:39:57 +0200 Subject: [PATCH 3/3] Update crates/bevy_render/src/spatial_bundle.rs Co-authored-by: Alice Cecile --- crates/bevy_render/src/spatial_bundle.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_render/src/spatial_bundle.rs b/crates/bevy_render/src/spatial_bundle.rs index 2d95c1cf3cebf..27dba5c215a77 100644 --- a/crates/bevy_render/src/spatial_bundle.rs +++ b/crates/bevy_render/src/spatial_bundle.rs @@ -10,7 +10,7 @@ use crate::view::{InheritedVisibility, ViewVisibility, Visibility}; /// but also visibility components, /// which determine whether the entity is visible or not. /// -/// Hierarchies of entities must contain +/// Parent-child hierarchies of entities must contain /// all the [`Component`]s in this `Bundle` /// to be rendered correctly. ///