Skip to content

Commit

Permalink
Clean ups
Browse files Browse the repository at this point in the history
Signed-off-by: Arjo Chakravarty <[email protected]>
  • Loading branch information
arjo129 committed Jul 21, 2023
1 parent 5430079 commit 77198bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 6 additions & 7 deletions rmf_site_editor/src/site/offscreen_render_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,11 @@ pub fn buffer_to_selection<const Layer: u8>(
if let Some(entity) = color_map.get_entity(&(pixel.0[0], pixel.0[1], pixel.0[2])) {
if Layer == POINT_PICKING_LAYER {
let Ok((_, parent)) = selections.get(*entity) else {
println!("No parent found");
error!("No parent found");
continue;
};
let Ok(_) = anchors.get(parent.get()) else {
println!("Not an anchor");
error!("Not an anchor");
continue;
};
if (mouse_button_input.just_released(MouseButton::Left)) {
Expand All @@ -240,24 +240,23 @@ pub fn buffer_to_selection<const Layer: u8>(
}
}

if Layer == LINE_PICKING_LAYER {
/*if Layer == LINE_PICKING_LAYER {
// TODO(arjoc): Make picker contain parent entity
let result: Vec<_> = lane_segments
.iter()
.filter(|(_, segment)| segment.picker == *entity)
.collect();
if result.len() > 0usize {
println!("Not a lane segment");
if result.len() == 0usize {
continue;
}
}
if mouse_button_input.just_released(MouseButton::Left) {
select_event.send(Select(Some(*entity)));
} else {
hover_event.send(Hover(Some(*entity)));
}
}
}*/
} else {
println!("Uh-oh can't find color {:?}", pixel);
//Color::as_linear_rgba_f32(self)
Expand Down
4 changes: 3 additions & 1 deletion rmf_site_editor/src/site/screenspace_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use crate::interaction::{LINE_PICKING_LAYER, POINT_PICKING_LAYER};

use super::{ImageToSave, PointAsset};

const SCREEN_SPACE_POINT_SIZE_SELECTION: f32 = 40.0;

#[derive(Debug, Clone)]
pub struct ScreenspacePolyline {
pub start: Vec3,
Expand Down Expand Up @@ -98,7 +100,7 @@ impl ColorEntityMap {
let color = Color::rgb_u8(r, g, b);

let material = point_materials.add(PointsMaterial {
point_size: 70.0, // Defines the size of the points.
point_size: SCREEN_SPACE_POINT_SIZE_SELECTION, // Defines the size of the points.
perspective: false, // Specify whether points' size is attenuated by the camera depth.
circle: true,
use_vertex_color: false,
Expand Down

0 comments on commit 77198bd

Please sign in to comment.