diff --git a/bevy_rapier3d/examples/boxes3.rs b/bevy_rapier3d/examples/boxes3.rs index e1078f40..9f862212 100644 --- a/bevy_rapier3d/examples/boxes3.rs +++ b/bevy_rapier3d/examples/boxes3.rs @@ -18,11 +18,10 @@ fn main() { } pub fn setup_graphics(mut commands: Commands) { - commands.spawn(Camera3dBundle { - transform: Transform::from_xyz(-30.0, 30.0, 100.0) - .looking_at(Vec3::new(0.0, 10.0, 0.0), Vec3::Y), - ..Default::default() - }); + commands.spawn(( + Camera3d::default(), + Transform::from_xyz(-30.0, 30.0, 100.0).looking_at(Vec3::new(0.0, 10.0, 0.0), Vec3::Y), + )); } pub fn setup_physics(mut commands: Commands) { @@ -33,7 +32,7 @@ pub fn setup_physics(mut commands: Commands) { let ground_height = 0.1; commands.spawn(( - TransformBundle::from(Transform::from_xyz(0.0, -ground_height, 0.0)), + Transform::from_xyz(0.0, -ground_height, 0.0), Collider::cuboid(ground_size, ground_height, ground_size), )); @@ -65,12 +64,10 @@ pub fn setup_physics(mut commands: Commands) { color += 1; commands - .spawn(TransformBundle::from(Transform::from_rotation( - Quat::from_rotation_x(0.2), - ))) + .spawn(Transform::from_rotation(Quat::from_rotation_x(0.2))) .with_children(|child| { child.spawn(( - TransformBundle::from(Transform::from_xyz(x, y, z)), + Transform::from_xyz(x, y, z), RigidBody::Dynamic, Collider::cuboid(rad, rad, rad), ColliderDebugColor(colors[color % 3]), diff --git a/bevy_rapier3d/examples/locked_rotations3.rs b/bevy_rapier3d/examples/locked_rotations3.rs index b78738ed..a4feab94 100644 --- a/bevy_rapier3d/examples/locked_rotations3.rs +++ b/bevy_rapier3d/examples/locked_rotations3.rs @@ -32,7 +32,7 @@ pub fn setup_physics(mut commands: Commands) { let ground_height = 0.1; commands.spawn(( - TransformBundle::from(Transform::from_xyz(0.0, -ground_height, 0.0)), + Transform::from_xyz(0.0, -ground_height, 0.0), Collider::cuboid(ground_size, ground_height, ground_size), )); @@ -40,7 +40,7 @@ pub fn setup_physics(mut commands: Commands) { * A rectangle that only rotates along the `x` axis. */ commands.spawn(( - TransformBundle::from(Transform::from_xyz(0.0, 3.0, 0.0)), + Transform::from_xyz(0.0, 3.0, 0.0), RigidBody::Dynamic, LockedAxes::TRANSLATION_LOCKED | LockedAxes::ROTATION_LOCKED_Y @@ -52,9 +52,7 @@ pub fn setup_physics(mut commands: Commands) { * A tilted cuboid that cannot rotate. */ commands.spawn(( - TransformBundle::from( - Transform::from_xyz(0.0, 5.0, 0.0).with_rotation(Quat::from_rotation_x(1.0)), - ), + Transform::from_xyz(0.0, 5.0, 0.0).with_rotation(Quat::from_rotation_x(1.0)), RigidBody::Dynamic, LockedAxes::ROTATION_LOCKED, Collider::cuboid(0.6, 0.4, 0.4), diff --git a/src/pipeline/events.rs b/src/pipeline/events.rs index 4a169932..aee04803 100644 --- a/src/pipeline/events.rs +++ b/src/pipeline/events.rs @@ -129,7 +129,7 @@ mod test { app::{App, Startup, Update}, prelude::{Commands, Component, Entity, Query, With}, time::{TimePlugin, TimeUpdateStrategy}, - transform::{bundles::TransformBundle, components::Transform, TransformPlugin}, + transform::{components::Transform, TransformPlugin}, MinimalPlugins, }; use systems::tests::HeadlessRenderPlugin; @@ -214,19 +214,16 @@ mod test { /* * Ground */ - commands.spawn(( - TransformBundle::from(Transform::from_xyz(0.0, -1.2, 0.0)), - cuboid(4.0, 1.0, 1.0), - )); + commands.spawn((Transform::from_xyz(0.0, -1.2, 0.0), cuboid(4.0, 1.0, 1.0))); commands.spawn(( - TransformBundle::from(Transform::from_xyz(0.0, 5.0, 0.0)), + Transform::from_xyz(0.0, 5.0, 0.0), cuboid(4.0, 1.5, 1.0), Sensor, )); commands.spawn(( - TransformBundle::from(Transform::from_xyz(0.0, 13.0, 0.0)), + Transform::from_xyz(0.0, 13.0, 0.0), RigidBody::Dynamic, cuboid(0.5, 0.5, 0.5), ActiveEvents::COLLISION_EVENTS, @@ -274,8 +271,7 @@ mod test { } pub fn setup_physics(mut commands: Commands) { for _i in 0..100 { - commands.spawn(( - TransformBundle::from(Transform::from_xyz(0.0, 0.0, 0.0)), + commands.spawn((Transform::from_xyz(0.0, 0.0, 0.0), RigidBody::Dynamic, cuboid(0.5, 0.5, 0.5), ActiveEvents::all(), @@ -289,8 +285,7 @@ mod test { let ground_height = 0.1; let starting_y = -0.5 - ground_height; - commands.spawn(( - TransformBundle::from(Transform::from_xyz(0.0, starting_y, 0.0)), + commands.spawn((Transform::from_xyz(0.0, starting_y, 0.0), cuboid(ground_size, ground_height, ground_size), )); }