From 191d918e4fbf3aee243d33bd9ebea733cd1425ea Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 22 Apr 2024 23:25:32 +0200 Subject: [PATCH] tweak legs --- src/skeleton.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/skeleton.rs b/src/skeleton.rs index 2d59e0a..81e33c0 100644 --- a/src/skeleton.rs +++ b/src/skeleton.rs @@ -45,6 +45,9 @@ pub fn asset_name_to_path(name: &str) -> &'static str { } pub fn skeleton_name_to_skeletondef(name: &str) -> Option { + // x: positive: left, negative: right + // y: positive: upward, negative: downward + // z: positive: forward, negative: backward match name { "suitv1" => Some(SkeletonDef::Human(HumanDef { collider: "skeleton/suit_v1/collider.glb#Scene0".into(), @@ -84,7 +87,7 @@ pub fn skeleton_name_to_skeletondef(name: &str) -> Option { LimbDef { class: Limb::UpperLegLeft, path: "skeleton/suit_v1/upper_leg.glb#Scene0".into(), - pos: Vec3::new(0.15, -0.25, 0.0), + pos: Vec3::new(0.15, -0.25, 0.1), mirror: true, children: vec![LimbDef { class: Limb::LowerLegLeft, @@ -97,7 +100,7 @@ pub fn skeleton_name_to_skeletondef(name: &str) -> Option { LimbDef { class: Limb::UpperLegRight, path: "skeleton/suit_v1/upper_leg.glb#Scene0".into(), - pos: Vec3::new(-0.15, -0.25, 0.0), + pos: Vec3::new(-0.15, -0.25, 0.1), children: vec![LimbDef { class: Limb::LowerLegRight, path: "skeleton/suit_v1/lower_leg.glb#Scene0".into(), @@ -299,20 +302,20 @@ pub fn animate_human_float(mut trans: &mut Transform, limb: &Limb, mirror: bool, Limb::UpperLegRight => rot(&mut trans, -30.0 + 10.0 * (t * 0.5).sin(), 0.0, - -25.0 + 2.5 * (t * 0.5).cos(), + -20.0 + 2.5 * (t * 0.5).cos(), ), Limb::UpperLegLeft => rot(&mut trans, -30.0 + 10.0 * (t * 0.5).sin(), 0.0, - 25.0 - 2.5 * (t * 0.5).cos(), + 20.0 - 2.5 * (t * 0.5).cos(), ), Limb::LowerLegRight => rot(&mut trans, - 30.0, + 35.0 + 5.0 * (t * 0.5).sin(), 0.0, 0.0, ), Limb::LowerLegLeft => rot(&mut trans, - 30.0, + 35.0 + 5.0 * (t * 0.5).sin(), 0.0, 0.0, ),