ani
This commit is contained in:
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user