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]]
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",

View File

@@ -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" }

View File

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

View File

@@ -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::<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"));
world.commands().entity(entity).insert((
Name::new("spawn"),
SceneRoot(mesh),
t,
RigidBody::Static,
ColliderConstructorHierarchy::new(ColliderConstructor::TrimeshFromMesh),
));

View File

@@ -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": {

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."
]
@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