From 877c7f93d7588d0bc78e4e1c3309c226b11ac27f Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Sat, 9 Aug 2025 15:26:28 -0500 Subject: [PATCH] Drop TODO to combine phys fns, update docstring Replacing the `Position` component with direct manipulation of the transform functionally completed the TODO. The functions weren't exactly combined, but the resulting behavior might as well have been. I've updated the docstring to (exist, actually. yay syntax) describe the system accurately. --- src/physics.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/physics.rs b/src/physics.rs index c495330..503ce87 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -18,13 +18,7 @@ pub(crate) struct Rotation(pub(crate) f32); #[derive(Component)] pub(crate) struct Wrapping; -// TODO: Combine movement integration steps into one function -// They need to be ordered so the physics is deterministic. Bevy can enforce -// order, but it makes more sense to cut out the extra machinery and have one -// single function. Probably better for cache locality or whatever, too. -/* - Add velocity to position -*/ +/// Integrate linear velocity and update the entity's transform. pub(crate) fn integrate_velocity(mut query: Query<(&mut Transform, &Velocity)>, time: Res