ignore (almost) stationary targets, they're probably ground-bound
This commit is contained in:
@@ -27,7 +27,7 @@ fn tripwire(
|
||||
mut commands: Commands,
|
||||
awacs: Query<(Entity, &Callsign, &Radio), (With<Awacs>, With<Blue>, With<Radio>)>,
|
||||
mut players: Query<(&Callsign, &Position, &RadioInfo, &mut Tripwire), With<Player>>,
|
||||
npc: Query<(&Id, &Position, &Heading), (Without<Player>, With<Red>)>,
|
||||
npc: Query<(&Id, &Position, &Heading, &Velocity), (Without<Player>, With<Red>)>,
|
||||
) {
|
||||
// get the players radio frequencies
|
||||
// match the tuned frequency with one of the awacs'
|
||||
@@ -44,9 +44,9 @@ fn tripwire(
|
||||
continue;
|
||||
}
|
||||
|
||||
for (n_id, n_position, n_heading) in npc.iter() {
|
||||
if n_position.angels() == 0 {
|
||||
// ignore on-ground units
|
||||
for (n_id, n_position, n_heading, n_velocity) in npc.iter() {
|
||||
if n_velocity.speed() < 10.0 {
|
||||
// ignore slow/on-ground units
|
||||
continue;
|
||||
}
|
||||
let distance = n_position.distance_to_nmi(p_position);
|
||||
|
||||
Reference in New Issue
Block a user