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

Urdf import, export and workcell editor fixes #177

Merged
merged 142 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
116c451
First try at workcell to URDF
audrow Jul 27, 2023
bb09860
Add visual to urdf export
audrow Jul 31, 2023
ccb7915
Add collision
audrow Jul 31, 2023
57e9592
Merge branch 'main' into audrow/urdf-export
audrow Jul 31, 2023
dfbf3d3
Move convert Workcell to URDF int to_urdf
audrow Jul 31, 2023
5e376ea
Don't panic on unknown pose type
audrow Jul 31, 2023
c8ef823
Apply easy suggestions
audrow Aug 3, 2023
77883bd
Make pose simpler
audrow Aug 3, 2023
41e04ff
Use hashmap + remove unnecessary clones
audrow Aug 3, 2023
cba2ebc
Make saving approach consistent
audrow Aug 3, 2023
6c5999c
Make visual child of world frame
audrow Aug 18, 2023
abce8ec
Merge branch 'main' into audrow/urdf-export
audrow Aug 18, 2023
9b7391c
Remove workaround for upstream issue, minor cleanup
luca-della-vedova Aug 21, 2023
328e12d
Merge branch 'main' into audrow/urdf-export
audrow Aug 21, 2023
e021bbf
First draft of urdf import
luca-della-vedova Aug 22, 2023
021d8ec
Fix scale
luca-della-vedova Aug 22, 2023
8ab7273
Remove last spurious clone
luca-della-vedova Aug 23, 2023
bac76fd
Change urdf import to return a Result
luca-della-vedova Aug 23, 2023
6cf8fe0
Merge remote-tracking branch 'origin/main' into luca/urdf_import
luca-della-vedova Aug 23, 2023
dd975c1
Add builder for joint entities
luca-della-vedova Aug 23, 2023
20dfccc
Merge branch 'main' into luca/urdf_import
luca-della-vedova Aug 23, 2023
8ff3c40
Merge branch 'audrow/urdf-export' into luca/urdf_import
luca-della-vedova Aug 23, 2023
4c94cdc
Add skeleton of joint export and unit test
luca-della-vedova Aug 23, 2023
efe851a
WIP add omre unit tests
luca-della-vedova Aug 24, 2023
483051a
WIP Widget to create joint between frames
luca-della-vedova Aug 25, 2023
391b17d
Merge remote-tracking branch 'origin/main' into luca/urdf_import
luca-della-vedova Aug 25, 2023
ba17a1a
WIP Adding inspect joint type
luca-della-vedova Aug 25, 2023
2c31863
Add saving of joint and inertial data
luca-della-vedova Aug 25, 2023
5e2f1f2
Finish unit test for urdf round trip
luca-della-vedova Aug 28, 2023
4e5b0a2
Fix regression in model selectability
luca-della-vedova Aug 28, 2023
ae03855
Remove rapier, since it's currently unused
luca-della-vedova Aug 30, 2023
67990a3
Merge remote-tracking branch 'origin/main' into luca/urdf_import
luca-della-vedova Aug 30, 2023
f419f33
Usability improvements and corner cases
luca-della-vedova Aug 30, 2023
d33b375
Add cleanup for orphaned joints
luca-della-vedova Aug 30, 2023
4dc3e54
Change keybinding for urdf export
luca-della-vedova Aug 31, 2023
dce2235
Use overwrite_set for state transition
luca-della-vedova Aug 31, 2023
8b1c34d
Fix selectability for mesh primitives
luca-della-vedova Aug 31, 2023
33e62c4
Remove automatic joint creation when exporting urdf
luca-della-vedova Aug 31, 2023
e1d9cdd
Improve mesh primitive inspector, fixed missing exported primitives
luca-della-vedova Aug 31, 2023
25c74fe
Make mesh primitive inspector read only
luca-della-vedova Aug 31, 2023
3f563a0
Migrate all add_children except site loading ones
luca-della-vedova Sep 4, 2023
b662c41
Refactor site load to remove add_children
luca-della-vedova Sep 4, 2023
9c93a33
Style
luca-della-vedova Sep 4, 2023
1fec468
Style
luca-della-vedova Sep 4, 2023
a57b19f
Merge branch 'main' into luca/urdf_import
luca-della-vedova Sep 4, 2023
dea6af9
Change to set_parent when simpler
luca-della-vedova Sep 4, 2023
1fa4a60
Bump bevy dependencies
luca-della-vedova Sep 4, 2023
9b12049
Add event derive
luca-della-vedova Sep 4, 2023
807b1da
State derive and default implementation
luca-della-vedova Sep 4, 2023
2b0a115
Remove now unnecessary 's lifetimes
luca-della-vedova Sep 4, 2023
fe66b4a
Migrate visibility component to enum
luca-della-vedova Sep 4, 2023
02291dd
First stab at schedule migration
luca-della-vedova Sep 5, 2023
3b33e62
Migrate EguiContext
luca-della-vedova Sep 5, 2023
7496a38
Minor fixes
luca-della-vedova Sep 5, 2023
35561ef
ChangeTrackers -> Ref
luca-della-vedova Sep 5, 2023
94dc154
Remaining SiteUpdateLabel migration
luca-della-vedova Sep 5, 2023
cc624cf
First windows as entity migration
luca-della-vedova Sep 5, 2023
5284b48
Derive TypePath for new asset types
luca-della-vedova Sep 5, 2023
b6b6548
Fix visibility hidden variant
luca-della-vedova Sep 5, 2023
67777bf
Iron out more errors in visibility
luca-della-vedova Sep 5, 2023
4fdc267
Migrate State -> NextState
luca-della-vedova Sep 5, 2023
998b644
Keycode migration
luca-della-vedova Sep 5, 2023
a06a82e
Minor additional fixes
luca-della-vedova Sep 5, 2023
354f83e
Fix remaining "trivial" issues, remove Label and Constraint
luca-della-vedova Sep 5, 2023
f39a5fd
Merge remote-tracking branch 'origin/main' into luca/bevy_0.11
luca-della-vedova Sep 5, 2023
3203473
Merge remote-tracking branch 'origin/main' into luca/urdf_import
luca-della-vedova Sep 5, 2023
9ce87a9
Fix demo workcell
luca-della-vedova Sep 5, 2023
b57b53f
Rename MeshPrimitive -> PrimitiveShape
luca-della-vedova Sep 6, 2023
bff8258
Change mesh filename to an AssetSource
luca-della-vedova Sep 6, 2023
aa70ca6
origin -> center for inertials
luca-della-vedova Sep 6, 2023
9405bdc
Inertia -> Moment
luca-della-vedova Sep 6, 2023
422a610
Inertial -> Inertia
luca-della-vedova Sep 6, 2023
53357a6
Unify joint axis / type / limit into JointProperties
luca-della-vedova Sep 6, 2023
769d485
Fix broken reference when spawning models
luca-della-vedova Sep 6, 2023
7ae3ad6
Last renames for shape primitive
luca-della-vedova Sep 6, 2023
8109080
Use trashcan for previews to fix panics
luca-della-vedova Sep 6, 2023
5106453
VERY TENTATIVE Picking migration, tuple size splitting
luca-della-vedova Sep 6, 2023
4668b9e
Fix last compile errors
luca-della-vedova Sep 6, 2023
b858e0e
Style
luca-della-vedova Sep 6, 2023
2433e18
First version up and running
luca-della-vedova Sep 6, 2023
672203a
Restore mesh materials
luca-della-vedova Sep 6, 2023
a4cc047
Screen space coordinate inversion
luca-della-vedova Sep 6, 2023
0d9c594
Fix web build
luca-della-vedova Sep 6, 2023
6260eb6
Clear more deprecation warnings
luca-della-vedova Sep 6, 2023
429ba1a
Fix remaining web issues
luca-della-vedova Sep 7, 2023
f5d277c
WIP Use manual raycast for picking
luca-della-vedova Sep 7, 2023
c3a4595
Remove bevy_mod_picking
luca-della-vedova Sep 7, 2023
ca2eb28
Iron out picking issues
luca-della-vedova Sep 7, 2023
216c1a7
Fix stage for AssignOrphans systems
luca-della-vedova Sep 7, 2023
34e0300
Fix issue in measurement serde / display
luca-della-vedova Sep 7, 2023
e517652
Add support for pnm files
luca-della-vedova Sep 7, 2023
987f356
Fix CI
luca-della-vedova Sep 7, 2023
9ee896f
Fix interaction systems stage
luca-della-vedova Sep 7, 2023
9b7816c
Fix assign_drawing_parent_to_new_measurements
luca-della-vedova Sep 7, 2023
2e215ba
Fix panic when deleting entities
luca-della-vedova Sep 7, 2023
35a26d3
Fix web panics and window size
luca-della-vedova Sep 8, 2023
da71957
Add note about georeference module
luca-della-vedova Sep 8, 2023
74ffc6d
Move keyboard to Last stage to avoid double delete panic
luca-della-vedova Sep 8, 2023
aff96bf
Fix anchor visibility
luca-della-vedova Sep 8, 2023
26c4a36
Cleanup, remove SiteState
luca-della-vedova Sep 8, 2023
4c1bf8e
Address TODO for systemparam limit workaround
luca-della-vedova Sep 8, 2023
41a552a
Hotfix for wrong model parenthood in site editor mode
luca-della-vedova Sep 11, 2023
449cfbf
Fix fmt
luca-della-vedova Sep 11, 2023
c5af2df
Change workcell name to NameOfWorkcell component
luca-della-vedova Sep 14, 2023
1acd268
Fix mesh constraint behavior when moving models
luca-della-vedova Sep 15, 2023
fe9851e
Fix missing rotation update in anchor transforms
luca-della-vedova Sep 18, 2023
62bf2d9
Add model parent reassignment capability
luca-della-vedova Sep 18, 2023
e9e6a8d
WIP remove constraint dependent
luca-della-vedova Sep 18, 2023
a0c2f11
Cleanup select_anchor
luca-della-vedova Sep 18, 2023
8e61d9a
WIP Keep global transform in parent reassignment
luca-della-vedova Sep 18, 2023
dc0b201
Restore name in workcell for frames
luca-della-vedova Sep 18, 2023
c51bebb
Create a base link for new workcell models
luca-della-vedova Sep 18, 2023
f3572d2
Merge branch 'main' into luca/bevy_0.11
mxgrey Oct 6, 2023
fed859c
Switch to Reinhard tonemapping
mxgrey Oct 6, 2023
7121724
Update lockfile
mxgrey Oct 6, 2023
84536ca
Use previous default material roughness
mxgrey Oct 6, 2023
6612422
Merge branch 'reinhard' into roughness
mxgrey Oct 6, 2023
d0f0320
Fix colors
mxgrey Oct 6, 2023
36cc3f6
Merge branch 'main' into luca/urdf_import
luca-della-vedova Nov 7, 2023
d018dca
Merge branch 'main' into luca/bevy_0.11
luca-della-vedova Nov 7, 2023
805288a
Add wireframe to primitive shapes
luca-della-vedova Nov 7, 2023
50757d7
Allow snapping frames to primitive shapes
luca-della-vedova Nov 7, 2023
663370c
Fix cylinder top and bottom locations
luca-della-vedova Nov 9, 2023
ef0b692
Merge branch 'luca/bevy_0.11' into luca/urdf_import
luca-della-vedova Nov 10, 2023
63e3c95
Merge remote-tracking branch 'origin/main' into luca/urdf_import
luca-della-vedova Nov 10, 2023
51ca6ee
Remove unused code
luca-della-vedova Nov 14, 2023
090d750
Update bevy_mod_raycast and fix picking hierarchy
luca-della-vedova Nov 14, 2023
4667803
Undo irrelevant change
luca-della-vedova Nov 15, 2023
2680725
Add package:// sdf files support
luca-della-vedova Nov 20, 2023
a7dc02d
Remove duplicated dependencies
luca-della-vedova Nov 20, 2023
4b0b3b6
Export package instead of URDF (#187)
audrow Nov 21, 2023
02b6548
Fix directory issue and package parsing, minor cleanup
luca-della-vedova Nov 21, 2023
deab473
General cleanup
luca-della-vedova Nov 21, 2023
4c3bf08
Fix saving of primitive shapes
luca-della-vedova Nov 22, 2023
4af2c4d
Merge branch 'main' into luca/urdf_import
luca-della-vedova Nov 23, 2023
811232e
Merge branch 'main' into luca/urdf_import
luca-della-vedova Nov 23, 2023
564839a
Add menu item for urdf export
luca-della-vedova Nov 23, 2023
411042d
Fix render layer propagation for primitive shapes
luca-della-vedova Nov 23, 2023
9da7259
Create a default for joint names
luca-della-vedova Dec 19, 2023
84d7bf1
Scale down workcell anchors
luca-della-vedova Jan 11, 2024
ffe7fbf
Merge branch 'main' into luca/urdf_import
luca-della-vedova Jan 11, 2024
c1b2af4
Merge branch 'main' into luca/urdf_import
mxgrey Jan 23, 2024
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
1,264 changes: 762 additions & 502 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions assets/demo_workcells/demo.workcell.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,9 @@
"visuals": {
},
"collisions": {
},
"inertias": {
},
"joints": {
}
}
8 changes: 4 additions & 4 deletions rmf_site_editor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ path = "examples/extending_menu.rs"

