This commit is contained in:
rewin
2024-03-15 21:45:14 +03:00
parent d8c837fa1b
commit 96e15921ae
15 changed files with 67 additions and 38 deletions
+2 -8
View File
@@ -1,8 +1,4 @@
use bevy::{
core_pipeline::fxaa::Fxaa,
prelude::*,
render::view::RenderLayers,
};
use bevy::{core_pipeline::fxaa::Fxaa, prelude::*, render::view::RenderLayers};
use space_editor::space_editor_ui::camera_plugin::NotShowCamera;
use crate::MainCamera;
@@ -23,9 +19,7 @@ pub(super) fn spawn_gizmo_camera(
Name::new("Gizmo Camera"),
GizmoCamera,
Camera3dBundle {
camera_3d: Camera3d {
..default()
},
camera_3d: Camera3d { ..default() },
camera: Camera {
hdr: true,
order: 1,
+1 -2
View File
@@ -46,8 +46,7 @@ impl Plugin for GizmoPlugin {
app.add_systems(
PreUpdate,
spawn_gizmo_camera.run_if(
any_with_component::<MainCamera>
.and_then(not(any_with_component::<GizmoCamera>)),
any_with_component::<MainCamera>.and_then(not(any_with_component::<GizmoCamera>)),
),
);
app.add_systems(
+3 -1
View File
@@ -302,7 +302,9 @@ pub(super) fn on_rotate(
}
let view_plane_normal = (cam_xform.translation() - p1).normalize();
let hit_dist = ray.intersect_plane(p1, Plane3d::new(view_plane_normal)).unwrap();
let hit_dist = ray
.intersect_plane(p1, Plane3d::new(view_plane_normal))
.unwrap();
let p2 = ray.origin + ray.direction * hit_dist;
let drag_dist = (p2 - p1).length();
// TODO: Sensitivity could use some tuning