acdream/src/AcDream.Core/Physics
Erik 4db0b2f16c feat(anim): Phase E.1 motion hooks + PosFrames + velocity/omega surfacing
AnimationSequencer now walks every integer frame boundary crossed in a
tick (ACE Sequence.update_internal pattern), dispatching AnimationHook
objects whose Direction matches the playback direction (Forward or
Backward) or is Both. Mirrors ACE's Sequence.execute_hooks exactly.

New public API:
- ConsumePendingHooks() drains all hooks fired since last call, including
  AnimationDone sentinel on link-node drain (emote/attack completion).
- ConsumeRootMotionDelta() drains accumulated PosFrames root motion;
  AFrame.Combine (forward) / AFrame.Subtract (backward) applied per
  crossed frame to match retail.
- CurrentVelocity / CurrentOmega expose the active MotionData's velocity
  and omega (scaled by speedMod at enqueue), letting downstream physics
  integrate the animation-driven motion.

All 27 AnimationHookType variants (SoundHook, AttackHook,
CreateParticleHook, ReplaceObjectHook, DefaultScriptHook, SetOmegaHook,
TransparentHook, ScaleHook, SetLightHook, etc.) now flow through the
hook queue. Consumers in E.2/E.3 (audio + particles) will route them to
the right subsystems.

9 new tests cover: forward-hook crossing fires exactly once, Both-direction
fires in either direction, Forward-only suppressed on reverse playback,
Backward fires on reverse, PosFrames accumulation + drain, Velocity
exposure + speedMod scaling, AnimationDone fires on link drain.

Build green; 470 tests → 479 (361 Core + 9 new E.1 hook tests + 109 Net).

Ref: docs/research/deepdives/r03-motion-animation.md §5 (hooks), §7.1-7.2
(PosFrames), §7.3 (negative framerate).
Ref: ACE Sequence.cs:262 (execute_hooks), Sequence.cs:351-443
(update_internal per-frame crossing walk).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 16:28:15 +02:00
..
AnimationSequencer.cs feat(anim): Phase E.1 motion hooks + PosFrames + velocity/omega surfacing 2026-04-18 16:28:15 +02:00
BSPQuery.cs feat(ui): debug overlay + refined input controls 2026-04-17 18:45:38 +02:00
CellSurface.cs feat(core): Phase B.3 — CellSurface (indoor floor polygon projection) 2026-04-12 09:51:22 +02:00
CollisionPrimitives.cs feat(physics): port 9 collision primitives from acclient.exe (chunk_00530000.c) 2026-04-12 23:53:47 +02:00
MotionInterpreter.cs fix(anim): jump animation via Falling SubState + kept PlayAction infra for emotes 2026-04-18 15:32:52 +02:00
PhysicsBody.cs fix(physics): jump apex velocity zeroing bug 2026-04-14 10:13:27 +02:00
PhysicsDataCache.cs feat(ui): debug overlay + refined input controls 2026-04-17 18:45:38 +02:00
PhysicsEngine.cs fix(physics): don't fall back to no-collision resolve on transition fail 2026-04-14 12:58:06 +02:00
PlayerWeenie.cs feat(physics): PlayerWeenie with retail Run/Jump formulas 2026-04-13 23:15:25 +02:00
PortalPlane.cs fix(core): Phase B.3 — add centroid + radius bounds to PortalPlane crossing test 2026-04-12 19:08:46 +02:00
ResolveResult.cs feat(core): Phase B.3 — PhysicsEngine (top-level collision resolver) 2026-04-12 09:54:28 +02:00
ShadowObjectRegistry.cs feat(ui): debug overlay + refined input controls 2026-04-17 18:45:38 +02:00
TerrainSurface.cs fix(physics): correct terrain Z sampling triangle layout in TerrainSurface 2026-04-12 22:25:32 +02:00
TransitionTypes.cs feat(ui): debug overlay + refined input controls 2026-04-17 18:45:38 +02:00