jump ani fixing and transition animations

This commit is contained in:
Nicholas Butzke
2026-08-10 12:50:00 -04:00
parent 833e936bcd
commit 0ce626ad42
13 changed files with 359 additions and 35 deletions
+41
View File
@@ -81,6 +81,40 @@ func _run() -> void:
_snap("post_right_20")
await _drive("ground", 0.0, 70)
_snap("post_right_idle")
# Speed-scaled traversal entry: preserve three early frames so a hard cut is
# visually obvious in review while the final wall pose remains unchanged.
body.velocity = Vector3(0.0, -3.0, -SPEED)
await _drive("air", SPEED, 20)
_model.set_wall_side(1.0)
_model.set_wall_glide_motion(Vector3(0.0, 0.0, -SPEED))
await _drive("wall_run", SPEED, 1)
_snap("wall_transition_01")
await _drive("wall_run", SPEED, 3)
_snap("wall_transition_04")
await _drive("wall_run", SPEED, 6)
_snap("wall_transition_10")
# The stopping one-shot is driven while speed physically decays instead of
# leaving the high-rate Sprint cycle active until an instant zero.
_model.set_locomotion(0.0, 1.0, 0.0)
await _drive("ground", 11.0, 45)
_snap("stop_00_run")
for sample in [["stop_01", 10.0, 1], ["stop_06", 4.5, 5],
["stop_14", 1.2, 8]]:
await _drive("stop", float(sample[1]), int(sample[2]))
_snap(String(sample[0]))
await _drive("ground", 0.0, 18)
_snap("stop_32_idle")
# Successive hops select source and offline-mirrored source performances.
body.velocity = Vector3(0.0, 8.5, -8.0)
await _drive("air", 8.0, 12)
_snap("jump_normal")
await _drive("ground", 0.0, 24)
body.velocity = Vector3(0.0, 8.5, -8.0)
await _drive("air_alt", 8.0, 12)
_snap("jump_alternate")
quit()
@@ -132,6 +166,7 @@ func _pose_metrics() -> Dictionary:
max_torso_joint_angle = joint_angle
max_torso_joint = _model.skeleton.get_bone_name(chain[index])
var max_leg_horizontal_ratio := 0.0
var knee_rise := {"L": 0.0, "R": 0.0}
for side in ["L", "R"]:
var thigh := _model._role_bone("thigh." + side,
["thigh." + side, "Left thigh" if side == "L" else "Right thigh"])
@@ -142,6 +177,7 @@ func _pose_metrics() -> Dictionary:
var segment := _model.skeleton.get_bone_global_pose(shin).origin \
- _model.skeleton.get_bone_global_pose(thigh).origin
segment = _model.skeleton.global_transform.basis * segment
knee_rise[side] = segment.y
if segment.length() > 0.0001:
max_leg_horizontal_ratio = maxf(max_leg_horizontal_ratio,
Vector2(segment.x, segment.z).length() / segment.length())
@@ -149,4 +185,9 @@ func _pose_metrics() -> Dictionary:
"torso_joint_angle": max_torso_joint_angle,
"torso_joint": max_torso_joint,
"leg_horizontal_ratio": max_leg_horizontal_ratio,
"left_knee_segment_y": knee_rise["L"],
"right_knee_segment_y": knee_rise["R"],
"knee_lead": float(knee_rise["R"]) - float(knee_rise["L"]),
"clip": _model.current_clip_debug(),
"crossfade": _model._state_trans.xfade_time,
}