Skip to content

Commit

Permalink
Simplify how meshes are created
Browse files Browse the repository at this point in the history
Co-authored-by: Félix Lescaudey de Maneville <[email protected]>
  • Loading branch information
vladbat00 and ManevilleF authored Feb 19, 2024
1 parent 357822a commit aa1b23e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/render_to_image_widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fn setup(
egui_user_textures.add_image(image_handle.clone());
commands.insert_resource(CubePreviewImage(image_handle.clone()));

let cube_handle = meshes.add(Mesh::from(Cuboid::new(4.0, 4.0, 4.0)));
let cube_handle = meshes.add(Cuboid::new(4.0, 4.0, 4.0));
let default_material = StandardMaterial {
base_color: Color::rgb(0.8, 0.7, 0.6),
reflectance: 0.02,
Expand Down Expand Up @@ -115,7 +115,7 @@ fn setup(
.insert(preview_pass_layer);

let cube_size = 4.0;
let cube_handle = meshes.add(Mesh::from(Cuboid::new(cube_size, cube_size, cube_size)));
let cube_handle = meshes.add(Cuboid::new(cube_size, cube_size, cube_size));

let main_material_handle = materials.add(default_material);

Expand Down
4 changes: 2 additions & 2 deletions examples/side_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ fn setup_system(
mut materials: ResMut<Assets<StandardMaterial>>,
) {
commands.spawn(PbrBundle {
mesh: meshes.add(Mesh::from(Plane3d::default().mesh().size(5.0, 5.0))),
mesh: meshes.add(Plane3d::default().mesh().size(5.0, 5.0)),
material: materials.add(Color::rgb(0.3, 0.5, 0.3)),
..Default::default()
});
commands.spawn(PbrBundle {
mesh: meshes.add(Mesh::from(Cuboid::new(1.0, 1.0, 1.0))),
mesh: meshes.add(Cuboid::new(1.0, 1.0, 1.0)),
material: materials.add(Color::rgb(0.8, 0.7, 0.6)),
transform: Transform::from_xyz(0.0, 0.5, 0.0),
..Default::default()
Expand Down

0 comments on commit aa1b23e

Please sign in to comment.