Skip to content

Commit c9eb34b

Browse files
author
DavidQ
committed
Finish shared transform pipeline cleanup across runtime, inspector, and editor preview - PR_26139_013-final-transform-pipeline-cleanup
1 parent 1594d35 commit c9eb34b

8 files changed

Lines changed: 611 additions & 334 deletions
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# PR_26139_013-final-transform-pipeline-cleanup
2+
3+
## Scope
4+
- Consolidated object-vector final transform behavior into shared rendering helpers.
5+
- Added a shared transform pipeline that resolves local shape points through object origin, shape transform, runtime instance rotation/position/scale, world-to-screen scale, and optional user zoom.
6+
- Routed runtime object rendering through the shared world/screen object render helper.
7+
- Routed Collision Inspector V2 viewport rendering through the shared viewport transform helper.
8+
- Routed shared collision geometry through the shared object-vector transform pipeline.
9+
- Routed Object Vector Studio V2 transformed bounds through the shared transformed-bounds helper while keeping editor zoom editor-only.
10+
- Preserved manifest geometry as the SSoT, intentional ship flame flicker, and intentional asteroid scale tuning.
11+
12+
## Runtime Lookup/Transform Path
13+
- Asteroids runtime still supplies explicit manifest object IDs and runtime radians.
14+
- `ObjectVectorRuntimeAssetService` now applies final object placement through `createWorldScreenTransform().applyObjectRenderTransform(...)`.
15+
- Shape-local transform still uses manifest shape transforms and object origin through `applyObjectVectorCanvasTransform(...)`.
16+
- Collision geometry now uses `createObjectVectorTransformPipeline(...).localPointsToWorld(...)` for final transformed points.
17+
- Collision Inspector V2 uses `applyViewportTransform(...)`; user zoom remains additional viewport zoom.
18+
- Object Vector Studio V2 uses shared point and transformed-bounds helpers for preview geometry while preserving editor viewport zoom semantics.
19+
20+
## Shared Helpers Added/Used
21+
- `createObjectVectorTransformPipeline`
22+
- `transformObjectVectorShapePoints`
23+
- `transformObjectVectorInstancePoints`
24+
- `boundsFromObjectVectorPoints`
25+
- `transformedObjectVectorShapeBounds`
26+
- `combineObjectVectorBounds`
27+
- `objectVectorBoundsCornerPoints`
28+
- `applyViewportTransform`
29+
- `applyObjectRenderTransform`
30+
- `worldPointToScreenPoint`
31+
- `worldPointToViewportPoint`
32+
33+
## Precision Note
34+
- The shared bounds helper intentionally does not round final bounds values early. A full Workspace V2 pass caught a 0.004px selection-bound drift when bounds were rounded to 3 decimals inside the helper; rounding now remains a display/reporting concern.
35+
36+
## Validation
37+
- PASS: `node --check src/engine/rendering/OrientationTransform.js`
38+
- PASS: `node --check src/engine/rendering/WorldScreenTransform.js`
39+
- PASS: `node --check src/engine/rendering/ObjectVectorRuntimeAssetService.js`
40+
- PASS: `node --check src/engine/collision/objectVector.js`
41+
- PASS: `node --check tools/collision-inspector-v2/js/CollisionInspectorV2Renderer.js`
42+
- PASS: `node --check tools/object-vector-studio-v2/js/ToolStarterApp.js`
43+
- PASS: `node --check tests/playwright/tools/CollisionInspectorV2.spec.mjs`
44+
- PASS: `npm run build:manifest`
45+
- Wrote `docs/build/sample-manifest.json`; generated output was removed after validation.
46+
- PASS: `node --input-type=module -e "import('./tests/games/AsteroidsPresentation.test.mjs').then((module) => module.run())"`
47+
- PASS: `node --input-type=module -e "import('./tests/final/PrecisionCollisionSystems.test.mjs').then((module) => module.run())"`
48+
- PASS: `npx playwright test tests/playwright/tools/CollisionInspectorV2.spec.mjs --project=playwright --workers=1 --reporter=list`
49+
- `4 passed`
50+
- Validates Collision Inspector V2 transform rendering, shared collision path, Asteroids manifest object loading, runtime/collision placement alignment, bullet heading/orientation, and Object Vector Studio V2 editor-only zoom against shared transform helpers.
51+
- PASS: `npx playwright test tests/playwright/tools/WorkspaceManagerV2.spec.mjs --project=playwright --workers=1 --reporter=list --grep "aligns Object Vector Studio V2 selection bounds to transformed preview geometry"`
52+
- `1 passed`
53+
- Validates Object Vector Studio V2 preview selection bounds align to transformed geometry after shared bounds consolidation.
54+
- PASS: `git diff --check HEAD~2`
55+
- PASS: Playwright V8 coverage report generated at `docs/dev/reports/playwright_v8_coverage_report.txt`.
56+
57+
## Workspace V2 Gate
58+
- WARN/FAIL: `npm run test:workspace-v2`
59+
- Final rerun result: `54 passed`, `2 failed`.
60+
- Failing tests:
61+
- `validates optional Text to Speech V2 schema contract through Workspace Manager V2 schema`
62+
- `tracks Object Vector Studio V2 dirty state through persisted edits and save outcomes`
63+
- The transform-related Workspace Manager V2 selection-bounds failure from the first run was fixed and rerun successfully.
64+
- Remaining failures are outside this PR's transform pipeline scope: one expects `text2speech-V2` to remain in Asteroids active context tools, and one expects a generated manifest schema-validation failure that now saves successfully through existing Workspace Manager V2 behavior.
65+
66+
## Full Samples Smoke Test
67+
- Skipped. This PR is limited to shared transform/runtime/tool alignment and does not broadly change the sample loader/framework.
68+
69+
## Manual Test Notes
70+
- Open `games/Asteroids/index.html`, rotate the ship, fire bullets, and verify ship, bullet, asteroid, and UFO placement/orientation remain visually aligned.
71+
- Open `tools/collision-inspector-v2/index.html?manifestPath=/games/Asteroids/game.manifest.json`, choose ship/bullet/asteroid/UFO pairs, change A/B rotation and zoom, and verify origins, heading guides, transformed points, and collision results update consistently.
72+
- Open Object Vector Studio V2, select/rotate transformed shapes, and verify selection bounds track preview geometry while editor zoom remains viewport-only.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# PR_26139_014-shared-transform-service-extraction
2+
3+
## Scope
4+
- Extracted the finalized object-vector transform pipeline into `ObjectVectorTransformService`.
5+
- Extracted world/screen scale, runtime object render transform, and inspector user zoom handling into `WorldScreenTransformService`.
6+
- Kept existing public helper functions as thin compatibility wrappers so Asteroids runtime, Collision Inspector V2, Object Vector Studio V2, and shared collision code continue using shared engine APIs.
7+
- Preserved Asteroids runtime as the placement/orientation source of truth: runtime object calls still provide world position, radians rotation, and manifest object IDs.
8+
- Preserved Object Vector Studio V2 editor semantics: editor zoom remains viewport/editor-only, while shared runtime/world scale remains independent.
9+
- Preserved manifest geometry as the SSoT, intentional ship flame flicker, and intentional asteroid scale tuning.
10+
11+
## Service Ownership
12+
- `src/engine/rendering/ObjectVectorTransformService.js`
13+
- Owns local shape point transforms.
14+
- Owns object origin/pivot handling.
15+
- Owns manifest shape rotation/scale/translation.
16+
- Owns runtime instance rotation, scale, and world position transforms.
17+
- Owns object-vector point/bounds helpers and pipeline creation.
18+
- `src/engine/rendering/WorldScreenTransformService.js`
19+
- Owns canonical world-to-screen scale.
20+
- Owns runtime object render transform application.
21+
- Owns inspector/user viewport zoom.
22+
- Owns screen/world/viewport point conversion.
23+
- `src/engine/rendering/OrientationTransform.js` and `WorldScreenTransform.js`
24+
- Now act as compatibility wrappers over the service classes.
25+
26+
## Runtime/Tool Alignment
27+
- Asteroids runtime render path still resolves through `ObjectVectorRuntimeAssetService`, which calls `createWorldScreenTransform(...).applyObjectRenderTransform(...)`.
28+
- Collision Inspector V2 still renders through the shared engine collision path and uses `applyViewportTransform(...)`; at zoom `1.0`, it matches runtime placement/orientation.
29+
- Object Vector Studio V2 preview still uses editor viewport zoom only; its transformed point and bounds checks now validate against the service-backed pipeline.
30+
31+
## Validation
32+
- PASS: `node --check src/engine/rendering/ObjectVectorTransformService.js`
33+
- PASS: `node --check src/engine/rendering/OrientationTransform.js`
34+
- PASS: `node --check src/engine/rendering/WorldScreenTransformService.js`
35+
- PASS: `node --check src/engine/rendering/WorldScreenTransform.js`
36+
- PASS: `node --check src/engine/rendering/index.js`
37+
- PASS: `node --check src/engine/rendering/ObjectVectorRuntimeAssetService.js`
38+
- PASS: `node --check src/engine/collision/objectVector.js`
39+
- PASS: `node --check tools/collision-inspector-v2/js/CollisionInspectorV2Renderer.js`
40+
- PASS: `node --check tools/object-vector-studio-v2/js/ToolStarterApp.js`
41+
- PASS: `node --check tests/playwright/tools/CollisionInspectorV2.spec.mjs`
42+
- PASS: direct module import/service sanity check for `ObjectVectorTransformService` and `WorldScreenTransformService`.
43+
- PASS: `npm run build:manifest`
44+
- Wrote `docs/build/sample-manifest.json`; generated output was removed after validation.
45+
- PASS: `node --input-type=module -e "import('./tests/games/AsteroidsPresentation.test.mjs').then((module) => module.run())"`
46+
- PASS: `node --input-type=module -e "import('./tests/final/PrecisionCollisionSystems.test.mjs').then((module) => module.run())"`
47+
- PASS: `npx playwright test tests/playwright/tools/CollisionInspectorV2.spec.mjs --project=playwright --workers=1 --reporter=list`
48+
- `4 passed`
49+
- Validates manifest object loading, runtime/collision placement alignment, bullet/object orientation, Collision Inspector viewport transforms, and Object Vector Studio V2 editor-only zoom against the extracted services.
50+
- PASS: `npx playwright test tests/playwright/tools/WorkspaceManagerV2.spec.mjs --project=playwright --workers=1 --reporter=list --grep "aligns Object Vector Studio V2 selection bounds to transformed preview geometry"`
51+
- `1 passed`
52+
- Validates OVS preview selection bounds still match transformed geometry after service extraction.
53+
- PASS: `git diff --check`
54+
- Only line-ending conversion warnings were reported.
55+
- PASS: Playwright V8 coverage report generated at `docs/dev/reports/playwright_v8_coverage_report.txt`.
56+
57+
## Workspace V2 Gate
58+
- WARN/FAIL: `npm run test:workspace-v2`
59+
- Result: `54 passed`, `2 failed`.
60+
- Failing tests:
61+
- `validates optional Text to Speech V2 schema contract through Workspace Manager V2 schema`
62+
- `tracks Object Vector Studio V2 dirty state through persisted edits and save outcomes`
63+
- These are the same non-transform failures documented in PR_26139_013. The transform-sensitive Workspace Manager V2 / Object Vector Studio V2 selection-bounds test passes.
64+
65+
## Full Samples Smoke Test
66+
- Skipped. This PR extracts shared transform services and validates the impacted runtime/tool paths directly; it does not broadly change sample loading/framework behavior.
67+
68+
## Manual Test Notes
69+
- Open `games/Asteroids/index.html`, rotate the ship, fire bullets, and verify ship, bullet, asteroid, and UFO placement/orientation remain visually aligned.
70+
- Open `tools/collision-inspector-v2/index.html?manifestPath=/games/Asteroids/game.manifest.json`, choose ship/bullet/asteroid/UFO pairs, change rotation and zoom, and verify zoom `1.0` matches runtime placement/orientation.
71+
- Open Object Vector Studio V2, select/rotate transformed shapes, and verify selection bounds track preview geometry while editor zoom remains viewport-only.

0 commit comments

Comments
 (0)