Halve walking arm swing for heroine and helpers

This commit is contained in:
JariKo
2026-10-29 13:29:58 +02:00
parent f60b87e725
commit 078cc5bb24
3 changed files with 13 additions and 5 deletions
+4 -4
View File
@@ -50,8 +50,8 @@ func run(g):
var forearm=actor.gait.point("wrist."+side)-actor.gait.point("lowerarm01."+side)
var angle=upper.angle_to(forearm);elbow_min=minf(elbow_min,angle);elbow_max=maxf(elbow_max,angle)
var swing_direction=upper.normalized().dot(actor.global_basis.z.normalized())
if swing_direction>.12:forward_angles+=angle;forward_samples+=1
if swing_direction<-.12:back_angles+=angle;back_samples+=1
if swing_direction>.05:forward_angles+=angle;forward_samples+=1
if swing_direction<-.05:back_angles+=angle;back_samples+=1
cross_sum+=hand_offsets.x*hand_offsets.y;hand_sum+=hand_offsets;samples+=1
for i in range(2):
var f=actor.gait.feet[i];var actual=actor.gait.point("foot."+f.side)
@@ -66,8 +66,8 @@ func run(g):
check(max_lift>.08 and planted_frames>150,"alternating lift/support")
check(hand_max.x-hand_min.x>.12 and hand_max.y-hand_min.y>.12,"both hands swing during locomotion")
check(cross_sum/samples-(hand_sum.x/samples)*(hand_sum.y/samples)<0,"opposing left/right arm swing")
check(elbow_min<deg_to_rad(23) and elbow_max>deg_to_rad(43) and elbow_max<deg_to_rad(59),"reduced swing still extends beside body and flexes forward")
check(forward_samples>0 and back_samples>0 and forward_angles/maxi(1,forward_samples)>back_angles/maxi(1,back_samples)+deg_to_rad(20),"elbow flexion follows actual forward/backward shoulder swing")
check(elbow_min<deg_to_rad(23) and elbow_max>deg_to_rad(28) and elbow_max<deg_to_rad(39),"half swing still extends beside body and flexes forward")
check(forward_samples>0 and back_samples>0 and forward_angles/maxi(1,forward_samples)>back_angles/maxi(1,back_samples)+deg_to_rad(9),"elbow flexion follows actual forward/backward shoulder swing")
print("GAIT_METRICS ",JSON.stringify({"scale":actor.scale.x,"speed":speed,"max_slide":max_slide,"max_target_error":max_error,"max_lift":max_lift,"min_contact":min_contact}))
var phase=actor.gait.phase
for frame in range(30):actor._process(1.0/60)
+1 -1
View File
@@ -1,6 +1,6 @@
extends "res://infernal_gait.gd"
# Grounded idle breathing layered after the approved locomotion.
const ARM_WALK_AMPLITUDE=0.8
const ARM_WALK_AMPLITUDE=0.4
var idle_time=0.0
var idle_weight=0.0
var relaxed_weight=0.0