ani
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
extends SceneTree
|
||||
|
||||
## Regression gate for authored wall running and physical grapple posing.
|
||||
## Regression gate for jet-propelled wall traversal and physical grapple posing.
|
||||
##
|
||||
## Wall running must select side-specific authored performances, never a ground
|
||||
## run under another name. Grapple must keep its authored airborne base while
|
||||
## Wall traversal must select the authored side-specific pilot performances,
|
||||
## keep their source timing independent of gameplay speed, and face along the
|
||||
## live wall tangent. Jets still own propulsion; the animation owns silhouette.
|
||||
## Grapple must keep its authored airborne base while
|
||||
## the live arm constraint lands the palm on the cable ray and body alignment
|
||||
## responds to pendulum energy.
|
||||
|
||||
const SETTLE_FRAMES := 90
|
||||
const SAMPLE_FRAMES := 30
|
||||
const WALL_RUN_SPEED := 13.0
|
||||
const WALL_RUN_REFERENCE_SPEED := 8.25
|
||||
const WALL_GLIDE_SPEED := 13.0
|
||||
|
||||
var _failures := 0
|
||||
|
||||
@@ -48,27 +49,27 @@ func _run() -> void:
|
||||
"hips and both hands resolve")
|
||||
|
||||
model.set_wall_side(-1.0)
|
||||
model.set_wall_run_motion(Vector3(13.0, 0.0, 0.0))
|
||||
await _settle(model, "wall_run", WALL_RUN_SPEED)
|
||||
model.set_wall_glide_motion(Vector3(13.0, 0.0, 0.0))
|
||||
await _settle(model, "wall_run", WALL_GLIDE_SPEED)
|
||||
_expect(model.current_clip_debug() == "WallRunLeft",
|
||||
"left wall selects the authored WallRunLeft performance")
|
||||
"left wall traversal selects its authored pilot performance")
|
||||
var wall_scale := float(model._anim_tree.get("parameters/loco_scale/scale"))
|
||||
_expect(absf(wall_scale - WALL_RUN_SPEED / WALL_RUN_REFERENCE_SPEED) < 0.02,
|
||||
"wall-run cadence tracks %.1f m/s (%.3fx)"
|
||||
% [WALL_RUN_SPEED, wall_scale])
|
||||
_expect(absf(wall_scale - 1.0) < 0.02,
|
||||
"wall traversal keeps the authored source timing (%.3fx)"
|
||||
% wall_scale)
|
||||
var wall_foot_motion := await _sample_foot_motion(
|
||||
model, foot, "wall_run", WALL_RUN_SPEED)
|
||||
_expect(wall_foot_motion > 0.30,
|
||||
"wall-run has a full wall-stride leg cycle (%.3f rad)"
|
||||
model, foot, "wall_run", WALL_GLIDE_SPEED)
|
||||
_expect(wall_foot_motion > 0.12,
|
||||
"wall traversal retains its authored propulsion cycle (%.3f rad motion)"
|
||||
% wall_foot_motion)
|
||||
var wall_forward := model.wall_run_forward_debug()
|
||||
var wall_forward := model.wall_glide_forward_debug()
|
||||
_expect(wall_forward.dot(Vector3.RIGHT) > 0.97,
|
||||
"wall-run model faces along wall-tangent velocity (dot %.3f)"
|
||||
"wall-glide model faces along wall-tangent velocity (dot %.3f)"
|
||||
% wall_forward.dot(Vector3.RIGHT))
|
||||
model.set_wall_side(1.0)
|
||||
await _settle(model, "wall_run", WALL_RUN_SPEED)
|
||||
await _settle(model, "wall_run", WALL_GLIDE_SPEED)
|
||||
_expect(model.current_clip_debug() == "WallRunRight",
|
||||
"right wall selects the authored WallRunRight performance")
|
||||
"right wall traversal selects its authored pilot performance")
|
||||
_expect(not model.clip_names_debug().has("WallRun"),
|
||||
"the relabelled ground-run WallRun clip is absent")
|
||||
|
||||
@@ -98,7 +99,8 @@ func _run() -> void:
|
||||
model.set_locomotion(0.0, -1.0, 0.0)
|
||||
await _settle(model, "ground", 8.25)
|
||||
var spine_names: Array = model._rig_info.get("roles", {}).get("spine", [])
|
||||
var first_spine := model.skeleton.find_bone(String(spine_names[0])) \
|
||||
var first_spine := RigRoles.find_imported_bone(
|
||||
model.skeleton, String(spine_names[0])) \
|
||||
if not spine_names.is_empty() else -1
|
||||
_expect(first_spine >= 0, "the first spine bone resolves")
|
||||
if first_spine >= 0:
|
||||
@@ -113,8 +115,12 @@ func _run() -> void:
|
||||
var hips_delta := hips_pose * hips_rest.inverse()
|
||||
var spine_delta := spine_pose * spine_rest.inverse()
|
||||
var abdomen_twist := hips_delta.angle_to(spine_delta)
|
||||
_expect(abdomen_twist < 1.45,
|
||||
"backward capture keeps hips and abdomen coherent (%.3f rad)"
|
||||
# The Titanfall combat-backpedal deliberately keeps the weapon-facing
|
||||
# chest counter-rotated over the travelling hips. The old broken capture
|
||||
# was a full 180-degree lower-body reversal; preserve the authored turn
|
||||
# while still rejecting that corkscrew.
|
||||
_expect(abdomen_twist < 2.25,
|
||||
"backward capture keeps the authored torso counter-turn (%.3f rad)"
|
||||
% abdomen_twist)
|
||||
|
||||
var anchor := model.global_position + Vector3(3.0, 7.0, -6.0)
|
||||
|
||||
Reference in New Issue
Block a user