update testbeds to bevy 0.14 (#723)

This commit is contained in:
Thierry Berger
2024-09-06 16:15:34 +02:00
committed by GitHub
parent bedb12b88a
commit 04058a111d
7 changed files with 42 additions and 41 deletions

View File

@@ -39,7 +39,7 @@ other-backends = ["wrapped2d"]
features = ["parallel", "other-backends"] features = ["parallel", "other-backends"]
[dependencies] [dependencies]
nalgebra = { version = "0.33", features = ["rand", "glam025"] } nalgebra = { version = "0.33", features = ["rand", "glam027"] }
rand = "0.8" rand = "0.8"
rand_pcg = "0.3" rand_pcg = "0.3"
instant = { version = "0.1", features = ["web-sys", "now"] } instant = { version = "0.1", features = ["web-sys", "now"] }
@@ -51,16 +51,16 @@ bincode = "1"
Inflector = "0.11" Inflector = "0.11"
md5 = "0.7" md5 = "0.7"
bevy_egui = "0.26" bevy_egui = "0.29"
bevy_ecs = "0.13" bevy_ecs = "0.14"
bevy_core_pipeline = "0.13" bevy_core_pipeline = "0.14"
bevy_pbr = "0.13" bevy_pbr = "0.14"
bevy_sprite = "0.13" bevy_sprite = "0.14"
#bevy_prototype_debug_lines = "0.7" #bevy_prototype_debug_lines = "0.7"
# Dependencies for native only. # Dependencies for native only.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
bevy = { version = "0.13", default-features = false, features = [ bevy = { version = "0.14", default-features = false, features = [
"bevy_asset", "bevy_asset",
"bevy_winit", "bevy_winit",
"x11", "x11",
@@ -74,7 +74,7 @@ bevy = { version = "0.13", default-features = false, features = [
# Dependencies for WASM only. # Dependencies for WASM only.
[target.'cfg(target_arch = "wasm32")'.dependencies] [target.'cfg(target_arch = "wasm32")'.dependencies]
bevy = { version = "0.13", default-features = false, features = [ bevy = { version = "0.14", default-features = false, features = [
"bevy_asset", "bevy_asset",
"bevy_winit", "bevy_winit",
"tonemapping_luts", "tonemapping_luts",

View File

@@ -39,7 +39,7 @@ other-backends = ["wrapped2d"]
features = ["parallel", "other-backends"] features = ["parallel", "other-backends"]
[dependencies] [dependencies]
nalgebra = { version = "0.33", features = ["rand", "glam025"] } nalgebra = { version = "0.33", features = ["rand", "glam027"] }
rand = "0.8" rand = "0.8"
rand_pcg = "0.3" rand_pcg = "0.3"
instant = { version = "0.1", features = ["web-sys", "now"] } instant = { version = "0.1", features = ["web-sys", "now"] }
@@ -51,16 +51,16 @@ bincode = "1"
Inflector = "0.11" Inflector = "0.11"
md5 = "0.7" md5 = "0.7"
bevy_egui = "0.26" bevy_egui = "0.29"
bevy_ecs = "0.13" bevy_ecs = "0.14"
bevy_core_pipeline = "0.13" bevy_core_pipeline = "0.14"
bevy_pbr = "0.13" bevy_pbr = "0.14"
bevy_sprite = "0.13" bevy_sprite = "0.14"
#bevy_prototype_debug_lines = "0.7" #bevy_prototype_debug_lines = "0.7"
# Dependencies for native only. # Dependencies for native only.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
bevy = { version = "0.13", default-features = false, features = [ bevy = { version = "0.14", default-features = false, features = [
"bevy_sprite", "bevy_sprite",
"bevy_winit", "bevy_winit",
"x11", "x11",
@@ -74,7 +74,7 @@ bevy = { version = "0.13", default-features = false, features = [
# Dependencies for WASM only. # Dependencies for WASM only.
[target.'cfg(target_arch = "wasm32")'.dependencies] [target.'cfg(target_arch = "wasm32")'.dependencies]
bevy = { version = "0.13", default-features = false, features = [ bevy = { version = "0.14", default-features = false, features = [
"bevy_sprite", "bevy_sprite",
"bevy_winit", "bevy_winit",
"tonemapping_luts", "tonemapping_luts",

View File

@@ -41,7 +41,7 @@ parallel = ["rapier/parallel", "num_cpus"]
features = ["parallel"] features = ["parallel"]
[dependencies] [dependencies]
nalgebra = { version = "0.33", features = ["rand", "glam025"] } nalgebra = { version = "0.33", features = ["rand", "glam027"] }
rand = "0.8" rand = "0.8"
rand_pcg = "0.3" rand_pcg = "0.3"
instant = { version = "0.1", features = ["web-sys", "now"] } instant = { version = "0.1", features = ["web-sys", "now"] }
@@ -53,16 +53,16 @@ md5 = "0.7"
Inflector = "0.11" Inflector = "0.11"
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
bevy_egui = "0.26" bevy_egui = "0.29"
bevy_ecs = "0.13" bevy_ecs = "0.14"
bevy_core_pipeline = "0.13" bevy_core_pipeline = "0.14"
bevy_pbr = "0.13" bevy_pbr = "0.14"
bevy_sprite = "0.13" bevy_sprite = "0.14"
#bevy_prototype_debug_lines = { version = "0.7", features = [ "3d" ] } #bevy_prototype_debug_lines = { version = "0.7", features = [ "3d" ] }
# Dependencies for native only. # Dependencies for native only.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
bevy = { version = "0.13", default-features = false, features = [ bevy = { version = "0.14", default-features = false, features = [
"bevy_winit", "bevy_winit",
"x11", "x11",
"tonemapping_luts", "tonemapping_luts",
@@ -75,7 +75,7 @@ bevy = { version = "0.13", default-features = false, features = [
# Dependencies for WASM only. # Dependencies for WASM only.
[target.'cfg(target_arch = "wasm32")'.dependencies] [target.'cfg(target_arch = "wasm32")'.dependencies]
bevy = { version = "0.13", default-features = false, features = [ bevy = { version = "0.14", default-features = false, features = [
"bevy_winit", "bevy_winit",
"tonemapping_luts", "tonemapping_luts",
"ktx2", "ktx2",

View File

@@ -39,12 +39,12 @@ other-backends = ["physx", "physx-sys", "glam"]
features = ["parallel", "other-backends"] features = ["parallel", "other-backends"]
[dependencies] [dependencies]
nalgebra = { version = "0.33", features = ["rand", "glam025"] } nalgebra = { version = "0.33", features = ["rand", "glam027"] }
rand = "0.8" rand = "0.8"
rand_pcg = "0.3" rand_pcg = "0.3"
instant = { version = "0.1", features = ["web-sys", "now"] } instant = { version = "0.1", features = ["web-sys", "now"] }
bitflags = "2" bitflags = "2"
glam = { version = "0.24", optional = true } # For Physx glam = { version = "0.27", optional = true } # For Physx
num_cpus = { version = "1", optional = true } num_cpus = { version = "1", optional = true }
physx = { version = "0.19", features = ["glam"], optional = true } physx = { version = "0.19", features = ["glam"], optional = true }
physx-sys = { version = "0.11", optional = true } physx-sys = { version = "0.11", optional = true }
@@ -54,16 +54,16 @@ md5 = "0.7"
Inflector = "0.11" Inflector = "0.11"
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
bevy_egui = "0.26" bevy_egui = "0.29"
bevy_ecs = "0.13" bevy_ecs = "0.14"
bevy_core_pipeline = "0.13" bevy_core_pipeline = "0.14"
bevy_pbr = "0.13" bevy_pbr = "0.14"
bevy_sprite = "0.13" bevy_sprite = "0.14"
#bevy_prototype_debug_lines = { version = "0.7", features = [ "3d" ] } #bevy_prototype_debug_lines = { version = "0.7", features = [ "3d" ] }
# Dependencies for native only. # Dependencies for native only.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
bevy = { version = "0.13", default-features = false, features = [ bevy = { version = "0.14", default-features = false, features = [
"bevy_winit", "bevy_winit",
"x11", "x11",
"tonemapping_luts", "tonemapping_luts",
@@ -76,7 +76,7 @@ bevy = { version = "0.13", default-features = false, features = [
# Dependencies for WASM only. # Dependencies for WASM only.
[target.'cfg(target_arch = "wasm32")'.dependencies] [target.'cfg(target_arch = "wasm32")'.dependencies]
bevy = { version = "0.13", default-features = false, features = [ bevy = { version = "0.14", default-features = false, features = [
"bevy_winit", "bevy_winit",
"tonemapping_luts", "tonemapping_luts",
"ktx2", "ktx2",

View File

@@ -25,7 +25,7 @@ pub fn track_mouse_state(
- Vec2::ONE) - Vec2::ONE)
* Vec2::new(1.0, -1.0); * Vec2::new(1.0, -1.0);
let ndc_to_world = let ndc_to_world =
camera_transform.compute_matrix() * camera.projection_matrix().inverse(); camera_transform.compute_matrix() * camera.clip_from_view().inverse();
let ray_pt1 = let ray_pt1 =
ndc_to_world.project_point3(Vec3::new(ndc_cursor.x, ndc_cursor.y, -1.0)); ndc_to_world.project_point3(Vec3::new(ndc_cursor.x, ndc_cursor.y, -1.0));

View File

@@ -44,7 +44,7 @@ impl EntityWithGraphics {
#[cfg(feature = "dim2")] #[cfg(feature = "dim2")]
let selection_material = ColorMaterial { let selection_material = ColorMaterial {
color: Color::rgb(1.0, 0.0, 0.0), color: Color::from(Srgba::rgb(1.0, 0.0, 0.0)),
texture: None, texture: None,
}; };
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
@@ -52,7 +52,7 @@ impl EntityWithGraphics {
metallic: 0.5, metallic: 0.5,
perceptual_roughness: 0.5, perceptual_roughness: 0.5,
double_sided: true, // TODO: this doesn't do anything? double_sided: true, // TODO: this doesn't do anything?
..StandardMaterial::from(Color::rgb(1.0, 0.0, 0.0)) ..StandardMaterial::from(Color::from(Srgba::rgb(1.0, 0.0, 0.0)))
}; };
instanced_materials.insert( instanced_materials.insert(
@@ -85,7 +85,7 @@ impl EntityWithGraphics {
.or_else(|| generate_collider_mesh(shape).map(|m| meshes.add(m))); .or_else(|| generate_collider_mesh(shape).map(|m| meshes.add(m)));
let opacity = 1.0; let opacity = 1.0;
let bevy_color = Color::rgba(color.x, color.y, color.z, opacity); let bevy_color = Color::from(Srgba::new(color.x, color.y, color.z, opacity));
let shape_pos = collider_pos * delta; let shape_pos = collider_pos * delta;
let mut transform = Transform::from_scale(scale); let mut transform = Transform::from_scale(scale);
transform.translation.x = shape_pos.translation.vector.x as f32; transform.translation.x = shape_pos.translation.vector.x as f32;
@@ -169,11 +169,12 @@ impl EntityWithGraphics {
if let Some(material) = materials.get_mut(&self.material) { if let Some(material) = materials.get_mut(&self.material) {
#[cfg(feature = "dim2")] #[cfg(feature = "dim2")]
{ {
material.color = Color::rgba(color.x, color.y, color.z, self.opacity); material.color = Color::from(Srgba::new(color.x, color.y, color.z, self.opacity));
} }
#[cfg(feature = "dim3")] #[cfg(feature = "dim3")]
{ {
material.base_color = Color::rgba(color.x, color.y, color.z, self.opacity); material.base_color =
Color::from(Srgba::new(color.x, color.y, color.z, self.opacity));
} }
} }
self.color = color; self.color = color;

View File

@@ -429,7 +429,7 @@ impl TestbedApp {
}; };
let mut app = App::new(); let mut app = App::new();
app.insert_resource(ClearColor(Color::rgb(0.15, 0.15, 0.15))) app.insert_resource(ClearColor(Color::from(Srgba::rgb(0.15, 0.15, 0.15))))
.insert_resource(Msaa::Sample4) .insert_resource(Msaa::Sample4)
.insert_resource(AmbientLight { .insert_resource(AmbientLight {
brightness: 0.3, brightness: 0.3,
@@ -1600,7 +1600,7 @@ fn highlight_hovered_body(
cursor.x / window.width() * 2.0 - 1.0, cursor.x / window.width() * 2.0 - 1.0,
1.0 - cursor.y / window.height() * 2.0, 1.0 - cursor.y / window.height() * 2.0,
); );
let ndc_to_world = camera_transform.compute_matrix() * camera.projection_matrix().inverse(); let ndc_to_world = camera_transform.compute_matrix() * camera.clip_from_view().inverse();
let ray_pt1 = ndc_to_world.project_point3(Vec3::new(ndc_cursor.x, ndc_cursor.y, -1.0)); let ray_pt1 = ndc_to_world.project_point3(Vec3::new(ndc_cursor.x, ndc_cursor.y, -1.0));
let ray_pt2 = ndc_to_world.project_point3(Vec3::new(ndc_cursor.x, ndc_cursor.y, 1.0)); let ray_pt2 = ndc_to_world.project_point3(Vec3::new(ndc_cursor.x, ndc_cursor.y, 1.0));
let ray_dir = ray_pt2 - ray_pt1; let ray_dir = ray_pt2 - ray_pt1;