use std::collections::HashMap; use avian2d::math::TAU; use avian2d::prelude::LinearVelocity; use bevy::log::debug; use bevy::math::ops::atan2; use bevy::prelude::{Component, Plugin, Transform}; use bevy::time::Time; use serde::{Deserialize, Serialize}; use crate::config::planet::{Planet, PlanetSpring, PlanetSpringJoint}; use crate::prelude::{App, Query, Res, Update, Without}; pub struct OrbitPlugin; impl Plugin for OrbitPlugin { fn build(&self, app: &mut App) { app.add_systems(Update, update_orbits); } } fn update_orbits( mut planets: Query<(&Planet, &Transform, &mut LinearVelocity), Without>, planets_2: Query<(&Planet, &Transform), Without>, mut planet_springs: Query<(&PlanetSpring, &mut Transform), Without>, time: Res