Fix bug with clipping
This commit is contained in:
@@ -36,7 +36,7 @@ export const config = {
|
|||||||
isMain: true,
|
isMain: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
pano: `pano/defsky-grass.jpg`,
|
pano: `pano/gradient.jpg`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id : "ssgp",
|
id : "ssgp",
|
||||||
@@ -48,10 +48,12 @@ export const config = {
|
|||||||
{
|
{
|
||||||
label: 'Teatro',
|
label: 'Teatro',
|
||||||
children: [
|
children: [
|
||||||
|
/*
|
||||||
{
|
{
|
||||||
label: 'Struttura complessiva',
|
label: 'Struttura complessiva',
|
||||||
model: 'models/ssgp/Teatro_SSGP_Full_ConSottrazioni.glb',
|
model: 'models/ssgp/Teatro_SSGP_Full_ConSottrazioni.glb',
|
||||||
},
|
},
|
||||||
|
*/
|
||||||
{
|
{
|
||||||
label: 'Involucro',
|
label: 'Involucro',
|
||||||
model: 'models/ssgp/Teatro_SSGP_Layer_Struttura_parete_di_fondo.glb',
|
model: 'models/ssgp/Teatro_SSGP_Layer_Struttura_parete_di_fondo.glb',
|
||||||
|
|||||||
2
js/ui.js
2
js/ui.js
@@ -24,7 +24,7 @@ UI.contentMenuTabs = `
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<!-- Tab panes -->
|
<!-- Tab panes -->
|
||||||
<div class="tab-content ps-4 ms-3" style="overflow: auto">
|
<div class="tab-content ps-4 ms-3 overflow-y-auto">
|
||||||
<div class="tab-pane active p-3 ms-3" id="layer" role="tabpanel" aria-labelledby="layer-tab" tabindex="0"></div>
|
<div class="tab-pane active p-3 ms-3" id="layer" role="tabpanel" aria-labelledby="layer-tab" tabindex="0"></div>
|
||||||
<div class="tab-pane p-3" id="media" role="tabpanel" aria-labelledby="media-tab" tabindex="0"></div>
|
<div class="tab-pane p-3" id="media" role="tabpanel" aria-labelledby="media-tab" tabindex="0"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,7 +9,13 @@
|
|||||||
* @param {Number} depth
|
* @param {Number} depth
|
||||||
*/
|
*/
|
||||||
function traverse(node, flatList, depth = 1) {
|
function traverse(node, flatList, depth = 1) {
|
||||||
const normNode = {label: node.label};
|
const normNode = {
|
||||||
|
id: node.label,
|
||||||
|
label: node.label,
|
||||||
|
opacity: node.opacity ?? null,
|
||||||
|
isMain: node.isMain ?? false,
|
||||||
|
active: true,
|
||||||
|
};
|
||||||
if (node.model) {
|
if (node.model) {
|
||||||
normNode.model = node.model;
|
normNode.model = node.model;
|
||||||
}
|
}
|
||||||
@@ -18,9 +24,8 @@ function traverse(node, flatList, depth = 1) {
|
|||||||
depth
|
depth
|
||||||
});
|
});
|
||||||
if (node.children) {
|
if (node.children) {
|
||||||
depth++;
|
|
||||||
for(let child of node.children) {
|
for(let child of node.children) {
|
||||||
traverse(child, flatList, depth);
|
traverse(child, flatList, depth + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,11 +37,11 @@ function traverse(node, flatList, depth = 1) {
|
|||||||
* @returns {Object[]} A flat list of nodes
|
* @returns {Object[]} A flat list of nodes
|
||||||
**/
|
**/
|
||||||
export function normalizeNodes (nodes) {
|
export function normalizeNodes (nodes) {
|
||||||
let flatNodes = [];
|
let flatList = [];
|
||||||
|
|
||||||
for (let node of nodes) {
|
for (let node of nodes) {
|
||||||
traverse(node, flatNodes);
|
traverse(node, flatList);
|
||||||
}
|
}
|
||||||
|
|
||||||
return flatNodes;
|
return flatList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ AppState.currentScene = 'salvador';
|
|||||||
AppState.sceneHasAudio = true;
|
AppState.sceneHasAudio = true;
|
||||||
const marker = config.markers.find(m => m.id === 'salvador');
|
const marker = config.markers.find(m => m.id === 'salvador');
|
||||||
AppState.normalizedNodes = normalizeNodes(marker.nodes);
|
AppState.normalizedNodes = normalizeNodes(marker.nodes);
|
||||||
|
|
||||||
AppState.normalizedNodes.forEach(node => node.active = true);
|
|
||||||
|
|
||||||
Scene.openScene(marker, AppState.normalizedNodes);
|
Scene.openScene(marker, AppState.normalizedNodes);
|
||||||
|
|
||||||
Scene.UI.pauseAudio('[data-bs-dismiss="modal"]');
|
Scene.UI.pauseAudio('[data-bs-dismiss="modal"]');
|
||||||
|
|||||||
@@ -6,7 +6,4 @@ import { normalizeNodes } from "../../js/utils/nodeUtils.js";
|
|||||||
AppState.currentScene = 'ssgp';
|
AppState.currentScene = 'ssgp';
|
||||||
const marker = config.markers.find(m => m.id === 'ssgp');
|
const marker = config.markers.find(m => m.id === 'ssgp');
|
||||||
AppState.normalizedNodes = normalizeNodes(marker.nodes);
|
AppState.normalizedNodes = normalizeNodes(marker.nodes);
|
||||||
|
|
||||||
AppState.normalizedNodes.forEach(node => node.active = true);
|
|
||||||
|
|
||||||
Scene.openScene(marker, AppState.normalizedNodes);
|
Scene.openScene(marker, AppState.normalizedNodes);
|
||||||
|
|||||||
Reference in New Issue
Block a user