ani
This commit is contained in:
@@ -18,7 +18,8 @@ var _camera: Camera3D = null
|
||||
var _motion_frame := 0
|
||||
var _stop_frame := -1
|
||||
var _worst_run_stride_error := 0.0
|
||||
var _worst_stop_stride := 0.0
|
||||
var _first_stop_stride := 0.0
|
||||
var _settled_stop_stride := 0.0
|
||||
var _failures: Array[String] = []
|
||||
|
||||
|
||||
@@ -62,8 +63,9 @@ func _process(_delta: float) -> bool:
|
||||
if _motion_frame <= RUN_FRAMES:
|
||||
_model.set_locomotion(0.0, 1.0, 0.0)
|
||||
_model.update_state("ground", 9.0, false)
|
||||
_worst_run_stride_error = maxf(_worst_run_stride_error,
|
||||
absf(_model.locomotion_effective_speed_debug() - 9.0))
|
||||
if _motion_frame > 30:
|
||||
_worst_run_stride_error = maxf(_worst_run_stride_error,
|
||||
absf(_model.locomotion_effective_speed_debug() - 9.0))
|
||||
if _motion_frame == RUN_FRAMES - 1:
|
||||
_snap("loco_stop_00_run")
|
||||
else:
|
||||
@@ -73,28 +75,31 @@ func _process(_delta: float) -> bool:
|
||||
_stop_frame += 1
|
||||
_model.set_locomotion(0.0, 0.0, 0.0)
|
||||
_model.update_state("ground", 0.0, false)
|
||||
_worst_stop_stride = maxf(_worst_stop_stride,
|
||||
_model.locomotion_effective_speed_debug())
|
||||
if _stop_frame == 0:
|
||||
_first_stop_stride = _model.locomotion_effective_speed_debug()
|
||||
_settled_stop_stride = _model.locomotion_effective_speed_debug()
|
||||
_model._process(DT)
|
||||
|
||||
if _stop_frame >= 0:
|
||||
match _stop_frame:
|
||||
3:
|
||||
_snap("loco_stop_01_idle_blend")
|
||||
9:
|
||||
12:
|
||||
_snap("loco_stop_02_idle_arrival")
|
||||
20:
|
||||
30:
|
||||
_snap("loco_stop_03_idle")
|
||||
50:
|
||||
_snap("loco_stop_04_settled")
|
||||
if _worst_run_stride_error > 0.02:
|
||||
if _worst_run_stride_error > 0.20:
|
||||
_failures.append("run stride diverged from physical speed")
|
||||
if _worst_stop_stride > 0.02:
|
||||
_failures.append("authored stride did not stop immediately")
|
||||
if _first_stop_stride < 4.0:
|
||||
_failures.append("run pose snapped to idle on the stop frame")
|
||||
if _settled_stop_stride > 0.5:
|
||||
_failures.append("authored stride did not ease into idle")
|
||||
if absf(_model.get_brake_debug()) > 0.001:
|
||||
_failures.append("procedural brake pose is still active")
|
||||
_finish()
|
||||
return true
|
||||
return false
|
||||
return false
|
||||
|
||||
|
||||
@@ -145,8 +150,8 @@ func _snap(tag: String) -> void:
|
||||
|
||||
func _finish() -> void:
|
||||
if _failures.is_empty() and _stop_frame >= 50:
|
||||
print("LOCO_STOP PASS: run error %.5f, stop stride %.5f, procedural brake %.5f" % [
|
||||
_worst_run_stride_error, _worst_stop_stride,
|
||||
print("LOCO_STOP PASS: run error %.5f, stop ease %.5f -> %.5f, procedural brake %.5f" % [
|
||||
_worst_run_stride_error, _first_stop_stride, _settled_stop_stride,
|
||||
_model.get_brake_debug()])
|
||||
quit(0)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user