Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
THREE.js fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
coderofsalvation committed Jun 12, 2024
1 parent f5167f4 commit 0649163
Show file tree
Hide file tree
Showing 10 changed files with 14,228 additions and 31 deletions.
14 changes: 7 additions & 7 deletions dist/xrfragment.aframe.all.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions dist/xrfragment.aframe.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* v0.5.1 generated at Tue Jun 11 05:22:22 PM UTC 2024
* v0.5.1 generated at Wed Jun 12 08:50:44 AM UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
Expand Down Expand Up @@ -2309,7 +2309,7 @@ xrf.addEventListener('audioInited', function(opts){

let audio = xrf.frag.href.audio = {}

actions = ['click','hover','teleport']
const actions = ['click','hover','teleport']
actions.map( (action) => {
const audioLoader = new THREE.AudioLoader();
audio[action] = new THREE.Audio( xrf.camera.listener )
Expand Down Expand Up @@ -2526,7 +2526,7 @@ xrf.frag.src.addModel = (model,url,frag,opts) => {
xrf.frag.src.scale( scene, opts, url ) // scale scene
mesh.add(scene)
}
xrf.frag.src.enableSourcePortation({scene,mesh,url,model})
xrf.frag.src.enableSourcePortation({...opts, scene,mesh,url,model})
// flag everything isSRC & isXRF
mesh.traverse( (n) => { n.isSRC = n.isXRF = n[ opts.isLocal ? 'isSRCLocal' : 'isSRCExternal' ] = true })

Expand All @@ -2540,7 +2540,7 @@ xrf.frag.src.renderAsPortal = (mesh) => {
}

xrf.frag.src.enableSourcePortation = (opts) => {
let {scene,mesh,url,model} = opts
let {scene,mesh,url,model,THREE} = opts
if( url[0] == '#' ) return

url = url.replace(/(&)?[-][\w-+\.]+(&)?/g,'&') // remove negative selectors to refer to original scene
Expand Down Expand Up @@ -3374,8 +3374,9 @@ xrf.addEventListener('parseModel', (opts) => {

xrf.URI.vars = new Proxy({},{
set(me,k,v){
if( k.match(/^(name)$/) ) return
if( k.match(/^(name)$/) ) return true
me[k] = v
return true
},
get(me,k ){
if( k == '__object' ){
Expand Down Expand Up @@ -3603,7 +3604,7 @@ xrf.init.audio = (opts) => {
let camera = xrf.camera
/* WebAudio: setup context via THREEjs */
if( !camera.listener ){
camera.listener = new THREE.AudioListener();
camera.listener = new xrf.THREE.AudioListener();
// *FIXME* camera vs camerarig conflict
(camera.getCam ? camera.getCam() : camera).add( camera.listener );
xrf.emit('audioInited',{listener:camera.listener, ...opts})
Expand Down Expand Up @@ -4991,7 +4992,6 @@ AFRAME.registerSystem('xrf-hands',{
if( bones[j].name == "index-finger-tip" ){
indexFinger = j
me.indexFinger.push(bones[j])
// addColliderToFingerTip(handEl,indexFinger)
const els = [...document.querySelectorAll('[xrf-pressable]')]
els.map( (el) => el.emit('indexFingerReady', {index: j} ) )
break
Expand Down
Loading

0 comments on commit 0649163

Please sign in to comment.