Let an animation key Z so an object can pass behind another
The timeline offered X and Y as position rows but never Z. The list of position rows was simply written without it when animations came in with #97. A swinging weapon could therefore not go behind its character. - Z is the third position row, after X and Y, on every placed root or object. A scene and a behavior still offer no position. - Play and preview already read and write any position row by name, so the one entry in POSITION_KEYS is all the code change. - The draw order is sorted on every render, and play writes z back into the scene each frame. A keyed Z therefore takes effect at once. A blended 4.5 sits above 4 and below 5. Tests: - ./check.sh: 165 files, 2416 tests, CHECK EXIT 0. - 3 new unit tests in tests/core/animation.test.ts: Z is offered after X and Y and not on a behavior or scene, a running game moves the object from behind to in front of another one, and play, scene write-back and preview agree on z. - e2e 25: ALL PASSED, 29 checks. The new check reads X, Y, Z as the first rows of the row dialog. Check sum 1396 -> 1397. - Counter-check: without z in the list all 3 new unit tests fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
147f8ffbea
commit
fae827c087
4 files changed
+75
-4
No files matched your search
@@ -56,7 +56,13 @@ export async function animation(t) {
|
||||
);
|
||||
await evaluate("__gm.animation.rowDialogPick('an-arm', 'x')");
|
||||
await settle();
|
||||
const armProperties = (await json('__gm.animation.rowDialog()')).properties.length;
|
||||
const armOffered = (await json('__gm.animation.rowDialog()')).properties;
|
||||
const armProperties = armOffered.length;
|
||||
check(
|
||||
'the position rows come first, Z (the draw order) after X and Y',
|
||||
JSON.stringify(armOffered.slice(0, 3)) === JSON.stringify(['X', 'Y', 'Z']),
|
||||
JSON.stringify(armOffered),
|
||||
);
|
||||
const addButton = await find('Add row', true);
|
||||
await click(addButton.x, addButton.y);
|
||||
const row = (await walk()).tracks;
|
||||
|
||||
Reference in new issue
Block a user