mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-24 08:26:01 +00:00
fmt
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user