upgrade and scaling hack removal
This commit is contained in:
12
src/main.rs
12
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::<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),
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user