From 0f375fab6450ca257da2f20f0b61e8bd1e601d59 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 30 Mar 2024 22:59:18 +0100 Subject: [PATCH] add collisions to asteroids, reduce count from 8k to 512 --- src/world.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/world.rs b/src/world.rs index 0eba23e..5c65b7a 100644 --- a/src/world.rs +++ b/src/world.rs @@ -82,7 +82,7 @@ pub fn setup( // }); // Generate a bunch of asteriods - let maxdist = 10; + let maxdist = 4; for i in -maxdist..maxdist { for j in -maxdist..maxdist { for k in -maxdist..maxdist { @@ -95,11 +95,11 @@ pub fn setup( _ => ASSET_ASTEROID2, }; commands.spawn(( - actor::Actor { - v: Vec3::new(-0.00, 0.0, 0.35), - angular_momentum: Quat::from_euler(EulerRot::XYZ, 0.001, 0.001, 0.0003), - ..default() - }, + actor::Actor::default(), + RigidBody::Dynamic, + AngularVelocity(Vec3::new(0.001, 0.001, 0.0003)), + LinearVelocity(Vec3::new(0.0, 0.0, 0.35)), + Collider::sphere(1.0), SceneBundle { transform: Transform { translation: Vec3::new(