Struct bevy_skybox_cubemap::SkyboxBundle [−][src]
pub struct SkyboxBundle {
pub material: Handle<SkyboxMaterial>,
pub mesh: Handle<Mesh>,
pub main_pass: MainPass,
pub draw: Draw,
pub visible: Visible,
pub render_pipelines: RenderPipelines,
pub transform: Transform,
pub global_transform: GlobalTransform,
}
Expand description
Bundle for spawning Skybox entities. Note that you should be able to use defaults for everything
besides material
. The only other field you may want to touch is transform
which can be used
to rotate the skybox if desired. Translations applied to skyboxes are ignored.
When inserting a skybox bundle, you should generally use ..Default::default()
for every
property except the material
and occasionally transform
(if you want to rotate the skybox
from its default orientation).
commands.spawn_bundle(SkyboxBundle::new(
skyboxes.add(SkyboxMaterial::from_texture(skybox_texture)),
));
Fields
material: Handle<SkyboxMaterial>
Material to use for the skybox. Defaults to a garish pink. In most usage this should be the only field you need to set.
mesh: Handle<Mesh>
Mesh to use for the skybox. Defaults to SKYBOX_MESH_HANDLE
, which is a unit cube. You
shouldn’t ever need to use any other mesh. Because of how cubemap sampling works, probably
any mesh that completely surrounds the camera would work equally well, but only the unit
cube is officially supported by this crate.
main_pass: MainPass
Marker to draw the skybox in the main pass.
draw: Draw
This is included in every type that can be drawn. Honestly not sure what it does.
visible: Visible
This is included in every type that can be drawn. Can be used to hide the skybox.
render_pipelines: RenderPipelines
Needs to be configured to use the skybox render pipeline.
transform: Transform
Transform can be used to manipulate the rotation of the skybox.
global_transform: GlobalTransform
Transforms get computed into global transforms used for drawing based on parenting. Note that it doesn’t make much sense to add a skybox as a child of any other entity; it should usually be freestanding.
Implementations
Convenience constructor for SkyboxBundle
. Sets the material and uses defaults for
everything else. In most use cases you should only need to set the material.
Trait Implementations
SAFE: TypeInfo is returned in field-definition-order. [from_components] and [get_components] use field-definition-order
Gets this [Bundle]’s components type info, in the order of this bundle’s Components
Calls func
, which should return data for each component in the bundle, in the order of
this bundle’s Components Read more
Auto Trait Implementations
impl RefUnwindSafe for SkyboxBundle
impl Send for SkyboxBundle
impl Sync for SkyboxBundle
impl Unpin for SkyboxBundle
impl UnwindSafe for SkyboxBundle
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert 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
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
impl<T> FromWorld for T where
T: Default,
impl<T> FromWorld for T where
T: Default,
pub fn from_world(_world: &mut World) -> T
pub fn from_world(_world: &mut World) -> T
Creates Self
using data from the given [World]
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more