spoint 0.1.21 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/client/app.js +5 -3
  2. package/package.json +1 -1
package/client/app.js CHANGED
@@ -657,8 +657,10 @@ ground.rotation.x = -Math.PI / 2
657
657
  ground.receiveShadow = true
658
658
  scene.add(ground)
659
659
 
660
- const gltfLoader = new GLTFLoader()
661
- const dracoLoader = new DRACOLoader()
660
+ const loadingManager = new THREE.LoadingManager()
661
+ loadingManager.onError = (url) => console.warn('[THREE] Failed to load:', url)
662
+ const gltfLoader = new GLTFLoader(loadingManager)
663
+ const dracoLoader = new DRACOLoader(loadingManager)
662
664
  dracoLoader.setDecoderPath('/draco/')
663
665
  gltfLoader.setDRACOLoader(dracoLoader)
664
666
  gltfLoader.register((parser) => new VRMLoaderPlugin(parser))
@@ -942,7 +944,7 @@ function loadEntityModel(entityId, entityState) {
942
944
  fitShadowFrustum()
943
945
  pendingLoads.delete(entityId)
944
946
  if (!environmentLoaded) { environmentLoaded = true; checkAllLoaded() }
945
- }, undefined, (err) => { console.error('[gltf]', entityId, err); pendingLoads.delete(entityId) })
947
+ }, (progress) => { if (progress.total > 0) console.log('[gltf]', url, Math.round(progress.loaded / progress.total * 100) + '%') }, (err) => { console.error('[gltf]', url, err); pendingLoads.delete(entityId) })
946
948
  }
947
949
 
948
950
  function renderAppUI(state) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spoint",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "description": "Physics and netcode SDK for multiplayer game servers",
5
5
  "type": "module",
6
6
  "main": "src/index.js",