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

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),
));