Skip to content

Commit 3af7e39

Browse files
committed
Add iPad 13+ detection
1 parent dad9998 commit 3af7e39

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

three.js/src/location-based/js/device-orientation-controls.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33

44
import { Euler, EventDispatcher, MathUtils, Quaternion, Vector3 } from "three";
55

6-
const isIOS = navigator.userAgent.match(/iPhone|iPad|iPod/i);
6+
const isIOS =
7+
navigator.userAgent.match(/iPhone|iPad|iPod/i) ||
8+
(/Macintosh/i.test(navigator.userAgent) &&
9+
navigator.maxTouchPoints != null &&
10+
navigator.maxTouchPoints > 1); // for iPad Safari
711

812
const _zee = new Vector3(0, 0, 1);
913
const _euler = new Euler();

0 commit comments

Comments
 (0)