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.
This commit is contained in:
2025-08-09 15:26:28 -05:00
parent 2b1a0f386e
commit 877c7f93d7

View File

@@ -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<Time>) {
for (mut transform, velocity) in &mut query {
let delta = velocity.0 * time.delta_secs();