From 8a440d6e816a4bd02ee0971f3314ed6cfd486593 Mon Sep 17 00:00:00 2001 From: Joe Ardent Date: Sat, 15 Jun 2024 15:55:55 -0700 Subject: [PATCH] add prev vel to body --- src/action/mod.rs | 2 +- src/action/systems.rs | 4 ++-- src/bike/body.rs | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/action/mod.rs b/src/action/mod.rs index 879123b..3ec51f4 100644 --- a/src/action/mod.rs +++ b/src/action/mod.rs @@ -38,7 +38,7 @@ impl Plugin for CyberActionPlugin { reset_wheel_forces, cyber_lean, falling_cat, - input_forces, + wheel_forces, drag, ) .chain(), diff --git a/src/action/systems.rs b/src/action/systems.rs index 5c5827f..069876d 100644 --- a/src/action/systems.rs +++ b/src/action/systems.rs @@ -137,7 +137,7 @@ pub(super) fn wheel_forces( &mut PreviousVelocity, Option<&CyberSteering>, ), - With, + (With, Without), >, mut body_query: Query< ( @@ -146,7 +146,7 @@ pub(super) fn wheel_forces( &mut PreviousVelocity, &ReadMassProperties, ), - With, + (With, Without), >, wheel_config: Res, rapier_config: Res, diff --git a/src/bike/body.rs b/src/bike/body.rs index cd7ca9e..50a612b 100644 --- a/src/bike/body.rs +++ b/src/bike/body.rs @@ -8,7 +8,10 @@ use bevy_rapier3d::prelude::{ }; use super::{spawn_wheels, CyberBikeBody, Meshterial, WheelConfig, BIKE_BODY_COLLISION_GROUP}; -use crate::{action::CatControllerState, planet::PLANET_RADIUS}; +use crate::{ + action::{CatControllerState, PreviousVelocity}, + planet::PLANET_RADIUS, +}; pub(super) fn spawn_cyberbike( mut commands: Commands, @@ -63,6 +66,7 @@ pub(super) fn spawn_cyberbike( Sleeping::disabled(), Ccd { enabled: true }, ReadMassProperties::default(), + PreviousVelocity::default(), )) .insert(TransformInterpolation { start: None,