diff --git a/Cargo.toml b/Cargo.toml index ec59d07..a946232 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,7 @@ itertools = "0.14" fnv = "1" [dev-dependencies] -bevy = "0.15" -bevy_panorbit_camera = "0.22" -ply-rs = "0.1" \ No newline at end of file +bevy = "0.18" +bevy_mesh = "0.18.1" +bevy_panorbit_camera = "0.34" +ply-rs = "0.1" diff --git a/examples/reconstruction_demo.rs b/examples/reconstruction_demo.rs index 080bbc6..a8fee3c 100644 --- a/examples/reconstruction_demo.rs +++ b/examples/reconstruction_demo.rs @@ -1,7 +1,8 @@ use bevy::asset::RenderAssetUsages; use bevy::pbr::wireframe::{Wireframe, WireframePlugin}; use bevy::prelude::*; -use bevy::render::mesh::{Indices, PrimitiveTopology}; +use bevy_mesh::Indices; +use bevy_mesh::PrimitiveTopology; use bevy_panorbit_camera::{PanOrbitCamera, PanOrbitCameraPlugin}; use nalgebra::{Point3, Vector3}; use ply_rs::{parser, ply}; @@ -14,7 +15,7 @@ use std::str::FromStr; fn main() { App::new() .add_plugins((DefaultPlugins, PanOrbitCameraPlugin)) - .add_plugins(WireframePlugin) + .add_plugins(WireframePlugin::default()) .add_systems(Startup, setup_camera_and_light) .add_systems(Startup, setup_scene) .run(); @@ -32,21 +33,17 @@ fn setup_scene( } fn setup_camera_and_light(mut commands: Commands) { - commands.spawn(PointLightBundle { - point_light: PointLight { + commands.spawn(( + PointLight { intensity: 900000.0, range: 1000., ..default() }, - transform: Transform::from_xyz(-100.0, 50.0, -100.0), - ..default() - }); + Transform::from_xyz(-100.0, 50.0, -100.0), + )); commands.spawn(( - Camera3dBundle { - transform: Transform::from_xyz(-100.0, 25.0, -100.0) - .looking_at(Vec3::new(0., 0., 0.), Vec3::Y), - ..default() - }, + Camera3d { ..default() }, + Transform::from_xyz(-100.0, 25.0, -100.0).looking_at(Vec3::new(0., 0., 0.), Vec3::Y), PanOrbitCamera::default(), )); } @@ -71,12 +68,11 @@ fn spawn_mesh( mesh.insert_indices(Indices::U32(points.indices().to_vec())); commands - .spawn(PbrBundle { - mesh: Mesh3d(meshes.add(mesh)), - material: MeshMaterial3d(materials.add(Color::srgb(0.0, 1.0, 0.0))), - transform: Transform::from_rotation(Quat::from_rotation_x(180.0f32.to_radians())), - ..default() - }) + .spawn(( + Mesh3d(meshes.add(mesh)), + MeshMaterial3d(materials.add(Color::srgb(0.0, 1.0, 0.0))), + Transform::from_rotation(Quat::from_rotation_x(180.0f32.to_radians())), + )) .insert(Wireframe); }