pages: minor bugfix

This commit is contained in:
Leon van Kammen 2024-07-12 17:01:46 +00:00
parent f5c480dcea
commit 9a05968710
6 changed files with 3182 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*
* v0.5.1 generated at Fri Jul 12 04:11:54 PM UTC 2024
* v0.5.1 generated at Fri Jul 12 05:00:05 PM UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
@ -3608,6 +3608,9 @@ let loadAudio = (mimetype) => function(url,opts){
return
}else sound.stop()
console.dir(sound)
debugger
// apply embedded audio/video samplerate/fps or global mixer fps
sound.setLoopStart(v.x);
sound.setLoopEnd(v.y || buffer.duration);

View File

@ -1,5 +1,5 @@
/*
* v0.5.1 generated at Fri Jul 12 04:11:54 PM UTC 2024
* v0.5.1 generated at Fri Jul 12 05:00:05 PM UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
@ -3606,6 +3606,9 @@ let loadAudio = (mimetype) => function(url,opts){
return
}else sound.stop()
console.dir(sound)
debugger
// apply embedded audio/video samplerate/fps or global mixer fps
sound.setLoopStart(v.x);
sound.setLoopEnd(v.y || buffer.duration);

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/*
* v0.5.1 generated at Fri Jul 12 04:11:54 PM UTC 2024
* v0.5.1 generated at Fri Jul 12 05:00:05 PM UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
@ -3606,6 +3606,9 @@ let loadAudio = (mimetype) => function(url,opts){
return
}else sound.stop()
console.dir(sound)
debugger
// apply embedded audio/video samplerate/fps or global mixer fps
sound.setLoopStart(v.x);
sound.setLoopEnd(v.y || buffer.duration);

View File

@ -1,5 +1,5 @@
/*
* v0.5.1 generated at Fri Jul 12 04:11:54 PM UTC 2024
* v0.5.1 generated at Fri Jul 12 05:00:05 PM UTC 2024
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
@ -3606,6 +3606,9 @@ let loadAudio = (mimetype) => function(url,opts){
return
}else sound.stop()
console.dir(sound)
debugger
// apply embedded audio/video samplerate/fps or global mixer fps
sound.setLoopStart(v.x);
sound.setLoopEnd(v.y || buffer.duration);

View File

@ -0,0 +1,32 @@
// switch camera when multiple cameras for url #mycameraname
xrf.addEventListener('navigateLoaded', (opts) => {
// select active camera if any
let {id,match,v} = opts
let envmap = {}
let current = ''
// Recursive function to traverse the graph
function traverseAndSetEnvMap(node, closestAncestorMaterialMap = null) {
// Check if the current node has a material
if (node.isMesh && node.material) {
if (node.material.map && closestAncestorMaterialMap) {
// If the node has a material map, set the closest ancestor material map
node.material.envMap = closestAncestorMaterialMap;
}
}
// Update the closest ancestor's material map
if (node.isMesh && node.material && node.material.map) {
closestAncestorMaterialMap = node.material.map.clone();
closestAncestorMaterialMap.mapping = THREE.EquirectangularReflectionMapping;
closestAncestorMaterialMap.needsUpdate = true
}
// Recursively traverse all children
node.children.forEach(child => traverseAndSetEnvMap(child, closestAncestorMaterialMap));
}
// Start traversal from the root node
traverseAndSetEnvMap(xrf.scene);
})