Update bevy from 0.12 to 0.13, update example to use new shapes in bevy 0.13

This commit is contained in:
Franklin 2024-02-18 19:46:45 +01:00
parent d1ddf7d547
commit 52db38768b
2 changed files with 5 additions and 16 deletions

View File

@ -10,4 +10,5 @@ keywords = ["gamedev", "graphics", "bevy", "animation"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
[dependencies] [dependencies]
bevy = "0.12" bevy = "0.13"
bevy_editor_pls = "0.6"

View File

@ -53,10 +53,7 @@ fn setup(
}); });
commands.spawn(PbrBundle { commands.spawn(PbrBundle {
mesh: meshes.add(Mesh::from(shape::Plane { mesh: meshes.add(Mesh::from(Plane3d::default().mesh().size(5.0, 5.0))),
size: 5.0,
subdivisions: 0,
})),
material: materials.add(StandardMaterial { material: materials.add(StandardMaterial {
base_color: Color::WHITE, base_color: Color::WHITE,
..default() ..default()
@ -99,16 +96,11 @@ fn setup_ik(
&names, &names,
) )
.unwrap(); .unwrap();
let target = commands let target = commands
.spawn(( .spawn((
PbrBundle { PbrBundle {
transform: Transform::from_xyz(0.3, 0.8, 0.2), transform: Transform::from_xyz(0.3, 0.8, 0.2),
mesh: meshes.add(Mesh::from(shape::UVSphere { mesh: meshes.add(Sphere::new(0.05).mesh().uv(7, 7)),
radius: 0.05,
sectors: 7,
stacks: 7,
})),
material: materials.add(StandardMaterial { material: materials.add(StandardMaterial {
base_color: Color::RED, base_color: Color::RED,
..default() ..default()
@ -122,11 +114,7 @@ fn setup_ik(
let pole_target = commands let pole_target = commands
.spawn(PbrBundle { .spawn(PbrBundle {
transform: Transform::from_xyz(-1.0, 0.4, -0.2), transform: Transform::from_xyz(-1.0, 0.4, -0.2),
mesh: meshes.add(Mesh::from(shape::UVSphere { mesh: meshes.add(Sphere::new(0.05).mesh().uv(7, 7)),
radius: 0.05,
sectors: 7,
stacks: 7,
})),
material: materials.add(StandardMaterial { material: materials.add(StandardMaterial {
base_color: Color::GREEN, base_color: Color::GREEN,
..default() ..default()