Free Shipping for all items over £500

Enrico HomeDecor

Summer Sale

<p># Review Packet — Lineup Heading Fix + Arrival Mode How-To ## 1. Goal Fix the visual bug where the aircraft moved sideways onto the runway during the `LineupAndWait` segment (heading was snapping to the runway axis immediately, while motion was perpendicular). Also document how to exercise the arrival route. ## 2. Files changed (1) - `src/shared/Sim/Motion/LerpStrategy.ts` — heading-resolution logic in `step()`. ## 3. Why the change `headingDegOverride` was applied to `targetCFrame` from `t = 0` of the segment. For `HOLD_23 → RWY23_ENTRY`: - motion direction: `+Z` (north, 0°) - destination override: `90°` (runway heading, +X / east) …so the aircraft slerped to face east while still translating north — sideways shuffle onto the runway. The override is correct **on arrival** (so lineup ends pointing down the runway), but wrong **during the segment**. The exception is `Pushback`, where the override = stand heading must hold for the whole segment, otherwise the motion-direction heading would face the aircraft backward as it reverses. ## 4. Resolution Introduced two constants in `LerpStrategy`: ```ts HOLD_HEADING_PHASES: ReadonlySet&lt;Phase&gt; = new Set(["Pushback"]) HEADING_BLEND_T = 0.5 ``` Heading is resolved as: | Case | Behavior | | --- | --- | | Phase is in `HOLD_HEADING_PHASES` AND override present | Override applied throughout segment (Pushback) | | Override present AND `t ≥ HEADING_BLEND_T` | Override applied — slerp turns aircraft to the override over second half of segment | | Override present AND `t &lt; HEADING_BLEND_T` | Face motion direction (turn toward destination) | | No override | Face motion direction | The existing heading slerp (`CFrame:Lerp` at rate 4, converges in ≈1 s) smooths the transition. For typical `LineupAndWait` (~6.7 s) and `TaxiToStand` (~3–32 s) segments, the second half is plenty of time to converge. ## 5. Visual outcome — departure run - Pushback: aircraft faces stand (heading 0°), moves -Z. ✓ (unchanged) - Taxi: aircraft faces motion direction along Alpha. ✓ (unchanged) - HoldingShort dwell: frozen facing east (last taxi heading). ✓ - LineupAndWait: turns left to face north toward the runway entry, then slerps right to face east as it nears the runway. Arrives at `N_RWY23_ENTRY` pointing 90°. ✓ (was sideways before) - LineupAndWait dwell at runway: 2 s pause. ✓ - TakeoffRoll: accelerates east. ✓ ## 6. Arrival mode (no code change — already wired) Trigger via Studio workspace attribute, read once by `startFlight()`. **Studio Command Bar:** ```lua workspace:SetAttribute("FlightMode", "arrival") ``` Press Play. Aircraft teleports to `(-200, 60, 0)`, descends to touchdown at `(380, 0, 0)`, decelerates along the runway, exits perpendicular at `(720, 0, -40)`, taxis back along return taxiway at `z = -80`, parks at `N_STAND_1 (0, 0, 0)` facing +Z. Set back to `"departure"` (or delete the attribute) to flip back. Graph visualizer (toggled via `workspace.ShowAirportGraph = true`) colors arrival nodes orange (Approach), lime (Touchdown), and blue (RunwayExit). ## 7. Build result `npm run build` → clean. Zero TypeScript errors. ## 8. Runtime risks - **`HEADING_BLEND_T = 0.5` is a fixed fraction**, not a time-based threshold. For very short segments (e.g., the 45-stud `E_ROLLOUT_EXIT`), half the segment is only ~1.9 s at 12 studs/s — slerp at rate 4 converges in ~1 s, still fits, but cutting `HEADING_BLEND_T` lower (e.g. 0.3) might be needed if you author much shorter segments later. - **Slerp rate `4` is unchanged.** Faster rotation looks twitchy on long descent segments where the motion-direction has a small Y component (gives nose-down pitch). - **`HOLD_HEADING_PHASES` is hardcoded** to `{Pushback}`. If a future phase needs the same "face one way, move another" semantics (e.g., a future `Backtrack`), add it to the set. The set lives at the top of `LerpStrategy.ts`, easy to find. - **No change to Approach descent visuals.** During approach the destination override (90°) takes effect at `t ≥ 0.5`, so the aircraft pitches slightly nose-down for the first half (motion direction has Y component), then levels off for touchdown. Looks reasonable; can be tuned by lowering `HEADING_BLEND_T` if you want it to level earlier. ## 9. What I recommend next 1. **Cycle mode** — after `Done`, wait N seconds, flip the FlightMode attribute, call `restart()`. Exercises both routes back-to-back from a single Play session and is the cleanest end-to-end smoke test for `resetState()` + `startFlight()`. 2. **ClearanceService seam** — replace the fixed `HoldingShort` / `LineupAndWait` dwell timers with `atc.isClearedFor(phase, aircraftId)`. MVP impl returns `true` after the same timer, but the contract decouples ATC from movement and unblocks arrival-specific clearances (`"cleared to land"`, `"contact tower"`) later. 3. **Anchor Approach coordinates to real Studio scene** — `(-200, 60, 0)` is geometric, not anchored. Worth picking real placement before more arrival logic accretes on top of arbitrary numbers. </p><p></p>

Free Delivery on orders £500+
Rated 4.8/5 from 2,600+ reviews
Summer Sale