pub struct Camera {
pub viewport: Option<Viewport>,
pub order: isize,
pub is_active: bool,
pub computed: ComputedCameraValues,
pub target: RenderTarget,
pub hdr: bool,
pub output_mode: CameraOutputMode,
pub msaa_writeback: bool,
pub clear_color: ClearColorConfig,
pub sub_camera_view: Option<SubCameraView>,
}
Expand description
The defining Component
for camera entities,
storing information about how and what to render through this camera.
The Camera
component is added to an entity to define the properties of the viewpoint from
which rendering occurs. It defines the position of the view to render, the projection method
to transform the 3D objects into a 2D image, as well as the render target into which that image
is produced.
Note that a Camera
needs a CameraRenderGraph
to render anything.
This is typically provided by adding a Camera2d
or Camera3d
component,
but custom render graphs can also be defined. Inserting a Camera
with no render
graph will emit an error at runtime.
Fields§
§viewport: Option<Viewport>
If set, this camera will render to the given Viewport
rectangle within the configured RenderTarget
.
order: isize
Cameras with a higher order are rendered later, and thus on top of lower order cameras.
is_active: bool
If this is set to true
, this camera will be rendered to its specified RenderTarget
. If false
, this
camera will not be rendered.
computed: ComputedCameraValues
Computed values for this camera, such as the projection matrix and the render target size.
target: RenderTarget
The “target” that this camera will render to.
hdr: bool
If this is set to true
, the camera will use an intermediate “high dynamic range” render texture.
This allows rendering with a wider range of lighting values.
output_mode: CameraOutputMode
The CameraOutputMode
for this camera.
msaa_writeback: bool
If this is enabled, a previous camera exists that shares this camera’s render target, and this camera has MSAA enabled, then the previous camera’s outputs will be written to the intermediate multi-sampled render target textures for this camera. This enables cameras with MSAA enabled to “write their results on top” of previous camera results, and include them as a part of their render results. This is enabled by default to ensure cameras with MSAA enabled layer their results in the same way as cameras without MSAA enabled by default.
clear_color: ClearColorConfig
The clear color operation to perform on the render target.
sub_camera_view: Option<SubCameraView>
If set, this camera will be a sub camera of a large view, defined by a SubCameraView
.
Implementations§
Source§impl Camera
impl Camera
Sourcepub fn to_logical(&self, physical_size: UVec2) -> Option<Vec2>
pub fn to_logical(&self, physical_size: UVec2) -> Option<Vec2>
Converts a physical size in this Camera
to a logical size.
Sourcepub fn physical_viewport_rect(&self) -> Option<URect>
pub fn physical_viewport_rect(&self) -> Option<URect>
The rendered physical bounds URect
of the camera. If the viewport
field is
set to Some
, this will be the rect of that custom viewport. Otherwise it will default to
the full physical rect of the current RenderTarget
.
Sourcepub fn logical_viewport_rect(&self) -> Option<Rect>
pub fn logical_viewport_rect(&self) -> Option<Rect>
The rendered logical bounds Rect
of the camera. If the viewport
field is set to
Some
, this will be the rect of that custom viewport. Otherwise it will default to the
full logical rect of the current RenderTarget
.
Sourcepub fn logical_viewport_size(&self) -> Option<Vec2>
pub fn logical_viewport_size(&self) -> Option<Vec2>
The logical size of this camera’s viewport. If the viewport
field is set to Some
, this
will be the size of that custom viewport. Otherwise it will default to the full logical size
of the current RenderTarget
.
For logic that requires the full logical size of the
RenderTarget
, prefer Camera::logical_target_size
.
Returns None
if either:
- the function is called just after the
Camera
is created, beforecamera_system
is executed, - the
RenderTarget
isn’t correctly set:- it references the
PrimaryWindow
when there is none, - it references a
Window
entity that doesn’t exist or doesn’t actually have aWindow
component, - it references an
Image
that doesn’t exist (invalid handle), - it references a
TextureView
that doesn’t exist (invalid handle).
- it references the
Sourcepub fn physical_viewport_size(&self) -> Option<UVec2>
pub fn physical_viewport_size(&self) -> Option<UVec2>
The physical size of this camera’s viewport (in physical pixels).
If the viewport
field is set to Some
, this
will be the size of that custom viewport. Otherwise it will default to the full physical size of
the current RenderTarget
.
For logic that requires the full physical size of the RenderTarget
, prefer Camera::physical_target_size
.
Sourcepub fn logical_target_size(&self) -> Option<Vec2>
pub fn logical_target_size(&self) -> Option<Vec2>
The full logical size of this camera’s RenderTarget
, ignoring custom viewport
configuration.
Note that if the viewport
field is Some
, this will not represent the size of the rendered area.
For logic that requires the size of the actually rendered area, prefer Camera::logical_viewport_size
.
Sourcepub fn physical_target_size(&self) -> Option<UVec2>
pub fn physical_target_size(&self) -> Option<UVec2>
The full physical size of this camera’s RenderTarget
(in physical pixels),
ignoring custom viewport
configuration.
Note that if the viewport
field is Some
, this will not represent the size of the rendered area.
For logic that requires the size of the actually rendered area, prefer Camera::physical_viewport_size
.
pub fn target_scaling_factor(&self) -> Option<f32>
Sourcepub fn clip_from_view(&self) -> Mat4
pub fn clip_from_view(&self) -> Mat4
The projection matrix computed using this camera’s CameraProjection
.
Sourcepub fn world_to_viewport(
&self,
camera_transform: &GlobalTransform,
world_position: Vec3,
) -> Result<Vec2, ViewportConversionError>
pub fn world_to_viewport( &self, camera_transform: &GlobalTransform, world_position: Vec3, ) -> Result<Vec2, ViewportConversionError>
Given a position in world space, use the camera to compute the viewport-space coordinates.
To get the coordinates in Normalized Device Coordinates, you should use
world_to_ndc
.
§Panics
Will panic if glam_assert
is enabled and the camera_transform
contains NAN
(see world_to_ndc
).
Sourcepub fn world_to_viewport_with_depth(
&self,
camera_transform: &GlobalTransform,
world_position: Vec3,
) -> Result<Vec3, ViewportConversionError>
pub fn world_to_viewport_with_depth( &self, camera_transform: &GlobalTransform, world_position: Vec3, ) -> Result<Vec3, ViewportConversionError>
Given a position in world space, use the camera to compute the viewport-space coordinates and depth.
To get the coordinates in Normalized Device Coordinates, you should use
world_to_ndc
.
§Panics
Will panic if glam_assert
is enabled and the camera_transform
contains NAN
(see world_to_ndc
).
Sourcepub fn viewport_to_world(
&self,
camera_transform: &GlobalTransform,
viewport_position: Vec2,
) -> Result<Ray3d, ViewportConversionError>
pub fn viewport_to_world( &self, camera_transform: &GlobalTransform, viewport_position: Vec2, ) -> Result<Ray3d, ViewportConversionError>
Returns a ray originating from the camera, that passes through everything beyond viewport_position
.
The resulting ray starts on the near plane of the camera.
If the camera’s projection is orthographic the direction of the ray is always equal to camera_transform.forward()
.
To get the world space coordinates with Normalized Device Coordinates, you should use
ndc_to_world
.
§Panics
Will panic if the camera’s projection matrix is invalid (has a determinant of 0) and
glam_assert
is enabled (see ndc_to_world
.
Sourcepub fn viewport_to_world_2d(
&self,
camera_transform: &GlobalTransform,
viewport_position: Vec2,
) -> Result<Vec2, ViewportConversionError>
pub fn viewport_to_world_2d( &self, camera_transform: &GlobalTransform, viewport_position: Vec2, ) -> Result<Vec2, ViewportConversionError>
Returns a 2D world position computed from a position on this Camera
’s viewport.
Useful for 2D cameras and other cameras with an orthographic projection pointing along the Z axis.
To get the world space coordinates with Normalized Device Coordinates, you should use
ndc_to_world
.
§Panics
Will panic if the camera’s projection matrix is invalid (has a determinant of 0) and
glam_assert
is enabled (see ndc_to_world
.
Sourcepub fn world_to_ndc(
&self,
camera_transform: &GlobalTransform,
world_position: Vec3,
) -> Option<Vec3>
pub fn world_to_ndc( &self, camera_transform: &GlobalTransform, world_position: Vec3, ) -> Option<Vec3>
Given a position in world space, use the camera’s viewport to compute the Normalized Device Coordinates.
When the position is within the viewport the values returned will be between -1.0 and 1.0 on the X and Y axes,
and between 0.0 and 1.0 on the Z axis.
To get the coordinates in the render target’s viewport dimensions, you should use
world_to_viewport
.
Returns None
if the camera_transform
, the world_position
, or the projection matrix defined by CameraProjection
contain NAN
.
§Panics
Will panic if the camera_transform
contains NAN
and the glam_assert
feature is enabled.
Sourcepub fn ndc_to_world(
&self,
camera_transform: &GlobalTransform,
ndc: Vec3,
) -> Option<Vec3>
pub fn ndc_to_world( &self, camera_transform: &GlobalTransform, ndc: Vec3, ) -> Option<Vec3>
Given a position in Normalized Device Coordinates, use the camera’s viewport to compute the world space position.
When the position is within the viewport the values returned will be between -1.0 and 1.0 on the X and Y axes,
and between 0.0 and 1.0 on the Z axis.
To get the world space coordinates with the viewport position, you should use
world_to_viewport
.
Returns None
if the camera_transform
, the world_position
, or the projection matrix defined by CameraProjection
contain NAN
.
§Panics
Will panic if the projection matrix is invalid (has a determinant of 0) and glam_assert
is enabled.
Sourcepub fn depth_ndc_to_view_z(&self, ndc_depth: f32) -> f32
pub fn depth_ndc_to_view_z(&self, ndc_depth: f32) -> f32
Converts the depth in Normalized Device Coordinates to linear view z for perspective projections.
Note: Depth values in front of the camera will be negative as -z is forward
Sourcepub fn depth_ndc_to_view_z_2d(&self, ndc_depth: f32) -> f32
pub fn depth_ndc_to_view_z_2d(&self, ndc_depth: f32) -> f32
Converts the depth in Normalized Device Coordinates to linear view z for orthographic projections.
Note: Depth values in front of the camera will be negative as -z is forward
Trait Implementations§
Source§impl Component for Camera
impl Component for Camera
Required Components: Frustum
, CameraMainTextureUsages
, VisibleEntities
, Transform
, Visibility
, Msaa
, SyncToRenderWorld
.
A component’s Required Components are inserted whenever it is inserted. Note that this will also insert the required components of the required components, recursively, in depth-first order.
Source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
Source§fn register_required_components(
requiree: ComponentId,
components: &mut Components,
storages: &mut Storages,
required_components: &mut RequiredComponents,
inheritance_depth: u16,
)
fn register_required_components( requiree: ComponentId, components: &mut Components, storages: &mut Storages, required_components: &mut RequiredComponents, inheritance_depth: u16, )
Source§fn register_component_hooks(hooks: &mut ComponentHooks)
fn register_component_hooks(hooks: &mut ComponentHooks)
ComponentHooks
.Source§impl FromReflect for Camerawhere
Camera: Any + Send + Sync,
Option<Viewport>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
isize: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
RenderTarget: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
ClearColorConfig: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Option<SubCameraView>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl FromReflect for Camerawhere
Camera: Any + Send + Sync,
Option<Viewport>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
isize: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
RenderTarget: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
ClearColorConfig: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Option<SubCameraView>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn from_reflect(reflect: &dyn PartialReflect) -> Option<Self>
fn from_reflect(reflect: &dyn PartialReflect) -> Option<Self>
Self
from a reflected value.Source§fn take_from_reflect(
reflect: Box<dyn PartialReflect>,
) -> Result<Self, Box<dyn PartialReflect>>
fn take_from_reflect( reflect: Box<dyn PartialReflect>, ) -> Result<Self, Box<dyn PartialReflect>>
Self
using,
constructing the value using from_reflect
if that fails. Read moreSource§impl GetTypeRegistration for Camerawhere
Camera: Any + Send + Sync,
Option<Viewport>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
isize: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
RenderTarget: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
ClearColorConfig: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Option<SubCameraView>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl GetTypeRegistration for Camerawhere
Camera: Any + Send + Sync,
Option<Viewport>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
isize: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
RenderTarget: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
ClearColorConfig: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Option<SubCameraView>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn get_type_registration() -> TypeRegistration
fn get_type_registration() -> TypeRegistration
TypeRegistration
for this type.Source§fn register_type_dependencies(registry: &mut TypeRegistry)
fn register_type_dependencies(registry: &mut TypeRegistry)
Source§impl PartialReflect for Camerawhere
Camera: Any + Send + Sync,
Option<Viewport>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
isize: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
RenderTarget: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
ClearColorConfig: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Option<SubCameraView>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl PartialReflect for Camerawhere
Camera: Any + Send + Sync,
Option<Viewport>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
isize: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
RenderTarget: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
ClearColorConfig: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Option<SubCameraView>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
Source§fn clone_value(&self) -> Box<dyn PartialReflect>
fn clone_value(&self) -> Box<dyn PartialReflect>
Reflect
trait object. Read moreSource§fn try_apply(&mut self, value: &dyn PartialReflect) -> Result<(), ApplyError>
fn try_apply(&mut self, value: &dyn PartialReflect) -> Result<(), ApplyError>
Source§fn reflect_kind(&self) -> ReflectKind
fn reflect_kind(&self) -> ReflectKind
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 try_into_reflect(
self: Box<Self>,
) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
fn try_into_reflect( self: Box<Self>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
Source§fn try_as_reflect(&self) -> Option<&dyn Reflect>
fn try_as_reflect(&self) -> Option<&dyn Reflect>
Source§fn try_as_reflect_mut(&mut self) -> Option<&mut dyn Reflect>
fn try_as_reflect_mut(&mut self) -> Option<&mut dyn Reflect>
Source§fn into_partial_reflect(self: Box<Self>) -> Box<dyn PartialReflect>
fn into_partial_reflect(self: Box<Self>) -> Box<dyn PartialReflect>
Source§fn as_partial_reflect(&self) -> &dyn PartialReflect
fn as_partial_reflect(&self) -> &dyn PartialReflect
Source§fn as_partial_reflect_mut(&mut self) -> &mut dyn PartialReflect
fn as_partial_reflect_mut(&mut self) -> &mut dyn PartialReflect
Source§fn reflect_partial_eq(&self, value: &dyn PartialReflect) -> Option<bool>
fn reflect_partial_eq(&self, value: &dyn PartialReflect) -> Option<bool>
Source§fn apply(&mut self, value: &(dyn PartialReflect + 'static))
fn apply(&mut self, value: &(dyn PartialReflect + 'static))
Source§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
Source§fn serializable(&self) -> Option<Serializable<'_>>
fn serializable(&self) -> Option<Serializable<'_>>
Source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
Source§impl Reflect for Camerawhere
Camera: Any + Send + Sync,
Option<Viewport>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
isize: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
RenderTarget: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
ClearColorConfig: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Option<SubCameraView>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl Reflect for Camerawhere
Camera: Any + Send + Sync,
Option<Viewport>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
isize: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
RenderTarget: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
ClearColorConfig: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Option<SubCameraView>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
&mut dyn Any
. Read moreSource§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§impl Struct for Camerawhere
Camera: Any + Send + Sync,
Option<Viewport>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
isize: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
RenderTarget: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
ClearColorConfig: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Option<SubCameraView>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl Struct for Camerawhere
Camera: Any + Send + Sync,
Option<Viewport>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
isize: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
RenderTarget: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
ClearColorConfig: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Option<SubCameraView>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn field(&self, name: &str) -> Option<&dyn PartialReflect>
fn field(&self, name: &str) -> Option<&dyn PartialReflect>
name
as a &dyn PartialReflect
.Source§fn field_mut(&mut self, name: &str) -> Option<&mut dyn PartialReflect>
fn field_mut(&mut self, name: &str) -> Option<&mut dyn PartialReflect>
name
as a
&mut dyn PartialReflect
.Source§fn field_at(&self, index: usize) -> Option<&dyn PartialReflect>
fn field_at(&self, index: usize) -> Option<&dyn PartialReflect>
index
as a
&dyn PartialReflect
.Source§fn field_at_mut(&mut self, index: usize) -> Option<&mut dyn PartialReflect>
fn field_at_mut(&mut self, index: usize) -> Option<&mut dyn PartialReflect>
index
as a &mut dyn PartialReflect
.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§fn get_represented_struct_info(&self) -> Option<&'static StructInfo>
fn get_represented_struct_info(&self) -> Option<&'static StructInfo>
None
if TypeInfo
is not available.Source§impl TypePath for Camera
impl TypePath for Camera
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 Camerawhere
Camera: Any + Send + Sync,
Option<Viewport>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
isize: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
RenderTarget: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
ClearColorConfig: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Option<SubCameraView>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl Typed for Camerawhere
Camera: Any + Send + Sync,
Option<Viewport>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
isize: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
bool: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
RenderTarget: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
ClearColorConfig: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Option<SubCameraView>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Auto Trait Implementations§
impl Freeze for Camera
impl !RefUnwindSafe for Camera
impl Send for Camera
impl Sync for Camera
impl Unpin for Camera
impl !UnwindSafe for Camera
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<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) -> C
Source§fn register_required_components(
components: &mut Components,
storages: &mut Storages,
required_components: &mut RequiredComponents,
)
fn register_required_components( components: &mut Components, storages: &mut Storages, required_components: &mut RequiredComponents, )
Bundle
.Source§fn get_component_ids(
components: &Components,
ids: &mut impl FnMut(Option<ComponentId>),
)
fn get_component_ids( components: &Components, ids: &mut impl FnMut(Option<ComponentId>), )
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>
. 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<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
fn get_components(self, func: &mut impl FnMut(StorageType, OwningPtr<'_>))
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>
Source§impl<T> DynamicTyped for Twhere
T: Typed,
impl<T> DynamicTyped for Twhere
T: Typed,
Source§fn reflect_type_info(&self) -> &'static TypeInfo
fn reflect_type_info(&self) -> &'static TypeInfo
Typed::type_info
.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
Creates Self
using default()
.
Source§impl<S> GetField for Swhere
S: Struct,
impl<S> GetField for Swhere
S: Struct,
Source§impl<T> GetPath for T
impl<T> GetPath for T
Source§fn reflect_path<'p>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
path
. Read moreSource§fn reflect_path_mut<'p>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
path
. Read moreSource§fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
path
. Read moreSource§fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
path
. Read moreSource§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