Listen for ATON Tap event

This commit is contained in:
2026-05-20 18:32:07 +02:00
parent b90d1614e9
commit 55f10e62d9
4 changed files with 24 additions and 24 deletions

View File

@@ -109,6 +109,7 @@ function loadNodes(nodes) {
if (n.isSemantic) {
createSemanticNode(n.model, n.label);
AppState.semanticNodes.set(n.label, n.content);
//ATON.getSemanticRoot().attach(semNode);
}
@@ -123,30 +124,6 @@ function loadNodes(nodes) {
console.error("No bounding sphere computed, clipping will fail. Ensure one node has 'isMain: true'.");
}
}
/**
* Uses a generic sphere shape as semantic annotation
* @param {Sphere} bound The scene node's bounding sphere
* @param {string} id The original scene node ID (3D object)
* @returns {ATON.SceneNode}
function createSemanticNode(bound, id) {
// Default/highlight materials for semantic node
let matSemDef = ATON.MatHub.materials.semanticShape;
let matSemHL = ATON.MatHub.materials.semanticShapeHL;
const semNode = ATON.createSemanticNode(id)
.setDefaultAndHighlightMaterials(matSemDef, matSemHL)
.attachToRoot();
const sphereCenter = bound.center;
const sphereRadius = bound.radius * 0.2;
let sphere = ATON.SemFactory.createSphere(id, sphereCenter, sphereRadius);
console.debug('Bound:', bound);
console.debug('Semantic sphere:', sphere);
}
*/
/**
* Creates a semantic annotation from a model
* @param {string} model The model's path to load

View File

@@ -24,6 +24,7 @@ let AppState = {
*/
normalizedNodes: [],
treeNodes: {},
semanticNodes: new Map,
mainNodeId: null,
currentScene: null,
sceneHasAudio: false,