Skip to content

Commit f9c500e

Browse files
clean: remove unnecessary code
1 parent fd3f4c7 commit f9c500e

File tree

2 files changed

+5
-65
lines changed

2 files changed

+5
-65
lines changed

crates/bevy_editor_pls_default_windows/src/cameras/mod.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ pub struct EditorCamera;
2929
// Present only one the one currently active camera
3030
#[derive(Component)]
3131
pub struct ActiveEditorCamera;
32-
// /// Changed to a type alias to guarentee being in sync with the GizmoCamera component,
33-
// /// this should be considered a 'hack' that maybe should be fixed down the line
34-
// pub type ActiveEditorCamera = transform_gizmo_bevy::GizmoCamera;
3532

3633
// Marker component for the 3d free camera
3734
#[derive(Component)]
@@ -172,7 +169,7 @@ fn set_active_editor_camera_marker(world: &mut World, editor_cam: EditorCamKind)
172169
state.iter(world).next().unwrap()
173170
}
174171
};
175-
world.entity_mut(entity).insert(ActiveEditorCamera {});
172+
world.entity_mut(entity).insert(ActiveEditorCamera);
176173
}
177174

178175
fn cameras_ui(ui: &mut egui::Ui, world: &mut World) {
@@ -503,21 +500,21 @@ fn initial_camera_setup(
503500
camera_state.editor_cam = EditorCamKind::D2PanZoom;
504501
commands
505502
.entity(cameras.p0().single().0)
506-
.insert(ActiveEditorCamera {});
503+
.insert(ActiveEditorCamera);
507504
*has_decided_initial_cam = true;
508505
}
509506
(false, true) => {
510507
camera_state.editor_cam = EditorCamKind::D3PanOrbit;
511508
commands
512509
.entity(cameras.p2().single().0)
513-
.insert(ActiveEditorCamera {});
510+
.insert(ActiveEditorCamera);
514511
*has_decided_initial_cam = true;
515512
}
516513
(true, true) => {
517514
camera_state.editor_cam = EditorCamKind::D3PanOrbit;
518515
commands
519516
.entity(cameras.p2().single().0)
520-
.insert(ActiveEditorCamera {});
517+
.insert(ActiveEditorCamera);
521518
*has_decided_initial_cam = true;
522519
}
523520
(false, false) => return,

crates/bevy_editor_pls_default_windows/src/gizmos.rs

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -230,61 +230,4 @@ fn add_gizmo_markers(
230230
));
231231
});
232232
}
233-
}
234-
235-
// fn draw_gizmo(
236-
// ui: &mut egui::Ui,
237-
// world: &mut World,
238-
// selected_entities: &SelectedEntities,
239-
// gizmo_mode: GizmoMode,
240-
// ) {
241-
// for entity in selected_entities.iter() {
242-
// world.entity_mut(entity).insert(transform_gizmo_bevy::GizmoTarget::default());
243-
// info!("Inserted GizmoTarget to entity: {:?}", entity);
244-
// }
245-
// // let Ok((cam_transform, projection)) = world
246-
// // .query_filtered::<(&GlobalTransform, &Projection), With<ActiveEditorCamera>>()
247-
// // .get_single(world)
248-
// // else {
249-
// // return;
250-
// // };
251-
// // let view_matrix = Mat4::from(cam_transform.affine().inverse());
252-
// // let projection_matrix = projection.get_projection_matrix();
253-
254-
// // if selected_entities.len() != 1 {
255-
// // return;
256-
// // }
257-
258-
// // for selected in selected_entities.iter() {
259-
// // // let Some(global_transform) = world.get::<GlobalTransform>(selected) else {
260-
// // // continue;
261-
// // // };
262-
// // // let model_matrix = global_transform.compute_matrix();
263-
264-
// // // let Some(result) = transform_gizmo_bevy::Gizmo::new(selected)
265-
// // // .model_matrix(model_matrix.into())
266-
// // // .view_matrix(view_matrix.into())
267-
// // // .projection_matrix(projection_matrix.into())
268-
// // // .orientation(transform_gizmo_bevy::GizmoOrientation::Local)
269-
// // // .mode(gizmo_mode)
270-
// // // .interact(ui)
271-
// // // else {
272-
// // // continue;
273-
// // // };
274-
275-
// // // let global_affine = global_transform.affine();
276-
277-
// // // let mut transform = world.get_mut::<Transform>(selected).unwrap();
278-
279-
// // // let parent_affine = global_affine * transform.compute_affine().inverse();
280-
// // // let inverse_parent_transform = GlobalTransform::from(parent_affine.inverse());
281-
282-
// // // let global_transform = Transform {
283-
// // // translation: result.translation.into(),
284-
// // // rotation: result.rotation.into(),
285-
// // // scale: result.scale.into(),
286-
// // // };
287-
288-
// // // *transform = (inverse_parent_transform * global_transform).into();
289-
// // }
290-
// }
233+
}

0 commit comments

Comments
 (0)