boundary padding
This commit is contained in:
parent
0009a83b1d
commit
3cab0eecd5
1 changed files with 6 additions and 4 deletions
|
@ -12,10 +12,12 @@ pub(crate) fn boid_border_teleport(
|
||||||
let half_width = width / 2.;
|
let half_width = width / 2.;
|
||||||
let half_height = height / 2.;
|
let half_height = height / 2.;
|
||||||
|
|
||||||
let left_bound = -half_width;
|
const PADDING: f32 = 50.;
|
||||||
let right_bound = half_width;
|
|
||||||
let top_bound = half_height;
|
let left_bound = -half_width - PADDING;
|
||||||
let bottom_bound = -half_height;
|
let right_bound = half_width + PADDING;
|
||||||
|
let top_bound = half_height + PADDING;
|
||||||
|
let bottom_bound = -half_height - PADDING;
|
||||||
|
|
||||||
for mut boid_transform in &mut boids {
|
for mut boid_transform in &mut boids {
|
||||||
let translation = &mut boid_transform.translation;
|
let translation = &mut boid_transform.translation;
|
||||||
|
|
Loading…
Reference in a new issue