update to BTB release!

This commit is contained in:
2025-05-16 14:27:21 +02:00
parent c69a528625
commit 16aaf2a961
5 changed files with 26 additions and 30 deletions

20
Cargo.lock generated
View File

@@ -868,6 +868,15 @@ dependencies = [
"encase_derive_impl", "encase_derive_impl",
] ]
[[package]]
name = "bevy_fix_gltf_coordinate_system"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3d322f8addff6f04423ea6bbd4ab37a5fb08c9c14aec426bf1aae01bee128e1"
dependencies = [
"bevy",
]
[[package]] [[package]]
name = "bevy_gilrs" name = "bevy_gilrs"
version = "0.16.0" version = "0.16.0"
@@ -1539,13 +1548,15 @@ dependencies = [
[[package]] [[package]]
name = "bevy_trenchbroom" name = "bevy_trenchbroom"
version = "0.8.0-dev" version = "0.8.0"
source = "git+https://github.com/Noxmore/bevy_trenchbroom.git?rev=3acfccf#3acfccfd7a5b56448a831c0f00157644cbdbfced" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce306a118409486343c73ede3decc9bf79906e499c8e3a90b3a812c1b701a6a8"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"atomicow", "atomicow",
"avian3d", "avian3d",
"bevy", "bevy",
"bevy_fix_gltf_coordinate_system",
"bevy_materialize", "bevy_materialize",
"bevy_mesh", "bevy_mesh",
"bevy_reflect", "bevy_reflect",
@@ -1569,8 +1580,9 @@ dependencies = [
[[package]] [[package]]
name = "bevy_trenchbroom_macros" name = "bevy_trenchbroom_macros"
version = "0.8.0-dev" version = "0.8.0"
source = "git+https://github.com/Noxmore/bevy_trenchbroom.git?rev=3acfccf#3acfccfd7a5b56448a831c0f00157644cbdbfced" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "520f2720901baee5c85f74a30351164780b153251e9632a57fecde7130da35d2"
dependencies = [ dependencies = [
"heck", "heck",
"proc-macro2", "proc-macro2",

View File

@@ -21,7 +21,7 @@ avian3d = { version = "0.3", default-features = false, features = [
"parallel", "parallel",
] } ] }
bevy = { version = "0.16.0", features = ["track_location"] } bevy = { version = "0.16.0", features = ["track_location"] }
bevy_trenchbroom = { version = "0.8.0-dev", features = ["avian"] } bevy_trenchbroom = { version = "0.8.0", features = ["avian"] }
nil = "0.14.0" nil = "0.14.0"
bevy_asset_loader = "0.23.0-rc.3" bevy_asset_loader = "0.23.0-rc.3"
bevy_sprite3d = "5.0.0" bevy_sprite3d = "5.0.0"
@@ -45,4 +45,3 @@ type_complexity = "allow"
[patch.crates-io] [patch.crates-io]
bevy-steamworks = { git = "https://github.com/extrawurst/bevy_steamworks.git", branch = "derive-debug-event" } bevy-steamworks = { git = "https://github.com/extrawurst/bevy_steamworks.git", branch = "derive-debug-event" }
bevy_trenchbroom = { git = "https://github.com/Noxmore/bevy_trenchbroom.git", rev = "3acfccf" }

View File

@@ -12,21 +12,11 @@ pub struct ProjectileOrigin;
#[derive(Component, Debug)] #[derive(Component, Debug)]
pub struct AnimatedCharacter { pub struct AnimatedCharacter {
head: usize, head: usize,
rotate_180: bool,
} }
impl AnimatedCharacter { impl AnimatedCharacter {
pub fn new(head: usize) -> Self { pub fn new(head: usize) -> Self {
Self { Self { head }
head,
rotate_180: false,
}
}
pub fn with_rotation(self) -> Self {
let mut s = self;
s.rotate_180 = true;
s
} }
} }
@@ -92,9 +82,7 @@ fn spawn(
let mut t = let mut t =
Transform::from_translation(Vec3::new(0., -1.45, 0.)).with_scale(Vec3::splat(1.2)); Transform::from_translation(Vec3::new(0., -1.45, 0.)).with_scale(Vec3::splat(1.2));
if character.rotate_180 { t.rotate_y(PI);
t.rotate_y(PI);
}
commands commands
.entity(entity) .entity(entity)

View File

@@ -45,10 +45,7 @@ fn init(mut commands: Commands, query: Query<(Entity, &EnemySpawn)>, heads_db: R
]), ]),
)) ))
.insert_if(Ai, || !spawn.disable_ai) .insert_if(Ai, || !spawn.disable_ai)
.with_child(( .with_child((Name::from("body-rig"), AnimatedCharacter::new(id)))
Name::from("body-rig"),
AnimatedCharacter::new(id).with_rotation(),
))
.observe(on_kill); .observe(on_kill);
} }
} }

