use beetmash::prelude::*; use bevy::prelude::*; use std::f32::consts::TAU; fn main() { App::new() .add_plugins(DefaultPlugins) .add_systems(Startup, setup) .add_systems(Update, update) .run(); } #[derive(Resource)] struct Entities { pos_a: Entity, pos_b: Entity, pos_c: Entity, } fn setup( mut commands: Commands, mut meshes: ResMut>, mut materials: ResMut>, ) { // light commands.spawn(( PointLight { shadows_enabled: true, ..default() }, Transform::from_xyz(4.0, 8.0, 4.0), )); // camera commands.spawn(( Camera3d::default(), Transform::from_xyz(-2.5, 4.5, 9.0).looking_at(Vec3::ZERO, Vec3::Y), )); // cube let pos_a = commands .spawn(( Mesh3d(meshes.add(Cuboid::new(1.0, 1.0, 1.0))), MeshMaterial3d(materials.add(Color::srgb_u8(255, 0, 255))), Transform::from_xyz(0.0, 0., 0.0), )) .id(); let pos_b = commands .spawn(( Mesh3d(meshes.add(Cuboid::new(1.0, 1.0, 1.0))), MeshMaterial3d(materials.add(Color::srgb_u8(255, 255, 0))), Transform::from_xyz(0.0, 0.5, 0.0), )) .id(); let pos_c = commands .spawn(( Mesh3d(meshes.add(Cuboid::new(1.0, 1.0, 1.0))), MeshMaterial3d(materials.add(Color::srgb_u8(0, 255, 255))), Transform::from_xyz(0.5, 0.5, 0.0), )) .id(); commands.insert_resource(Entities { pos_a, pos_b, pos_c, }); } fn update( time: Res