add prev vel to body
This commit is contained in:
parent
ff9b1671b1
commit
8a440d6e81
3 changed files with 8 additions and 4 deletions
|
@ -38,7 +38,7 @@ impl Plugin for CyberActionPlugin {
|
||||||
reset_wheel_forces,
|
reset_wheel_forces,
|
||||||
cyber_lean,
|
cyber_lean,
|
||||||
falling_cat,
|
falling_cat,
|
||||||
input_forces,
|
wheel_forces,
|
||||||
drag,
|
drag,
|
||||||
)
|
)
|
||||||
.chain(),
|
.chain(),
|
||||||
|
|
|
@ -137,7 +137,7 @@ pub(super) fn wheel_forces(
|
||||||
&mut PreviousVelocity,
|
&mut PreviousVelocity,
|
||||||
Option<&CyberSteering>,
|
Option<&CyberSteering>,
|
||||||
),
|
),
|
||||||
With<CyberWheel>,
|
(With<CyberWheel>, Without<CyberBikeBody>),
|
||||||
>,
|
>,
|
||||||
mut body_query: Query<
|
mut body_query: Query<
|
||||||
(
|
(
|
||||||
|
@ -146,7 +146,7 @@ pub(super) fn wheel_forces(
|
||||||
&mut PreviousVelocity,
|
&mut PreviousVelocity,
|
||||||
&ReadMassProperties,
|
&ReadMassProperties,
|
||||||
),
|
),
|
||||||
With<CyberBikeBody>,
|
(With<CyberBikeBody>, Without<CyberWheel>),
|
||||||
>,
|
>,
|
||||||
wheel_config: Res<WheelConfig>,
|
wheel_config: Res<WheelConfig>,
|
||||||
rapier_config: Res<RapierConfiguration>,
|
rapier_config: Res<RapierConfiguration>,
|
||||||
|
|
|
@ -8,7 +8,10 @@ use bevy_rapier3d::prelude::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{spawn_wheels, CyberBikeBody, Meshterial, WheelConfig, BIKE_BODY_COLLISION_GROUP};
|
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(
|
pub(super) fn spawn_cyberbike(
|
||||||
mut commands: Commands,
|
mut commands: Commands,
|
||||||
|
@ -63,6 +66,7 @@ pub(super) fn spawn_cyberbike(
|
||||||
Sleeping::disabled(),
|
Sleeping::disabled(),
|
||||||
Ccd { enabled: true },
|
Ccd { enabled: true },
|
||||||
ReadMassProperties::default(),
|
ReadMassProperties::default(),
|
||||||
|
PreviousVelocity::default(),
|
||||||
))
|
))
|
||||||
.insert(TransformInterpolation {
|
.insert(TransformInterpolation {
|
||||||
start: None,
|
start: None,
|
||||||
|
|
Loading…
Reference in a new issue