fix: the camera looks at the ramped city, not at a point in the air above it
The relief ramp scales the ground group to 5.78/15 when you are in a city, so Twin Peaks is not 4 km tall at FiDi. Camera targets lived in world space and were still written from baked 15x groundAt, so the look-at hung 2.6x above downtown and every tower read as a needle. chapterPose, the aircraft, and seek now use the scaled surface. When the ramp moves, camera and look-at Y scale with it from sea level so height-above-surface stays authored.
This commit is contained in:
+2
-2
@@ -2753,11 +2753,11 @@ function publishCameraHook(record: MountedBoard): void {
|
||||
const world = record.handle.world;
|
||||
const scene = record.handle.stageScene;
|
||||
const [x, z] = world.project(at.lat, at.lng);
|
||||
const ground = world.groundAt(at.lat, at.lng);
|
||||
const ground = record.handle.groundWorldY(at.lat, at.lng);
|
||||
const standoff = (at.standoffM ?? 20_000) / world.metresPerUnit;
|
||||
const lift =
|
||||
((at.heightM ?? (at.standoffM ?? 20_000) * 0.6) / world.metresPerUnit) *
|
||||
world.city.verticalExaggeration;
|
||||
world.city.verticalExaggeration * record.handle.reliefScale();
|
||||
const azimuth = at.azimuth ?? 0.6;
|
||||
scene.controls.target.set(x, ground, z);
|
||||
scene.camera.position.set(
|
||||
|
||||
Reference in New Issue
Block a user