be more brake-aggressive
This commit is contained in:
parent
6fd4f7c2e0
commit
9e63186aa5
1 changed files with 5 additions and 12 deletions
|
@ -2,16 +2,10 @@ use std::f32::consts::PI;
|
||||||
#[cfg(feature = "inspector")]
|
#[cfg(feature = "inspector")]
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
|
|
||||||
use bevy::{
|
use bevy::prelude::{Commands, Entity, Query, Res, ResMut, Time, Transform, Vec3, With, Without};
|
||||||
ecs::entity,
|
use bevy_rapier3d::prelude::{
|
||||||
prelude::{Commands, Entity, Quat, Query, Res, ResMut, Time, Transform, Vec3, With, Without},
|
CollisionGroups, ExternalForce, Group, MultibodyJoint, QueryFilter, RapierConfiguration,
|
||||||
};
|
RapierContext, ReadMassProperties, Velocity,
|
||||||
use bevy_rapier3d::{
|
|
||||||
prelude::{
|
|
||||||
CollisionGroups, ExternalForce, GenericJoint, Group, MultibodyJoint, QueryFilter,
|
|
||||||
RapierConfiguration, RapierContext, ReadMassProperties, RevoluteJoint, Velocity,
|
|
||||||
},
|
|
||||||
rapier::prelude::JointAxis,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(feature = "inspector")]
|
#[cfg(feature = "inspector")]
|
||||||
|
@ -92,7 +86,6 @@ pub(super) fn input_forces(
|
||||||
(With<CyberBikeBody>, Without<CyberSteering>),
|
(With<CyberBikeBody>, Without<CyberSteering>),
|
||||||
>,
|
>,
|
||||||
mut steering_query: Query<&mut MultibodyJoint, With<CyberSteering>>,
|
mut steering_query: Query<&mut MultibodyJoint, With<CyberSteering>>,
|
||||||
#[cfg(feature = "inspector")] mut debug_instant: ResMut<ActionDebugInstant>,
|
|
||||||
) {
|
) {
|
||||||
let (xform, mut forces) = body_query.single_mut();
|
let (xform, mut forces) = body_query.single_mut();
|
||||||
|
|
||||||
|
@ -104,7 +97,7 @@ pub(super) fn input_forces(
|
||||||
|
|
||||||
// brake
|
// brake
|
||||||
for mut motor in braking_query.iter_mut() {
|
for mut motor in braking_query.iter_mut() {
|
||||||
let factor = if input.brake { settings.accel } else { 0.0 };
|
let factor = if input.brake { 100.00 } else { 0.0 };
|
||||||
motor.data = (*motor
|
motor.data = (*motor
|
||||||
.data
|
.data
|
||||||
.as_revolute_mut()
|
.as_revolute_mut()
|
||||||
|
|
Loading…
Reference in a new issue