This commit is contained in:
Leon van Kammen 2024-01-31 15:03:58 +00:00
parent 5ddb7aa608
commit 1645d53238
10 changed files with 23929 additions and 12 deletions

View file

@ -1,5 +1,5 @@
/* /*
* v0.5.1 generated at Wed Jan 31 11:37:04 AM UTC 2024 * v0.5.1 generated at Wed Jan 31 02:59:52 PM UTC 2024
* https://xrfragment.org * https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0 * SPDX-License-Identifier: MPL-2.0
*/ */
@ -2480,6 +2480,12 @@ window.AFRAME.registerComponent('xrf', {
if( com ) com.update({collisionEntities:true}) if( com ) com.update({collisionEntities:true})
else console.warn("xrfragments: blink-controls is not mounted, please run manually: $('[blink-controls]).components['blink-controls'].update({collisionEntities:true})") else console.warn("xrfragments: blink-controls is not mounted, please run manually: $('[blink-controls]).components['blink-controls'].update({collisionEntities:true})")
} }
// give headset users way to debug without a cumbersome usb-tapdance
if( xrf.debug || document.location.hostname.match(/^(localhost|[1-9])/) && !aScene.getAttribute("vconsole") ){
aScene.setAttribute('vconsole','')
}
}) })
xrf.addEventListener('navigateLoading', (opts) => { xrf.addEventListener('navigateLoading', (opts) => {
@ -2640,10 +2646,9 @@ window.AFRAME.registerComponent('xrf-button', {
depth: 0.005 depth: 0.005
}); });
el.setAttribute('material', { el.setAttribute('material', {
shader: "flat",
color: this.color, color: this.color,
transparent:true, transparent:true,
opacity:0.7 opacity:0.3
}); });
el.setAttribute('pressable', ''); el.setAttribute('pressable', '');
labelEl.setAttribute('position', '0 0 0.01'); labelEl.setAttribute('position', '0 0 0.01');
@ -2711,6 +2716,33 @@ window.AFRAME.registerComponent('xrf-button', {
}); });
} }
}); });
AFRAME.registerComponent('vconsole', {
init: function () {
//AFRAME.XRF.navigator.to("https://coderofsalvation.github.io/xrsh-media/assets/background.glb")
document.head.innerHTML += `
<style type="text/css">
.vc-panel {
right:unset !important;
width:100%;
max-width:900px;
z-index:100 !important;
}
.vc-mask{ display:none !important; }
</style>
`
let script = document.createElement("script")
script.src = "https://unpkg.com/vconsole@latest/dist/vconsole.min.js"
script.setAttribute('async','true')
script.onload = function(){
this.vConsole = new window.VConsole()
document.querySelector('.vc-switch').style.right = 'unset'
document.querySelector('.vc-switch').style.left = '20px'
}
document.body.appendChild(script)
}
});
AFRAME.registerComponent('xrf-fade', { AFRAME.registerComponent('xrf-fade', {
schema:{ schema:{
fadetime:{type:"number", default: 1000}, fadetime:{type:"number", default: 1000},

View file

@ -1,5 +1,5 @@
/* /*
* v0.5.1 generated at Wed Jan 31 11:37:04 AM UTC 2024 * v0.5.1 generated at Wed Jan 31 02:59:52 PM UTC 2024
* https://xrfragment.org * https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0 * SPDX-License-Identifier: MPL-2.0
*/ */
@ -2478,6 +2478,12 @@ window.AFRAME.registerComponent('xrf', {
if( com ) com.update({collisionEntities:true}) if( com ) com.update({collisionEntities:true})
else console.warn("xrfragments: blink-controls is not mounted, please run manually: $('[blink-controls]).components['blink-controls'].update({collisionEntities:true})") else console.warn("xrfragments: blink-controls is not mounted, please run manually: $('[blink-controls]).components['blink-controls'].update({collisionEntities:true})")
} }
// give headset users way to debug without a cumbersome usb-tapdance
if( xrf.debug || document.location.hostname.match(/^(localhost|[1-9])/) && !aScene.getAttribute("vconsole") ){
aScene.setAttribute('vconsole','')
}
}) })
xrf.addEventListener('navigateLoading', (opts) => { xrf.addEventListener('navigateLoading', (opts) => {
@ -2638,10 +2644,9 @@ window.AFRAME.registerComponent('xrf-button', {
depth: 0.005 depth: 0.005
}); });
el.setAttribute('material', { el.setAttribute('material', {
shader: "flat",
color: this.color, color: this.color,
transparent:true, transparent:true,
opacity:0.7 opacity:0.3
}); });
el.setAttribute('pressable', ''); el.setAttribute('pressable', '');
labelEl.setAttribute('position', '0 0 0.01'); labelEl.setAttribute('position', '0 0 0.01');
@ -2709,6 +2714,33 @@ window.AFRAME.registerComponent('xrf-button', {
}); });
} }
}); });
AFRAME.registerComponent('vconsole', {
init: function () {
//AFRAME.XRF.navigator.to("https://coderofsalvation.github.io/xrsh-media/assets/background.glb")
document.head.innerHTML += `
<style type="text/css">
.vc-panel {
right:unset !important;
width:100%;
max-width:900px;
z-index:100 !important;
}
.vc-mask{ display:none !important; }
</style>
`
let script = document.createElement("script")
script.src = "https://unpkg.com/vconsole@latest/dist/vconsole.min.js"
script.setAttribute('async','true')
script.onload = function(){
this.vConsole = new window.VConsole()
document.querySelector('.vc-switch').style.right = 'unset'
document.querySelector('.vc-switch').style.left = '20px'
}
document.body.appendChild(script)
}
});
AFRAME.registerComponent('xrf-fade', { AFRAME.registerComponent('xrf-fade', {
schema:{ schema:{
fadetime:{type:"number", default: 1000}, fadetime:{type:"number", default: 1000},

23822
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 Wed Jan 31 11:37:04 AM UTC 2024 * v0.5.1 generated at Wed Jan 31 02:59:52 PM UTC 2024
* https://xrfragment.org * https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0 * SPDX-License-Identifier: MPL-2.0
*/ */

View file

@ -1,5 +1,5 @@
/* /*
* v0.5.1 generated at Wed Jan 31 11:37:04 AM UTC 2024 * v0.5.1 generated at Wed Jan 31 02:59:52 PM UTC 2024
* https://xrfragment.org * https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0 * SPDX-License-Identifier: MPL-2.0
*/ */

View file

@ -10,8 +10,7 @@
</head> </head>
<body> <body>
<a-scene xr-mode-ui="XRMode: xr" renderer="colorManagement: true; highRefreshRate:true; " light="defaultLightsEnabled: false">
<a-scene xr-mode-ui="XRMode: xr" renderer="colorManagement: true; highRefreshRate:true; multiviewStereo:true " light="defaultLightsEnabled: false">
<a-entity id="player" wasd-controls look-controls> <a-entity id="player" wasd-controls look-controls>
<a-entity camera="fov:90" position="0 1.6 0" id="camera"></a-entity> <a-entity camera="fov:90" position="0 1.6 0" id="camera"></a-entity>
<a-entity id="left-hand" laser-controls="hand: left" raycaster="objects:.ray" blink-controls="cameraRig:#player; teleportOrigin: #camera; collisionEntities: .floor"> <a-entity id="left-hand" laser-controls="hand: left" raycaster="objects:.ray" blink-controls="cameraRig:#player; teleportOrigin: #camera; collisionEntities: .floor">

Binary file not shown.

View file

@ -77,6 +77,12 @@ window.AFRAME.registerComponent('xrf', {
if( com ) com.update({collisionEntities:true}) if( com ) com.update({collisionEntities:true})
else console.warn("xrfragments: blink-controls is not mounted, please run manually: $('[blink-controls]).components['blink-controls'].update({collisionEntities:true})") else console.warn("xrfragments: blink-controls is not mounted, please run manually: $('[blink-controls]).components['blink-controls'].update({collisionEntities:true})")
} }
// give headset users way to debug without a cumbersome usb-tapdance
if( xrf.debug || document.location.hostname.match(/^(localhost|[1-9])/) && !aScene.getAttribute("vconsole") ){
aScene.setAttribute('vconsole','')
}
}) })
xrf.addEventListener('navigateLoading', (opts) => { xrf.addEventListener('navigateLoading', (opts) => {

View file

@ -36,10 +36,9 @@ window.AFRAME.registerComponent('xrf-button', {
depth: 0.005 depth: 0.005
}); });
el.setAttribute('material', { el.setAttribute('material', {
shader: "flat",
color: this.color, color: this.color,
transparent:true, transparent:true,
opacity:0.7 opacity:0.3
}); });
el.setAttribute('pressable', ''); el.setAttribute('pressable', '');
labelEl.setAttribute('position', '0 0 0.01'); labelEl.setAttribute('position', '0 0 0.01');

View file

@ -0,0 +1,27 @@
AFRAME.registerComponent('vconsole', {
init: function () {
//AFRAME.XRF.navigator.to("https://coderofsalvation.github.io/xrsh-media/assets/background.glb")
document.head.innerHTML += `
<style type="text/css">
.vc-panel {
right:unset !important;
width:100%;
max-width:900px;
z-index:100 !important;
}
.vc-mask{ display:none !important; }
</style>
`
let script = document.createElement("script")
script.src = "https://unpkg.com/vconsole@latest/dist/vconsole.min.js"
script.setAttribute('async','true')
script.onload = function(){
this.vConsole = new window.VConsole()
document.querySelector('.vc-switch').style.right = 'unset'
document.querySelector('.vc-switch').style.left = '20px'
}
document.body.appendChild(script)
}
});