remove debug code

This commit is contained in:
yuni 2024-04-02 07:22:40 +02:00
parent d3df885e65
commit 868668ab43

View file

@ -1,4 +1,4 @@
use crate::{actor, nature, settings, hud};
use crate::{actor, nature, settings};
use bevy::prelude::*;
use bevy::render::render_resource::{AsBindGroup, ShaderRef};
use bevy::math::{DVec3, I64Vec3};
@ -184,7 +184,6 @@ fn spawn_despawn_asteroids(
asset_server: Res<AssetServer>,
mut q_asteroid: Query<(Entity, &mut Visibility), With<Asteroid>>,
mut last_player_cell: Local<I64Vec3>,
mut log: ResMut<hud::Log>,
) {
if !timer.0.tick(time.delta()).just_finished() || q_player.is_empty() {
//if q_player.is_empty() {
@ -201,10 +200,6 @@ fn spawn_despawn_asteroids(
}
*last_player_cell = player_cell;
let mut spawned = 0;
let mut spawned_near = 0;
let mut despawned = 0;
// Parameters
let view_radius: f64 = ASTEROID_VIEW_RADIUS;
let step: f64 = ASTEROID_SPAWN_STEP;
@ -230,7 +225,6 @@ fn spawn_despawn_asteroids(
entity: asteroid.entity,
origin: origin.clone(),
});
despawned += 1;
despawning_worked = true;
break;
}
@ -290,8 +284,6 @@ fn spawn_despawn_asteroids(
if dist > 6.0 {
continue;
}
dbg!(size_density, dist);
spawned_near += 1;
}
let size: f32 = ASTEROID_SIZE_FACTOR * size_density;
@ -336,13 +328,9 @@ fn spawn_despawn_asteroids(
entity: entity_commands.id(),
//viewdistance: 99999999.0,
});
spawned += 1;
}
}
}
if spawned != 0 || despawned != 0 {
//log.notice(format!("spawned: {spawned} (near: {spawned_near}), despawned: {despawned}"));
}
}
fn handle_despawn(