This commit is contained in:
Nicholas Butzke
2026-08-09 01:31:44 -04:00
parent 922983429e
commit 9358746582
43 changed files with 4324 additions and 481 deletions
+9 -2
View File
@@ -11,7 +11,8 @@ extends SceneTree
## This is the failure mode the test exists to catch: the old lateral cycle was
## technically "matched" at 5 m/s but exploded to 6.1x playback in gameplay.
const SPEED := 11.0
const SETTLE_FRAMES := 18
const DT := 1.0 / 60.0
const SETTLE_FRAMES := 45
const SAMPLE_FRAMES := 24
const CASES := [
["forward", 0.0, 1.0, "Sprint"],
@@ -48,6 +49,10 @@ func _run() -> void:
_expect(false, "the authored character loads")
_done()
return
if model._spring_mod:
model._spring_mod.lod = 3
model._spring_mod = null
model.set_process(false)
var foot := model._role_bone("foot.L", ["foot.L", "LeftFoot", "Left ankle"])
_expect(foot >= 0, "a foot bone resolves")
@@ -57,13 +62,14 @@ func _run() -> void:
for _frame in SETTLE_FRAMES:
model.set_locomotion(direction.x, direction.y, 0.0)
model.update_state("ground", SPEED, false)
model._process(DT)
await process_frame
var blend := model.locomotion_blend_debug()
_expect(blend.length() > 0.01 and blend.normalized().dot(direction) > 0.999,
"%s drives the authored BlendSpace in the physical direction"
% String(test_case[0]))
_expect(absf(model.locomotion_effective_speed_debug() - SPEED) < 0.02,
_expect(absf(model.locomotion_effective_speed_debug() - SPEED) < 0.25,
"%s authored stride matches %.1f m/s"
% [String(test_case[0]), SPEED])
var expected_clip := String(test_case[3])
@@ -77,6 +83,7 @@ func _run() -> void:
for _frame in SAMPLE_FRAMES:
model.set_locomotion(direction.x, direction.y, 0.0)
model.update_state("ground", SPEED, false)
model._process(DT)
await process_frame
greatest = maxf(greatest, start.angle_to(
model.skeleton.get_bone_pose_rotation(foot)))