Skip to content

Commit a7c1c98

Browse files
author
Delta Team
committed
Merge PR_26177_DELTA_003-hitboxes-engine-collision-contract
2 parents 25918db + e6c4f68 commit a7c1c98

9 files changed

Lines changed: 750 additions & 306 deletions
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# PR_26177_DELTA_003-hitboxes-engine-collision-contract
2+
3+
Team: Delta
4+
Branch: PR_26177_DELTA_003-hitboxes-engine-collision-contract
5+
Base: PR_26177_DELTA_002-hitboxes-foundation
6+
Scope: Shared engine collision contract only
7+
8+
## Summary
9+
10+
Added an engine-owned Hitboxes collision contract for future Hitboxes preview/testing and runtime reuse. The logic is shared under `src/engine/collision/` and is not page-local.
11+
12+
## Changes
13+
14+
- Added `src/engine/collision/hitboxCollision.js`.
15+
- Added AABB normalization and overlap helpers.
16+
- Added swept AABB collision calculation with collision time, impact normal, impact point, and before/after/impact positions.
17+
- Added focused unit tests in `tests/engine/HitboxCollisionContract.test.mjs`.
18+
19+
## Deferred
20+
21+
- No Hitboxes editor UI.
22+
- No object source selection.
23+
- No two-object preview UI.
24+
- No swept-motion preview UI.
25+
- No Hitboxes persistence changes.
26+
27+
## Validation
28+
29+
- PASS: `node --check src/engine/collision/hitboxCollision.js`
30+
- PASS: `node --check tests/engine/HitboxCollisionContract.test.mjs`
31+
- PASS: `node ./scripts/run-node-test-files.mjs tests/engine/HitboxCollisionContract.test.mjs`
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# PR_26177_DELTA_003 Hitboxes Engine Collision Contract Branch Validation
2+
3+
Branch: PR_26177_DELTA_003-hitboxes-engine-collision-contract
4+
Base: PR_26177_DELTA_002-hitboxes-foundation
5+
6+
Result: PASS
7+
8+
| Check | Status | Notes |
9+
|---|---|---|
10+
| Current branch inside Delta Hitboxes chain | PASS | Started from `PR_26177_DELTA_002-hitboxes-foundation`. |
11+
| Working tree clean before branch | PASS | No dirty files before branch creation. |
12+
| Stacked branch created | PASS | Work is on `PR_26177_DELTA_003-hitboxes-engine-collision-contract`. |
13+
| No return to main | PASS | This PR was stacked from the active Delta Hitboxes branch. |
14+
| Scope is engine collision contract only | PASS | Changed shared engine collision module, unit test, and reports only. |
15+
| No Hitboxes editor UI | PASS | No `toolbox/hitboxes` or `assets/toolbox/hitboxes` files changed. |
16+
| start_of_day untouched | PASS | No `start_of_day` files changed. |
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# PR_26177_DELTA_003 Hitboxes Engine Collision Contract Manual Validation Notes
2+
3+
- Confirmed this PR is stacked from `PR_26177_DELTA_002-hitboxes-foundation`, not from `main`.
4+
- Confirmed the implementation is engine-owned shared collision logic under `src/engine/collision/`.
5+
- Confirmed no Hitboxes editor UI files were modified.
6+
- Confirmed the high-speed vertical swept AABB regression detects impact at time `0.4`.
7+
- Confirmed impact normal for downward motion is `{ x: 0, y: -1 }`.
8+
- Confirmed before, after, and impact positions are exposed by the contract result.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# PR_26177_DELTA_003 Hitboxes Engine Collision Contract Requirement Checklist
2+
3+
| Requirement | Status | Notes |
4+
|---|---|---|
5+
| Add shared collision module | PASS | Added `src/engine/collision/hitboxCollision.js`. |
6+
| Collision logic not page-local | PASS | Logic lives under engine collision source, not Hitboxes page JS. |
7+
| AABB overlap contract | PASS | `aabbOverlap(...)` returns normalized boxes, overlap state, and intersection. |
8+
| Bounding box normalization | PASS | `normalizeBoundingBox(...)` supports negative dimensions and left/top/right/bottom. |
9+
| Swept AABB contract | PASS | `sweptAabb(...)` evaluates moving AABB against target AABB over a delta. |
10+
| Collision time | PASS | Swept result includes `collisionTime`; helper `collisionTime(...)` is exported. |
11+
| Impact normal | PASS | Swept result includes `impactNormal`. |
12+
| Impact point | PASS | Swept result includes `impactPoint`. |
13+
| Before/after positions | PASS | Swept result includes `beforePosition`, `afterPosition`, `startPosition`, and `endPosition`. |
14+
| Regression high-speed vertical impact | PASS | Test covers moving 10x10 box from `0,0` toward target at `0,50` without skipping. |
15+
| Unit tests | PASS | Added `tests/engine/HitboxCollisionContract.test.mjs`. |
16+
| No Hitboxes editor UI | PASS | No UI files changed in this PR. |
17+
| No unrelated tools | PASS | No unrelated tool files changed. |
18+
| No start_of_day folders | PASS | No `start_of_day` files changed. |
19+
| Required reports and ZIP | PASS | Reports and `tmp/PR_26177_DELTA_003-hitboxes-engine-collision-contract_delta.zip` produced. |
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# PR_26177_DELTA_003 Hitboxes Engine Collision Contract Validation Lane
2+
3+
## Commands
4+
5+
| Command | Status | Notes |
6+
|---|---|---|
7+
| `git branch --show-current` | PASS | Confirmed `PR_26177_DELTA_003-hitboxes-engine-collision-contract`. |
8+
| `node --check src/engine/collision/hitboxCollision.js` | PASS | Shared collision module parses. |
9+
| `node --check tests/engine/HitboxCollisionContract.test.mjs` | PASS | Unit test parses. |
10+
| `node ./scripts/run-node-test-files.mjs tests/engine/HitboxCollisionContract.test.mjs` | PASS | `1/1 targeted node test file(s) passed.` |
11+
12+
## Result
13+
14+
PASS. Focused engine collision contract validation completed.
Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
assets/toolbox/hitboxes/js/index.js
2-
docs_build/dev/admin-notes/tools/index.txt
3-
docs_build/dev/reports/PR_26177_DELTA_002-hitboxes-foundation.md
4-
docs_build/dev/reports/PR_26177_DELTA_002-hitboxes-foundation_branch-validation.md
5-
docs_build/dev/reports/PR_26177_DELTA_002-hitboxes-foundation_manual-validation-notes.md
6-
docs_build/dev/reports/PR_26177_DELTA_002-hitboxes-foundation_requirement-checklist.md
7-
docs_build/dev/reports/PR_26177_DELTA_002-hitboxes-foundation_validation-lane.md
8-
src/shared/toolbox/tool-metadata-inventory.js
9-
toolbox/hitboxes/index.html
1+
docs_build/dev/reports/PR_26177_DELTA_003-hitboxes-engine-collision-contract.md
2+
docs_build/dev/reports/PR_26177_DELTA_003-hitboxes-engine-collision-contract_branch-validation.md
3+
docs_build/dev/reports/PR_26177_DELTA_003-hitboxes-engine-collision-contract_manual-validation-notes.md
4+
docs_build/dev/reports/PR_26177_DELTA_003-hitboxes-engine-collision-contract_requirement-checklist.md
5+
docs_build/dev/reports/PR_26177_DELTA_003-hitboxes-engine-collision-contract_validation-lane.md
6+
src/engine/collision/hitboxCollision.js
7+
tests/engine/HitboxCollisionContract.test.mjs
108
docs_build/dev/reports/codex_changed_files.txt
119
docs_build/dev/reports/codex_review.diff

0 commit comments

Comments
 (0)