@stowkit/three-loader 0.1.22 → 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.
- package/README.md +34 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,6 +40,7 @@ function animate() {
|
|
|
40
40
|
- ✅ **Animations** - Skeletal animations with automatic mixer setup
|
|
41
41
|
- ✅ **Textures** - KTX2/Basis Universal GPU-compressed textures
|
|
42
42
|
- ✅ **Audio** - OGG/MP3 audio with Three.js Audio integration
|
|
43
|
+
- ✅ **Multiple Packs** - Load multiple .stow files simultaneously with isolated state
|
|
43
44
|
- ✅ **WASM Parsing** - All binary parsing done in WASM for performance
|
|
44
45
|
- ✅ **Type Safe** - Full TypeScript support
|
|
45
46
|
- ✅ **Zero Config** - Works out of the box
|
|
@@ -304,6 +305,39 @@ function animate() {
|
|
|
304
305
|
animate();
|
|
305
306
|
```
|
|
306
307
|
|
|
308
|
+
## Loading Multiple Packs
|
|
309
|
+
|
|
310
|
+
Each pack is fully isolated with its own state. You can load multiple packs simultaneously without any interference:
|
|
311
|
+
|
|
312
|
+
```typescript
|
|
313
|
+
// Load multiple packs at once
|
|
314
|
+
const [environmentPack, characterPack, audioPack] = await Promise.all([
|
|
315
|
+
StowKitLoader.load('environment.stow'),
|
|
316
|
+
StowKitLoader.load('characters.stow'),
|
|
317
|
+
StowKitLoader.load('audio.stow')
|
|
318
|
+
]);
|
|
319
|
+
|
|
320
|
+
// Load assets from different packs
|
|
321
|
+
const level = await environmentPack.loadMesh('level1');
|
|
322
|
+
const player = await characterPack.loadSkinnedMesh('player');
|
|
323
|
+
const bgm = await audioPack.loadAudio('theme', listener);
|
|
324
|
+
|
|
325
|
+
scene.add(level);
|
|
326
|
+
scene.add(player);
|
|
327
|
+
bgm.play();
|
|
328
|
+
|
|
329
|
+
// Each pack maintains its own asset catalog
|
|
330
|
+
console.log(`Environment: ${environmentPack.getAssetCount()} assets`);
|
|
331
|
+
console.log(`Characters: ${characterPack.getAssetCount()} assets`);
|
|
332
|
+
console.log(`Audio: ${audioPack.getAssetCount()} assets`);
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
**Note:** Each pack creates its own WASM instance for isolated state. Dispose packs when no longer needed:
|
|
336
|
+
|
|
337
|
+
```typescript
|
|
338
|
+
environmentPack.dispose();
|
|
339
|
+
```
|
|
340
|
+
|
|
307
341
|
## Asset Types
|
|
308
342
|
|
|
309
343
|
```typescript
|