Struct bevy::prelude::SpatialBundle
source · pub struct SpatialBundle {
pub visibility: Visibility,
pub inherited_visibility: InheritedVisibility,
pub view_visibility: ViewVisibility,
pub transform: Transform,
pub global_transform: GlobalTransform,
}
Expand description
A Bundle
that allows the correct positional rendering of an entity.
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.
Parent-child hierarchies of entities must contain
all the Component
s in this Bundle
to be rendered correctly.
Fields§
§visibility: Visibility
The visibility of the entity.
inherited_visibility: InheritedVisibility
The inherited visibility of the entity.
view_visibility: ViewVisibility
The view visibility of the entity.
transform: Transform
The transform of the entity.
global_transform: GlobalTransform
The global transform of the entity.
Implementations§
source§impl SpatialBundle
impl SpatialBundle
sourcepub const fn from_transform(transform: Transform) -> SpatialBundle
pub const fn from_transform(transform: Transform) -> SpatialBundle
Creates a new SpatialBundle
from a Transform
.
This initializes GlobalTransform
as identity, and visibility as visible
sourcepub const INHERITED_IDENTITY: SpatialBundle = _
pub const INHERITED_IDENTITY: SpatialBundle = _
A visible SpatialBundle
, with no translation, rotation, and a scale of 1 on all axes.
sourcepub const HIDDEN_IDENTITY: SpatialBundle = _
pub const HIDDEN_IDENTITY: SpatialBundle = _
An invisible SpatialBundle
, with no translation, rotation, and a scale of 1 on all axes.
Trait Implementations§
source§impl Clone for SpatialBundle
impl Clone for SpatialBundle
source§fn clone(&self) -> SpatialBundle
fn clone(&self) -> SpatialBundle
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SpatialBundle
impl Debug for SpatialBundle
source§impl Default for SpatialBundle
impl Default for SpatialBundle
source§fn default() -> SpatialBundle
fn default() -> SpatialBundle
source§impl From<Transform> for SpatialBundle
impl From<Transform> for SpatialBundle
source§fn from(transform: Transform) -> SpatialBundle
fn from(transform: Transform) -> SpatialBundle
impl Bundle for SpatialBundle
impl DynamicBundle for SpatialBundle
Auto Trait Implementations§
impl RefUnwindSafe for SpatialBundle
impl Send for SpatialBundle
impl Sync for SpatialBundle
impl Unpin for SpatialBundle
impl UnwindSafe for SpatialBundle
Blanket Implementations§
source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self
using data from the given World
.