Reduce walking arm swing and elbow flexion amplitude by twenty percent

This commit is contained in:
JariKo
2026-10-29 00:00:53 +02:00
parent cc22bdcc4b
commit ebe00c366c
3 changed files with 12 additions and 4 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
extends "res://infernal_gait.gd"
# Grounded idle breathing layered after the approved locomotion.
const ARM_WALK_AMPLITUDE=0.8
var idle_time=0.0
var idle_weight=0.0
var relaxed_weight=0.0
@@ -41,7 +42,7 @@ func relax_arm(side,breath):
var length_lower=point(lower).distance_to(point(wrist))
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 swing=sign_x*sin(phase*TAU)*.32*ARM_WALK_AMPLITUDE*walk_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.
@@ -52,7 +53,7 @@ func relax_arm(side,breath):
# Human arm swing: flex on the forward half of the step, then extend while
# returning through the relaxed side position and the small backswing.
var forward_reach=smoothstep(0.0,1.0,maxf(0.0,sin(phase*TAU)*sign_x))
var walking_bend=lerpf(bend,deg_to_rad(60.0),forward_reach)
var walking_bend=lerpf(bend,deg_to_rad(60.0),forward_reach*ARM_WALK_AMPLITUDE)
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()