[dependencies]
bevy_egui = "0.21"
bevy_mod_raycast = "0.13"
bevy_mod_raycast = "0.15"
bevy_mod_outline = "0.5"
bevy_infinite_grid = "0.8"
bevy_polyline = "0.7"
bevy_stl = "0.11"
bevy_obj = { version = "0.11", features = ["scene"] }
bevy_rapier3d = "0.22.0"
smallvec = "*"
serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.8.23"
Expand All @@ -33,7 +32,7 @@ wasm-bindgen = "=0.2.84"
futures-lite = "1.12.0"
bevy = { version = "0.11", features = ["pnm", "jpeg", "tga"] }
bevy_utils = "0.11"
dirs = "4.0"
dirs = "5.0"
thread_local = "*"
lyon = "1"
thiserror = "*"
Expand All @@ -46,9 +45,10 @@ tracing-subscriber = "0.3.1"
rfd = "0.12"
urdf-rs = "0.7"
utm = "0.1.6"
sdformat_rs = { git = "https://github.com/open-rmf/sdf_rust_experimental", rev = "f86344f"}
sdformat_rs = { git = "https://github.com/open-rmf/sdf_rust_experimental", rev = "a5daef0"}
gz-fuel = { git = "https://github.com/open-rmf/gz-fuel-rs", branch = "first_implementation" }
pathdiff = "*"
tera = "1.19.1"

