(autoformat)
This commit is contained in:
@@ -117,12 +117,14 @@ fn do_scan(
|
|||||||
match select_mode {
|
match select_mode {
|
||||||
SelectionMode::NearestSingle => todo!(),
|
SelectionMode::NearestSingle => todo!(),
|
||||||
SelectionMode::CircularArea => {
|
SelectionMode::CircularArea => {
|
||||||
let boids = spatial.shape_intersections(
|
let boids = spatial
|
||||||
|
.shape_intersections(
|
||||||
&Collider::circle(SCANRADIUS),
|
&Collider::circle(SCANRADIUS),
|
||||||
cursor_pos.translation.xy(),
|
cursor_pos.translation.xy(),
|
||||||
0.0,
|
0.0,
|
||||||
&SpatialQueryFilter::default()
|
&SpatialQueryFilter::default(),
|
||||||
).into_iter()
|
)
|
||||||
|
.into_iter()
|
||||||
.map(|entt| {
|
.map(|entt| {
|
||||||
let (tsfm, vel, _) = boids_query
|
let (tsfm, vel, _) = boids_query
|
||||||
.get(entt)
|
.get(entt)
|
||||||
@@ -141,9 +143,9 @@ fn do_scan(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ScannerMode::Velocity => {
|
ScannerMode::Velocity => {
|
||||||
if let Some(avg_velocity) = velocity_of_boids(boids.map(|item| {
|
if let Some(avg_velocity) =
|
||||||
(*item.1).xy() * 1.0
|
velocity_of_boids(boids.map(|item| (*item.1).xy() * 1.0))
|
||||||
})) {
|
{
|
||||||
// cursor_pos.translation is already in world space, so I can skip the window -> world transform like in update_cursor()
|
// cursor_pos.translation is already in world space, so I can skip the window -> world transform like in update_cursor()
|
||||||
gizmos.line_2d(
|
gizmos.line_2d(
|
||||||
cursor_pos.translation.xy(),
|
cursor_pos.translation.xy(),
|
||||||
|
|||||||
Reference in New Issue
Block a user