DOC · SYSTEM OVERVIEW REV · 2026.06 RUNTIME · WEB / ANDROID ENGINE · THREE.JS r0.165

Nürburgring
Drive

A first-person driving simulator running on real OSM track geometry. Three.js rendering layered over a hand-written 240 Hz vehicle physics engine — one codebase, shipped to both web and Android via Capacitor.

240Hz
Fixed physics step
20.7km
Surveyed DEM track
6DOF
Rigid-body dynamics
6env
Weather / time presets
Tire · Pacejka combined-slip

Friction-circle tire model

Longitudinal slip ratio and lateral slip angle are folded into one normalized slip ρ, sharing grip inside a friction circle. Accelerating, braking and cornering draw on the same limit.

F = μ · load · sin(1.5 · atan(1.73 · ρ))
Suspension · raycast

4-wheel raycast suspension

Each wheel casts a ray to the road for penetration depth, then feeds spring + damper force into the body. Even a stiff kart keeps all four wheels planted via modelled compliance.

F = k · comp − c · vcomp
Aerodynamics · v²

Drag & downforce

Both scale with the square of speed. Downforce loads the tires vertically to create high-speed cornering grip — the defining trait of a wing car.

drag = ½ρ·CdA·v² DF = ½ρ·ClA·v²
Launch · clutch slip

Clutch launch model

In first gear the clutch slips, holding the engine in the power band until the wheels catch up — instead of the revs cratering the instant the clutch grabs.

launching = g1 & thr>0.2 & roadRpm < launchRpm·0.92
Surface μ — asphalt / curb / grass1.22 / 1.10 / 0.55
Weather grip — dry / wet1.00 / 0.72
Driver aids — traction control / ABSON · ON
Integration safety clamp130 m/s
Upshift · only under throttle
idleredline − 350

Shifts up just shy of the limiter. Lift off and the revs fall on their own, so no upshift fires while coasting — the gear holds for engine braking.

Downshift · as revs drop
shiftDownredline

Drops a gear once revs fall below the band (except under hard braking), keeping engine braking available into a corner.

Retained fixes · under the simple policy
roadRpm = wheel-speed based no false upshift on wheelspin · clutch OPEN during a shift no ratio-amplified engine braking
ModelDriveMass0–100 / Top
Elantra NHYUNDAI FWD 1430kg 5.8s265
911 GT3PORSCHE RWD 1435kg 4.2s318
Drivetrain

Spec-driven design

All per-car difference lives in one file; physics, audio and visuals read the same spec. Adding a car means adding data.

Validation

Regression suite

0–100, top speed, cornering, shifting and reverse are measured headless — every physics change is regression-checked.

NoonMorning fogSunset NightRainNight · lit
Rain

Instanced shader rain

Three depth layers of streak quads — vertical at a standstill, raked long at speed. Wet reflective road, grip 0.72, layered rain SFX, headlights auto-on.

streak ∝ |rainVel − carVel|view
Night · lit

Street lighting

Lamps every 62 m. Each light pool is projected as an ellipse aligned to the road's surface basis, so it lands on the tarmac regardless of which side the lamp is on. Real point lights track only the nearest lamps.

pool = makeBasis(right·w, tangent·l, normal)
Audio · AudioWorklet

Waveguide engine

A port of Antonio's MIT waveguide model — bidirectional waveguides, valve-timed reflections and a muffler set the timbre from cylinder count and exhaust length. Tire, wind and rain layers sit on top.

Render · Three.js

Render pipeline

Physical Sky shader with PMREM environment reflections, chunked instanced forest, shadows. A quality tier auto-scales particle and light counts down on mobile.

Engine firing frequencyrpm / 120 · cyl
Instrument clusterrpm + speed needles · shift LEDs
Secure-context audiohttps / localhost