Commit a2ace1d
committed
bitmap 3D PFP: simplify pass after /simplify review
Hot path
- frameForward / frameSide cached once per frame in pfpFrame
(cacheFrameVectors after applyLookStick) instead of re-deriving from
camera.getWorldDirection 10× per substep. Saves ~18 matrix decomposes
+ 9 normalizes per frame on the move path.
- applyEyeSafety skipped when playerVelocity.lengthSq() < 1e-4. Saves
one octree raycast per idle frame; the previous frame's eye check
still holds while the capsule is at rest.
- Dropped dead playerDirection scratch (replaced by frameForward/Side).
- New moveAddScratch keeps the cached frame vectors immutable across
the two add operations in applyControls.
Dedup
- captureLookAtQuat helper extracted from beginFlyToPfp / beginFlyToIso
(saved 16 lines of saved-state / lookAt / restore boilerplate from
both fly setups). InstanceType<typeof THREE.X> type alias keeps
param annotations in the runtime-namespace world.
- SPEED_RUN_SQ + SPEED_WALK_SQ moved from a renderer-local const to
bitmap-3d-physics.ts as named exports. Renderer + jest spec import
one source of truth; threshold tweaks are a single edit.
- Shared Playwright helpers extracted to playwright/specs/_shared/
bitmap-3d-debug.ts (Bitmap3dDebug type, readDebug, waitForState,
tick, setKey, mountFixture, loadBitmapFixture). Desktop + mobile
specs collapse to a single import block + mountFixture beforeEach.
Folder is outside both project testDirs so Playwright doesn't try
to execute it.
Tidy
- Dropped redundant cdr.markForCheck() from Bitmap3dE2EComponent;
OnPush + (click) bindings already mark the view dirty.
- Dropped (navigator as any)?.maxTouchPoints cast — it's standard
Navigator since DOM lib 2018+.
Comment trim (per workspace HARD RULE: keep JSDoc / "why" / sourcing /
encoding / example / edge-case comment blocks; only trim bombast +
before/after history TEXT INSIDE):
- fitDist comment: dropped "previously used Math.atan instead of
Math.tan, fix while we're here" before/after history.
- finalCamera magnitude comment: dropped "previously the iso corner
was at sqrt(3/2)*distance..." before/after history.
- PLAYER_RADIUS comment: trimmed "bumped from 0.12 -> 0.22 to fix
the wall-clip bug" before/after history to current-tense rationale.
- nipplejs move-listener comment: trimmed "the old (evt, data) two-arg
shape used during the initial port crashed silently..." to one-line
current-tense "Two-arg (evt, data) throws on every move."
All other JSDoc + sourcing + edge-case blocks (sun direction lookup,
needle/rune pixel-threshold idiom, ecctrl line refs, nipplejs #61/#64
defences, three.js#21921 eye-safety, etc.) untouched per HARD RULE.
Tests
- jest: 279/279 (incl. all 40 bitmap-3d-physics tests with the
imported SPEED_*_SQ constants).
- playwright: 17/17 across desktop + mobile projects.1 parent 9f6d6e4 commit a2ace1d
7 files changed
Lines changed: 188 additions & 168 deletions
File tree
- frontend
- playwright/specs
- desktop
- mobile
- src/app/components/_ordpool/digital-artifact-viewer/bitmap-viewer
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
47 | 12 | | |
48 | 13 | | |
49 | 14 | | |
50 | | - | |
51 | | - | |
52 | | - | |
| 15 | + | |
53 | 16 | | |
54 | 17 | | |
55 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
37 | 11 | | |
38 | 12 | | |
39 | 13 | | |
40 | | - | |
41 | | - | |
42 | | - | |
| 14 | + | |
43 | 15 | | |
44 | 16 | | |
45 | 17 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
| 50 | + | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
60 | 60 | | |
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
11 | 19 | | |
12 | 20 | | |
13 | 21 | | |
| |||
0 commit comments