Skip to content

Commit

Permalink
Fix missed explicit conversions in examples (#11261)
Browse files Browse the repository at this point in the history
# Objective

A few of these were missed in #10878

## Solution

Fix em
  • Loading branch information
rparrett authored Jan 9, 2024
1 parent 9813e39 commit 9c972f0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions examples/2d/2d_shapes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn setup(
// Circle
commands.spawn(MaterialMesh2dBundle {
mesh: meshes.add(shape::Circle::new(50.)).into(),
material: materials.add(ColorMaterial::from(Color::PURPLE)),
material: materials.add(Color::PURPLE),
transform: Transform::from_translation(Vec3::new(-150., 0., 0.)),
..default()
});
Expand All @@ -38,15 +38,15 @@ fn setup(
// Quad
commands.spawn(MaterialMesh2dBundle {
mesh: meshes.add(shape::Quad::new(Vec2::new(50., 100.))).into(),
material: materials.add(ColorMaterial::from(Color::LIME_GREEN)),
material: materials.add(Color::LIME_GREEN),
transform: Transform::from_translation(Vec3::new(50., 0., 0.)),
..default()
});

// Hexagon
commands.spawn(MaterialMesh2dBundle {
mesh: meshes.add(shape::RegularPolygon::new(50., 6)).into(),
material: materials.add(ColorMaterial::from(Color::TURQUOISE)),
material: materials.add(Color::TURQUOISE),
transform: Transform::from_translation(Vec3::new(150., 0., 0.)),
..default()
});
Expand Down
4 changes: 2 additions & 2 deletions examples/2d/bloom_2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn setup(
commands.spawn(MaterialMesh2dBundle {
mesh: meshes.add(shape::Circle::new(100.)).into(),
// 4. Put something bright in a dark environment to see the effect
material: materials.add(ColorMaterial::from(Color::rgb(7.5, 0.0, 7.5))),
material: materials.add(Color::rgb(7.5, 0.0, 7.5)),
transform: Transform::from_translation(Vec3::new(-200., 0., 0.)),
..default()
});
Expand All @@ -59,7 +59,7 @@ fn setup(
commands.spawn(MaterialMesh2dBundle {
mesh: meshes.add(shape::RegularPolygon::new(100., 6)).into(),
// 4. Put something bright in a dark environment to see the effect
material: materials.add(ColorMaterial::from(Color::rgb(6.25, 9.4, 9.1))),
material: materials.add(Color::rgb(6.25, 9.4, 9.1)),
transform: Transform::from_translation(Vec3::new(200., 0., 0.)),
..default()
});
Expand Down
2 changes: 1 addition & 1 deletion examples/2d/mesh2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn setup(
commands.spawn(MaterialMesh2dBundle {
mesh: meshes.add(shape::Quad::default()).into(),
transform: Transform::default().with_scale(Vec3::splat(128.)),
material: materials.add(ColorMaterial::from(Color::PURPLE)),
material: materials.add(Color::PURPLE),
..default()
});
}
2 changes: 1 addition & 1 deletion examples/2d/mesh2d_vertex_color_texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn setup(
mesh: mesh_handle,
transform: Transform::from_translation(Vec3::new(96., 0., 0.))
.with_scale(Vec3::splat(128.)),
material: materials.add(ColorMaterial::from(texture_handle)),
material: materials.add(texture_handle),
..default()
});
}
4 changes: 2 additions & 2 deletions examples/2d/pixel_grid_snap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ fn setup_mesh(
) {
commands.spawn((
MaterialMesh2dBundle {
mesh: meshes.add(Mesh::from(shape::Capsule::default())).into(),
mesh: meshes.add(shape::Capsule::default()).into(),
transform: Transform::from_xyz(40., 0., 2.).with_scale(Vec3::splat(32.)),
material: materials.add(ColorMaterial::from(Color::BLACK)),
material: materials.add(Color::BLACK),
..default()
},
Rotate,
Expand Down
4 changes: 2 additions & 2 deletions examples/3d/transmission.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ fn setup(

let plane_mesh = meshes.add(shape::Plane::from_size(2.0));

let cylinder_mesh = meshes.add(Mesh::from(shape::Cylinder {
let cylinder_mesh = meshes.add(shape::Cylinder {
radius: 0.5,
height: 2.0,
resolution: 50,
segments: 1,
}));
});

// Cube #1
commands.spawn((
Expand Down

0 comments on commit 9c972f0

Please sign in to comment.