Re-apply NS+EW swap (user feedback: mirror needs fixing)
User reported 'N at close tiles' and 'NS mirrored, EW reversed'. With the canvas axes swapped: - lng=+12 (corridor front in N flight) at canvas top -> screen top -> ahead in flight direction (correct) - perp<0 (world east) at canvas right -> screen right (correct) Verifies user expectation: north tiles ahead (screen top), east tiles to the right (screen right). N label appears at the far-ahead tiles along the top of the screen, pointing forward in flight direction.
This commit is contained in:
1 parent
eeb2e3e5f6
commit
bfe0a559b5
1 file changed
+6
-2
Vendored
+6
-2
@@ -328,8 +328,12 @@ function drawTileAt(lng, perp, dx, dz, centerTileX, centerTileY) {
|
|||||||
// (vertical) and perp along canvas X (horizontal). This way the
|
// (vertical) and perp along canvas X (horizontal). This way the
|
||||||
// corridor's long axis (flight direction +Z) appears as a vertical
|
// corridor's long axis (flight direction +Z) appears as a vertical
|
||||||
// strip on canvas, matching the way depth maps on screen.
|
// strip on canvas, matching the way depth maps on screen.
|
||||||
var canvasX = (perp + halfPerp + 0.5) * GROUND_TILE_SIZE;
|
// UNPACK_FLIP_Y_WEBGL=true inverts V: canvas top -> texture V=1 (top).
|
||||||
var canvasY = (lng + halfLong + 0.5) * GROUND_TILE_SIZE;
|
// To put lng=+12 (corridor front in N flight) at screen TOP we put it
|
||||||
|
// at canvas top (small canvasY). Same inversion for perp so world
|
||||||
|
// east (dx>0, perp<0) ends up at canvas right (large canvasX).
|
||||||
|
var canvasX = (-perp + halfPerp + 0.5) * GROUND_TILE_SIZE;
|
||||||
|
var canvasY = (-lng + halfLong + 0.5) * GROUND_TILE_SIZE;
|
||||||
if (canvasX < 0 || canvasX >= groundCanvas.width || canvasY < 0 || canvasY >= groundCanvas.height) {
|
if (canvasX < 0 || canvasX >= groundCanvas.width || canvasY < 0 || canvasY >= groundCanvas.height) {
|
||||||
return Promise.resolve(false);
|
return Promise.resolve(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user