use bevy::math::Vec3Swizzles; use bevy::{color::palettes::css, prelude::*, window::PresentMode}; use bevy_rapier2d::prelude::*; const TICK_RATE: f32 = 1.0 / 100.0; fn main() { App::new() .insert_resource(ClearColor( Srgba::rgb( 0xF9 as f32 / 255.0, 0xF9 as f32 / 255.0, 0xFF as f32 / 255.0, ) .into(), )) .insert_resource(Msaa::default()) .add_plugins(DefaultPlugins) //.add_plugin(bevy_editor_pls::EditorPlugin::new()) .add_plugins(bevy_inspector_egui::quick::WorldInspectorPlugin::default()) .insert_resource(bevy_framepace::FramepaceSettings { limiter: bevy_framepace::Limiter::Manual(std::time::Duration::from_secs_f64( TICK_RATE as f64, )), ..default() }) .add_plugins(RapierPhysicsPlugin::::pixels_per_meter(10.0)) .add_plugins(RapierDebugRenderPlugin::default()) .add_systems(Startup, setup_graphics) .add_systems(Startup, setup_translation) //.add_systems(Startup, setup_rotation) .add_systems(Update, spring_impulse) .register_type::() .run(); } fn setup_graphics(mut commands: Commands) { commands .spawn(Camera2dBundle { camera: Camera { is_active: true, ..default() }, transform: Transform::from_xyz(0.0, 300.0, 5.0), ..default() }) .insert(Name::new("Camera")); } #[derive(Debug, Copy, Clone, Component)] pub struct Spring { pub containing: Entity, } #[derive(Default, Debug, Copy, Clone, Component, Reflect)] #[reflect(Component)] pub struct SpringSettings(springy::Spring); /* pub fn spring_impulse( time: Res