upgraded aframe to v1.6.0 + added check for duplicate movement-controls & touch-controls

This commit is contained in:
Leon van Kammen 2024-12-09 15:42:34 +00:00
parent c3b0636bf7
commit 4bc3d1c520
17 changed files with 19125 additions and 1073 deletions

2
dist/aframe.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,43 @@
/*
* v0.5.1 generated at Mon Dec 9 15:41:10 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:39:00 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:38:50 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:38:27 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:37:05 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:36:14 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:35:39 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 03:32:13 PM UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Oct 14 11:39:48 AM CEST 2024
* https://xrfragment.org
@ -3064,10 +3104,6 @@ xrf.frag.pos = function(v, opts){
if( pos.x == undefined ){
let obj = scene.getObjectByName(v.string)
if( !obj ) return console.warn("#pos="+v.string+" not found")
//let worldPos = new THREE.Vector3()
//obj.getWorldPosition(worldPos)
//camera.position.copy(worldPos)
//obj.attach(camera) // instead of add() [keeps camera animations intact]
obj.add(camera)
camera.position.set(0,0,0)
let c = camera.rotation
@ -4834,6 +4870,8 @@ window.AFRAME.registerComponent('xrf', {
},
init: async function () {
this.data = Object.values(this.attrValue)[0]
// override this.data when URL has passed (`://....com/?https://foo.com/index.glb` e.g.)
if( typeof this.data == "string" ){
let searchIsUri = document.location.search &&
@ -5048,6 +5086,8 @@ const MAX_DELTA = 0.2; // ms
const EPS = 10e-6;
const MOVED = 'moved';
if( !AFRAME.components['movement-controls'] ){
AFRAME.registerComponent('movement-controls', {
/*******************************************************************
@ -5258,6 +5298,7 @@ AFRAME.registerComponent('movement-controls', {
}())
});
}
AFRAME.components['hand-tracking-controls'].Component.prototype.onModelLoaded = function(onModelLoaded){
return function(e){
onModelLoaded.apply(this);
@ -5325,6 +5366,9 @@ AFRAME.components['look-controls'].Component.prototype.updateOrientation = funct
/**
* Touch-to-move-forward controls for mobile.
*/
if( !AFRAME.components['touch-controls'] ){
AFRAME.registerComponent('touch-controls', {
schema: {
enabled: { default: true },
@ -5413,6 +5457,7 @@ AFRAME.registerComponent('touch-controls', {
//xrSession.addEventListener('selectend', this.onTouchEnd);
}
})
}
window.AFRAME.registerComponent('xrf-button', {
schema: {
label: {

40
dist/xrfragment.js vendored
View File

@ -1,3 +1,43 @@
/*
* v0.5.1 generated at Mon Dec 9 15:41:10 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:39:00 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:38:50 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:38:27 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:37:05 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:36:14 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:35:39 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 03:32:13 PM UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Oct 14 11:39:48 AM CEST 2024
* https://xrfragment.org

File diff suppressed because one or more lines are too long

17796
dist/xrfragment.module.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/*
* v0.5.1 generated at Mon Oct 14 11:39:48 AM CEST 2024
* v0.5.1 generated at Mon Dec 9 15:41:10 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

View File

@ -1,5 +1,5 @@
/*
* v0.5.1 generated at Mon Oct 14 11:39:48 AM CEST 2024
* v0.5.1 generated at Mon Dec 9 15:41:10 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

View File

@ -1,5 +1,5 @@
/*
* v0.5.1 generated at Mon Oct 14 11:39:48 AM CEST 2024
* v0.5.1 generated at Mon Dec 9 15:41:10 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

View File

@ -1,5 +1,5 @@
/*
* v0.5.1 generated at Mon Oct 14 11:39:48 AM CEST 2024
* v0.5.1 generated at Mon Dec 9 15:41:10 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

View File

@ -1,5 +1,5 @@
/*
* v0.5.1 generated at Mon Oct 14 11:39:48 AM CEST 2024
* v0.5.1 generated at Mon Dec 9 15:41:10 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

View File

@ -1,5 +1,5 @@
/*
* v0.5.1 generated at Mon Oct 14 11:39:48 AM CEST 2024
* v0.5.1 generated at Mon Dec 9 15:41:10 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

View File

@ -1,3 +1,43 @@
/*
* v0.5.1 generated at Mon Dec 9 15:41:10 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:39:00 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:38:50 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:38:27 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:37:05 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:36:14 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:35:39 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 03:32:13 PM UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Oct 14 11:39:48 AM CEST 2024
* https://xrfragment.org
@ -3064,10 +3104,6 @@ xrf.frag.pos = function(v, opts){
if( pos.x == undefined ){
let obj = scene.getObjectByName(v.string)
if( !obj ) return console.warn("#pos="+v.string+" not found")
//let worldPos = new THREE.Vector3()
//obj.getWorldPosition(worldPos)
//camera.position.copy(worldPos)
//obj.attach(camera) // instead of add() [keeps camera animations intact]
obj.add(camera)
camera.position.set(0,0,0)
let c = camera.rotation

View File

@ -1,3 +1,43 @@
/*
* v0.5.1 generated at Mon Dec 9 15:41:10 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:39:00 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:38:50 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:38:27 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:37:05 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:36:14 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 15:35:39 UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Dec 9 03:32:13 PM UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/*
* v0.5.1 generated at Mon Oct 14 11:39:48 AM CEST 2024
* https://xrfragment.org
@ -3064,10 +3104,6 @@ xrf.frag.pos = function(v, opts){
if( pos.x == undefined ){
let obj = scene.getObjectByName(v.string)
if( !obj ) return console.warn("#pos="+v.string+" not found")
//let worldPos = new THREE.Vector3()
//obj.getWorldPosition(worldPos)
//camera.position.copy(worldPos)
//obj.attach(camera) // instead of add() [keeps camera animations intact]
obj.add(camera)
camera.position.set(0,0,0)
let c = camera.rotation

View File

@ -5,6 +5,8 @@ window.AFRAME.registerComponent('xrf', {
},
init: async function () {
this.data = Object.values(this.attrValue)[0]
// override this.data when URL has passed (`://....com/?https://foo.com/index.glb` e.g.)
if( typeof this.data == "string" ){
let searchIsUri = document.location.search &&

View File

@ -9,6 +9,8 @@ const MAX_DELTA = 0.2; // ms
const EPS = 10e-6;
const MOVED = 'moved';
if( !AFRAME.components['movement-controls'] ){
AFRAME.registerComponent('movement-controls', {
/*******************************************************************
@ -219,3 +221,4 @@ AFRAME.registerComponent('movement-controls', {
}())
});
}

View File

@ -1,6 +1,9 @@
/**
* Touch-to-move-forward controls for mobile.
*/
if( !AFRAME.components['touch-controls'] ){
AFRAME.registerComponent('touch-controls', {
schema: {
enabled: { default: true },
@ -89,3 +92,4 @@ AFRAME.registerComponent('touch-controls', {
//xrSession.addEventListener('selectend', this.onTouchEnd);
}
})
}