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

Calls func on each value, in the order of this bundle’s Components. This will “mem::forget” the bundle fields, so callers are responsible for dropping the fields if that is desirable. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

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

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

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

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Performs the conversion.

Creates Self using data from the given [World]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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