mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-22 08:06:01 +00:00
cargo fmt
This commit is contained in:
@@ -5,7 +5,7 @@ use crate::interaction::TransformSpace;
|
||||
|
||||
#[derive(Component, Reflect)]
|
||||
pub(super) struct TransformGizmo {
|
||||
pub(super) target : Entity,
|
||||
pub(super) target: Entity,
|
||||
pub(super) transform_space: TransformSpace,
|
||||
}
|
||||
|
||||
@@ -24,20 +24,19 @@ pub(super) struct InitialTransform(pub GlobalTransform);
|
||||
|
||||
impl TransformGizmoBundle {
|
||||
pub fn new(
|
||||
target : Entity,
|
||||
target_global_transform : &GlobalTransform,
|
||||
target: Entity,
|
||||
target_global_transform: &GlobalTransform,
|
||||
space: TransformSpace,
|
||||
normalizing_scale: f32,
|
||||
) -> Self {
|
||||
let name = Name::new("TransformGizmo");
|
||||
let marker = TransformGizmo {
|
||||
target,
|
||||
transform_space: space
|
||||
transform_space: space,
|
||||
};
|
||||
|
||||
match space {
|
||||
TransformSpace::Local => {
|
||||
|
||||
let mut transform = target_global_transform.compute_transform();
|
||||
transform.scale = Vec3::splat(normalizing_scale);
|
||||
|
||||
@@ -45,14 +44,13 @@ impl TransformGizmoBundle {
|
||||
name,
|
||||
marker,
|
||||
spatial: SpatialBundle {
|
||||
global_transform : GlobalTransform::from(transform),
|
||||
global_transform: GlobalTransform::from(transform),
|
||||
transform,
|
||||
..default()
|
||||
},
|
||||
}
|
||||
}
|
||||
TransformSpace::World => {
|
||||
|
||||
let transform = Transform::from_translation(target_global_transform.translation())
|
||||
.with_scale(Vec3::splat(normalizing_scale));
|
||||
|
||||
@@ -60,7 +58,7 @@ impl TransformGizmoBundle {
|
||||
name,
|
||||
marker,
|
||||
spatial: SpatialBundle {
|
||||
global_transform : GlobalTransform::from(transform),
|
||||
global_transform: GlobalTransform::from(transform),
|
||||
transform,
|
||||
..default()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user