View File

@@ -36,25 +36,25 @@ impl SpawnPoint {
#[derive(SolidClass, Component, Reflect, Default)] #[derive(SolidClass, Component, Reflect, Default)]
#[reflect(QuakeClass, Component)] #[reflect(QuakeClass, Component)]
#[geometry(GeometryProvider::new().convex_collider())] #[spawn_hooks(SpawnHooks::new().convex_collider())]
pub struct Worldspawn; pub struct Worldspawn;
#[derive(SolidClass, Component, Reflect, Default)] #[derive(SolidClass, Component, Reflect, Default)]
#[reflect(QuakeClass, Component)] #[reflect(QuakeClass, Component)]
#[geometry(GeometryProvider::new())] #[spawn_hooks(SpawnHooks::new())]
#[base(Transform)] #[base(Transform)]
pub struct Water; pub struct Water;
#[derive(SolidClass, Component, Reflect, Default)] #[derive(SolidClass, Component, Reflect, Default)]
#[reflect(QuakeClass, Component)] #[reflect(QuakeClass, Component)]
#[base(Transform)] #[base(Transform)]
#[geometry(GeometryProvider::new().convex_collider())] #[spawn_hooks(SpawnHooks::new().convex_collider())]
pub struct Crates; pub struct Crates;
#[derive(SolidClass, Component, Reflect, Default)] #[derive(SolidClass, Component, Reflect, Default)]
#[reflect(QuakeClass, Component)] #[reflect(QuakeClass, Component)]
#[base(Transform)] #[base(Transform)]
#[geometry(GeometryProvider::new().convex_collider())] #[spawn_hooks(SpawnHooks::new().convex_collider())]
pub struct NamedEntity { pub struct NamedEntity {
pub name: String, pub name: String,
} }
@@ -62,7 +62,7 @@ pub struct NamedEntity {
#[derive(SolidClass, Component, Reflect, Default)] #[derive(SolidClass, Component, Reflect, Default)]
#[reflect(QuakeClass, Component)] #[reflect(QuakeClass, Component)]
#[base(Transform, Target)] #[base(Transform, Target)]
#[geometry(GeometryProvider::new().convex_collider())] #[spawn_hooks(SpawnHooks::new().convex_collider())]
pub struct Platform; pub struct Platform;
#[derive(PointClass, Component, Reflect, Default)] #[derive(PointClass, Component, Reflect, Default)]
@@ -75,7 +75,7 @@ pub struct PlatformTarget {
#[derive(SolidClass, Component, Reflect, Default)] #[derive(SolidClass, Component, Reflect, Default)]
#[reflect(QuakeClass, Component)] #[reflect(QuakeClass, Component)]
#[base(Transform, Target)] #[base(Transform, Target)]
#[geometry(GeometryProvider::new().convex_collider())] #[spawn_hooks(SpawnHooks::new().convex_collider())]
pub struct Movable { pub struct Movable {
pub name: String, pub name: String,
} }