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

Improved camera controls #218

Merged
merged 36 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
00176b8
Refactor camera_control to distinguish camera state from user input s…
reuben-thomas May 21, 2024
fd6f4fa
Selection based pan, zoom, orbit for perspective camera
reuben-thomas May 27, 2024
6b5d790
Preserve cursor selection between camera control updates, corrected p…
reuben-thomas May 28, 2024
2b3da96
Reverted to prior orbit method
reuben-thomas May 29, 2024
4b21ea4
Add orthographic control with rotation
reuben-thomas May 29, 2024
b85c3cb
Added selection based orthographic panning, support fov zoom
reuben-thomas May 30, 2024
51ba52b
Fix styling
reuben-thomas May 30, 2024
0726cb2
fixed picking based orbits
reuben-thomas May 30, 2024
b806ef6
update cursor command type
reuben-thomas May 31, 2024
fb63ade
orbit camera around fixed point
reuben-thomas Jun 3, 2024
e6fd8a3
fix styling, stability when camera horizontal
reuben-thomas Jun 3, 2024
addc613
fix stability near small angles
reuben-thomas Jun 5, 2024
a8b04af
Selectable orbit center
reuben-thomas Jun 9, 2024
593a7af
Add marker with depth bias
reuben-thomas Jun 10, 2024
b0cd322
add wireframe sphere and persistent dot as orbit marker
reuben-thomas Jun 11, 2024
387f6b3
keyboard camera control prototype
reuben-thomas Jun 11, 2024
e3d5149
keyboard controls
reuben-thomas Jun 11, 2024
d798f98
fix styling
reuben-thomas Jun 12, 2024
465b9c3
orbit around cursor initital selection
reuben-thomas Jun 14, 2024
7939a27
orbit proportional to cursor direction
reuben-thomas Jun 14, 2024
c437a87
proportional orbits
reuben-thomas Jun 14, 2024
ddf5aa2
consistent camera controls, selecting orbit center from plane ahead
reuben-thomas Jun 17, 2024
513839c
Merge branch 'main' into main
mxgrey Jun 19, 2024
c17bef5
Clear deltas as they get used and stay in control mode when cursor ex…
mxgrey Jun 19, 2024
5febdd6
don't use cursor selection for orbits
reuben-thomas Jun 19, 2024
d63be04
show selection for both orbits and panning
reuben-thomas Jun 19, 2024
bbd6eb4
Merge branch 'camera_controls' of github.com:open-rmf/rmf_site
reuben-thomas Jun 19, 2024
f4429a9
address review comments: fixed new file dates, cleaned dead code
reuben-thomas Jun 19, 2024
2be0ed9
smoothen zoom while panning
reuben-thomas Jun 19, 2024
aeec885
ignore egui panels for keyboard camera control
reuben-thomas Jun 20, 2024
431cc99
ignore egui borders for camera zoom
reuben-thomas Jun 20, 2024
52ce07e
address review comments
reuben-thomas Jun 21, 2024
ff4f21a
reduce duplicate code
reuben-thomas Jun 21, 2024
3840065
Fix merge with main
mxgrey Jun 24, 2024
c09e359
Merge pull request #2 from open-rmf/camera_controls
reuben-thomas Jun 27, 2024
09b5bf0
fix styling
reuben-thomas Jul 2, 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,138 changes: 486 additions & 652 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions rmf_site_editor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ gz-fuel = { git = "https://github.com/open-rmf/gz-fuel-rs", branch = "main" }
pathdiff = "*"
tera = "1.19.1"
ehttp = { version = "0.4", features = ["native-async"] }
nalgebra = "0.32.5"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
clap = { version = "4.0.10", features = ["color", "derive", "help", "usage", "suggestions"] }
Expand Down
25 changes: 25 additions & 0 deletions rmf_site_editor/src/interaction/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ use bevy_polyline::{
material::PolylineMaterial,
polyline::{Polyline, PolylineBundle},
};
use shape::UVSphere;

#[derive(Clone, Debug, Resource)]
pub struct InteractionAssets {
pub dagger_mesh: Handle<Mesh>,
pub dagger_material: Handle<StandardMaterial>,
pub halo_mesh: Handle<Mesh>,
pub halo_material: Handle<StandardMaterial>,
pub camera_control_mesh: Handle<Mesh>,
pub camera_control_orbit_material: Handle<StandardMaterial>,
pub camera_control_pan_material: Handle<StandardMaterial>,
pub arrow_mesh: Handle<Mesh>,
pub point_light_socket_mesh: Handle<Mesh>,
pub point_light_shine_mesh: Handle<Mesh>,
Expand Down Expand Up @@ -224,6 +228,10 @@ impl FromWorld for InteractionAssets {
let mut meshes = world.get_resource_mut::<Assets<Mesh>>().unwrap();
let dagger_mesh = meshes.add(make_dagger_mesh());
let halo_mesh = meshes.add(make_halo_mesh());
let camera_control_mesh = meshes.add(Mesh::from(UVSphere {
radius: 0.02,
..Default::default()
}));
let arrow_mesh = meshes.add(make_cylinder_arrow_mesh());
let point_light_socket_mesh = meshes.add(
make_cylinder(0.06, 0.02)
Expand Down Expand Up @@ -298,10 +306,24 @@ impl FromWorld for InteractionAssets {
});
let dagger_material = materials.add(StandardMaterial {
base_color: Color::WHITE,
emissive: Color::WHITE,
perceptual_roughness: 0.089,
metallic: 0.01,
..default()
});
let camera_control_orbit_material = materials.add(StandardMaterial {
base_color: Color::GREEN,
emissive: Color::GREEN,
depth_bias: f32::MAX,
unlit: true,
..default()
});
let camera_control_pan_material = materials.add(StandardMaterial {
base_color: Color::WHITE,
emissive: Color::WHITE,
unlit: true,
..default()
});
let light_cover_color = Color::rgb(0.6, 0.7, 0.8);
let physical_light_cover_material = materials.add(StandardMaterial {
base_color: light_cover_color,
Expand Down Expand Up @@ -401,6 +423,9 @@ impl FromWorld for InteractionAssets {
dagger_material,
halo_mesh,
halo_material,
camera_control_mesh,
camera_control_orbit_material,
camera_control_pan_material,
arrow_mesh,
point_light_socket_mesh,
point_light_shine_mesh,
Expand Down
Loading
Loading