#![allow(unused_imports)] #![allow(unused_variables)] use bevy::diagnostic::{Diagnostics, FrameTimeDiagnosticsPlugin}; use bevy::prelude::*; use bevy_egui::{egui, EguiContext, EguiPlugin}; use bevy_fly_camera::{FlyCamera2d, FlyCameraPlugin}; use bevy_prototype_lyon::prelude::*; use derive_more::Deref; use starfall::astronomy::star::Star; use starfall::astronomy::star_subsystem::StarSubsystem; use starfall::astronomy::star_system::constraints::Constraints; use starfall::astronomy::star_system::StarSystem; use std::collections::HashMap; use std::f32::consts::PI; /* REWRITE #[derive(Default)] struct Stats { frame_number: usize, n_objects: usize, draw_traces: bool, } const GRAVITATIONAL_CONSTANT: f32 = 5.0; struct ClearTraces; struct Reset; #[derive(Component, Debug, Clone, Deref)] struct Velocity(Vec2); #[derive(Component, Debug, Clone)] struct Planet { radius: f32, mass: f32, color: Color, is_sun: bool, } #[derive(Component)] struct Trace { live_until: f64, } impl Planet {} fn gravity( mut commands: Commands, mut planet_query: Query<(Entity, &mut Planet, &mut Velocity, &mut Transform)>, mut stats: ResMut, time: Res