MikaFil commited on
Commit
54716da
·
verified ·
1 Parent(s): d689425

Update viewer.js

Browse files
Files changed (1) hide show
  1. viewer.js +3 -24
viewer.js CHANGED
@@ -104,8 +104,6 @@ export async function initializeViewer(config, instanceId) {
104
  color_bg_hex = "#A1D4D2";
105
  color_bg = hexToRgbaArray(color_bg_hex);
106
 
107
- console.log("color bg : ", color_bg);
108
-
109
  chosenCameraX = isMobile ? cameraXPhone : cameraX;
110
  chosenCameraY = isMobile ? cameraYPhone : cameraY;
111
  chosenCameraZ = isMobile ? cameraZPhone : cameraZ;
@@ -194,30 +192,9 @@ export async function initializeViewer(config, instanceId) {
194
  presentoir: new pc.Asset('presentoir', 'container', {url: presentoirUrl}),
195
  };
196
 
197
- // --- LOG: asset list and all URLs
198
- /*console.log("%c[VIEWER DEBUG] About to load assets:", "color: #39CCCC;", JSON.stringify(
199
- Object.fromEntries(Object.entries(assets).map(([k, v]) => [k, v && v.url]))
200
- , null, 2));
201
- Object.entries(assets).forEach(([name, asset]) => {
202
- if (asset && asset.url) {
203
- console.log(`[VIEWER DEBUG] Asset "${name}" loading from: ${asset.url}`);
204
- }
205
- });*/
206
-
207
  for (const key in assets) app.assets.add(assets[key]);
208
 
209
- // --- LOG: asset load or error events
210
- /*Object.entries(assets).forEach(([name, asset]) => {
211
- if (!asset) return;
212
- asset.once('load', function(resource) {
213
- console.log(`%c[VIEWER DEBUG] Asset loaded: "${name}"`, "color: #2ECC40;", asset.url, resource);
214
- });
215
- asset.once('error', function(err) {
216
- console.error(`%c[VIEWER DEBUG] Asset failed to load: "${name}"`, "color: #FF4136;", asset.url, err);
217
- });
218
- });*/
219
-
220
- const loader = new pc.AssetListLoader(Object.values(assets), app.assets);
221
  loader.load(() => {
222
  console.log("%c[VIEWER DEBUG] All assets loaded, starting app", "color: #2ECC40;");
223
  app.start();
@@ -253,6 +230,8 @@ export async function initializeViewer(config, instanceId) {
253
  }
254
  }
255
  });
 
 
256
  }
257
 
258
  cameraEntity = new pc.Entity('camera');
 
104
  color_bg_hex = "#A1D4D2";
105
  color_bg = hexToRgbaArray(color_bg_hex);
106
 
 
 
107
  chosenCameraX = isMobile ? cameraXPhone : cameraX;
108
  chosenCameraY = isMobile ? cameraYPhone : cameraY;
109
  chosenCameraZ = isMobile ? cameraZPhone : cameraZ;
 
192
  presentoir: new pc.Asset('presentoir', 'container', {url: presentoirUrl}),
193
  };
194
 
 
 
 
 
 
 
 
 
 
 
195
  for (const key in assets) app.assets.add(assets[key]);
196
 
197
+ const loader = new pc.AssetListLoader(Object.values(assets), app.assets);
 
 
 
 
 
 
 
 
 
 
 
198
  loader.load(() => {
199
  console.log("%c[VIEWER DEBUG] All assets loaded, starting app", "color: #2ECC40;");
200
  app.start();
 
230
  }
231
  }
232
  });
233
+
234
+ console.log("matSol : ok");
235
  }
236
 
237
  cameraEntity = new pc.Entity('camera');