Fix: spatial tree update frequency is too low
The reubild frequency of the spatial tree was causing calculations to operate on old information. This is not the intended behavior. The default schedule seems to be to run every frame. I also lowered the debug pointer coefficient. Boids moving at a normal velocity are actually fast enough to draw a meaningful line. Maybe I'll switch it into some kind of exponential space so small changes are visible, and big changes don't draw a line all the way across the screen.
This commit is contained in:
@@ -159,7 +159,7 @@ fn do_scan(
|
||||
boids.iter().map(|item| {
|
||||
let entity_id = item.1.unwrap_or_else(|| panic!("Entity has no ID!"));
|
||||
let (_, vel, _) = boids_query.get(entity_id).unwrap_or_else(|_| panic!("Boid has no Velocity component!"));
|
||||
(*vel).xy() * 50.0
|
||||
(*vel).xy() * 1.0
|
||||
})
|
||||
) {
|
||||
// cursor_pos.translation is already in world space, so I can skip the window -> world transform like in update_cursor()
|
||||
|
||||
Reference in New Issue
Block a user