|
|
|
|
@ -261,7 +261,7 @@ fn hydrate_camera(
|
|
|
|
|
FogSettings { ..default() },
|
|
|
|
|
ScreenSpaceAmbientOcclusionBundle { ..default() },
|
|
|
|
|
TemporalAntiAliasSettings { ..default() },
|
|
|
|
|
MotionVectorPrepass { ..default() },
|
|
|
|
|
MotionVectorPrepass,
|
|
|
|
|
// Name::new("3D Camera"),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
@ -757,17 +757,14 @@ fn select(
|
|
|
|
|
.filter(|ev| ev.state == ButtonState::Pressed)
|
|
|
|
|
.for_each(|_| {
|
|
|
|
|
windows.iter().for_each(|window| {
|
|
|
|
|
window.cursor_position().map(|pos| {
|
|
|
|
|
cameras.iter().for_each(|(camera, gt)| {
|
|
|
|
|
camera.viewport_to_world(gt, pos).map(|ray| {
|
|
|
|
|
query
|
|
|
|
|
if let Some(pos) = window.cursor_position() { cameras.iter().for_each(|(camera, gt)| {
|
|
|
|
|
if let Some(ray) = camera.viewport_to_world(gt, pos) { query
|
|
|
|
|
.iter()
|
|
|
|
|
.filter_map(|(entity, handle, gt)| {
|
|
|
|
|
meshes.get(handle).map(|mesh| (entity, mesh, gt))
|
|
|
|
|
})
|
|
|
|
|
.for_each(|(entity, mesh, gt)| {
|
|
|
|
|
hit::intersects3d(&ray, mesh, gt).map(|_hit| {
|
|
|
|
|
selectable
|
|
|
|
|
if let Some(_hit) = hit::intersects3d(&ray, mesh, gt) { selectable
|
|
|
|
|
.iter()
|
|
|
|
|
.find_map(|(e, &board_index, &side)| {
|
|
|
|
|
// Check the side of the selection if no piece is selected
|
|
|
|
|
@ -794,15 +791,9 @@ fn select(
|
|
|
|
|
info!("Board index selected: {:?}", board_index);
|
|
|
|
|
selections
|
|
|
|
|
.send(game::Selection(board_index));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}); }
|
|
|
|
|
}); }
|
|
|
|
|
}); }
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|