New formatting fix

This commit is contained in:
Aevyrie 2023-10-23 00:44:07 -07:00
parent 21b9f31288
commit 8118c11980
2 changed files with 9 additions and 5 deletions

View File

@ -44,11 +44,11 @@ fn setup(
..default() ..default()
}, },
GridCell::<i128>::default(), // All spatial entities need this component GridCell::<i128>::default(), // All spatial entities need this component
FloatingOrigin, // Important: marks this as the entity to use as the floating origin FloatingOrigin, // Important: marks this as the entity to use as the floating origin when propagating transforms for rendering.
CameraController::default() // Built-in camera controller CameraController::default() // Built-in camera controller
.with_max_speed(10e35) .with_max_speed(10e35)
.with_smoothness(0.95, 0.9) .with_smoothness(0.95, 0.9)
.with_speed(1.5), .with_speed(1.0),
)); ));
let mesh_handle = meshes.add( let mesh_handle = meshes.add(
@ -143,8 +143,12 @@ fn highlight_nearest_sphere(
objects: Query<&GlobalTransform>, objects: Query<&GlobalTransform>,
mut gizmos: Gizmos, mut gizmos: Gizmos,
) { ) {
let Some((entity, _)) = cameras.single().nearest_object() else { return }; let Some((entity, _)) = cameras.single().nearest_object() else {
let Ok(transform) = objects.get(entity) else { return }; return;
};
let Ok(transform) = objects.get(entity) else {
return;
};
let (scale, rotation, translation) = transform.to_scale_rotation_translation(); let (scale, rotation, translation) = transform.to_scale_rotation_translation();
gizmos gizmos
.sphere(translation, rotation, scale.x * 0.505, Color::RED) .sphere(translation, rotation, scale.x * 0.505, Color::RED)