pub struct ShapeCommands<'w, 's> { /* private fields */ }
Expand description
A system param that allows ergonomic spawning of shape entities.
The ShapeConfig
used is initially extracted from the BaseShapeConfig
resource.
Subsequent calls to reset()
will reset the config back to whatever is currently stored within the BaseShapeConfig
resource.
Shapes will be spawned with commands during the next instance of apply_deferred
Implementations§
Source§impl<'w, 's> ShapeCommands<'w, 's>
impl<'w, 's> ShapeCommands<'w, 's>
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Set the painter’s ShapeConfig
to the current value of the BaseShapeConfig
resource.
Methods from Deref<Target = ShapeConfig>§
Sourcepub fn translate(&mut self, dir: Vec3)
pub fn translate(&mut self, dir: Vec3)
Helper method to modify the configs transform taking into account rotation and scale.
Examples found in repository?
34fn draw_health_bar(painter: &mut ShapePainter, hp: f32) {
35 painter.translate(Vec3::Y * 0.7);
36 painter.corner_radii = Vec4::splat(0.3);
37
38 painter.set_color(GREEN * hp + RED * (1. - hp));
39 painter.rect(Vec2::new(0.2 + 0.8 * hp, 0.2));
40
41 painter.thickness = 0.02;
42 painter.hollow = true;
43 painter.color = Color::WHITE;
44 painter.rect(Vec2::new(1.06, 0.26));
45}
More examples
42fn draw_shapes(time: Res<Time>, mut painter: ShapePainter, canvas: Single<(Entity, &Canvas)>) {
43 let (canvas_e, canvas) = canvas.into_inner();
44 painter.image(canvas.image.clone(), Vec2::splat(20.));
45
46 painter.set_canvas(canvas_e);
47 painter.hollow = true;
48 painter.thickness = 6.0;
49 painter.set_color(CRIMSON);
50 painter.translate(Vec3::Y * time.elapsed_secs().sin() * 256.0);
51 painter.circle(48.0);
52
53 painter.reset();
54}
32fn draw_canvas(time: Res<Time>, mut painter: ShapePainter, canvas: Single<Entity, With<Canvas>>) {
33 painter.rotate_z(time.elapsed_secs().sin());
34 painter.set_canvas(*canvas);
35 painter.set_color(WHITE * 2.0);
36 painter.translate(Vec3::NEG_Y * 12.0 * 16.0);
37 painter.thickness = 16.0;
38
39 for _ in 0..12 {
40 painter.translate(Vec3::Y * 32.0);
41 painter.line(Vec3::NEG_X * 256.0, Vec3::X * 256.0);
42 }
43 painter.reset();
44}
45
46fn draw_shapes(time: Res<Time>, mut painter: ShapePainter, canvas: Single<&Canvas>) {
47 painter.texture = Some(canvas.image.clone());
48 painter.translate(Vec3::NEG_Y * 2.0);
49
50 gallery(painter, time.elapsed_secs(), 0..10);
51}
35fn draw_circles(painter: &mut ShapePainter, radius: f32) {
36 painter.translate(-(Vec3::X + Vec3::NEG_Y) * f32::sqrt(radius) * 0.5);
37 painter.color = Color::srgba(1.0, 0.0, 0.0, 0.5);
38 painter.circle(radius);
39
40 painter.rotate_z(-TAU / 3.0);
41 painter.translate(Vec3::Y * radius * 1.2 + Vec3::Z * 0.0001);
42 painter.color = Color::srgba(0.0, 1.0, 0.0, 0.5);
43 painter.circle(radius);
44
45 painter.rotate_z(-TAU / 3.0);
46 painter.translate(Vec3::Y * radius * 1.2 + Vec3::Z * 0.0001);
47 painter.color = Color::srgba(0.0, 0.0, 1.0, 0.5);
48 painter.circle(radius);
49}
50
51fn draw_gallery(mut painter: ShapePainter) {
52 let radius = 2.0;
53
54 painter.reset();
55 painter.translate(Vec3::X * radius * -4.0);
56 painter.alpha_mode = ShapeAlphaMode::Add;
57 draw_circles(&mut painter, radius);
58
59 painter.reset();
60 painter.alpha_mode = ShapeAlphaMode::Multiply;
61 draw_circles(&mut painter, radius);
62
63 painter.reset();
64 painter.translate(Vec3::X * radius * 4.0);
65 painter.alpha_mode = ShapeAlphaMode::Blend;
66 draw_circles(&mut painter, radius);
67}
34fn draw_tree(time: f32, painter: &mut ShapePainter, depth: u32) {
35 if depth == 0 {
36 return;
37 }
38
39 let line_a = Vec3::Y + Vec3::X * 0.5;
40 painter.rotate_z(time.sin() * 0.2);
41 painter
42 .line(Vec3::ZERO, line_a)
43 .with_children(|child_painter| {
44 child_painter.translate(line_a);
45
46 draw_tree(time, child_painter, depth - 1);
47 });
48
49 let line_b = Vec3::Y + Vec3::NEG_X * 0.5;
50 painter.rotate_z(-time.sin() * 0.4);
51 painter
52 .line(Vec3::ZERO, line_b)
53 .with_children(|child_painter| {
54 child_painter.translate(line_b);
55
56 draw_tree(time, child_painter, depth - 1);
57 });
58}
59
60fn draw_gallery(
61 time: Res<Time>,
62 mut painter: ShapePainter,
63 mut tree: Single<&mut Transform, With<Tree>>,
64) {
65 tree.rotation = Quat::from_rotation_z(time.elapsed_secs().sin() / 4.0);
66
67 // Position our painter relative to our tree entity
68 painter.transform = **tree;
69 painter.set_color(SEA_GREEN + WHITE * 0.25);
70 painter
71 .line(Vec3::ZERO, Vec3::Y)
72 .with_children(|child_painter| {
73 child_painter.translate(Vec3::Y);
74 draw_tree(time.elapsed_secs(), child_painter, 10);
75 });
76}
88fn draw_shapes(time: Res<Time>, mut painter: ShapePainter) {
89 painter.reset();
90 painter.render_layers = Some(RenderLayers::layer(1));
91 painter.hollow = true;
92 painter.transform.scale = Vec3::ONE * 3.0;
93
94 let meter_fill = (time.elapsed_secs().sin() + 1.0) / 2.0;
95 let meter_size = PI * 1.5;
96
97 let start_angle = -meter_size / 2.0;
98 let end_angle = -meter_size / 2.0 + meter_fill * meter_size;
99
100 painter.cap = Cap::Round;
101 painter.thickness = 0.4;
102 painter.set_color(CRIMSON * (1.0 / (0.5 + meter_fill)));
103 painter.arc(1.3, start_angle, end_angle);
104
105 painter.cap = Cap::None;
106 painter.thickness = 0.2;
107 painter.set_color(DARK_GRAY);
108 painter.arc(1.6, start_angle, -start_angle);
109 painter.arc(0.8, start_angle, -start_angle);
110
111 let offset = Quat::from_rotation_z(start_angle) * Vec3::Y * 1.1;
112 painter.translate(offset);
113 painter.arc(0.5, start_angle + PI * 1.5, start_angle + 2.5 * PI);
114 painter.translate(-offset);
115
116 painter.translate(Quat::from_rotation_z(-start_angle) * Vec3::Y * 1.1);
117 painter.arc(0.5, start_angle + PI, start_angle + 2.0 * PI);
118}
Sourcepub fn set_translation(&mut self, translation: Vec3)
pub fn set_translation(&mut self, translation: Vec3)
Helper method to set the configs transform.
Examples found in repository?
More examples
24fn draw(mut painter: ShapePainter) {
25 // Render the background
26 painter.color = Color::BLACK.with_alpha(0.9);
27 painter.corner_radii = Vec4::splat(0.1);
28 painter.rect(Vec2::new(2.0, 1.0));
29
30 // Set the circle color
31 painter.color = Color::WHITE;
32
33 // Set the origin of the circles in front of the background
34 // Without this, the left circle is blended in the wrong order
35 painter.origin = Some(Vec3::Z * 0.01);
36
37 // Render the left circle
38 painter.set_translation(Vec3::X * -0.5);
39 painter.circle(0.2);
40
41 // Render the right circle
42 painter.set_translation(Vec3::X * 0.5);
43 painter.circle(0.2);
44}
Sourcepub fn rotate(&mut self, quat: Quat)
pub fn rotate(&mut self, quat: Quat)
Helper method to rotate the configs transform by a given Quat
.
Sourcepub fn set_rotation(&mut self, rotation: Quat)
pub fn set_rotation(&mut self, rotation: Quat)
Helper method to set the configs rotation.
Sourcepub fn rotate_x(&mut self, angle: f32)
pub fn rotate_x(&mut self, angle: f32)
Helper method to rotate the configs transform around the x axis.
Sourcepub fn rotate_y(&mut self, angle: f32)
pub fn rotate_y(&mut self, angle: f32)
Helper method to rotate the configs transform around the y axis.
Sourcepub fn rotate_z(&mut self, angle: f32)
pub fn rotate_z(&mut self, angle: f32)
Helper method to rotate the configs transform around the z axis.
Examples found in repository?
32fn draw_canvas(time: Res<Time>, mut painter: ShapePainter, canvas: Single<Entity, With<Canvas>>) {
33 painter.rotate_z(time.elapsed_secs().sin());
34 painter.set_canvas(*canvas);
35 painter.set_color(WHITE * 2.0);
36 painter.translate(Vec3::NEG_Y * 12.0 * 16.0);
37 painter.thickness = 16.0;
38
39 for _ in 0..12 {
40 painter.translate(Vec3::Y * 32.0);
41 painter.line(Vec3::NEG_X * 256.0, Vec3::X * 256.0);
42 }
43 painter.reset();
44}
More examples
18fn setup(mut commands: Commands, mut shapes: ShapeCommands) {
19 commands.spawn((
20 Camera3d::default(),
21 Transform::from_xyz(0., 0.0, 16.).looking_at(Vec3::ZERO, Vec3::Y),
22 Msaa::Off,
23 ));
24
25 // The ShapeCommands API is identical to the ShapePainter API so can be used almost interchangeably
26 shapes.circle(1.0).with_children(|parent| {
27 for _ in 0..4 {
28 parent.rotate_z(PI / 2.0);
29 parent.line(Vec3::ZERO, Vec3::Y * 2.0);
30 }
31 });
32}
27fn draw_shapes(time: Res<Time>, mut painter: ShapePainter, canvas: Single<(Entity, &Canvas)>) {
28 let (canvas_e, canvas) = canvas.into_inner();
29 painter.image(canvas.image.clone(), Vec2::splat(12.));
30
31 painter.set_canvas(canvas_e);
32 painter.hollow = true;
33 painter.thickness = 16.0;
34 painter.set_color(SEA_GREEN + Srgba::WHITE * 0.25);
35 painter.rect(Vec2::splat(1024.0));
36
37 painter.rotate_z(time.elapsed_secs().sin());
38 painter.image(canvas.image.clone(), Vec2::splat(980.0));
39
40 painter.reset();
41}
35fn draw_circles(painter: &mut ShapePainter, radius: f32) {
36 painter.translate(-(Vec3::X + Vec3::NEG_Y) * f32::sqrt(radius) * 0.5);
37 painter.color = Color::srgba(1.0, 0.0, 0.0, 0.5);
38 painter.circle(radius);
39
40 painter.rotate_z(-TAU / 3.0);
41 painter.translate(Vec3::Y * radius * 1.2 + Vec3::Z * 0.0001);
42 painter.color = Color::srgba(0.0, 1.0, 0.0, 0.5);
43 painter.circle(radius);
44
45 painter.rotate_z(-TAU / 3.0);
46 painter.translate(Vec3::Y * radius * 1.2 + Vec3::Z * 0.0001);
47 painter.color = Color::srgba(0.0, 0.0, 1.0, 0.5);
48 painter.circle(radius);
49}
34fn draw_tree(time: f32, painter: &mut ShapePainter, depth: u32) {
35 if depth == 0 {
36 return;
37 }
38
39 let line_a = Vec3::Y + Vec3::X * 0.5;
40 painter.rotate_z(time.sin() * 0.2);
41 painter
42 .line(Vec3::ZERO, line_a)
43 .with_children(|child_painter| {
44 child_painter.translate(line_a);
45
46 draw_tree(time, child_painter, depth - 1);
47 });
48
49 let line_b = Vec3::Y + Vec3::NEG_X * 0.5;
50 painter.rotate_z(-time.sin() * 0.4);
51 painter
52 .line(Vec3::ZERO, line_b)
53 .with_children(|child_painter| {
54 child_painter.translate(line_b);
55
56 draw_tree(time, child_painter, depth - 1);
57 });
58}
24fn setup(mut commands: Commands, mut shapes: ShapeCommands, mut meshes: ResMut<Assets<Mesh>>) {
25 commands.spawn((
26 Camera3d::default(),
27 Transform::from_xyz(0., 0.0, 16.).looking_at(Vec3::ZERO, Vec3::Y),
28 Msaa::Off,
29 ));
30
31 // When spawning shapes as children of non-shape entities you can use `with_shape_children`
32 // This requires passing in a ShapeConfig, you can construct one yourself or
33 // take an existing one from a ShapePainter or ShapeCommands with .config()
34 commands
35 .spawn((Target, Transform::default(), Visibility::default()))
36 .with_shape_children(shapes.config(), |child_builder| {
37 for _ in 0..4 {
38 child_builder.rotate_z(PI / 2.0);
39 child_builder.line(Vec3::Y, Vec3::Y * 2.0);
40 }
41 });
42
43 let cube_handle = meshes.add(Mesh::from(Cuboid::new(0.2, 0.2, 0.2)));
44
45 // When spawning non-shapes as children of shapes you can use `with_children` like normal
46 shapes
47 .circle(0.2)
48 .insert((Target, Transform::default(), Visibility::default()))
49 .with_children(|child_builder| {
50 for i in 0..4 {
51 let transform = Transform::from_translation(
52 Quat::from_rotation_z(PI / 2.0 * i as f32 + PI / 4.0)
53 * Vec3::new(0.0, 1.0, 0.0),
54 );
55 child_builder.spawn((
56 Mesh3d(cube_handle.clone()),
57 MeshMaterial3d::<StandardMaterial>::default(),
58 transform,
59 ));
60 }
61 });
62}
Sourcepub fn set_scale(&mut self, scale: Vec3)
pub fn set_scale(&mut self, scale: Vec3)
Helper method to set the configs scale.
Examples found in repository?
More examples
Sourcepub fn set_canvas(&mut self, canvas: Entity)
pub fn set_canvas(&mut self, canvas: Entity)
Helper method to change shape render target to a canvas.
Also sets pipeline to Shape2d.
Examples found in repository?
More examples
42fn draw_shapes(time: Res<Time>, mut painter: ShapePainter, canvas: Single<(Entity, &Canvas)>) {
43 let (canvas_e, canvas) = canvas.into_inner();
44 painter.image(canvas.image.clone(), Vec2::splat(20.));
45
46 painter.set_canvas(canvas_e);
47 painter.hollow = true;
48 painter.thickness = 6.0;
49 painter.set_color(CRIMSON);
50 painter.translate(Vec3::Y * time.elapsed_secs().sin() * 256.0);
51 painter.circle(48.0);
52
53 painter.reset();
54}
32fn draw_canvas(time: Res<Time>, mut painter: ShapePainter, canvas: Single<Entity, With<Canvas>>) {
33 painter.rotate_z(time.elapsed_secs().sin());
34 painter.set_canvas(*canvas);
35 painter.set_color(WHITE * 2.0);
36 painter.translate(Vec3::NEG_Y * 12.0 * 16.0);
37 painter.thickness = 16.0;
38
39 for _ in 0..12 {
40 painter.translate(Vec3::Y * 32.0);
41 painter.line(Vec3::NEG_X * 256.0, Vec3::X * 256.0);
42 }
43 painter.reset();
44}
27fn draw_shapes(time: Res<Time>, mut painter: ShapePainter, canvas: Single<(Entity, &Canvas)>) {
28 let (canvas_e, canvas) = canvas.into_inner();
29 painter.image(canvas.image.clone(), Vec2::splat(12.));
30
31 painter.set_canvas(canvas_e);
32 painter.hollow = true;
33 painter.thickness = 16.0;
34 painter.set_color(SEA_GREEN + Srgba::WHITE * 0.25);
35 painter.rect(Vec2::splat(1024.0));
36
37 painter.rotate_z(time.elapsed_secs().sin());
38 painter.image(canvas.image.clone(), Vec2::splat(980.0));
39
40 painter.reset();
41}
Sourcepub fn without_transform(&self) -> Self
pub fn without_transform(&self) -> Self
Helper method to clone the config without it’s transform, useful when parenting.
Sourcepub fn set_color(&mut self, color: impl Into<Color>)
pub fn set_color(&mut self, color: impl Into<Color>)
Examples found in repository?
34fn draw_health_bar(painter: &mut ShapePainter, hp: f32) {
35 painter.translate(Vec3::Y * 0.7);
36 painter.corner_radii = Vec4::splat(0.3);
37
38 painter.set_color(GREEN * hp + RED * (1. - hp));
39 painter.rect(Vec2::new(0.2 + 0.8 * hp, 0.2));
40
41 painter.thickness = 0.02;
42 painter.hollow = true;
43 painter.color = Color::WHITE;
44 painter.rect(Vec2::new(1.06, 0.26));
45}
46
47fn draw_spheres(time: Res<Time>, mut painter: ShapePainter) {
48 for x in 0..SHAPES_PER_AXIS {
49 for y in 0..SHAPES_PER_AXIS {
50 let (x, y) = (x as f32, y as f32);
51 let offset = time.elapsed_secs() + x + 100. * y;
52 let position = Vec3::new(x * 2.0, offset.sin(), y * 2.0);
53
54 painter.hollow = false;
55 painter.set_color(GRAY);
56 painter.alignment = Alignment::Billboard;
57 painter.transform.translation = position;
58 painter.corner_radii = Vec4::splat(1.0);
59 painter.rect(Vec2::splat(1.0));
60
61 let hp = (offset.sin() + 1.) / 2.0;
62 draw_health_bar(&mut painter, hp);
63 }
64 }
65}
More examples
42fn draw_shapes(time: Res<Time>, mut painter: ShapePainter, canvas: Single<(Entity, &Canvas)>) {
43 let (canvas_e, canvas) = canvas.into_inner();
44 painter.image(canvas.image.clone(), Vec2::splat(20.));
45
46 painter.set_canvas(canvas_e);
47 painter.hollow = true;
48 painter.thickness = 6.0;
49 painter.set_color(CRIMSON);
50 painter.translate(Vec3::Y * time.elapsed_secs().sin() * 256.0);
51 painter.circle(48.0);
52
53 painter.reset();
54}
32fn draw_canvas(time: Res<Time>, mut painter: ShapePainter, canvas: Single<Entity, With<Canvas>>) {
33 painter.rotate_z(time.elapsed_secs().sin());
34 painter.set_canvas(*canvas);
35 painter.set_color(WHITE * 2.0);
36 painter.translate(Vec3::NEG_Y * 12.0 * 16.0);
37 painter.thickness = 16.0;
38
39 for _ in 0..12 {
40 painter.translate(Vec3::Y * 32.0);
41 painter.line(Vec3::NEG_X * 256.0, Vec3::X * 256.0);
42 }
43 painter.reset();
44}
27fn draw_shapes(time: Res<Time>, mut painter: ShapePainter, canvas: Single<(Entity, &Canvas)>) {
28 let (canvas_e, canvas) = canvas.into_inner();
29 painter.image(canvas.image.clone(), Vec2::splat(12.));
30
31 painter.set_canvas(canvas_e);
32 painter.hollow = true;
33 painter.thickness = 16.0;
34 painter.set_color(SEA_GREEN + Srgba::WHITE * 0.25);
35 painter.rect(Vec2::splat(1024.0));
36
37 painter.rotate_z(time.elapsed_secs().sin());
38 painter.image(canvas.image.clone(), Vec2::splat(980.0));
39
40 painter.reset();
41}
60fn draw_gallery(
61 time: Res<Time>,
62 mut painter: ShapePainter,
63 mut tree: Single<&mut Transform, With<Tree>>,
64) {
65 tree.rotation = Quat::from_rotation_z(time.elapsed_secs().sin() / 4.0);
66
67 // Position our painter relative to our tree entity
68 painter.transform = **tree;
69 painter.set_color(SEA_GREEN + WHITE * 0.25);
70 painter
71 .line(Vec3::ZERO, Vec3::Y)
72 .with_children(|child_painter| {
73 child_painter.translate(Vec3::Y);
74 draw_tree(time.elapsed_secs(), child_painter, 10);
75 });
76}
88fn draw_shapes(time: Res<Time>, mut painter: ShapePainter) {
89 painter.reset();
90 painter.render_layers = Some(RenderLayers::layer(1));
91 painter.hollow = true;
92 painter.transform.scale = Vec3::ONE * 3.0;
93
94 let meter_fill = (time.elapsed_secs().sin() + 1.0) / 2.0;
95 let meter_size = PI * 1.5;
96
97 let start_angle = -meter_size / 2.0;
98 let end_angle = -meter_size / 2.0 + meter_fill * meter_size;
99
100 painter.cap = Cap::Round;
101 painter.thickness = 0.4;
102 painter.set_color(CRIMSON * (1.0 / (0.5 + meter_fill)));
103 painter.arc(1.3, start_angle, end_angle);
104
105 painter.cap = Cap::None;
106 painter.thickness = 0.2;
107 painter.set_color(DARK_GRAY);
108 painter.arc(1.6, start_angle, -start_angle);
109 painter.arc(0.8, start_angle, -start_angle);
110
111 let offset = Quat::from_rotation_z(start_angle) * Vec3::Y * 1.1;
112 painter.translate(offset);
113 painter.arc(0.5, start_angle + PI * 1.5, start_angle + 2.5 * PI);
114 painter.translate(-offset);
115
116 painter.translate(Quat::from_rotation_z(-start_angle) * Vec3::Y * 1.1);
117 painter.arc(0.5, start_angle + PI, start_angle + 2.0 * PI);
118}
Trait Implementations§
Source§impl<'w, 's> Deref for ShapeCommands<'w, 's>
impl<'w, 's> Deref for ShapeCommands<'w, 's>
Source§impl<'w, 's> DerefMut for ShapeCommands<'w, 's>
impl<'w, 's> DerefMut for ShapeCommands<'w, 's>
Source§impl<'w, 's> ShapeSpawner<'w> for ShapeCommands<'w, 's>
impl<'w, 's> ShapeSpawner<'w> for ShapeCommands<'w, 's>
Source§fn spawn_shape(&mut self, bundle: impl Bundle) -> ShapeEntityCommands<'_, '_>
fn spawn_shape(&mut self, bundle: impl Bundle) -> ShapeEntityCommands<'_, '_>
ShapeBundle
does not include RenderLayers
as there is no support for optional components
so instead it is inserted in this function conditionally depending on the ShapeConfig
in self
Prefer the function for the shape you want over ShapeSpawner::spawn_shape
, e.g. commands.rect(...)
fn config(&self) -> &ShapeConfig
fn set_config(&mut self, config: ShapeConfig)
Source§impl SystemParam for ShapeCommands<'_, '_>
impl SystemParam for ShapeCommands<'_, '_>
Source§type Item<'w, 's> = ShapeCommands<'w, 's>
type Item<'w, 's> = ShapeCommands<'w, 's>
Self
, instantiated with new lifetimes. Read moreSource§fn init_state(world: &mut World, system_meta: &mut SystemMeta) -> Self::State
fn init_state(world: &mut World, system_meta: &mut SystemMeta) -> Self::State
World
access used by this SystemParam
and creates a new instance of this param’s State
.Source§unsafe fn new_archetype(
state: &mut Self::State,
archetype: &Archetype,
system_meta: &mut SystemMeta,
)
unsafe fn new_archetype( state: &mut Self::State, archetype: &Archetype, system_meta: &mut SystemMeta, )
Archetype
, registers the components accessed by this SystemParam
(if applicable).a Read moreSource§fn apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World)
fn apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World)
SystemParam
’s state.
This is used to apply Commands
during ApplyDeferred
.Source§fn queue(
state: &mut Self::State,
system_meta: &SystemMeta,
world: DeferredWorld<'_>,
)
fn queue( state: &mut Self::State, system_meta: &SystemMeta, world: DeferredWorld<'_>, )
ApplyDeferred
.Source§unsafe fn validate_param<'w, 's>(
state: &'s Self::State,
_system_meta: &SystemMeta,
_world: UnsafeWorldCell<'w>,
) -> Result<(), SystemParamValidationError>
unsafe fn validate_param<'w, 's>( state: &'s Self::State, _system_meta: &SystemMeta, _world: UnsafeWorldCell<'w>, ) -> Result<(), SystemParamValidationError>
Source§unsafe fn get_param<'w, 's>(
state: &'s mut Self::State,
system_meta: &SystemMeta,
world: UnsafeWorldCell<'w>,
change_tick: Tick,
) -> Self::Item<'w, 's>
unsafe fn get_param<'w, 's>( state: &'s mut Self::State, system_meta: &SystemMeta, world: UnsafeWorldCell<'w>, change_tick: Tick, ) -> Self::Item<'w, 's>
SystemParamFunction
. Read moreimpl<'w, 's> ReadOnlySystemParam for ShapeCommands<'w, 's>where
&'s mut ShapeConfig: ReadOnlySystemParam,
Commands<'w, 's>: ReadOnlySystemParam,
Res<'w, BaseShapeConfig>: ReadOnlySystemParam,
Auto Trait Implementations§
impl<'w, 's> Freeze for ShapeCommands<'w, 's>
impl<'w, 's> !RefUnwindSafe for ShapeCommands<'w, 's>
impl<'w, 's> Send for ShapeCommands<'w, 's>
impl<'w, 's> Sync for ShapeCommands<'w, 's>
impl<'w, 's> Unpin for ShapeCommands<'w, 's>
impl<'w, 's> !UnwindSafe for ShapeCommands<'w, 's>
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<'w, T> DiscSpawner<'w> for Twhere
T: ShapeSpawner<'w>,
impl<'w, T> DiscSpawner<'w> for Twhere
T: ShapeSpawner<'w>,
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<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