# only enable the 'dynamic_linking' feature if we're not building for web or windows
# TODO(luca) it seems this can be enabled on windows, check
Expand Down
26 changes: 15 additions & 11 deletions rmf_site_editor/src/interaction/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
use crate::{
animate::*,
interaction::*,
site::{AnchorBundle, Pending, SiteAssets},
site::{AnchorBundle, Pending, SiteAssets, Trashcan},
};
use bevy::{ecs::system::SystemParam, prelude::*, window::PrimaryWindow};
use bevy_mod_raycast::{Ray3d, RaycastMesh, RaycastSource};
use rmf_site_format::{FloorMarker, Model, ModelMarker, WallMarker, WorkcellModel};
use bevy_mod_raycast::{deferred::RaycastMesh, deferred::RaycastSource, primitives::rays::Ray3d};
use rmf_site_format::{FloorMarker, Model, ModelMarker, PrimitiveShape, WallMarker, WorkcellModel};
use std::collections::HashSet;

/// A resource that keeps track of the unique entities that play a role in
Expand All @@ -36,6 +36,7 @@ pub struct Cursor {
pub level_anchor_placement: Entity,
pub site_anchor_placement: Entity,
pub frame_placement: Entity,
pub trashcan: Entity,
pub preview_model: Option<Entity>,
dependents: HashSet<Entity>,
/// Use a &str to label each mode that might want to turn the cursor on
Expand Down Expand Up @@ -107,10 +108,7 @@ impl Cursor {

fn remove_preview(&mut self, commands: &mut Commands) {
if let Some(current_preview) = self.preview_model {
commands
.entity(self.frame)
.remove_children(&[current_preview]);
commands.entity(current_preview).despawn_recursive();
commands.entity(current_preview).set_parent(self.trashcan);
}
}

Expand All @@ -133,9 +131,9 @@ impl Cursor {
) {
self.remove_preview(commands);
self.preview_model = if let Some(model) = model {
let cmd = commands.spawn(Pending);
let mut cmd = commands.spawn(Pending);
let e = cmd.id();
model.add_bevy_components(cmd);
model.add_bevy_components(&mut cmd);
commands.entity(self.frame).push_children(&[e]);
Some(e)
} else {
Expand Down Expand Up @@ -251,13 +249,16 @@ impl FromWorld for Cursor {
})
.id();

let trashcan = world.spawn(Trashcan).id();

Self {
frame: cursor,
halo,
dagger,
level_anchor_placement,
site_anchor_placement,
frame_placement,
trashcan,
preview_model: None,
dependents: Default::default(),
modes: Default::default(),
Expand All @@ -278,6 +279,7 @@ pub struct IntersectGroundPlaneParams<'w, 's> {
camera_controls: Res<'w, CameraControls>,
cameras: Query<'w, 's, &'static Camera>,
global_transforms: Query<'w, 's, &'static GlobalTransform>,
primary_window: Query<'w, 's, &'static Window, With<PrimaryWindow>>,
}

impl<'w, 's> IntersectGroundPlaneParams<'w, 's> {
Expand All @@ -287,7 +289,9 @@ impl<'w, 's> IntersectGroundPlaneParams<'w, 's> {
let e_active_camera = self.camera_controls.active_camera();
let active_camera = self.cameras.get(e_active_camera).ok()?;
let camera_tf = self.global_transforms.get(e_active_camera).ok()?;
let ray = Ray3d::from_screenspace(cursor_position, active_camera, camera_tf)?;
let primary_window = self.primary_window.get_single().ok()?;
let ray =
Ray3d::from_screenspace(cursor_position, active_camera, camera_tf, primary_window)?;
let n_p = Vec3::Z;
let n_r = ray.direction();
let denom = n_p.dot(n_r);
Expand All @@ -304,7 +308,7 @@ pub fn update_cursor_transform(
mode: Res<InteractionMode>,
cursor: Res<Cursor>,
raycast_sources: Query<&RaycastSource<SiteRaycastSet>>,
models: Query<(), With<ModelMarker>>,
models: Query<(), Or<(With<ModelMarker>, With<PrimitiveShape>)>>,
mut transforms: Query<&mut Transform>,
hovering: Res<Hovering>,
intersect_ground_params: IntersectGroundPlaneParams,
Expand Down
10 changes: 7 additions & 3 deletions rmf_site_editor/src/interaction/gizmo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/

use crate::interaction::*;
use bevy::{math::Affine3A, prelude::*};
use bevy_mod_raycast::{Ray3d, RaycastMesh, RaycastSource};
use bevy::{math::Affine3A, prelude::*, window::PrimaryWindow};
use bevy_mod_raycast::{deferred::RaycastMesh, deferred::RaycastSource, primitives::rays::Ray3d};
use rmf_site_format::Pose;

#[derive(Debug, Clone, Copy)]
Expand Down Expand Up @@ -363,6 +363,7 @@ pub fn update_drag_motions(
drag_state: Res<GizmoState>,
mut cursor_motion: EventReader<CursorMoved>,
mut move_to: EventWriter<MoveTo>,
primary_window: Query<&Window, With<PrimaryWindow>>,
) {
if let GizmoState::Dragging(dragging) = *drag_state {
let cursor_position = match cursor_motion.iter().last() {
Expand All @@ -381,7 +382,10 @@ pub fn update_drag_motions(
}
};

match Ray3d::from_screenspace(cursor_position, camera, &camera_tf) {
let Ok(primary_window) = primary_window.get_single() else {
return;
};
match Ray3d::from_screenspace(cursor_position, camera, &camera_tf, primary_window) {
Some(ray) => ray,
None => {
return;
Expand Down
13 changes: 3 additions & 10 deletions rmf_site_editor/src/interaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub use visual_cue::*;

use bevy::prelude::*;
use bevy_mod_outline::OutlinePlugin;
use bevy_mod_raycast::{DefaultRaycastingPlugin, RaycastSystem};
use bevy_mod_raycast::deferred::DeferredRaycastingPlugin;
use bevy_polyline::PolylinePlugin;

#[derive(Reflect)]
Expand Down Expand Up @@ -136,7 +136,7 @@ impl Plugin for InteractionPlugin {
apply_deferred.in_set(InteractionUpdateSet::CommandFlush),
)
.add_plugins(PolylinePlugin)
.add_plugins(DefaultRaycastingPlugin::<SiteRaycastSet>::default())
.add_plugins(DeferredRaycastingPlugin::<SiteRaycastSet>::default())
.init_resource::<InteractionAssets>()
.init_resource::<Cursor>()
.init_resource::<CameraControls>()
Expand Down Expand Up @@ -254,14 +254,7 @@ impl Plugin for InteractionPlugin {
)
.run_if(in_state(InteractionState::Enable)),
)
.add_systems(
First,
(
update_picked,
update_interaction_mode,
update_raycast_with_cursor.before(RaycastSystem::BuildRays::<SiteRaycastSet>),
),
);
.add_systems(First, (update_picked, update_interaction_mode));
}
}

Expand Down
3 changes: 2 additions & 1 deletion rmf_site_editor/src/interaction/outline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use bevy::render::view::RenderLayers;
use bevy_mod_outline::{OutlineBundle, OutlineRenderLayers, OutlineVolume, SetOutlineDepth};
use rmf_site_format::{
ConstraintMarker, DoorType, FiducialMarker, FloorMarker, LiftCabin, LightKind, LocationTags,
MeasurementMarker, ModelMarker, PhysicalCameraProperties, WallMarker,
MeasurementMarker, ModelMarker, PhysicalCameraProperties, PrimitiveShape, WallMarker,
};
use smallvec::SmallVec;

Expand Down Expand Up @@ -118,6 +118,7 @@ pub fn add_outline_visualization(
Added<PhysicalCameraProperties>,
Added<LightKind>,
Added<LocationTags>,
Added<PrimitiveShape>,
)>,
>,
) {
Expand Down
26 changes: 8 additions & 18 deletions rmf_site_editor/src/interaction/picking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

use crate::{interaction::*, site::Anchor, CurrentWorkspace};
use bevy::prelude::*;
use bevy_mod_raycast::{RaycastMethod, RaycastSource};
use bevy_mod_raycast::{
deferred::RaycastMethod, deferred::RaycastSource, immediate::RaycastVisibility,
};

/// A resource to track what kind of picking blockers are currently active
#[derive(Resource)]
Expand Down Expand Up @@ -72,9 +74,11 @@ pub fn update_picking_cam(
.remove::<RaycastSource<SiteRaycastSet>>();
}

commands
.entity(camera_controls.active_camera())
.insert(RaycastSource::<SiteRaycastSet>::new().with_early_exit(false));
commands.entity(camera_controls.active_camera()).insert(
RaycastSource::<SiteRaycastSet>::new_cursor()
.with_early_exit(false)
.with_visibility(RaycastVisibility::MustBeVisible),
);
}
}
}
Expand Down Expand Up @@ -115,20 +119,6 @@ fn pick_topmost(
return None;
}

// Update our `RaycastSource` with the current cursor position every frame.
pub fn update_raycast_with_cursor(
mut cursor: EventReader<CursorMoved>,
mut query: Query<&mut RaycastSource<SiteRaycastSet>>,
) {
// Grab the most recent cursor event if it exists:
let Some(cursor_moved) = cursor.iter().last() else {
return;
};
for mut pick_source in &mut query {
pick_source.cast_method = RaycastMethod::Screenspace(cursor_moved.position);
}
}

pub fn update_picked(
mode: Res<InteractionMode>,
selectable: Query<&Selectable>,
Expand Down
6 changes: 2 additions & 4 deletions rmf_site_editor/src/interaction/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

use crate::{interaction::*, site::Anchor};
use bevy::prelude::*;
use bevy_mod_raycast::RaycastMesh;
use bevy_mod_raycast::deferred::RaycastMesh;
use std::collections::HashSet;

/// This component is put on entities with meshes to mark them as items that can
Expand Down Expand Up @@ -236,9 +236,7 @@ pub fn maintain_hovered_entities(
// TODO(luca) refactor to remove this hack
// Skip if we are in SelectAnchor3D mode
if let InteractionMode::SelectAnchor3D(mode) = &*mode {
if mode.begin_creating() {
return;
}
return;
}
select.send(Select(Some(current_hovered)));
}
Expand Down
Loading