scaenae/js/state.js
2026-01-14 16:42:47 +01:00

64 lines
1.4 KiB
JavaScript

/**
* @namespace AppState
*/
let AppState = {
// The root scene object
root: null,
mainNodeId: null,
initialRotation: null,
camera: null,
renderer: null,
ambientOcclusion : true,
shadows : true,
lightProbe : false,
map : null,
clipping : {
enabled: false,
plane : null,
controls: null,
onDrag: null,
helper : null,
arrow : null,
boundingSphere: null,
listeners: {
button: false,
plane: false,
},
vector: null,
},
/**
* Reset the overall app state
* to default values but keep map
*
* @param {L.Map} map - The Leaflet map object
*/
resetSceneState(map) {
AppState = {
root: null,
mainNodeId: null,
initialRotation: null,
camera: null,
renderer: null,
ambientOcclusion : true,
shadows : true,
lightProbe : false,
map,
clipping : {
enabled: false,
plane : null,
controls: null,
onDrag: null,
helper : null,
arrow : null,
boundingSphere: null,
listeners: {
button: false,
plane: false,
},
vector: null,
}
}
}
}
export default AppState;