Updated to Bevy 0.15.1

This commit is contained in:
2025-01-13 21:43:50 -05:00
parent 8e2dc04a6f
commit 5b4e96177c
28 changed files with 1232 additions and 1090 deletions

View File

@@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bevy = "0.14.2"
bevy = "0.15.1"
serde = { version = "1.0.204", features = ["derive"] }
world_generation = { path = "../../engine/world_generation" }

View File

@@ -13,6 +13,6 @@ impl Plugin for SimpleAnimationPlugin {
fn rotate(mut query: Query<(&mut Transform, &RotationAnimation)>, time: Res<Time>) {
for (mut transform, rot) in query.iter_mut() {
let cur_rot = transform.rotation;
transform.rotation = cur_rot * Quat::from_axis_angle(rot.axis, rot.speed.to_radians() * time.delta_seconds());
transform.rotation = cur_rot * Quat::from_axis_angle(rot.axis, rot.speed.to_radians() * time.delta_secs());
}
}

View File

@@ -24,7 +24,7 @@ impl Plugin for DespawnPuglin {
fn despawn_at(mut commands: Commands, time: Res<Time>, entities: Query<(Entity, &DespawnAt), Without<DespawnAfter>>) {
for (entity, at) in entities.iter() {
let d = at.0 - time.elapsed_seconds();
let d = at.0 - time.elapsed_secs();
commands
.entity(entity)
.insert(DespawnAfter(Timer::from_seconds(d, TimerMode::Once)));

View File

@@ -19,17 +19,16 @@ impl PrefabDefination {
let mesh_handle = &gltf.named_meshes[&self.path.clone().into_boxed_str()];
if let Some(gltf_mesh) = meshes.get(mesh_handle.id()) {
let (m, mat) = gltf_mesh.unpack();
let mut entity = commands.spawn(PbrBundle {
mesh: m,
material: mat,
transform: Transform::from_translation(self.pos).with_rotation(Quat::from_euler(
let mut entity = commands.spawn((
Mesh3d(m),
MeshMaterial3d(mat),
Transform::from_translation(self.pos).with_rotation(Quat::from_euler(
bevy::math::EulerRot::XYZ,
self.rot.x,
self.rot.y,
self.rot.z,
)),
..Default::default()
});
));
if let Some(children) = &self.children {
entity.with_children(|b| {
for child in children {