upgrade and scaling hack removal

This commit is contained in:
2025-02-27 22:19:55 +01:00
parent adf0077a83
commit 13824c1445
6 changed files with 8 additions and 18 deletions

4
Cargo.lock generated
View File

@@ -1320,7 +1320,7 @@ dependencies = [
[[package]] [[package]]
name = "bevy_trenchbroom" name = "bevy_trenchbroom"
version = "0.6.2" 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 = [ dependencies = [
"anyhow", "anyhow",
"avian3d", "avian3d",
@@ -1348,7 +1348,7 @@ dependencies = [
[[package]] [[package]]
name = "bevy_trenchbroom_macros" name = "bevy_trenchbroom_macros"
version = "0.6.2" 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 = [ dependencies = [
"heck", "heck",
"proc-macro2", "proc-macro2",

View File

@@ -15,4 +15,4 @@ nil = "0.14.0"
bevy-inspector-egui = "0.29.1" bevy-inspector-egui = "0.29.1"
[patch.crates-io] [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" }

View File

@@ -531,6 +531,5 @@
// entity 1 // entity 1
{ {
"classname" "spawn_point" "classname" "spawn_point"
"origin" "152 232 -248" "origin" "104 216 -248"
"scale" "50"
} }

View File

@@ -27,10 +27,8 @@ struct DebugVisuals {
#[reflect(Component)] #[reflect(Component)]
#[require(Transform)] #[require(Transform)]
#[component(on_add = Self::on_add)] #[component(on_add = Self::on_add)]
#[model({ "path": "models/spawn.glb", "scale": scale })] #[model({ "path": "models/spawn.glb" })]
pub struct SpawnPoint { pub struct SpawnPoint {}
scale: f32,
}
impl SpawnPoint { impl SpawnPoint {
fn on_add(mut world: DeferredWorld, entity: Entity, _id: ComponentId) { fn on_add(mut world: DeferredWorld, entity: Entity, _id: ComponentId) {
@@ -38,17 +36,11 @@ impl SpawnPoint {
return; return;
}; };
// let scale = world.entity(entity).get::<Self>().unwrap().scale;
let mut t = world.entity(entity).get::<Transform>().unwrap().clone();
t.scale = Vec3::splat(1.0);
let mesh = asset_server.load(GltfAssetLabel::Scene(0).from_asset("models/spawn.glb")); let mesh = asset_server.load(GltfAssetLabel::Scene(0).from_asset("models/spawn.glb"));
world.commands().entity(entity).insert(( world.commands().entity(entity).insert((
Name::new("spawn"), Name::new("spawn"),
SceneRoot(mesh), SceneRoot(mesh),
t,
RigidBody::Static, RigidBody::Static,
ColliderConstructorHierarchy::new(ColliderConstructor::TrimeshFromMesh), ColliderConstructorHierarchy::new(ColliderConstructor::TrimeshFromMesh),
)); ));

View File

@@ -33,7 +33,7 @@
"hedz.fgd" "hedz.fgd"
], ],
"defaultcolor": "0.6 0.6 0.6 1", "defaultcolor": "0.6 0.6 0.6 1",
"scale": {{ scale == undefined -> 1, scale }}, "scale": {{ scale == undefined -> 39.37008, scale }},
"setDefaultProperties": false "setDefaultProperties": false
}, },
"tags": { "tags": {

View File

@@ -56,9 +56,8 @@
NOTE: Changing to 2, for example, will cause the bmodel to initially be solid black. Youll need to add minlight or lights with _light_channel_mask 2." NOTE: Changing to 2, for example, will cause the bmodel to initially be solid black. Youll 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 @BaseClass = transform