Better config defaults

This commit is contained in:
2026-04-16 15:23:16 +02:00
parent 12ae63d332
commit 337bcce0bb
2 changed files with 8 additions and 4 deletions

View File

@@ -18,6 +18,9 @@ export const config = {
scene : { scene : {
initialExposure: 0.7, initialExposure: 0.7,
autoLP: false, autoLP: false,
shadows: false,
initLightDir: [0.2,-0.3,-0.7],
initRotation: [0, 1.5, 0],
}, },
menu : { menu : {
//audioBtn1 //audioBtn1

View File

@@ -34,13 +34,14 @@ function init () {
// All assets for this app are stored here // All assets for this app are stored here
ATON.setPathCollection('/a/scaenae/assets/'); ATON.setPathCollection('/a/scaenae/assets/');
// Initial light direction // Initial light direction
ATON.setMainLightDirection(new THREE.Vector3(0.2,-0.3,-0.7)); ATON.setMainLightDirection(new THREE.Vector3(...config.scene.initLightDir));
ATON.toggleShadows(true); ATON.toggleShadows(config.scene.shadows);
ATON.setExposure(config.scene.initialExposure); ATON.setExposure(config.scene.initialExposure);
// Open settings side panel when clicking on settings btn // Open settings side panel when clicking on settings btn
AppState.camera = ATON.Nav._camera; AppState.camera = ATON.Nav._camera;
AppState.renderer = ATON._renderer; AppState.renderer = ATON._renderer;
AppState.shadows = config.scene.shadows;
ATON.Nav.setUserControl(true); ATON.Nav.setUserControl(true);
} }
@@ -57,7 +58,7 @@ export function openScene (marker, nodes) {
ATON.setMainPanorama(marker.pano); ATON.setMainPanorama(marker.pano);
// TODO: hardcoded... // TODO: hardcoded...
AppState.initialRotation = new THREE.Vector3(0, 1.5, 0); AppState.initialRotation = new THREE.Vector3(...config.scene.initRotation);
ATON.setAutoLP(config.scene.autoLP); ATON.setAutoLP(config.scene.autoLP);
AppState.lightProbe = config.scene.autoLP; AppState.lightProbe = config.scene.autoLP;
@@ -74,7 +75,7 @@ function loadNodes(nodes) {
nodes.forEach(n => { nodes.forEach(n => {
let node = ATON.createSceneNode(n.label); let node = ATON.createSceneNode(n.label);
node.load(n.model); node.load(n.model);
node.setRotation(0, 1.5, 0); node.setRotation(...config.scene.initRotation);
// Apply any transparency before attaching to scene // Apply any transparency before attaching to scene
if (n.opacity !== undefined && n.opacity !== null) { if (n.opacity !== undefined && n.opacity !== null) {