u
This commit is contained in:
10
src/index.js
10
src/index.js
@@ -12,16 +12,18 @@ let cameraConfig = null;
|
||||
// Load camera configuration from config file
|
||||
async function loadCameraConfig() {
|
||||
try {
|
||||
const response = await fetch('camera-config.json');
|
||||
const response = await fetch('./camera-config.json');
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
cameraConfig = await response.json();
|
||||
console.log('Camera config loaded:', cameraConfig);
|
||||
console.log('✅ Camera config loaded successfully:', cameraConfig);
|
||||
return cameraConfig;
|
||||
} catch (error) {
|
||||
console.warn('Could not load camera config, using defaults:', error);
|
||||
// Return default config if file load fails
|
||||
console.warn('⚠️ Could not load camera-config.json, using original defaults.');
|
||||
console.log('📝 To use custom camera settings, ensure camera-config.json is accessible from your web server.');
|
||||
|
||||
// Return original simple defaults
|
||||
return {
|
||||
camera: {
|
||||
position: { x: 20, y: 20, z: 20 },
|
||||
|
||||
@@ -57,6 +57,10 @@ module.exports = (env, argv) => {
|
||||
{
|
||||
from: 'cube/',
|
||||
to: 'cube/'
|
||||
},
|
||||
{
|
||||
from: 'camera-config.json',
|
||||
to: 'camera-config.json'
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user