From 13824c144515c028f46145a7af0fae60dc46168c Mon Sep 17 00:00:00 2001 From: extrawurst Date: Thu, 27 Feb 2025 22:19:55 +0100 Subject: [PATCH] upgrade and scaling hack removal --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- assets/maps/map1.map | 3 +-- src/main.rs | 12 ++---------- trenchbroom/hedz/GameConfig.cfg | 2 +- trenchbroom/hedz/hedz.fgd | 3 +-- 6 files changed, 8 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 808caae..5798ed3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1320,7 +1320,7 @@ dependencies = [ [[package]] name = "bevy_trenchbroom" version = "0.6.2" -source = "git+https://github.com/Noxmore/bevy_trenchbroom.git?rev=7038e61#7038e616ba81ec9d8a42ea86818ca4ad5ea40472" +source = "git+https://github.com/Noxmore/bevy_trenchbroom.git?rev=3b79f1b#3b79f1bc54d54767d84961f518a3ebadb8103590" dependencies = [ "anyhow", "avian3d", @@ -1348,7 +1348,7 @@ dependencies = [ [[package]] name = "bevy_trenchbroom_macros" version = "0.6.2" -source = "git+https://github.com/Noxmore/bevy_trenchbroom.git?rev=7038e61#7038e616ba81ec9d8a42ea86818ca4ad5ea40472" +source = "git+https://github.com/Noxmore/bevy_trenchbroom.git?rev=3b79f1b#3b79f1bc54d54767d84961f518a3ebadb8103590" dependencies = [ "heck", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index adbb69a..d39f0b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,4 +15,4 @@ nil = "0.14.0" bevy-inspector-egui = "0.29.1" [patch.crates-io] -bevy_trenchbroom = { git = "https://github.com/Noxmore/bevy_trenchbroom.git", rev = "7038e61" } +bevy_trenchbroom = { git = "https://github.com/Noxmore/bevy_trenchbroom.git", rev = "3b79f1b" } diff --git a/assets/maps/map1.map b/assets/maps/map1.map index f61cc18..62033da 100644 --- a/assets/maps/map1.map +++ b/assets/maps/map1.map @@ -531,6 +531,5 @@ // entity 1 { "classname" "spawn_point" -"origin" "152 232 -248" -"scale" "50" +"origin" "104 216 -248" } diff --git a/src/main.rs b/src/main.rs index 208e625..0839168 100644 --- a/src/main.rs +++ b/src/main.rs @@ -27,10 +27,8 @@ struct DebugVisuals { #[reflect(Component)] #[require(Transform)] #[component(on_add = Self::on_add)] -#[model({ "path": "models/spawn.glb", "scale": scale })] -pub struct SpawnPoint { - scale: f32, -} +#[model({ "path": "models/spawn.glb" })] +pub struct SpawnPoint {} impl SpawnPoint { fn on_add(mut world: DeferredWorld, entity: Entity, _id: ComponentId) { @@ -38,17 +36,11 @@ impl SpawnPoint { return; }; - // let scale = world.entity(entity).get::().unwrap().scale; - - let mut t = world.entity(entity).get::().unwrap().clone(); - t.scale = Vec3::splat(1.0); - let mesh = asset_server.load(GltfAssetLabel::Scene(0).from_asset("models/spawn.glb")); world.commands().entity(entity).insert(( Name::new("spawn"), SceneRoot(mesh), - t, RigidBody::Static, ColliderConstructorHierarchy::new(ColliderConstructor::TrimeshFromMesh), )); diff --git a/trenchbroom/hedz/GameConfig.cfg b/trenchbroom/hedz/GameConfig.cfg index bda21a9..f77c40f 100644 --- a/trenchbroom/hedz/GameConfig.cfg +++ b/trenchbroom/hedz/GameConfig.cfg @@ -33,7 +33,7 @@ "hedz.fgd" ], "defaultcolor": "0.6 0.6 0.6 1", - "scale": {{ scale == undefined -> 1, scale }}, + "scale": {{ scale == undefined -> 39.37008, scale }}, "setDefaultProperties": false }, "tags": { diff --git a/trenchbroom/hedz/hedz.fgd b/trenchbroom/hedz/hedz.fgd index 48bb293..28aaefa 100644 --- a/trenchbroom/hedz/hedz.fgd +++ b/trenchbroom/hedz/hedz.fgd @@ -56,9 +56,8 @@ NOTE: Changing to 2, for example, will cause the bmodel to initially be solid black. You’ll need to add minlight or lights with _light_channel_mask 2." ] -@PointClass base(transform) model({ "path": "models/spawn.glb", "scale": scale }) = spawn_point +@PointClass base(transform) model({ "path": "models/spawn.glb" }) = spawn_point [ - scale(float) : "scale" : "0" : "" ] @BaseClass = transform