@@ -230,61 +230,4 @@ fn add_gizmo_markers(
230
230
) ) ;
231
231
} ) ;
232
232
}
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