From 52db38768be99fe6b9975a1ec725d970045b12b5 Mon Sep 17 00:00:00 2001 From: Franklin Date: Sun, 18 Feb 2024 19:46:45 +0100 Subject: [PATCH] Update bevy from 0.12 to 0.13, update example to use new shapes in bevy 0.13 --- Cargo.toml | 3 ++- examples/skin_mesh.rs | 18 +++--------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2b8ae99..15284f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,4 +10,5 @@ keywords = ["gamedev", "graphics", "bevy", "animation"] license = "MIT OR Apache-2.0" [dependencies] -bevy = "0.12" +bevy = "0.13" +bevy_editor_pls = "0.6" \ No newline at end of file diff --git a/examples/skin_mesh.rs b/examples/skin_mesh.rs index 359c395..d84ac7c 100644 --- a/examples/skin_mesh.rs +++ b/examples/skin_mesh.rs @@ -53,10 +53,7 @@ fn setup( }); commands.spawn(PbrBundle { - mesh: meshes.add(Mesh::from(shape::Plane { - size: 5.0, - subdivisions: 0, - })), + mesh: meshes.add(Mesh::from(Plane3d::default().mesh().size(5.0, 5.0))), material: materials.add(StandardMaterial { base_color: Color::WHITE, ..default() @@ -99,16 +96,11 @@ fn setup_ik( &names, ) .unwrap(); - let target = commands .spawn(( PbrBundle { transform: Transform::from_xyz(0.3, 0.8, 0.2), - mesh: meshes.add(Mesh::from(shape::UVSphere { - radius: 0.05, - sectors: 7, - stacks: 7, - })), + mesh: meshes.add(Sphere::new(0.05).mesh().uv(7, 7)), material: materials.add(StandardMaterial { base_color: Color::RED, ..default() @@ -122,11 +114,7 @@ fn setup_ik( let pole_target = commands .spawn(PbrBundle { transform: Transform::from_xyz(-1.0, 0.4, -0.2), - mesh: meshes.add(Mesh::from(shape::UVSphere { - radius: 0.05, - sectors: 7, - stacks: 7, - })), + mesh: meshes.add(Sphere::new(0.05).mesh().uv(7, 7)), material: materials.add(StandardMaterial { base_color: Color::GREEN, ..default()