Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GeoVistoogsi
AR
Commits
0e320470
Commit
0e320470
authored
3 months ago
by
Percen
Browse files
Options
Download
Email Patches
Plain Diff
Update public/index.html
parent
2e4e22e8
master
21caog1bif-master-patch-76399
21caog1bif-master-patch-83779
21caog1bif-master-patch-96693
1 merge request
!74
Update public/index.html
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/index.html
+15
-16
public/index.html
with
15 additions
and
16 deletions
+15
-16
public/index.html
+
15
-
16
View file @
0e320470
...
...
@@ -30,7 +30,6 @@
let
currentModel
=
null
;
let
scene
,
camera
,
hitTestSource
;
let
hitTestResults
=
[];
let
isSwipe
=
false
;
async
function
activateXR
()
{
const
canvas
=
document
.
createElement
(
'
canvas
'
);
...
...
@@ -101,30 +100,30 @@
}
// Touch-Logik zur Unterscheidung zwischen Swipe und Tap
let
startX
=
0
,
endX
=
0
,
isSwiping
=
false
;
const
t
hreshold
=
50
;
let
startX
=
0
,
startY
=
0
,
endX
=
0
,
endY
=
0
;
const
swipeT
hreshold
=
50
;
// Minimale Swipe-Distanz
document
.
body
.
addEventListener
(
'
touchstart
'
,
(
e
)
=>
{
startX
=
e
.
touches
[
0
].
clientX
;
isSwiping
=
false
;
startY
=
e
.
touches
[
0
].
clientY
;
});
document
.
body
.
addEventListener
(
'
touchmove
'
,
(
e
)
=>
{
const
moveX
=
e
.
touches
[
0
].
clientX
;
if
(
Math
.
abs
(
moveX
-
startX
)
>
threshold
)
{
isSwiping
=
true
;
if
(
moveX
>
startX
)
{
document
.
body
.
addEventListener
(
'
touchend
'
,
(
e
)
=>
{
endX
=
e
.
changedTouches
[
0
].
clientX
;
endY
=
e
.
changedTouches
[
0
].
clientY
;
const
deltaX
=
endX
-
startX
;
const
deltaY
=
endY
-
startY
;
// Unterscheidung zwischen Swipe und Tap
if
(
Math
.
abs
(
deltaX
)
>
swipeThreshold
)
{
if
(
deltaX
>
0
)
{
switchModel
(
'
next
'
);
}
else
{
switchModel
(
'
previous
'
);
}
startX
=
moveX
;
// Verhindert mehrfaches Swipen bei einem langen Touchmove
}
});
document
.
body
.
addEventListener
(
'
touchend
'
,
()
=>
{
if
(
!
isSwiping
)
{
placeModel
();
}
else
if
(
Math
.
abs
(
deltaY
)
<
swipeThreshold
)
{
placeModel
();
// Nur platzieren, wenn keine große Bewegung erkannt wurde
}
});
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets