From ad5e86a06b136607bbe7afb41337ad497d8cd5f1 Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Sat, 9 Aug 2025 15:05:02 -0500 Subject: [PATCH] Begin removal of `Position` component The position component is redundant with the built-in Bevy Transform. I've updated the velocity integrator to use the transform directly. Physics still works, but things still set their initial locations through the Position component. I'll need to fix all those call sites. --- src/lib.rs | 1 - src/physics.rs | 17 +++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index f968fbc..3b58b94 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,7 +63,6 @@ impl Plugin for AsteroidPlugin { FixedPostUpdate, ( physics::integrate_velocity, - physics::update_positions, physics::apply_rotation_to_mesh, ) .run_if(in_state(GameState::Playing)), diff --git a/src/physics.rs b/src/physics.rs index 7d2021e..9adb4c4 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -25,16 +25,13 @@ pub(crate) struct Wrapping; /* Add velocity to position */ -pub(crate) fn integrate_velocity(mut query: Query<(&mut Position, &Velocity)>, time: Res