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