diff --git a/crates/bevy_gltf/src/loader.rs b/crates/bevy_gltf/src/loader.rs index 5be5526d62b607..629e7fafe45acb 100644 --- a/crates/bevy_gltf/src/loader.rs +++ b/crates/bevy_gltf/src/loader.rs @@ -465,7 +465,7 @@ async fn load_gltf<'a, 'b>( world .spawn() - .insert_bundle(TransformBundle::identity()) + .insert_bundle(TransformBundle::IDENTITY) .insert_bundle(VisibilityBundle::default()) .with_children(|parent| { for node in scene.nodes() { @@ -1170,7 +1170,7 @@ mod test { GltfNode { children: vec![], mesh: None, - transform: bevy_transform::prelude::Transform::identity(), + transform: bevy_transform::prelude::Transform::IDENTITY, } } } diff --git a/crates/bevy_pbr/src/light.rs b/crates/bevy_pbr/src/light.rs index 5033b273b1b32a..a6739701d00f19 100644 --- a/crates/bevy_pbr/src/light.rs +++ b/crates/bevy_pbr/src/light.rs @@ -1447,7 +1447,7 @@ pub fn update_point_light_frusta( Mat4::perspective_infinite_reverse_rh(std::f32::consts::FRAC_PI_2, 1.0, POINT_LIGHT_NEAR_Z); let view_rotations = CUBE_MAP_FACES .iter() - .map(|CubeMapFace { target, up }| Transform::identity().looking_at(*target, *up)) + .map(|CubeMapFace { target, up }| Transform::IDENTITY.looking_at(*target, *up)) .collect::>(); for (entity, transform, point_light, mut cubemap_frusta) in &mut views { diff --git a/crates/bevy_pbr/src/render/light.rs b/crates/bevy_pbr/src/render/light.rs index 29c3d0b5b439da..b4f2098daec9d9 100644 --- a/crates/bevy_pbr/src/render/light.rs +++ b/crates/bevy_pbr/src/render/light.rs @@ -779,7 +779,7 @@ pub fn prepare_lights( Mat4::perspective_infinite_reverse_rh(std::f32::consts::FRAC_PI_2, 1.0, POINT_LIGHT_NEAR_Z); let cube_face_rotations = CUBE_MAP_FACES .iter() - .map(|CubeMapFace { target, up }| Transform::identity().looking_at(*target, *up)) + .map(|CubeMapFace { target, up }| Transform::IDENTITY.looking_at(*target, *up)) .collect::>(); global_light_meta.entity_to_index.clear(); diff --git a/crates/bevy_transform/src/systems.rs b/crates/bevy_transform/src/systems.rs index 9406149fb08472..390f804b3aca39 100644 --- a/crates/bevy_transform/src/systems.rs +++ b/crates/bevy_transform/src/systems.rs @@ -297,14 +297,12 @@ mod test { .world .spawn() .insert(Transform::from_translation(translation)) - .insert(GlobalTransform::default()) + .insert(GlobalTransform::IDENTITY) .with_children(|builder| { child = builder - .spawn_bundle((Transform::identity(), GlobalTransform::default())) + .spawn_bundle(TransformBundle::IDENTITY) .with_children(|builder| { - grandchild = builder - .spawn_bundle((Transform::identity(), GlobalTransform::default())) - .id(); + grandchild = builder.spawn_bundle(TransformBundle::IDENTITY).id(); }) .id(); }) @@ -338,11 +336,11 @@ mod test { let mut grandchild = Entity::from_raw(0); let child = world .spawn() - .insert_bundle((Transform::identity(), GlobalTransform::default())) + .insert_bundle(TransformBundle::IDENTITY) .with_children(|builder| { grandchild = builder .spawn() - .insert_bundle((Transform::identity(), GlobalTransform::default())) + .insert_bundle(TransformBundle::IDENTITY) .id(); }) .id(); @@ -357,7 +355,7 @@ mod test { app.world .spawn() - .insert_bundle((Transform::default(), GlobalTransform::default())) + .insert_bundle(TransformBundle::IDENTITY) .push_children(&[child]); std::mem::swap( &mut *app.world.get_mut::(child).unwrap(), diff --git a/crates/bevy_ui/src/update.rs b/crates/bevy_ui/src/update.rs index 05628555f1980b..b0cf91aa6abb33 100644 --- a/crates/bevy_ui/src/update.rs +++ b/crates/bevy_ui/src/update.rs @@ -150,7 +150,7 @@ mod tests { struct Label(&'static str); fn node_with_transform(name: &'static str) -> (Label, Node, Transform) { - (Label(name), Node::default(), Transform::identity()) + (Label(name), Node::default(), Transform::IDENTITY) } fn node_without_transform(name: &'static str) -> (Label, Node) { diff --git a/examples/animation/custom_skinned_mesh.rs b/examples/animation/custom_skinned_mesh.rs index 94a657ffe5f907..4bf90350224399 100644 --- a/examples/animation/custom_skinned_mesh.rs +++ b/examples/animation/custom_skinned_mesh.rs @@ -123,14 +123,14 @@ fn setup( let joint_0 = commands .spawn_bundle(( Transform::from_xyz(i as f32 * 1.5, 0.0, 0.0), - GlobalTransform::identity(), + GlobalTransform::IDENTITY, )) .id(); let joint_1 = commands .spawn_bundle(( AnimatedJoint, - Transform::identity(), - GlobalTransform::identity(), + Transform::IDENTITY, + GlobalTransform::IDENTITY, )) .id(); diff --git a/examples/ecs/component_change_detection.rs b/examples/ecs/component_change_detection.rs index 2d31302a3dd477..e3e986597ce359 100644 --- a/examples/ecs/component_change_detection.rs +++ b/examples/ecs/component_change_detection.rs @@ -18,7 +18,7 @@ struct MyComponent(f64); fn setup(mut commands: Commands) { commands.spawn().insert(MyComponent(0.)); - commands.spawn().insert(Transform::identity()); + commands.spawn().insert(Transform::IDENTITY); } fn change_component(time: Res