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

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