diff --git a/assets/models/suit_v1/base.glb b/assets/models/suit_v1/base.glb deleted file mode 100644 index 8510e98..0000000 Binary files a/assets/models/suit_v1/base.glb and /dev/null differ diff --git a/assets/models/suit_v1/collider.glb b/assets/models/suit_v1/collider.glb deleted file mode 100644 index 885ee3a..0000000 Binary files a/assets/models/suit_v1/collider.glb and /dev/null differ diff --git a/assets/models/suit_v1/head.glb b/assets/models/suit_v1/head.glb deleted file mode 100644 index fd77004..0000000 Binary files a/assets/models/suit_v1/head.glb and /dev/null differ diff --git a/assets/models/suit_v1/lower_arm.glb b/assets/models/suit_v1/lower_arm.glb deleted file mode 100644 index 1201d28..0000000 Binary files a/assets/models/suit_v1/lower_arm.glb and /dev/null differ diff --git a/assets/models/suit_v1/lower_leg.glb b/assets/models/suit_v1/lower_leg.glb deleted file mode 100644 index 0eef56c..0000000 Binary files a/assets/models/suit_v1/lower_leg.glb and /dev/null differ diff --git a/assets/models/suit_v1/upper_arm.glb b/assets/models/suit_v1/upper_arm.glb deleted file mode 100644 index 9c3f779..0000000 Binary files a/assets/models/suit_v1/upper_arm.glb and /dev/null differ diff --git a/assets/models/suit_v1/upper_leg.glb b/assets/models/suit_v1/upper_leg.glb deleted file mode 100644 index 7ab23b4..0000000 Binary files a/assets/models/suit_v1/upper_leg.glb and /dev/null differ diff --git a/assets/models/suit_v1/ar_chefhat.glb b/assets/models/suit_v2/ar_chefhat.glb similarity index 80% rename from assets/models/suit_v1/ar_chefhat.glb rename to assets/models/suit_v2/ar_chefhat.glb index fc1bb91..6ec8d2f 100644 Binary files a/assets/models/suit_v1/ar_chefhat.glb and b/assets/models/suit_v2/ar_chefhat.glb differ diff --git a/assets/models/suit_v2/suit_v2.glb b/assets/models/suit_v2/suit_v2.glb new file mode 100644 index 0000000..1522145 Binary files /dev/null and b/assets/models/suit_v2/suit_v2.glb differ diff --git a/src/data/defs.txt b/src/data/defs.txt index 9969574..54aca91 100644 --- a/src/data/defs.txt +++ b/src/data/defs.txt @@ -120,7 +120,7 @@ actor 0 0 0 jupiter clickable no physics off -actor 0 593051 0 suitv1 +actor 0 593051 0 suitv2 relativeto jupiter orbit 224000e3 0.66 player yes @@ -207,7 +207,7 @@ actor 0 0 0 moonlet orbit 221900e3 0.66 scale 50e3 angularmomentum 0 0.025 0 - actor -48e3 20e3 0 suitv1 + actor -48e3 20e3 0 suitv2 relativeto thebe id yuni name "Yuni" @@ -362,7 +362,7 @@ actor -3300 10 0 pizzeria chatid SubduedClippy pronoun it - actor -45 -4 -4 suitv1 + actor -45 -4 -4 suitv2 relativeto pizzeria name "Nox" chatid PizzaChef @@ -377,7 +377,7 @@ actor -3300 10 0 pizzeria angularmomentum 0 0 0 pronoun he -actor 60 -15 -40 suitv1 +actor 60 -15 -40 suitv2 relativeto player name Icarus id Icarus @@ -394,7 +394,7 @@ actor 60 -15 -40 suitv1 wants maxvelocity 0 pronoun it -actor -300 0 40 suitv1 +actor -300 0 40 suitv2 relativeto player id Drifter name "梓涵" @@ -442,7 +442,7 @@ actor 100 -18000 2000 "orb_busstop" name "Light Orb" relativeto busstopclippy light "47FF00" 1000000 - actor 8 2 0 suitv1 + actor 8 2 0 suitv2 relativeto "busstopclippy" name "Rudy" wants maxrotation 0.2 diff --git a/src/skeleton.rs b/src/skeleton.rs index 3ffb755..a70d469 100644 --- a/src/skeleton.rs +++ b/src/skeleton.rs @@ -18,12 +18,14 @@ pub struct SkeletonPlugin; impl Plugin for SkeletonPlugin { fn build(&self, app: &mut App) { app.add_systems(Update, animate_skeleton_parts); + app.add_systems(Update, play_animations); } } pub fn asset_name_to_path(name: &str) -> &'static str { match name { - "suit_ar_chefhat" => "models/suit_v1/ar_chefhat.glb#Scene0", + "suitv2" => "models/suit_v2/suit_v2.glb#Scene0", + "suit_ar_chefhat" => "models/suit_v2/ar_chefhat.glb#Scene0", "asteroid1" => "models/asteroid.glb#Scene0", "asteroid2" => "models/asteroid2.glb#Scene0", "asteroid_lum" => "models/asteroid_lum.glb#Scene0", @@ -327,3 +329,34 @@ pub fn animate_human_float(mut trans: &mut Transform, limb: &Limb, mirror: bool, _ => {}, } } + +fn play_animations( + mut players: Query<&mut AnimationPlayer, Added>, + asset_server: Res, +) { + for mut player in &mut players { + let animation = asset_server.load("models/suit_v2/suit_v2.glb#Animation0"); + player.play(animation.clone()).repeat(); + } +} + +//fn play_animations( +// players: Query<(Entity, &Parent, &AnimationPlayer), Added>, +// q_parents: Query<(Entity, &Parent)>, +// world: &World, +//) { +// for (entity, parent, player) in &players { +// info!("Got player!"); +//// dbg!(world.inspect_entity(entity)); +//// let parent_entity = q_parents.get(parent.get()); +//// if let Ok((parent_entity, parent_parents)) = parent_entity { +//// //dbg!(world.inspect_entity(parent_entity)); +//// let parent_entity = q_parents.get(parent_parents.get()); +//// if let Ok((parent_entity, parent_parents)) = parent_entity { +//// dbg!(world.inspect_entity(parent_entity)); +//// } +//// } +// //dbg!(player); +// //player.play(animations.0[0].clone_weak()).repeat(); +// } +//}