Skip to content

Commit edf49f1

Browse files
committed
bitmap 3D PFP: always show touch UI in PFP + taller player
Two fixes for the mobile session: - showTouchUi was gated on a pointer:coarse / ontouchstart detection that some mobile browsers don't satisfy reliably (modern iPads with Pencil report fine pointer; some Android desktop-mode sessions skip ontouchstart). Drop the gate -- show the jump button always while in PFP. Joystick base/knob still only render on actual finger contact via the touchstart handler, so desktop sees just the jump button. - PLAYER_HEIGHT 0.5 -> 0.8. Tron citizen, but a bit taller; eye level rises from 0.38 to ~0.68, so the smallest size-1 cubes feel a touch less imposing and the head clears the floor more.
1 parent 01d2f63 commit edf49f1

1 file changed

Lines changed: 14 additions & 16 deletions

File tree

frontend/src/app/components/_ordpool/digital-artifact-viewer/bitmap-viewer/bitmap-3d-renderer.component.ts

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ export class Bitmap3dRendererComponent implements AfterViewInit, OnDestroy {
429429
cubeColliderGeom.dispose();
430430
groundColliderGeom.dispose();
431431

432-
const PLAYER_HEIGHT = 0.5;
432+
const PLAYER_HEIGHT = 0.8; // taller citizen; eye at ~0.64
433433
const PLAYER_RADIUS = 0.12;
434434
const SPAWN_X = 0;
435435
const SPAWN_Z = layoutSize.height / 2 + 2;
@@ -485,9 +485,7 @@ export class Bitmap3dRendererComponent implements AfterViewInit, OnDestroy {
485485
// Left half of the canvas = joystick (drag from anywhere; the anchor is
486486
// wherever the finger lands, so there's no fixed thumbstick to miss).
487487
// Right half = mouse-look equivalent (drag to rotate).
488-
// Floating jump button overlays the bottom-right.
489-
const isTouch = window.matchMedia('(pointer: coarse)').matches
490-
|| ('ontouchstart' in window);
488+
// Floating jump button overlays the bottom-right (shown in any PFP).
491489
const joy = { fwd: 0, right: 0 };
492490
let leftId: number | null = null;
493491
let leftStartX = 0, leftStartY = 0;
@@ -890,25 +888,25 @@ export class Bitmap3dRendererComponent implements AfterViewInit, OnDestroy {
890888
playerOnFloor = false;
891889
physicsClock.getDelta();
892890
state = 'pfp';
893-
// Mobile: show the touch UI now that we're walking. Wait
894-
// one CD cycle for the @if to render the jump button, then
895-
// wire it.
896-
if (isTouch) {
897-
this.zone.run(() => {
898-
this.showTouchUi = true;
899-
this.cdr.markForCheck();
900-
setTimeout(wireJumpButton, 0);
901-
});
902-
}
891+
// Always show the touch UI in PFP. Pointer-coarse detection
892+
// is unreliable on some browsers; the jump button doesn't
893+
// hurt desktop (you can click it too), and the joystick
894+
// base/knob only render on actual finger contact via the
895+
// touchstart handler.
896+
this.zone.run(() => {
897+
this.showTouchUi = true;
898+
this.cdr.markForCheck();
899+
setTimeout(wireJumpButton, 0);
900+
});
903901
} else if (flyAfterIso === 'orbit') {
904902
controls.enabled = true;
905903
state = 'orbit';
906-
if (isTouch && this.showTouchUi) {
904+
if (this.showTouchUi) {
907905
this.zone.run(() => { this.showTouchUi = false; this.cdr.markForCheck(); });
908906
}
909907
} else {
910908
state = 'exit-done';
911-
if (isTouch && this.showTouchUi) {
909+
if (this.showTouchUi) {
912910
this.zone.run(() => { this.showTouchUi = false; this.cdr.markForCheck(); });
913911
}
914912
this.zone.run(() => this.exitDone.emit());

0 commit comments

Comments
 (0)