fixed tests + included git tag version
This commit is contained in:
parent
28f349775d
commit
a12a142f24
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* generated at $(date)
|
* v0.5.1 generated at Wed Dec 6 09:38:34 PM CET 2023
|
||||||
* https://xrfragment.org
|
* https://xrfragment.org
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
* SPDX-License-Identifier: MPL-2.0
|
||||||
*/
|
*/
|
||||||
|
@ -2929,31 +2929,26 @@ AFRAME.registerComponent('xrf-gaze',{
|
||||||
material="color: #BBBBBB; shader: flat">
|
material="color: #BBBBBB; shader: flat">
|
||||||
</a-entity>`
|
</a-entity>`
|
||||||
}else{
|
}else{
|
||||||
//if( document.querySelector('[cursor]') )
|
if( document.querySelector('[cursor]') ) {
|
||||||
// document.querySelector('[cursor]').setAttribute("visible",false)
|
document.querySelector('[cursor]').setAttribute("visible",false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init:function(data){
|
init:function(data){
|
||||||
this.immersive = false;
|
this.log = ""
|
||||||
let enabled = () => AFRAME.utils.device.isMobile()
|
let enabled = () => AFRAME.utils.device.isMobile()
|
||||||
let setVisible = () => {
|
let setVisible = (state) => {
|
||||||
let cursor = document.querySelector('[cursor]')
|
this.log += state ? ">true" :">false"
|
||||||
if( cursor ) cursor.setAttribute('visible', enabled() )
|
alert(this.log)
|
||||||
|
if( enabled() ) setGazer(state)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setGazer(enabled())
|
setVisible(false);
|
||||||
setVisible();
|
|
||||||
|
|
||||||
document.querySelector("a-scene").addEventListener('exit-vr', () => {
|
document.querySelector("a-scene").addEventListener('exit-vr', () => setVisible(false) )
|
||||||
this.immersive = false;
|
document.querySelector("a-scene").addEventListener('enter-vr', () => setVisible(true) )
|
||||||
setVisible()
|
document.querySelector("a-scene").addEventListener('exit-ar', () => setVisible(false) )
|
||||||
})
|
document.querySelector("a-scene").addEventListener('enter-ar', () => setVisible(true) )
|
||||||
|
|
||||||
document.querySelector("a-scene").addEventListener('enter-vr', () => {
|
|
||||||
this.immersive = true;
|
|
||||||
setVisible()
|
|
||||||
if( !document.querySelector("#cursor") ) return
|
|
||||||
})
|
|
||||||
|
|
||||||
let highlightMesh = (state) => (e) => {
|
let highlightMesh = (state) => (e) => {
|
||||||
if( !e.target.object3D ) return
|
if( !e.target.object3D ) return
|
||||||
|
|
|
@ -1,105 +0,0 @@
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* generated at $(date)
|
|
||||||
* https://xrfragment.org
|
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
|
||||||
*/
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* generated at $(date)
|
* v0.5.1 generated at Wed Dec 6 09:38:34 PM CET 2023
|
||||||
* https://xrfragment.org
|
* https://xrfragment.org
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
* SPDX-License-Identifier: MPL-2.0
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* generated at $(date)
|
* v0.5.1 generated at Wed Dec 6 09:38:34 PM CET 2023
|
||||||
* https://xrfragment.org
|
* https://xrfragment.org
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
* SPDX-License-Identifier: MPL-2.0
|
||||||
*/
|
*/
|
||||||
|
|
12
make
12
make
|
@ -1,6 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
try(){ set +e; "$@" 2>/dev/null; set -e; }
|
try(){ set +e; "$@" 2>/dev/null; set -e; }
|
||||||
trace(){ set -x; "$@"; set +x; }
|
trace(){ set -x; "$@"; set +x; }
|
||||||
|
|
||||||
|
@ -81,13 +80,14 @@ build(){
|
||||||
cat dist/xrfragment.three.js > dist/xrfragment.three.module.js
|
cat dist/xrfragment.three.js > dist/xrfragment.three.module.js
|
||||||
echo "export default xrf;" >> dist/xrfragment.three.module.js
|
echo "export default xrf;" >> dist/xrfragment.three.module.js
|
||||||
|
|
||||||
|
# convert ESM to normal browser js
|
||||||
|
sed 's/export //g' example/assets/js/utils.js > dist/utils.js
|
||||||
|
|
||||||
# add AFRAME
|
# add AFRAME
|
||||||
cat dist/xrfragment.three.js \
|
cat dist/xrfragment.three.js \
|
||||||
dist/utils.js \
|
dist/utils.js \
|
||||||
src/3rd/js/aframe/*.js \
|
src/3rd/js/aframe/*.js \
|
||||||
example/assets/js/qr.js > dist/xrfragment.aframe.js
|
example/assets/js/qr.js > dist/xrfragment.aframe.js
|
||||||
# convert ESM to normal browser js
|
|
||||||
sed 's/export //g' example/assets/js/utils.js > dist/utils.js
|
|
||||||
|
|
||||||
# fat all-in-one standalone xrf release
|
# fat all-in-one standalone xrf release
|
||||||
test -f /tmp/xrf-aframe.js || {
|
test -f /tmp/xrf-aframe.js || {
|
||||||
|
@ -95,13 +95,13 @@ build(){
|
||||||
wget "https://cdn.jsdelivr.net/npm/aframe-blink-controls/dist/aframe-blink-controls.min.js" -O /tmp/xrf-blink.js
|
wget "https://cdn.jsdelivr.net/npm/aframe-blink-controls/dist/aframe-blink-controls.min.js" -O /tmp/xrf-blink.js
|
||||||
for i in /tmp/xrf-*.js; do echo -e "\n" >> $i; done # add extra linebreak to prevent bundle issues
|
for i in /tmp/xrf-*.js; do echo -e "\n" >> $i; done # add extra linebreak to prevent bundle issues
|
||||||
}
|
}
|
||||||
cat /tmp/xrf-*.js dist/xrfragment.aframe.js dist/utils.js > dist/xrfragment.aframe.all.js
|
cat /tmp/xrf-*.js dist/xrfragment.aframe.js > dist/xrfragment.aframe.all.js
|
||||||
|
|
||||||
# add license headers
|
# add license headers
|
||||||
for file in dist/xrfragment.{aframe,module,three,three.module,all}.js; do
|
for file in dist/xrfragment.{aframe,module,three,three.module,aframe.all}.js; do
|
||||||
awk 'BEGIN{
|
awk 'BEGIN{
|
||||||
print "/*"
|
print "/*"
|
||||||
print " * generated at $(date)"
|
print " * '"$(git tag)"' generated at '"$(date)"'"
|
||||||
print " * https://xrfragment.org"
|
print " * https://xrfragment.org"
|
||||||
print " * SPDX-License-Identifier: MPL-2.0"
|
print " * SPDX-License-Identifier: MPL-2.0"
|
||||||
print " */"
|
print " */"
|
||||||
|
|
Loading…
Reference in New Issue