pub struct RetainedViewEntity {
pub main_entity: MainEntity,
pub auxiliary_entity: MainEntity,
pub subview_index: u32,
}
Expand description
An identifier for a view that is stable across frames.
We can’t use Entity
for this because render world entities aren’t
stable, and we can’t use just MainEntity
because some main world views
extract to multiple render world views. For example, a directional light
extracts to one render world view per cascade, and a point light extracts to
one render world view per cubemap face. So we pair the main entity with an
auxiliary entity and a subview index, which together uniquely identify
a view in the render world in a way that’s stable from frame to frame.
Fields§
§main_entity: MainEntity
The main entity that this view corresponds to.
auxiliary_entity: MainEntity
Another entity associated with the view entity.
This is currently used for shadow cascades. If there are multiple cameras, each camera needs to have its own set of shadow cascades. Thus the light and subview index aren’t themselves enough to uniquely identify a shadow cascade: we need the camera that the cascade is associated with as well. This entity stores that camera.
If not present, this will be MainEntity(Entity::PLACEHOLDER)
.
subview_index: u32
The index of the view corresponding to the entity.
For example, for point lights that cast shadows, this is the index of the cubemap face (0 through 5 inclusive). For directional lights, this is the index of the cascade.
Implementations§
Source§impl RetainedViewEntity
impl RetainedViewEntity
Sourcepub fn new(
main_entity: MainEntity,
auxiliary_entity: Option<MainEntity>,
subview_index: u32,
) -> Self
pub fn new( main_entity: MainEntity, auxiliary_entity: Option<MainEntity>, subview_index: u32, ) -> Self
Creates a new RetainedViewEntity
from the given main world entity,
auxiliary main world entity, and subview index.
See RetainedViewEntity::subview_index
for an explanation of what
auxiliary_entity
and subview_index
are.
Trait Implementations§
Source§impl Clone for RetainedViewEntity
impl Clone for RetainedViewEntity
Source§fn clone(&self) -> RetainedViewEntity
fn clone(&self) -> RetainedViewEntity
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RetainedViewEntity
impl Debug for RetainedViewEntity
Source§impl Hash for RetainedViewEntity
impl Hash for RetainedViewEntity
Source§impl PartialEq for RetainedViewEntity
impl PartialEq for RetainedViewEntity
impl Copy for RetainedViewEntity
impl Eq for RetainedViewEntity
impl StructuralPartialEq for RetainedViewEntity
Auto Trait Implementations§
impl Freeze for RetainedViewEntity
impl RefUnwindSafe for RetainedViewEntity
impl Send for RetainedViewEntity
impl Sync for RetainedViewEntity
impl Unpin for RetainedViewEntity
impl UnwindSafe for RetainedViewEntity
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<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
, which can then be
downcast
into Box<dyn 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>
, which 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> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more