port to bevy .13

This commit is contained in:
Lillian Vixe 2024-03-21 13:51:53 -07:00
parent 2fe1812f35
commit 1eee8cfe9a
4 changed files with 597 additions and 439 deletions

1015
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -6,5 +6,5 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bevy = "0.12"
bevy = "0.13"
rand = "0.8.5"

View file

@ -28,7 +28,7 @@ pub mod orbit_camera {
window_query: Query<&Window, With<PrimaryWindow>>,
mut ev_motion: EventReader<MouseMotion>,
mut ev_scroll: EventReader<MouseWheel>,
input_mouse: Res<Input<MouseButton>>,
input_mouse: Res<ButtonInput<MouseButton>>,
mut query: Query<(&mut PanOrbitCamera, &mut Transform, &Projection)>,
) {
// change input mapping for orbit and panning here

View file

@ -1,7 +1,9 @@
pub mod mesh_plugin {
use bevy::{
prelude::*,
render::{mesh::Indices, render_resource::PrimitiveTopology},
render::{
mesh::Indices, render_asset::RenderAssetUsages, render_resource::PrimitiveTopology,
},
};
use crate::orbit_camera::orbit_camera::*;
@ -26,11 +28,14 @@ pub mod mesh_plugin {
normals: Vec<[f32; 3]>,
colors: Vec<[f32; 4]>,
) -> Mesh {
Mesh::new(PrimitiveTopology::TriangleList)
.with_inserted_attribute(Mesh::ATTRIBUTE_POSITION, vertices)
.with_inserted_attribute(Mesh::ATTRIBUTE_COLOR, colors)
.with_inserted_attribute(Mesh::ATTRIBUTE_NORMAL, normals)
.with_indices(Some(Indices::U32(indices)))
Mesh::new(
PrimitiveTopology::TriangleList,
RenderAssetUsages::RENDER_WORLD,
)
.with_inserted_attribute(Mesh::ATTRIBUTE_POSITION, vertices)
.with_inserted_attribute(Mesh::ATTRIBUTE_COLOR, colors)
.with_inserted_attribute(Mesh::ATTRIBUTE_NORMAL, normals)
.with_inserted_indices(Indices::U32(indices))
}
fn emit_cube_at(