Skip to content

Commit 52bcd59

Browse files
authored
Mobile fixes (#338)
* fix: removed touch sens on mobile * fix: moved AR button to bottom left for fullscreen button
1 parent ee3c62d commit 52bcd59

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/camera-controls.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,6 @@ class CameraControls {
134134

135135
wheelSpeed = 0.06;
136136

137-
// sensitivity tweak for input touch devices
138-
touchSensitivity = 0.5;
139-
140137
gamepadDeadZone: Vec2 = new Vec2(0.3, 0.6);
141138

142139
constructor(app: AppBase, camera: CameraComponent, observer: Observer) {
@@ -277,17 +274,17 @@ class CameraControls {
277274
const orbitMove = screenToWorld(this._camera, touch[0], touch[1], distance);
278275
v.add(orbitMove.mulScalar(orbit * pan));
279276
const flyMove = new Vec3(leftInput[0], 0, -leftInput[1]);
280-
v.add(flyMove.mulScalar(fly * this.moveSpeed * this.touchSensitivity * dt));
277+
v.add(flyMove.mulScalar(fly * this.moveSpeed * dt));
281278
const pinchMove = new Vec3(0, 0, pinch[0]);
282279
v.add(pinchMove.mulScalar(orbit * double * this.pinchSpeed * dt));
283280
deltas.move.append([v.x, v.y, v.z]);
284281

285282
// mobile rotate
286283
v.set(0, 0, 0);
287284
const orbitRotate = new Vec3(touch[0], touch[1], 0);
288-
v.add(orbitRotate.mulScalar(orbit * (1 - pan) * this.orbitSpeed * this.touchSensitivity * dt));
285+
v.add(orbitRotate.mulScalar(orbit * (1 - pan) * this.orbitSpeed * dt));
289286
const flyRotate = new Vec3(rightInput[0], rightInput[1], 0);
290-
v.add(flyRotate.mulScalar(fly * this.orbitSpeed * this.touchSensitivity * dt));
287+
v.add(flyRotate.mulScalar(fly * this.orbitSpeed * dt));
291288
deltas.rotate.append([v.x, v.y, v.z]);
292289

293290
// gamepad move

src/style.scss

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ input {
258258

259259
#launch-ar-button {
260260
position: absolute;
261-
right: 20px;
262-
top: 20px;
261+
bottom: 20px;
262+
left: 20px;
263263
}
264264

265265
.download-button::before, .fullscreen-button::before {
@@ -615,13 +615,16 @@ input {
615615
#popup > #popup-buttons-parent {
616616
left: 50%;
617617
transform: translateX(-50%);
618-
bottom: 11px;
618+
bottom: 20px;
619619
}
620620

621621
#popup > #floating-buttons-parent > .pcui-button,
622622
#popup > #popup-buttons-parent > .pcui-button {
623623
margin: 4px !important;
624624
}
625+
#popup > #popup-buttons-parent {
626+
margin: 8px 0 !important;
627+
}
625628

626629
#popup > #floating-buttons-parent > #fullscreen-button {
627630
display: none;

0 commit comments

Comments
 (0)