Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add polylines and spheres for handling large worlds #152

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b67b072
Preliminary spawning of polylines for lanes
luca-della-vedova Jun 13, 2023
c3ae7fb
Adds support for offscreen rendering.
arjo129 Jun 21, 2023
2f5b6dc
Able to retrieve and debug a color selection buffer.
arjo129 Jun 23, 2023
a78996c
Get selection camera to follow main camera.
arjo129 Jun 23, 2023
983feac
Fix various resizing related issues.
arjo129 Jun 23, 2023
d91eb55
Adds a simple color picking shader.
arjo129 Jun 26, 2023
e48b0bb
Comments
arjo129 Jun 27, 2023
efa32f2
Clean ups
arjo129 Jul 7, 2023
6e35e8d
Minor fixes.
arjo129 Jul 11, 2023
96472de
Playing with bevy_points
arjo129 Jul 11, 2023
14418f5
Got fixed sized anchors working
arjo129 Jul 14, 2023
4929e7f
Make anchors pickable in screen space as well
arjo129 Jul 17, 2023
87f2994
Lane selecting works
arjo129 Jul 18, 2023
e9b1ccb
Rename
arjo129 Jul 18, 2023
6e00b78
Style
arjo129 Jul 18, 2023
5430079
Merge branch 'main' of github.com:open-rmf/rmf_site into arjo/feat/of…
arjo129 Jul 21, 2023
77198bd
Clean ups
arjo129 Jul 21, 2023
4c0b3ce
Get arrows to scale as well
arjo129 Jul 24, 2023
4596c76
style
arjo129 Jul 24, 2023
e53ea42
Refactoring out the scale factor
arjo129 Jul 28, 2023
cd75fc9
Refactoring out the scale factor
arjo129 Jul 28, 2023
4efd873
Refactoring the selection system out
arjo129 Jul 28, 2023
c0cbe57
Renaming files to make things more readable
arjo129 Jul 28, 2023
df93732
More refactors
arjo129 Jul 28, 2023
0c6179a
style
arjo129 Jul 28, 2023
4ec4d20
Yet another rename
arjo129 Jul 28, 2023
ae4b634
Remove expensive re-spawning that was being done.
arjo129 Aug 3, 2023
366adce
More refactoring
arjo129 Aug 3, 2023
795ca6e
Merge branch 'main' into arjo/feat/offscreen_rendering
arjo129 Aug 4, 2023
54e421e
Disable color picking
arjo129 Sep 29, 2023
23cfeae
Merge remote-tracking branch 'origin' into arjo/feat/offscreen_rendering
arjo129 Sep 29, 2023
6466fa0
Broke stuff
arjo129 Sep 29, 2023
425889d
Discovered why selection was not working.
arjo129 Oct 2, 2023
d5dbd97
ctually commit the sign flip code.
arjo129 Oct 2, 2023
a4083bf
Second attempt at integrating into the system
arjo129 Oct 2, 2023
33d2015
GPU picking seems to work for anchors
arjo129 Oct 2, 2023
dac8788
Style
arjo129 Oct 2, 2023
22ab07c
Style
arjo129 Oct 2, 2023
efaef70
Lane picking should work now
arjo129 Oct 3, 2023
667522e
Merge branch 'main' into arjo/feat/offscreen_rendering
arjo129 Oct 6, 2023
ef4d256
Clean ups
arjo129 Oct 6, 2023
0f1c1fc
Double perf with smaller texture
arjo129 Oct 6, 2023
c8dc723
Slight perf improvement
arjo129 Oct 6, 2023
3487b85
cargo fmt
arjo129 Oct 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 149 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion rmf_site_editor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ path = "examples/extending_menu.rs"
bevy_egui = "0.19"
bevy_mod_picking = "0.11"
bevy_mod_raycast = "0.7"
bevy_mod_outline = "0.3.3"
bevy_mod_outline = { git = "https://github.com/arjo129/bevy_mod_outline.git", branch= "09_compatibility"}
bevy_infinite_grid = "0.6"
bevy_polyline = "0.4"
bevy_stl = "0.7.0"
Expand Down Expand Up @@ -49,6 +49,12 @@ rfd = "0.11"
urdf-rs = "0.7"
utm = "0.1.6"
sdformat_rs = { git = "https://github.com/open-rmf/sdf_rust_experimental", rev = "f86344f"}
pollster = "0.3.0"
futures-intrusive = "0.5.0"
wgpu="0.14.2"
image = "0.24.6"
rand = "0.8.5"
bevy_points = "0.1.3"
gz-fuel = { git = "https://github.com/open-rmf/gz-fuel-rs", branch = "first_implementation" }
pathdiff = "*"

Expand Down
14 changes: 13 additions & 1 deletion rmf_site_editor/src/interaction/anchor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{
interaction::IntersectGroundPlaneParams,
interaction::*,
keyboard::DebugMode,
site::{Anchor, Category, Delete, Dependents, SiteAssets, Subordinate},
site::{Anchor, Category, Delete, Dependents, PointAsset, SiteAssets, Subordinate},
};
use bevy::prelude::*;

Expand All @@ -38,6 +38,8 @@ pub fn add_anchor_visual_cues(
>,
categories: Query<&Category>,
site_assets: Res<SiteAssets>,
point_assets: Res<PointAsset>,
interaction_assets: Res<InteractionAssets>,
) {
for (e, parent, subordinate, anchor) in &new_anchors {
let body_mesh = match categories.get(parent.get()).unwrap() {
Expand All @@ -47,13 +49,23 @@ pub fn add_anchor_visual_cues(
};

let mut entity_commands = commands.entity(e);
entity_commands.insert(LimitScaleFactor {
distance_to_start_scaling: 10.0,
original_scale: 1.0,
});
let body = entity_commands.add_children(|parent| {
let mut body = parent.spawn(PbrBundle {
mesh: body_mesh,
material: site_assets.passive_anchor_material.clone(),
..default()
});
body.insert(Selectable::new(e));
body.insert(MaterialMeshBundle {
mesh: point_assets.bevy_point_mesh.clone(),
material: point_assets.bevy_point_material.clone(),
..default()
});
body.insert(ScreenSpaceSelection::Point(e));
if subordinate.is_none() {
body.insert(DragPlaneBundle::new(e, Vec3::Z));
}
Expand Down
12 changes: 9 additions & 3 deletions rmf_site_editor/src/interaction/camera_controls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,19 @@ pub const HOVERED_OUTLINE_LAYER: u8 = 4;
/// The X-Ray layer is used to show visual cues that need to be rendered
/// above anything that would be obstructing them.
pub const XRAY_RENDER_LAYER: u8 = 5;
/// The Line Picking layer contains an entity based color map for picking
/// polylines which are drawn in screen space.
pub const LINE_PICKING_LAYER: u8 = 6;
/// The Line Picking layer contains an entity based color map for picking
/// points which are drawn in screen space.
pub const POINT_PICKING_LAYER: u8 = 7;
/// The Model Preview layer is used by model previews to spawn and render
/// models in the engine without having them being visible to general cameras
pub const MODEL_PREVIEW_LAYER: u8 = 6;
pub const MODEL_PREVIEW_LAYER: u8 = 8;

#[derive(Resource)]
struct MouseLocation {
previous: Vec2,
pub struct MouseLocation {
pub previous: Vec2,
}

impl Default for MouseLocation {
Expand Down
Loading