new build
This commit is contained in:
parent
05a2858ef7
commit
139f12031f
4 changed files with 11 additions and 2 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 6a4342f1d9ce83f9ef712cbd10d35ecf844e56e5
|
||||
Subproject commit 834f5c9b22fdb729d0ab4775c86f36927b8bc2b0
|
||||
BIN
xrsh.com
BIN
xrsh.com
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
dfedff673458686beba2e7e6939dc0f0474d6947387c0efb0cf92b08678c98f9 xrsh.com
|
||||
471cc09a6433f368246ceb4b5698d59e840420a1b36b1ddb1c923534718d0ede xrsh.com
|
||||
|
|
|
|||
9
xrsh.js
9
xrsh.js
|
|
@ -625,6 +625,15 @@ if( typeof AFRAME != 'undefined '){
|
|||
instance.addEventListener('window.onmaximize', resize )
|
||||
|
||||
const focus = (e) => {
|
||||
|
||||
// calculate distance between thumb and indexfinger to detect pinch
|
||||
// which should prevent focus-event (annoying to have keyboard popping up during pinch)
|
||||
if( e.detail?.withEl?.components['hand-tracking-controls'] ){
|
||||
const hand = e.detail.withEl.components['hand-tracking-controls']
|
||||
const thumb = hand.bones.find( (b) => b.name == 'thumb-tip' )
|
||||
const diff = thumb.position.distanceTo(hand.indexTipPosition)
|
||||
if( diff < 0.02) return // pinching! don't trigger keyboard (focus)
|
||||
}
|
||||
this.el.emit('focus',e.detail)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue