Skip to content

Commit

Permalink
clean up examples
Browse files Browse the repository at this point in the history
  • Loading branch information
IceSentry committed Jan 26, 2024
1 parent 81172b3 commit a724608
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
17 changes: 9 additions & 8 deletions examples/linestrip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,19 @@ fn setup(
..Default::default()
});

// circular base
commands.spawn(PbrBundle {
mesh: meshes.add(Mesh::from(shape::Plane::from_size(5.0))),
material: standard_materials.add(Color::rgb(0.3, 0.5, 0.3).into()),
transform: Transform::from_xyz(0.0, -0.5, 0.0),
..Default::default()
mesh: meshes.add(shape::Circle::new(4.0).into()),
material: standard_materials.add(Color::WHITE.into()),
transform: Transform::from_rotation(Quat::from_rotation_x(-std::f32::consts::FRAC_PI_2))
.with_translation(Vec3::new(0.0, -0.5, 0.0)),
..default()
});

// cube
commands.spawn(PbrBundle {
mesh: meshes.add(Mesh::from(shape::Cube { size: 1.0 })),
material: standard_materials.add(Color::rgb(0.8, 0.7, 0.6).into()),
..Default::default()
mesh: meshes.add(shape::Cube { size: 1.0 }.into()),
material: standard_materials.add(Color::rgb_u8(124, 144, 255).into()),
..default()
});

// light
Expand Down
2 changes: 1 addition & 1 deletion examples/nbody.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn main() {
Update,
((nbody_system, update_trails).chain(), rotator_system),
)
.add_plugins(FrameTimeDiagnosticsPlugin::default())
.add_plugins(FrameTimeDiagnosticsPlugin)
.add_plugins(LogDiagnosticsPlugin::default())
.run();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/perspective.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fn toggle_perspective(
mut polyline_materials: ResMut<Assets<PolylineMaterial>>,
keyboard_input: Res<Input<KeyCode>>,
) {
for (_, mut mat) in polyline_materials.iter_mut() {
for (_, mat) in polyline_materials.iter_mut() {
if keyboard_input.just_pressed(KeyCode::X) {
mat.perspective = !mat.perspective;
}
Expand Down

0 comments on commit a724608

Please sign in to comment.