fix(animation): retain trailing PartArray poses

Port CPartArray::UpdateParts minimum-count behavior: preserve the prior visual and rigid transforms for setup parts absent from a short authored AnimFrame, including the initial hydrated rest pose.

Co-Authored-By: OpenAI Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-21 09:41:15 +02:00
parent f004ac5562
commit a2fd61684a
6 changed files with 326 additions and 59 deletions

View file

@ -194,6 +194,29 @@ InterpolationManager.adjust_offset(delta, dt):
relative.frame.set_heading(0)
delta = relative.frame // replaces both origin and orientation
## Part-count retention (`CPartArray::UpdateParts` @ `0x005190F0`)
```text
count = min(partArray.num_parts, animationFrame.num_parts)
for i in 0 .. count - 1:
part[i].frame = combine_scaled(animationFrame.part[i], partArray.scale)
// No loop touches [count .. partArray.num_parts).
// Those CPhysicsPart frames therefore retain their complete prior state.
```
The retained state has two presentation channels in acdream:
- the visible mesh transform retains Setup `DefaultScale`, animated frame, and
object `ObjScale`;
- the indexed rigid/effect pose retains animated orientation and the
ObjScale-adjusted origin, without Setup `DefaultScale`.
On the first presentation, "prior" means the already-hydrated Setup/rest
frames installed by PartArray construction. A short later AnimFrame retains
the most recently presented transform in both channels. Resetting missing
parts to origin/identity is not retail behavior.
CPhysicsObj.SetPositionInternal(transition):
if transition.current_cell is null:
prepare_to_leave_visibility()