Increase walking elbow flexion while preserving approved idle
This commit is contained in:
@@ -31,6 +31,7 @@ func run(g):
|
||||
actor.get_parent().position=Vector3.ZERO;actor.rotation=Vector3.ZERO;actor.striking=false;actor.refresh();actor.animator.advance(0);actor.reset_gait()
|
||||
var max_slide=0.0;var max_error=0.0;var max_lift=0.0;var min_contact=10.0;var planted_frames=0
|
||||
var hand_min=Vector2(INF,INF);var hand_max=Vector2(-INF,-INF);var cross_sum=0.0
|
||||
var hand_sum=Vector2.ZERO;var samples=0;var elbow_min=INF;var elbow_max=0.0
|
||||
for frame in range(240):
|
||||
var before=[]
|
||||
for f in actor.gait.feet:before.append({"grounded":f.grounded,"anchor":f.anchor,"position":actor.gait.point("foot."+f.side)})
|
||||
@@ -44,7 +45,10 @@ func run(g):
|
||||
var side="L" if side_index==0 else "R"
|
||||
hand_offsets[side_index]=(actor.gait.point("wrist."+side)-actor.gait.point("upperarm01."+side)).dot(actor.global_basis.z.normalized())
|
||||
hand_min[side_index]=minf(hand_min[side_index],hand_offsets[side_index]);hand_max[side_index]=maxf(hand_max[side_index],hand_offsets[side_index])
|
||||
cross_sum+=(hand_offsets.x-.12)*(hand_offsets.y-.12)
|
||||
var upper=actor.gait.point("lowerarm01."+side)-actor.gait.point("upperarm01."+side)
|
||||
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)
|
||||
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)
|
||||
max_error=maxf(max_error,actual.distance_to(f.target))
|
||||
@@ -57,7 +61,8 @@ func run(g):
|
||||
check(min_contact>-.002,"ground clearance")
|
||||
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<0,"opposing left/right arm swing")
|
||||
check(cross_sum/samples-(hand_sum.x/samples)*(hand_sum.y/samples)<0,"opposing left/right arm swing")
|
||||
check(elbow_min>deg_to_rad(38) and elbow_max<deg_to_rad(68),"pronounced but natural walking elbow flexion")
|
||||
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)
|
||||
|
||||
@@ -42,11 +42,17 @@ func relax_arm(side,breath):
|
||||
var forward=actor.global_basis.z.normalized();var right=actor.global_basis.x.normalized()
|
||||
var down=-actor.global_basis.y.normalized()
|
||||
var swing=sign_x*sin(phase*TAU)*.32*walk_weight
|
||||
var bend=deg_to_rad(14.0+8.0*walk_weight)+sin(idle_time*TAU/6.4+sign_x*.4)*.025*idle_weight
|
||||
var bend=deg_to_rad(14.0)+sin(idle_time*TAU/6.4+sign_x*.4)*.025*idle_weight
|
||||
# The Meshy arm surface has a wider sculpted rest pose than the inherited rig.
|
||||
# Retarget its lateral offset so the visible arms, not just the bones, hang down.
|
||||
var upper_direction=(down-right*sign_x*.24+forward*(swing+breath*.012*idle_weight)).normalized()
|
||||
aim_blended(upper,lower,a+upper_direction*length_upper)
|
||||
var elbow=point(lower)
|
||||
var forearm_direction=(down-right*sign_x*.13+forward*(swing+tan(bend)+breath*.012*idle_weight)).normalized()
|
||||
# Rotate the forearm relative to its swinging upper arm so flexion does not
|
||||
# collapse when that arm swings forward. The approved idle stays identical.
|
||||
var walking_bend=deg_to_rad(52.0+8.0*sin(phase*TAU*sign_x-.3))
|
||||
var walking_base=(down-right*sign_x*.13+forward*swing).normalized()
|
||||
var walking_forearm=Quaternion(right,-walking_bend)*walking_base
|
||||
forearm_direction=forearm_direction.slerp(walking_forearm,walk_weight).normalized()
|
||||
aim_blended(lower,wrist,elbow+forearm_direction*length_lower)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# Walking elbow flexion, second iteration
|
||||
|
||||
The accepted idle is unchanged. During locomotion, forearms rotate relative
|
||||
to the upper-arm swing, with a 52-degree center and 8-degree cycle variation.
|
||||
This avoids the old additive direction cancelling flexion on the forward swing.
|
||||
Stopping blends smoothly back to the original relaxed pose. Whip retains control.
|
||||
|
||||
`walk.gif` and `side.png`: actual Godot game capture from the side.
|
||||
Capture command: `tools/capture_relaxed_arms.gd -- --run-only --side`.
|
||||
`--test-gait` passes for heroine and three helpers at five speeds, including
|
||||
38–68-degree measured elbow bounds, opposing hand motion, feet and stopping.
|
||||
The original idle breathing and pose code has not been changed. No EXE export.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 207 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.6 MiB |
Reference in New Issue
Block a user