Struct bevy_render::view::visibility::ComputedVisibility
source · pub struct ComputedVisibility { /* private fields */ }
Expand description
Algorithmically-computed indication of whether an entity is visible and should be extracted for rendering
Implementations§
source§impl ComputedVisibility
impl ComputedVisibility
sourcepub const HIDDEN: Self = _
pub const HIDDEN: Self = _
A ComputedVisibility
, set as invisible.
sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Whether this entity is visible to something this frame. This is true if and only if Self::is_visible_in_hierarchy
and Self::is_visible_in_view
are true. This is the canonical method to call to determine if an entity should be drawn.
This value is updated in PostUpdate
by the VisibilitySystems::CheckVisibility
system set.
Reading it during Update
will yield the value from the previous frame.
sourcepub fn is_visible_in_hierarchy(&self) -> bool
pub fn is_visible_in_hierarchy(&self) -> bool
Whether this entity is visible in the entity hierarchy, which is determined by the Visibility
component.
This takes into account “visibility inheritance”. If any of this entity’s ancestors (see Parent
) are hidden, this entity
will be hidden as well. This value is updated in the VisibilitySystems::VisibilityPropagate
, which lives in the PostUpdate
schedule.
sourcepub fn is_visible_in_view(&self) -> bool
pub fn is_visible_in_view(&self) -> bool
Whether this entity is visible in any view (Cameras, Lights, etc). Each entity type (and view type) should choose how to set this
value. For cameras and drawn entities, this will take into account RenderLayers
.
This value is reset to false
every frame in VisibilitySystems::VisibilityPropagate
during PostUpdate
.
Each entity type then chooses how to set this field in the VisibilitySystems::CheckVisibility
system set, in PostUpdate
.
Meshes might use frustum culling to decide if they are visible in a view.
Other entities might just set this to true
every frame.
sourcepub fn set_visible_in_view(&mut self)
pub fn set_visible_in_view(&mut self)
Sets is_visible_in_view
to true
. This is not reversible for a given frame, as it encodes whether or not this is visible in
any view. This will be automatically reset to false
every frame in VisibilitySystems::VisibilityPropagate
and then set
to the proper value in VisibilitySystems::CheckVisibility
. This should only be set in systems with the VisibilitySystems::CheckVisibility
label. Don’t call this unless you are defining a custom visibility system. For normal user-defined entity visibility, see Visibility
.
Trait Implementations§
source§impl Clone for ComputedVisibility
impl Clone for ComputedVisibility
source§fn clone(&self) -> ComputedVisibility
fn clone(&self) -> ComputedVisibility
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Component for ComputedVisibilitywhere
Self: Send + Sync + 'static,
impl Component for ComputedVisibilitywhere Self: Send + Sync + 'static,
§type Storage = TableStorage
type Storage = TableStorage
TableStorage
or SparseStorage
.source§impl Debug for ComputedVisibility
impl Debug for ComputedVisibility
source§impl Default for ComputedVisibility
impl Default for ComputedVisibility
source§impl FromReflect for ComputedVisibilitywhere
ComputedVisibilityFlags: FromReflect,
impl FromReflect for ComputedVisibilitywhere ComputedVisibilityFlags: FromReflect,
source§fn from_reflect(reflect: &dyn Reflect) -> Option<Self>
fn from_reflect(reflect: &dyn Reflect) -> Option<Self>
Self
from a reflected value.source§impl GetTypeRegistration for ComputedVisibilitywhere
ComputedVisibilityFlags: FromReflect,
impl GetTypeRegistration for ComputedVisibilitywhere ComputedVisibilityFlags: FromReflect,
source§impl PartialEq<ComputedVisibility> for ComputedVisibility
impl PartialEq<ComputedVisibility> for ComputedVisibility
source§fn eq(&self, other: &ComputedVisibility) -> bool
fn eq(&self, other: &ComputedVisibility) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Reflect for ComputedVisibilitywhere
ComputedVisibilityFlags: FromReflect,
impl Reflect for ComputedVisibilitywhere ComputedVisibilityFlags: FromReflect,
source§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
&mut dyn Any
.source§fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
source§fn as_reflect(&self) -> &dyn Reflect
fn as_reflect(&self) -> &dyn Reflect
source§fn as_reflect_mut(&mut self) -> &mut dyn Reflect
fn as_reflect_mut(&mut self) -> &mut dyn Reflect
source§fn clone_value(&self) -> Box<dyn Reflect>
fn clone_value(&self) -> Box<dyn Reflect>
Reflect
trait object. Read moresource§fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>
fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>
source§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
source§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
source§fn reflect_owned(self: Box<Self>) -> ReflectOwned
fn reflect_owned(self: Box<Self>) -> ReflectOwned
source§fn reflect_partial_eq(&self, value: &dyn Reflect) -> Option<bool>
fn reflect_partial_eq(&self, value: &dyn Reflect) -> Option<bool>
source§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
source§fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
source§fn serializable(&self) -> Option<Serializable<'_>>
fn serializable(&self) -> Option<Serializable<'_>>
source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
source§impl Struct for ComputedVisibilitywhere
ComputedVisibilityFlags: FromReflect,
impl Struct for ComputedVisibilitywhere ComputedVisibilityFlags: FromReflect,
source§fn field(&self, name: &str) -> Option<&dyn Reflect>
fn field(&self, name: &str) -> Option<&dyn Reflect>
name
as a &dyn Reflect
.source§fn field_mut(&mut self, name: &str) -> Option<&mut dyn Reflect>
fn field_mut(&mut self, name: &str) -> Option<&mut dyn Reflect>
name
as a
&mut dyn Reflect
.source§fn field_at(&self, index: usize) -> Option<&dyn Reflect>
fn field_at(&self, index: usize) -> Option<&dyn Reflect>
index
as a
&dyn Reflect
.source§fn field_at_mut(&mut self, index: usize) -> Option<&mut dyn Reflect>
fn field_at_mut(&mut self, index: usize) -> Option<&mut dyn Reflect>
index
as a &mut dyn Reflect
.source§fn name_at(&self, index: usize) -> Option<&str>
fn name_at(&self, index: usize) -> Option<&str>
index
.source§fn iter_fields(&self) -> FieldIter<'_>
fn iter_fields(&self) -> FieldIter<'_>
source§fn clone_dynamic(&self) -> DynamicStruct
fn clone_dynamic(&self) -> DynamicStruct
DynamicStruct
.source§impl TypePath for ComputedVisibilitywhere
ComputedVisibilityFlags: FromReflect,
impl TypePath for ComputedVisibilitywhere ComputedVisibilityFlags: FromReflect,
source§fn type_path() -> &'static str
fn type_path() -> &'static str
source§fn short_type_path() -> &'static str
fn short_type_path() -> &'static str
source§fn type_ident() -> Option<&'static str>
fn type_ident() -> Option<&'static str>
source§fn crate_name() -> Option<&'static str>
fn crate_name() -> Option<&'static str>
source§impl Typed for ComputedVisibilitywhere
ComputedVisibilityFlags: FromReflect,
impl Typed for ComputedVisibilitywhere ComputedVisibilityFlags: FromReflect,
impl Eq for ComputedVisibility
impl StructuralEq for ComputedVisibility
impl StructuralPartialEq for ComputedVisibility
Auto Trait Implementations§
impl RefUnwindSafe for ComputedVisibility
impl Send for ComputedVisibility
impl Sync for ComputedVisibility
impl Unpin for ComputedVisibility
impl UnwindSafe for ComputedVisibility
Blanket Implementations§
source§impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere U: ShaderType, &'a T: for<'a> Into<U>,
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<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere C: Component,
fn component_ids( components: &mut Components, storages: &mut Storages, ids: &mut impl FnMut(ComponentId) )
unsafe fn from_components<T, F>(ctx: &mut T, func: &mut F) -> Cwhere F: for<'a> FnMut(&'a mut T) -> OwningPtr<'a, Aligned>,
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
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, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
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<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere C: Component,
fn get_components( self, func: &mut impl FnMut(StorageType, OwningPtr<'_, Aligned>) )
source§impl<T> DynamicTypePath for Twhere
T: TypePath,
impl<T> DynamicTypePath for Twhere T: TypePath,
source§fn reflect_type_path(&self) -> &str
fn reflect_type_path(&self) -> &str
TypePath::type_path
.source§fn reflect_short_type_path(&self) -> &str
fn reflect_short_type_path(&self) -> &str
source§fn reflect_type_ident(&self) -> Option<&str>
fn reflect_type_ident(&self) -> Option<&str>
TypePath::type_ident
.source§fn reflect_crate_name(&self) -> Option<&str>
fn reflect_crate_name(&self) -> Option<&str>
TypePath::crate_name
.source§fn reflect_module_path(&self) -> Option<&str>
fn reflect_module_path(&self) -> Option<&str>
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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 Worldsource§impl<S> GetField for Swhere
S: Struct,
impl<S> GetField for Swhere S: Struct,
source§impl<T> GetPath for Twhere
T: Reflect,
impl<T> GetPath for Twhere T: Reflect,
source§fn reflect_path<'r, 'p>(
&'r self,
path: &'p str
) -> Result<&'r (dyn Reflect + 'static), ReflectPathError<'p>>
fn reflect_path<'r, 'p>( &'r self, path: &'p str ) -> Result<&'r (dyn Reflect + 'static), ReflectPathError<'p>>
path
. Read moresource§fn reflect_path_mut<'r, 'p>(
&'r mut self,
path: &'p str
) -> Result<&'r mut (dyn Reflect + 'static), ReflectPathError<'p>>
fn reflect_path_mut<'r, 'p>( &'r mut self, path: &'p str ) -> Result<&'r mut (dyn Reflect + 'static), ReflectPathError<'p>>
path
. Read more