angular-three-soba 4.0.0-next.97 → 4.0.0-next.99
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/abstractions/lib/catmull-rom-line.d.ts +88 -88
- package/abstractions/lib/edges.d.ts +88 -88
- package/abstractions/lib/gradient-texture.d.ts +1 -1
- package/abstractions/lib/helper.d.ts +6 -1
- package/abstractions/lib/line.d.ts +1 -1
- package/abstractions/lib/text-3d.d.ts +1 -1
- package/cameras/lib/cube-camera.d.ts +7 -2
- package/cameras/lib/orthographic-camera.d.ts +1 -1
- package/cameras/lib/perspective-camera.d.ts +1 -1
- package/fesm2022/angular-three-soba-abstractions.mjs +16 -11
- package/fesm2022/angular-three-soba-abstractions.mjs.map +1 -1
- package/fesm2022/angular-three-soba-cameras.mjs +16 -11
- package/fesm2022/angular-three-soba-cameras.mjs.map +1 -1
- package/fesm2022/angular-three-soba-controls.mjs +7 -7
- package/fesm2022/angular-three-soba-controls.mjs.map +1 -1
- package/fesm2022/angular-three-soba-gizmos.mjs +10 -10
- package/fesm2022/angular-three-soba-gizmos.mjs.map +1 -1
- package/fesm2022/angular-three-soba-loaders.mjs +186 -49
- package/fesm2022/angular-three-soba-loaders.mjs.map +1 -1
- package/fesm2022/angular-three-soba-materials.mjs +14 -14
- package/fesm2022/angular-three-soba-materials.mjs.map +1 -1
- package/fesm2022/angular-three-soba-misc.mjs +68 -52
- package/fesm2022/angular-three-soba-misc.mjs.map +1 -1
- package/fesm2022/angular-three-soba-performances.mjs +6 -6
- package/fesm2022/angular-three-soba-performances.mjs.map +1 -1
- package/fesm2022/angular-three-soba-staging.mjs +142 -54
- package/fesm2022/angular-three-soba-staging.mjs.map +1 -1
- package/gizmos/lib/pivot-controls/axis-arrow.d.ts +1 -1
- package/gizmos/lib/pivot-controls/axis-rotator.d.ts +1 -1
- package/gizmos/lib/pivot-controls/pivot-controls.d.ts +1 -1
- package/gizmos/lib/pivot-controls/plane-slider.d.ts +1 -1
- package/gizmos/lib/pivot-controls/scaling-sphere.d.ts +1 -1
- package/loaders/index.d.ts +4 -0
- package/loaders/lib/fbx-loader.d.ts +9 -1
- package/loaders/lib/fbx-resource.d.ts +7 -0
- package/loaders/lib/font-loader.d.ts +6 -20
- package/loaders/lib/font-resource.d.ts +28 -0
- package/loaders/lib/gltf-loader.d.ts +8 -0
- package/loaders/lib/gltf-resource.d.ts +32 -0
- package/loaders/lib/loader.d.ts +2 -2
- package/loaders/lib/progress.d.ts +6 -1
- package/loaders/lib/texture-loader.d.ts +8 -0
- package/loaders/lib/texture-resource.d.ts +10 -0
- package/misc/lib/animations.d.ts +6 -1
- package/misc/lib/decal.d.ts +1 -1
- package/misc/lib/depth-buffer.d.ts +6 -1
- package/misc/lib/fbo.d.ts +7 -2
- package/misc/lib/html/html.d.ts +2 -2
- package/misc/lib/intersect.d.ts +6 -1
- package/misc/lib/sampler.d.ts +1 -1
- package/package.json +9 -9
- package/staging/index.d.ts +1 -0
- package/staging/lib/accumulative-shadows.d.ts +1 -1
- package/staging/lib/caustics.d.ts +1 -1
- package/staging/lib/center.d.ts +2 -2
- package/staging/lib/contact-shadows.d.ts +1 -1
- package/staging/lib/environment/environment-resource.d.ts +35 -0
- package/staging/lib/environment/environment.d.ts +3 -3
- package/staging/lib/environment/inject-environment.d.ts +8 -24
- package/staging/lib/lightformer.d.ts +1 -1
- package/staging/lib/mask.d.ts +1 -1
- package/staging/lib/matcap-texture.d.ts +17 -4
- package/staging/lib/normal-texture.d.ts +20 -7
- package/staging/lib/sky.d.ts +1 -1
- package/staging/lib/spot-light.d.ts +4 -4
- package/staging/lib/stage.d.ts +6 -6
|
@@ -1,19 +1,37 @@
|
|
|
1
|
-
import { injectLoader, pick, injectStore, is } from 'angular-three';
|
|
1
|
+
import { loaderResource, injectLoader, signalState, pick, injectStore, is } from 'angular-three';
|
|
2
2
|
import { assertInjector } from 'ngxtension/assert-injector';
|
|
3
3
|
import { FBXLoader, FontLoader, DRACOLoader, MeshoptDecoder, GLTFLoader } from 'three-stdlib';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import {
|
|
5
|
+
import { resource, computed, inject, DestroyRef, input, viewChild, signal, effect, untracked, Component, ChangeDetectionStrategy } from '@angular/core';
|
|
6
6
|
import { mergeInputs } from 'ngxtension/inject-inputs';
|
|
7
7
|
import * as THREE from 'three';
|
|
8
8
|
|
|
9
|
+
function fbxResource(input, { injector } = {}) {
|
|
10
|
+
return assertInjector(fbxResource, injector, () => {
|
|
11
|
+
return loaderResource(() => FBXLoader, input);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
fbxResource.preload = (input) => {
|
|
15
|
+
loaderResource.preload(FBXLoader, input);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use fbxResource instead. Will be removed in v5.0.0
|
|
20
|
+
* @since v4.0.0
|
|
21
|
+
*/
|
|
9
22
|
function _injectFBX(input, { injector } = {}) {
|
|
10
23
|
return assertInjector(_injectFBX, injector, () => {
|
|
11
|
-
|
|
24
|
+
const resource = fbxResource(input, { injector });
|
|
25
|
+
return resource.value.asReadonly();
|
|
12
26
|
});
|
|
13
27
|
}
|
|
14
28
|
_injectFBX.preload = (input) => {
|
|
15
29
|
injectLoader.preload(() => FBXLoader, input);
|
|
16
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Use fbxResource instead. Will be removed in v5.0.0
|
|
33
|
+
* @since v4.0.0
|
|
34
|
+
*/
|
|
17
35
|
const injectFBX = _injectFBX;
|
|
18
36
|
|
|
19
37
|
let fontLoader = null;
|
|
@@ -27,62 +45,81 @@ function parseFontData(fontData) {
|
|
|
27
45
|
return fontLoader.parse(fontData);
|
|
28
46
|
}
|
|
29
47
|
const cache = new Map();
|
|
30
|
-
function
|
|
31
|
-
return assertInjector(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
});
|
|
48
|
+
function fontResource(input, { injector } = {}) {
|
|
49
|
+
return assertInjector(fontResource, injector, () => {
|
|
50
|
+
return resource({
|
|
51
|
+
request: input,
|
|
52
|
+
loader: async ({ request }) => {
|
|
53
|
+
if (cache.has(request)) {
|
|
54
|
+
return cache.get(request);
|
|
55
|
+
}
|
|
56
|
+
const fontData = await loadFontData(request);
|
|
57
|
+
const parsed = parseFontData(fontData);
|
|
58
|
+
cache.set(request, parsed);
|
|
59
|
+
return parsed;
|
|
60
|
+
},
|
|
44
61
|
});
|
|
45
|
-
return font.asReadonly();
|
|
46
62
|
});
|
|
47
63
|
}
|
|
48
|
-
|
|
49
|
-
loadFontData(input
|
|
64
|
+
fontResource.preload = (input) => {
|
|
65
|
+
loadFontData(input).then((data) => {
|
|
50
66
|
const parsed = parseFontData(data);
|
|
51
|
-
cache.set(input
|
|
67
|
+
cache.set(input, parsed);
|
|
52
68
|
});
|
|
53
69
|
};
|
|
54
|
-
|
|
70
|
+
fontResource.clear = (input) => {
|
|
55
71
|
if (input) {
|
|
56
|
-
cache.delete(input
|
|
72
|
+
cache.delete(input);
|
|
57
73
|
}
|
|
58
74
|
else {
|
|
59
75
|
cache.clear();
|
|
60
76
|
}
|
|
61
77
|
};
|
|
62
78
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
79
|
+
/**
|
|
80
|
+
* @deprecated Use fontResource instead. Will be removed in v5.0.0
|
|
81
|
+
* @since v4.0.0
|
|
82
|
+
*/
|
|
83
|
+
function injectFont(input, { injector } = {}) {
|
|
84
|
+
return assertInjector(injectFont, injector, () => {
|
|
85
|
+
const resource = fontResource(input, { injector });
|
|
86
|
+
return resource.value.asReadonly();
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
injectFont.preload = (input) => {
|
|
90
|
+
fontResource.preload(input());
|
|
91
|
+
};
|
|
92
|
+
injectFont.clear = (input) => {
|
|
93
|
+
fontResource.clear(input?.());
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
let dracoLoader$1 = null;
|
|
97
|
+
let decoderPath$1 = 'https://www.gstatic.com/draco/versioned/decoders/1.5.5/';
|
|
98
|
+
function _extensions$1(useDraco, useMeshOpt, extensions) {
|
|
66
99
|
return (loader) => {
|
|
67
100
|
if (extensions) {
|
|
68
101
|
extensions(loader);
|
|
69
102
|
}
|
|
70
103
|
if (useDraco) {
|
|
71
|
-
if (!dracoLoader) {
|
|
72
|
-
dracoLoader = new DRACOLoader();
|
|
104
|
+
if (!dracoLoader$1) {
|
|
105
|
+
dracoLoader$1 = new DRACOLoader();
|
|
73
106
|
}
|
|
74
|
-
dracoLoader.setDecoderPath(typeof useDraco === 'string' ? useDraco : decoderPath);
|
|
75
|
-
loader.setDRACOLoader(dracoLoader);
|
|
107
|
+
dracoLoader$1.setDecoderPath(typeof useDraco === 'string' ? useDraco : decoderPath$1);
|
|
108
|
+
loader.setDRACOLoader(dracoLoader$1);
|
|
76
109
|
}
|
|
77
110
|
if (useMeshOpt) {
|
|
78
111
|
loader.setMeshoptDecoder(typeof MeshoptDecoder === 'function' ? MeshoptDecoder() : MeshoptDecoder);
|
|
79
112
|
}
|
|
80
113
|
};
|
|
81
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* @deprecated Use gltfResource instead. Will be removed in v5.0.0
|
|
117
|
+
* @since v4.0.0
|
|
118
|
+
*/
|
|
82
119
|
function _injectGLTF(path, { useDraco = true, useMeshOpt = true, injector, extensions, onLoad, } = {}) {
|
|
83
120
|
return assertInjector(_injectGLTF, injector, () => {
|
|
84
121
|
const result = injectLoader(() => GLTFLoader, path, {
|
|
85
|
-
extensions: _extensions(useDraco, useMeshOpt, extensions),
|
|
122
|
+
extensions: _extensions$1(useDraco, useMeshOpt, extensions),
|
|
86
123
|
// @ts-expect-error - we know the type of the data
|
|
87
124
|
onLoad,
|
|
88
125
|
});
|
|
@@ -98,49 +135,104 @@ function _injectGLTF(path, { useDraco = true, useMeshOpt = true, injector, exten
|
|
|
98
135
|
});
|
|
99
136
|
}
|
|
100
137
|
_injectGLTF.preload = (path, { useDraco = true, useMeshOpt = true, extensions, onLoad, } = {}) => {
|
|
101
|
-
injectLoader.preload(() => GLTFLoader, path, _extensions(useDraco, useMeshOpt, extensions),
|
|
138
|
+
injectLoader.preload(() => GLTFLoader, path, _extensions$1(useDraco, useMeshOpt, extensions),
|
|
102
139
|
// @ts-expect-error - we know the type of the data
|
|
103
140
|
onLoad);
|
|
104
141
|
};
|
|
105
142
|
_injectGLTF.setDecoderPath = (path) => {
|
|
106
|
-
decoderPath = path;
|
|
143
|
+
decoderPath$1 = path;
|
|
107
144
|
};
|
|
145
|
+
/**
|
|
146
|
+
* @deprecated Use gltfResource instead. Will be removed in v5.0.0
|
|
147
|
+
* @since v4.0.0
|
|
148
|
+
*/
|
|
108
149
|
const injectGLTF = _injectGLTF;
|
|
109
150
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
151
|
+
let dracoLoader = null;
|
|
152
|
+
let decoderPath = 'https://www.gstatic.com/draco/versioned/decoders/1.5.5/';
|
|
153
|
+
function _extensions(useDraco, useMeshOpt, extensions) {
|
|
154
|
+
return (loader) => {
|
|
155
|
+
if (extensions) {
|
|
156
|
+
extensions(loader);
|
|
157
|
+
}
|
|
158
|
+
if (useDraco) {
|
|
159
|
+
if (!dracoLoader) {
|
|
160
|
+
dracoLoader = new DRACOLoader();
|
|
161
|
+
}
|
|
162
|
+
dracoLoader.setDecoderPath(typeof useDraco === 'string' ? useDraco : decoderPath);
|
|
163
|
+
loader.setDRACOLoader(dracoLoader);
|
|
164
|
+
}
|
|
165
|
+
if (useMeshOpt) {
|
|
166
|
+
loader.setMeshoptDecoder(typeof MeshoptDecoder === 'function' ? MeshoptDecoder() : MeshoptDecoder);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function gltfResource(input, { useDraco = true, useMeshOpt = true, injector, extensions, onLoad, } = {}) {
|
|
171
|
+
return assertInjector(gltfResource, injector, () => {
|
|
172
|
+
const resource = loaderResource(() => GLTFLoader, input, {
|
|
173
|
+
extensions: _extensions(useDraco, useMeshOpt, extensions),
|
|
174
|
+
// @ts-expect-error - we know the type of the data
|
|
175
|
+
onLoad,
|
|
176
|
+
});
|
|
177
|
+
Object.defineProperty(resource, 'scene', {
|
|
178
|
+
value: computed(() => {
|
|
179
|
+
const data = resource.value();
|
|
180
|
+
if (!data)
|
|
181
|
+
return null;
|
|
182
|
+
if (Array.isArray(data)) {
|
|
183
|
+
return data.map((item) => item.scene);
|
|
184
|
+
}
|
|
185
|
+
if ('parser' in data) {
|
|
186
|
+
return data.scene;
|
|
187
|
+
}
|
|
188
|
+
return Object.keys(data).reduce((acc, key) => {
|
|
189
|
+
acc[key] = data[key].scene;
|
|
190
|
+
return acc;
|
|
191
|
+
}, {});
|
|
192
|
+
}),
|
|
193
|
+
});
|
|
194
|
+
return resource;
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
gltfResource.preload = (input, { useDraco = true, useMeshOpt = true, extensions, } = {}) => {
|
|
198
|
+
loaderResource.preload(GLTFLoader, input, _extensions(useDraco, useMeshOpt, extensions));
|
|
199
|
+
};
|
|
200
|
+
gltfResource.setDecoderPath = (path) => {
|
|
201
|
+
decoderPath = path;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
function progress(injector) {
|
|
205
|
+
return assertInjector(progress, injector, () => {
|
|
206
|
+
const progressState = signalState({ errors: [], active: false, progress: 0, item: '', loaded: 0, total: 0 });
|
|
113
207
|
const defaultOnStart = THREE.DefaultLoadingManager.onStart?.bind(THREE.DefaultLoadingManager);
|
|
114
208
|
const defaultOnLoad = THREE.DefaultLoadingManager.onLoad?.bind(THREE.DefaultLoadingManager);
|
|
115
209
|
const defaultOnError = THREE.DefaultLoadingManager.onError?.bind(THREE.DefaultLoadingManager);
|
|
116
210
|
const defaultOnProgress = THREE.DefaultLoadingManager.onProgress?.bind(THREE.DefaultLoadingManager);
|
|
117
211
|
let saveLastTotalLoaded = 0;
|
|
118
212
|
THREE.DefaultLoadingManager.onStart = (item, loaded, total) => {
|
|
119
|
-
|
|
120
|
-
...prev,
|
|
213
|
+
progressState.update({
|
|
121
214
|
active: true,
|
|
122
215
|
item,
|
|
123
216
|
loaded,
|
|
124
217
|
total,
|
|
125
218
|
progress: ((loaded - saveLastTotalLoaded) / (total - saveLastTotalLoaded)) * 100,
|
|
126
|
-
})
|
|
219
|
+
});
|
|
127
220
|
};
|
|
128
221
|
THREE.DefaultLoadingManager.onLoad = () => {
|
|
129
|
-
|
|
222
|
+
progressState.update({ active: false });
|
|
130
223
|
};
|
|
131
224
|
THREE.DefaultLoadingManager.onError = (url) => {
|
|
132
|
-
|
|
225
|
+
progressState.update((prev) => ({ errors: [...prev.errors, url] }));
|
|
133
226
|
};
|
|
134
227
|
THREE.DefaultLoadingManager.onProgress = (item, loaded, total) => {
|
|
135
228
|
if (loaded === total)
|
|
136
229
|
saveLastTotalLoaded = total;
|
|
137
|
-
|
|
138
|
-
...prev,
|
|
230
|
+
progressState.update({
|
|
139
231
|
item,
|
|
140
232
|
loaded,
|
|
141
233
|
total,
|
|
142
234
|
progress: ((loaded - saveLastTotalLoaded) / (total - saveLastTotalLoaded)) * 100 || 100,
|
|
143
|
-
})
|
|
235
|
+
});
|
|
144
236
|
};
|
|
145
237
|
inject(DestroyRef).onDestroy(() => {
|
|
146
238
|
THREE.DefaultLoadingManager.onStart = defaultOnStart;
|
|
@@ -148,9 +240,14 @@ function injectProgress(injector) {
|
|
|
148
240
|
THREE.DefaultLoadingManager.onError = defaultOnError;
|
|
149
241
|
THREE.DefaultLoadingManager.onProgress = defaultOnProgress;
|
|
150
242
|
});
|
|
151
|
-
return
|
|
243
|
+
return progressState;
|
|
152
244
|
});
|
|
153
245
|
}
|
|
246
|
+
/**
|
|
247
|
+
* @deprecated Use `progress` instead. Will be removed in v5.0.0
|
|
248
|
+
* @since v4.0.0
|
|
249
|
+
*/
|
|
250
|
+
const injectProgress = progress;
|
|
154
251
|
|
|
155
252
|
const defaultDataInterpolation = (p) => `Loading ${p.toFixed(2)}%`;
|
|
156
253
|
const defaultOptions = {
|
|
@@ -163,9 +260,9 @@ const defaultOptions = {
|
|
|
163
260
|
};
|
|
164
261
|
class NgtsLoader {
|
|
165
262
|
constructor() {
|
|
166
|
-
this.progressState =
|
|
167
|
-
this.active =
|
|
168
|
-
this.progress =
|
|
263
|
+
this.progressState = progress();
|
|
264
|
+
this.active = this.progressState.active;
|
|
265
|
+
this.progress = this.progressState.progress;
|
|
169
266
|
this.options = input(defaultOptions, { transform: mergeInputs(defaultOptions) });
|
|
170
267
|
this.containerClass = pick(this.options, 'containerClass');
|
|
171
268
|
this.innerClass = pick(this.options, 'innerClass');
|
|
@@ -250,6 +347,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
250
347
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".ngts-loader-container{--ngts-loader-container-opacity: 0;position:absolute;top:0;left:0;width:100%;height:100%;background:#171717;display:flex;align-items:center;justify-content:center;transition:opacity .3s ease;z-index:1000;opacity:var(--ngts-loader-container-opacity)}.ngts-loader-inner{width:100px;height:3px;background:#272727;text-align:center}.ngts-loader-bar{--ngts-loader-bar-scale: 0;height:3px;width:100px;background:#fff;transition:transform .2s;transform-origin:left center;transform:scaleX(var(--ngts-loader-bar-scale))}.ngts-loader-data{display:inline-block;position:relative;font-variant-numeric:tabular-nums;margin-top:.8em;color:#f0f0f0;font-size:.6em;font-family:-apple-system,BlinkMacSystemFont,Inter,Segoe UI,Helvetica Neue,Helvetica,Arial,Roboto,Ubuntu,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol;white-space:nowrap}\n"] }]
|
|
251
348
|
}], ctorParameters: () => [] });
|
|
252
349
|
|
|
350
|
+
/**
|
|
351
|
+
* @deprecated Use textureResource instead. Will be removed in v5.0.0
|
|
352
|
+
* @since v4.0.0
|
|
353
|
+
*/
|
|
253
354
|
function _injectTexture(input, { onLoad, injector } = {}) {
|
|
254
355
|
return assertInjector(_injectTexture, injector, () => {
|
|
255
356
|
const store = injectStore();
|
|
@@ -276,11 +377,47 @@ function _injectTexture(input, { onLoad, injector } = {}) {
|
|
|
276
377
|
_injectTexture.preload = (input) => {
|
|
277
378
|
injectLoader.preload(() => THREE.TextureLoader, input);
|
|
278
379
|
};
|
|
380
|
+
/**
|
|
381
|
+
* @deprecated Use textureResource instead. Will be removed in v5.0.0
|
|
382
|
+
* @since v4.0.0
|
|
383
|
+
*/
|
|
279
384
|
const injectTexture = _injectTexture;
|
|
280
385
|
|
|
386
|
+
function textureResource(input, { onLoad, injector, } = {}) {
|
|
387
|
+
return assertInjector(textureResource, injector, () => {
|
|
388
|
+
const store = injectStore();
|
|
389
|
+
const resource = loaderResource(() => THREE.TextureLoader, input);
|
|
390
|
+
effect(() => {
|
|
391
|
+
if (!resource.hasValue())
|
|
392
|
+
return;
|
|
393
|
+
const result = resource.value();
|
|
394
|
+
if (onLoad)
|
|
395
|
+
onLoad(result);
|
|
396
|
+
const gl = store.snapshot.gl;
|
|
397
|
+
if ('initTexture' in gl) {
|
|
398
|
+
let textures;
|
|
399
|
+
if (Array.isArray(result)) {
|
|
400
|
+
textures = result;
|
|
401
|
+
}
|
|
402
|
+
else if (is.three(result, 'isTexture')) {
|
|
403
|
+
textures = [result];
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
textures = Object.values(result);
|
|
407
|
+
}
|
|
408
|
+
textures.forEach(gl.initTexture.bind(gl));
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
return resource;
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
textureResource.preload = (input) => {
|
|
415
|
+
loaderResource.preload(THREE.TextureLoader, input);
|
|
416
|
+
};
|
|
417
|
+
|
|
281
418
|
/**
|
|
282
419
|
* Generated bundle index. Do not edit.
|
|
283
420
|
*/
|
|
284
421
|
|
|
285
|
-
export { NgtsLoader, injectFBX, injectFont, injectGLTF, injectProgress, injectTexture };
|
|
422
|
+
export { NgtsLoader, fbxResource, fontResource, gltfResource, injectFBX, injectFont, injectGLTF, injectProgress, injectTexture, progress, textureResource };
|
|
286
423
|
//# sourceMappingURL=angular-three-soba-loaders.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular-three-soba-loaders.mjs","sources":["../../../../libs/soba/loaders/src/lib/fbx-loader.ts","../../../../libs/soba/loaders/src/lib/font-loader.ts","../../../../libs/soba/loaders/src/lib/gltf-loader.ts","../../../../libs/soba/loaders/src/lib/progress.ts","../../../../libs/soba/loaders/src/lib/loader.ts","../../../../libs/soba/loaders/src/lib/texture-loader.ts","../../../../libs/soba/loaders/src/angular-three-soba-loaders.ts"],"sourcesContent":["import { Injector } from '@angular/core';\nimport { injectLoader } from 'angular-three';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport { FBXLoader } from 'three-stdlib';\n\nfunction _injectFBX<TUrl extends string | string[] | Record<string, string>>(\n\tinput: () => TUrl,\n\t{ injector }: { injector?: Injector } = {},\n) {\n\treturn assertInjector(_injectFBX, injector, () => {\n\t\treturn injectLoader(() => FBXLoader, input);\n\t});\n}\n\n_injectFBX.preload = <TUrl extends string | string[] | Record<string, string>>(input: () => TUrl) => {\n\tinjectLoader.preload(() => FBXLoader, input);\n};\n\nexport type NgtsFBXLoader = typeof _injectFBX;\nexport const injectFBX: NgtsFBXLoader = _injectFBX;\n","import { effect, Injector, signal } from '@angular/core';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport { Font, FontLoader } from 'three-stdlib';\n\nexport type Glyph = {\n\t_cachedOutline: string[];\n\tha: number;\n\to: string;\n};\n\nexport type FontData = {\n\tboundingBox: {\n\t\tyMax: number;\n\t\tyMin: number;\n\t};\n\tfamilyName: string;\n\tglyphs: {\n\t\t[k: string]: Glyph;\n\t};\n\tresolution: number;\n\tunderlineThickness: number;\n};\n\nexport type NgtsFontInput = string | FontData;\n\nlet fontLoader: FontLoader | null = null;\n\nasync function loadFontData(font: NgtsFontInput): Promise<FontData> {\n\treturn typeof font === 'string' ? await (await fetch(font)).json() : font;\n}\n\nfunction parseFontData(fontData: FontData) {\n\tif (!fontLoader) {\n\t\tfontLoader = new FontLoader();\n\t}\n\treturn fontLoader.parse(fontData);\n}\n\nconst cache = new Map<NgtsFontInput, Font>();\n\nexport function injectFont(input: () => NgtsFontInput, { injector }: { injector?: Injector } = {}) {\n\treturn assertInjector(injectFont, injector, () => {\n\t\tconst font = signal<Font | null>(null);\n\n\t\teffect(() => {\n\t\t\tconst fontInput = input();\n\n\t\t\tif (cache.has(fontInput)) {\n\t\t\t\tfont.set(cache.get(fontInput) as Font);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tloadFontData(input()).then((data) => {\n\t\t\t\tconst parsed = parseFontData(data);\n\t\t\t\tcache.set(fontInput, parsed);\n\t\t\t\tfont.set(parsed);\n\t\t\t});\n\t\t});\n\n\t\treturn font.asReadonly();\n\t});\n}\n\ninjectFont.preload = (input: () => NgtsFontInput) => {\n\tloadFontData(input()).then((data) => {\n\t\tconst parsed = parseFontData(data);\n\t\tcache.set(input(), parsed);\n\t});\n};\ninjectFont.clear = (input?: () => NgtsFontInput) => {\n\tif (input) {\n\t\tcache.delete(input());\n\t} else {\n\t\tcache.clear();\n\t}\n};\n","import { computed, Injector, Signal } from '@angular/core';\nimport { injectLoader, NgtLoaderResults, NgtObjectMap } from 'angular-three';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport * as THREE from 'three';\nimport { DRACOLoader, GLTF, GLTFLoader, MeshoptDecoder } from 'three-stdlib';\n\nlet dracoLoader: DRACOLoader | null = null;\nlet decoderPath = 'https://www.gstatic.com/draco/versioned/decoders/1.5.5/';\n\nfunction _extensions(useDraco: boolean | string, useMeshOpt: boolean, extensions?: (loader: GLTFLoader) => void) {\n\treturn (loader: THREE.Loader) => {\n\t\tif (extensions) {\n\t\t\textensions(loader as GLTFLoader);\n\t\t}\n\n\t\tif (useDraco) {\n\t\t\tif (!dracoLoader) {\n\t\t\t\tdracoLoader = new DRACOLoader();\n\t\t\t}\n\n\t\t\tdracoLoader.setDecoderPath(typeof useDraco === 'string' ? useDraco : decoderPath);\n\t\t\t(loader as GLTFLoader).setDRACOLoader(dracoLoader);\n\t\t}\n\t\tif (useMeshOpt) {\n\t\t\t(loader as GLTFLoader).setMeshoptDecoder(\n\t\t\t\ttypeof MeshoptDecoder === 'function' ? MeshoptDecoder() : MeshoptDecoder,\n\t\t\t);\n\t\t}\n\t};\n}\n\ntype InjectGLTFUrl<TGltf extends GLTF | GLTF[] | Record<string, GLTF>> = TGltf extends GLTF\n\t? string\n\t: TGltf extends GLTF[]\n\t\t? string[]\n\t\t: TGltf extends Record<string, GLTF>\n\t\t\t? Record<string, string>\n\t\t\t: never;\ntype InjectGLTFObjectMap<TGltf extends GLTF | GLTF[] | Record<string, GLTF>> = TGltf extends GLTF\n\t? TGltf & NgtObjectMap\n\t: TGltf extends Array<infer _GLTF extends GLTF>\n\t\t? Array<_GLTF & NgtObjectMap>\n\t\t: TGltf extends Record<string, infer _GLTF extends GLTF>\n\t\t\t? Record<string, _GLTF & NgtObjectMap>\n\t\t\t: never;\n\nfunction _injectGLTF<\n\tTGltf extends GLTF | GLTF[] | Record<string, GLTF> = GLTF,\n\tTUrl extends string | string[] | Record<string, string> = InjectGLTFUrl<TGltf>,\n>(\n\tpath: () => TUrl,\n\t{\n\t\tuseDraco = true,\n\t\tuseMeshOpt = true,\n\t\tinjector,\n\t\textensions,\n\t\tonLoad,\n\t}: {\n\t\tuseDraco?: boolean | string;\n\t\tuseMeshOpt?: boolean;\n\t\tinjector?: Injector;\n\t\textensions?: (loader: GLTFLoader) => void;\n\t\tonLoad?: (data: InjectGLTFObjectMap<TGltf>) => void;\n\t} = {},\n): Signal<InjectGLTFObjectMap<TGltf> | null> & { scene: Signal<GLTF['scene'] | null> } {\n\treturn assertInjector(_injectGLTF, injector, () => {\n\t\tconst result = injectLoader(() => GLTFLoader, path, {\n\t\t\textensions: _extensions(useDraco, useMeshOpt, extensions),\n\t\t\t// @ts-expect-error - we know the type of the data\n\t\t\tonLoad,\n\t\t});\n\n\t\tObject.defineProperty(result, 'scene', {\n\t\t\tvalue: computed(() => {\n\t\t\t\tconst gltf = result() as unknown as GLTF;\n\t\t\t\tif (!gltf) return null;\n\t\t\t\treturn gltf.scene;\n\t\t\t}),\n\t\t});\n\n\t\treturn result;\n\t}) as Signal<InjectGLTFObjectMap<TGltf> | null> & { scene: Signal<GLTF['scene'] | null> };\n}\n\n_injectGLTF.preload = <TUrl extends string | string[] | Record<string, string>>(\n\tpath: () => TUrl,\n\t{\n\t\tuseDraco = true,\n\t\tuseMeshOpt = true,\n\t\textensions,\n\t\tonLoad,\n\t}: {\n\t\tuseDraco?: boolean | string;\n\t\tuseMeshOpt?: boolean;\n\t\textensions?: (loader: GLTFLoader) => void;\n\t\tonLoad?: (data: NgtLoaderResults<TUrl, GLTF & NgtObjectMap>) => void;\n\t} = {},\n) => {\n\tinjectLoader.preload(\n\t\t() => GLTFLoader,\n\t\tpath,\n\t\t_extensions(useDraco, useMeshOpt, extensions) as any,\n\t\t// @ts-expect-error - we know the type of the data\n\t\tonLoad,\n\t);\n};\n\n_injectGLTF.setDecoderPath = (path: string) => {\n\tdecoderPath = path;\n};\n\nexport type NgtsGLTFLoader = typeof _injectGLTF;\nexport const injectGLTF: NgtsGLTFLoader = _injectGLTF;\n","import { DestroyRef, inject, Injector, signal } from '@angular/core';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport * as THREE from 'three';\n\nexport function injectProgress(injector?: Injector) {\n\treturn assertInjector(injectProgress, injector, () => {\n\t\tconst progress = signal<{\n\t\t\terrors: string[];\n\t\t\tactive: boolean;\n\t\t\tprogress: number;\n\t\t\titem: string;\n\t\t\tloaded: number;\n\t\t\ttotal: number;\n\t\t}>({ errors: [], active: false, progress: 0, item: '', loaded: 0, total: 0 });\n\n\t\tconst defaultOnStart = THREE.DefaultLoadingManager.onStart?.bind(THREE.DefaultLoadingManager);\n\t\tconst defaultOnLoad = THREE.DefaultLoadingManager.onLoad?.bind(THREE.DefaultLoadingManager);\n\t\tconst defaultOnError = THREE.DefaultLoadingManager.onError?.bind(THREE.DefaultLoadingManager);\n\t\tconst defaultOnProgress = THREE.DefaultLoadingManager.onProgress?.bind(THREE.DefaultLoadingManager);\n\n\t\tlet saveLastTotalLoaded = 0;\n\n\t\tTHREE.DefaultLoadingManager.onStart = (item, loaded, total) => {\n\t\t\tprogress.update((prev) => ({\n\t\t\t\t...prev,\n\t\t\t\tactive: true,\n\t\t\t\titem,\n\t\t\t\tloaded,\n\t\t\t\ttotal,\n\t\t\t\tprogress: ((loaded - saveLastTotalLoaded) / (total - saveLastTotalLoaded)) * 100,\n\t\t\t}));\n\t\t};\n\n\t\tTHREE.DefaultLoadingManager.onLoad = () => {\n\t\t\tprogress.update((prev) => ({ ...prev, active: false }));\n\t\t};\n\n\t\tTHREE.DefaultLoadingManager.onError = (url) => {\n\t\t\tprogress.update((prev) => ({ ...prev, errors: [...prev.errors, url] }));\n\t\t};\n\n\t\tTHREE.DefaultLoadingManager.onProgress = (item, loaded, total) => {\n\t\t\tif (loaded === total) saveLastTotalLoaded = total;\n\n\t\t\tprogress.update((prev) => ({\n\t\t\t\t...prev,\n\t\t\t\titem,\n\t\t\t\tloaded,\n\t\t\t\ttotal,\n\t\t\t\tprogress: ((loaded - saveLastTotalLoaded) / (total - saveLastTotalLoaded)) * 100 || 100,\n\t\t\t}));\n\t\t};\n\n\t\tinject(DestroyRef).onDestroy(() => {\n\t\t\tTHREE.DefaultLoadingManager.onStart = defaultOnStart;\n\t\t\tTHREE.DefaultLoadingManager.onLoad = defaultOnLoad;\n\t\t\tTHREE.DefaultLoadingManager.onError = defaultOnError;\n\t\t\tTHREE.DefaultLoadingManager.onProgress = defaultOnProgress;\n\t\t});\n\n\t\treturn progress.asReadonly();\n\t});\n}\n","import {\n\tChangeDetectionStrategy,\n\tComponent,\n\tElementRef,\n\tcomputed,\n\teffect,\n\tinput,\n\tsignal,\n\tuntracked,\n\tviewChild,\n} from '@angular/core';\nimport { pick } from 'angular-three';\nimport { mergeInputs } from 'ngxtension/inject-inputs';\nimport { injectProgress } from './progress';\n\nconst defaultDataInterpolation = (p: number) => `Loading ${p.toFixed(2)}%`;\n\nexport interface NgtsLoaderOptions {\n\tcontainerClass?: string;\n\tinnerClass?: string;\n\tbarClass?: string;\n\tdataClass?: string;\n\tdataInterpolation: (value: number) => string;\n\tinitialState: (value: boolean) => boolean;\n}\n\nconst defaultOptions: NgtsLoaderOptions = {\n\tcontainerClass: '',\n\tinnerClass: '',\n\tbarClass: '',\n\tdataClass: '',\n\tdataInterpolation: defaultDataInterpolation,\n\tinitialState: (value) => value,\n};\n\n@Component({\n\tselector: 'ngts-loader',\n\ttemplate: `\n\t\t@if (shown()) {\n\t\t\t<div\n\t\t\t\tclass=\"ngts-loader-container\"\n\t\t\t\t[class]=\"containerClass() || ''\"\n\t\t\t\t[style.--ngts-loader-container-opacity]=\"active() ? 1 : 0\"\n\t\t\t>\n\t\t\t\t<div>\n\t\t\t\t\t<div class=\"ngts-loader-inner\" [class]=\"innerClass() || ''\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass=\"ngts-loader-bar\"\n\t\t\t\t\t\t\t[class]=\"barClass() || ''\"\n\t\t\t\t\t\t\t[style.--ngts-loader-bar-scale]=\"progress() / 100\"\n\t\t\t\t\t\t></div>\n\t\t\t\t\t\t<span #progressSpanRef class=\"ngts-loader-data\" [class]=\"dataClass() || ''\"></span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t}\n\t`,\n\tstyleUrls: ['./loader.css'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgtsLoader {\n\tprivate progressState = injectProgress();\n\n\tprotected active = computed(() => this.progressState().active);\n\tprotected progress = computed(() => this.progressState().progress);\n\n\toptions = input(defaultOptions, { transform: mergeInputs(defaultOptions) });\n\n\tprotected containerClass = pick(this.options, 'containerClass');\n\tprotected innerClass = pick(this.options, 'innerClass');\n\tprotected barClass = pick(this.options, 'barClass');\n\tprotected dataClass = pick(this.options, 'dataClass');\n\tprivate initialState = pick(this.options, 'initialState');\n\tprivate dataInterpolation = pick(this.options, 'dataInterpolation');\n\n\tprivate progressSpanRef = viewChild<ElementRef<HTMLSpanElement>>('progressSpanRef');\n\n\tprotected shown = signal(this.initialState()(this.active()));\n\n\tconstructor() {\n\t\teffect((onCleanup) => {\n\t\t\tconst [active, lastShown] = [this.active(), untracked(this.shown)];\n\t\t\tif (lastShown !== active) {\n\t\t\t\tconst timeoutId = setTimeout(() => {\n\t\t\t\t\tthis.shown.set(active);\n\t\t\t\t}, 300);\n\t\t\t\tonCleanup(() => clearTimeout(timeoutId));\n\t\t\t}\n\t\t});\n\n\t\tlet progressRef = 0;\n\t\tlet rafId: ReturnType<typeof requestAnimationFrame>;\n\t\teffect((onCleanup) => {\n\t\t\tconst [dataInterpolation, progress] = [this.dataInterpolation(), this.progress()];\n\t\t\tconst updateProgress = () => {\n\t\t\t\tconst progressSpan = this.progressSpanRef()?.nativeElement;\n\t\t\t\tif (!progressSpan) return;\n\t\t\t\tprogressRef += (progress - progressRef) / 2;\n\t\t\t\tif (progressRef > 0.95 * progress || progress === 100) progressRef = progress;\n\t\t\t\tprogressSpan.innerText = dataInterpolation(progressRef);\n\t\t\t\tif (progressRef < progress) {\n\t\t\t\t\trafId = requestAnimationFrame(updateProgress);\n\t\t\t\t}\n\t\t\t};\n\t\t\tupdateProgress();\n\t\t\tonCleanup(() => cancelAnimationFrame(rafId));\n\t\t});\n\t}\n}\n","import { effect, Injector, Signal } from '@angular/core';\nimport { injectLoader, injectStore, is, NgtLoaderResults } from 'angular-three';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport * as THREE from 'three';\n\nfunction _injectTexture<TInput extends string[] | string | Record<string, string>>(\n\tinput: () => TInput,\n\t{ onLoad, injector }: { onLoad?: (texture: THREE.Texture[]) => void; injector?: Injector } = {},\n): Signal<NgtLoaderResults<TInput, THREE.Texture> | null> {\n\treturn assertInjector(_injectTexture, injector, () => {\n\t\tconst store = injectStore();\n\t\tconst result = injectLoader(() => THREE.TextureLoader, input);\n\n\t\teffect(() => {\n\t\t\tconst textures = result();\n\t\t\tif (!textures) return;\n\t\t\tconst gl = store.snapshot.gl;\n\t\t\tif ('initTexture' in gl) {\n\t\t\t\tconst array = Array.isArray(textures)\n\t\t\t\t\t? textures\n\t\t\t\t\t: is.three<THREE.Texture>(textures, 'isTexture')\n\t\t\t\t\t\t? [textures]\n\t\t\t\t\t\t: Object.values(textures);\n\t\t\t\tif (onLoad) onLoad(array);\n\t\t\t\tarray.forEach(gl.initTexture.bind(gl));\n\t\t\t}\n\t\t});\n\n\t\treturn result;\n\t});\n}\n\n_injectTexture.preload = <TInput extends string[] | string | Record<string, string>>(input: () => TInput) => {\n\tinjectLoader.preload(() => THREE.TextureLoader, input);\n};\n\nexport type NgtsTextureLoader = typeof _injectTexture;\nexport const injectTexture: NgtsTextureLoader = _injectTexture;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAKA,SAAS,UAAU,CAClB,KAAiB,EACjB,EAAE,QAAQ,KAA8B,EAAE,EAAA;AAE1C,IAAA,OAAO,cAAc,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAK;QAChD,OAAO,YAAY,CAAC,MAAM,SAAS,EAAE,KAAK,CAAC;AAC5C,KAAC,CAAC;AACH;AAEA,UAAU,CAAC,OAAO,GAAG,CAA0D,KAAiB,KAAI;IACnG,YAAY,CAAC,OAAO,CAAC,MAAM,SAAS,EAAE,KAAK,CAAC;AAC7C,CAAC;AAGM,MAAM,SAAS,GAAkB;;ACMxC,IAAI,UAAU,GAAsB,IAAI;AAExC,eAAe,YAAY,CAAC,IAA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AE,CAAC,KAAK,CAAgB,QAAQ,EAAE,WAAW;0BAC5C,CAAC,QAAQ;AACX,0BAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC3B,gBAAA,IAAI,MAAM;oBAAE,MAAM,CAAC,KAAK,CAAC;AACzB,gBAAA,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;;AAExC,SAAC,CAAC;AAEF,QAAA,OAAO,MAAM;AACd,KAAC,CAAC;AACH;AAEA,cAAc,CAAC,OAAO,GAAG,CAA4D,KAAmB,KAAI;AAC3G,IAAA,YAAY,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC;AACvD,CAAC;AAGM,MAAM,aAAa,GAAsB;;ACrChD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"angular-three-soba-loaders.mjs","sources":["../../../../libs/soba/loaders/src/lib/fbx-resource.ts","../../../../libs/soba/loaders/src/lib/fbx-loader.ts","../../../../libs/soba/loaders/src/lib/font-resource.ts","../../../../libs/soba/loaders/src/lib/font-loader.ts","../../../../libs/soba/loaders/src/lib/gltf-loader.ts","../../../../libs/soba/loaders/src/lib/gltf-resource.ts","../../../../libs/soba/loaders/src/lib/progress.ts","../../../../libs/soba/loaders/src/lib/loader.ts","../../../../libs/soba/loaders/src/lib/texture-loader.ts","../../../../libs/soba/loaders/src/lib/texture-resource.ts","../../../../libs/soba/loaders/src/angular-three-soba-loaders.ts"],"sourcesContent":["import { Injector } from '@angular/core';\nimport { loaderResource } from 'angular-three';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport { FBXLoader } from 'three-stdlib';\n\nexport function fbxResource<TUrl extends string | string[] | Record<string, string>>(\n\tinput: () => TUrl,\n\t{ injector }: { injector?: Injector } = {},\n) {\n\treturn assertInjector(fbxResource, injector, () => {\n\t\treturn loaderResource(() => FBXLoader, input);\n\t});\n}\n\nfbxResource.preload = <TUrl extends string | string[] | Record<string, string>>(input: TUrl) => {\n\tloaderResource.preload(FBXLoader, input);\n};\n","import { Injector } from '@angular/core';\nimport { injectLoader } from 'angular-three';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport { FBXLoader } from 'three-stdlib';\nimport { fbxResource } from './fbx-resource';\n\n/**\n * @deprecated Use fbxResource instead. Will be removed in v5.0.0\n * @since v4.0.0\n */\nfunction _injectFBX<TUrl extends string | string[] | Record<string, string>>(\n\tinput: () => TUrl,\n\t{ injector }: { injector?: Injector } = {},\n) {\n\treturn assertInjector(_injectFBX, injector, () => {\n\t\tconst resource = fbxResource(input, { injector });\n\t\treturn resource.value.asReadonly();\n\t});\n}\n\n_injectFBX.preload = <TUrl extends string | string[] | Record<string, string>>(input: () => TUrl) => {\n\tinjectLoader.preload(() => FBXLoader, input);\n};\n\nexport type NgtsFBXLoader = typeof _injectFBX;\n\n/**\n * @deprecated Use fbxResource instead. Will be removed in v5.0.0\n * @since v4.0.0\n */\nexport const injectFBX: NgtsFBXLoader = _injectFBX;\n","import { Injector, resource } from '@angular/core';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport { Font, FontLoader } from 'three-stdlib';\n\ntype Glyph = {\n\t_cachedOutline: string[];\n\tha: number;\n\to: string;\n};\n\ntype FontData = {\n\tboundingBox: {\n\t\tyMax: number;\n\t\tyMin: number;\n\t};\n\tfamilyName: string;\n\tglyphs: {\n\t\t[k: string]: Glyph;\n\t};\n\tresolution: number;\n\tunderlineThickness: number;\n};\n\nexport type NgtsFontInput = string | FontData;\n\nlet fontLoader: FontLoader | null = null;\n\nasync function loadFontData(font: NgtsFontInput): Promise<FontData> {\n\treturn typeof font === 'string' ? await (await fetch(font)).json() : font;\n}\n\nfunction parseFontData(fontData: FontData) {\n\tif (!fontLoader) {\n\t\tfontLoader = new FontLoader();\n\t}\n\treturn fontLoader.parse(fontData);\n}\n\nconst cache = new Map<NgtsFontInput, Font>();\n\nexport function fontResource(input: () => NgtsFontInput, { injector }: { injector?: Injector } = {}) {\n\treturn assertInjector(fontResource, injector, () => {\n\t\treturn resource({\n\t\t\trequest: input,\n\t\t\tloader: async ({ request }) => {\n\t\t\t\tif (cache.has(request)) {\n\t\t\t\t\treturn cache.get(request) as Font;\n\t\t\t\t}\n\n\t\t\t\tconst fontData = await loadFontData(request);\n\t\t\t\tconst parsed = parseFontData(fontData);\n\t\t\t\tcache.set(request, parsed);\n\t\t\t\treturn parsed;\n\t\t\t},\n\t\t});\n\t});\n}\n\nfontResource.preload = (input: NgtsFontInput) => {\n\tloadFontData(input).then((data) => {\n\t\tconst parsed = parseFontData(data);\n\t\tcache.set(input, parsed);\n\t});\n};\n\nfontResource.clear = (input?: NgtsFontInput) => {\n\tif (input) {\n\t\tcache.delete(input);\n\t} else {\n\t\tcache.clear();\n\t}\n};\n","import { Injector } from '@angular/core';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport { fontResource, type NgtsFontInput } from './font-resource';\n\n/**\n * @deprecated Use fontResource instead. Will be removed in v5.0.0\n * @since v4.0.0\n */\nexport function injectFont(input: () => NgtsFontInput, { injector }: { injector?: Injector } = {}) {\n\treturn assertInjector(injectFont, injector, () => {\n\t\tconst resource = fontResource(input, { injector });\n\t\treturn resource.value.asReadonly();\n\t});\n}\n\ninjectFont.preload = (input: () => NgtsFontInput) => {\n\tfontResource.preload(input());\n};\ninjectFont.clear = (input?: () => NgtsFontInput) => {\n\tfontResource.clear(input?.());\n};\n","import { computed, Injector, Signal } from '@angular/core';\nimport { injectLoader, NgtLoaderResults, NgtObjectMap } from 'angular-three';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport * as THREE from 'three';\nimport { DRACOLoader, GLTF, GLTFLoader, MeshoptDecoder } from 'three-stdlib';\n\nlet dracoLoader: DRACOLoader | null = null;\nlet decoderPath = 'https://www.gstatic.com/draco/versioned/decoders/1.5.5/';\n\nfunction _extensions(useDraco: boolean | string, useMeshOpt: boolean, extensions?: (loader: GLTFLoader) => void) {\n\treturn (loader: THREE.Loader) => {\n\t\tif (extensions) {\n\t\t\textensions(loader as GLTFLoader);\n\t\t}\n\n\t\tif (useDraco) {\n\t\t\tif (!dracoLoader) {\n\t\t\t\tdracoLoader = new DRACOLoader();\n\t\t\t}\n\n\t\t\tdracoLoader.setDecoderPath(typeof useDraco === 'string' ? useDraco : decoderPath);\n\t\t\t(loader as GLTFLoader).setDRACOLoader(dracoLoader);\n\t\t}\n\t\tif (useMeshOpt) {\n\t\t\t(loader as GLTFLoader).setMeshoptDecoder(\n\t\t\t\ttypeof MeshoptDecoder === 'function' ? MeshoptDecoder() : MeshoptDecoder,\n\t\t\t);\n\t\t}\n\t};\n}\n\ntype InjectGLTFUrl<TGltf extends GLTF | GLTF[] | Record<string, GLTF>> = TGltf extends GLTF\n\t? string\n\t: TGltf extends GLTF[]\n\t\t? string[]\n\t\t: TGltf extends Record<string, GLTF>\n\t\t\t? Record<string, string>\n\t\t\t: never;\ntype InjectGLTFObjectMap<TGltf extends GLTF | GLTF[] | Record<string, GLTF>> = TGltf extends GLTF\n\t? TGltf & NgtObjectMap\n\t: TGltf extends Array<infer _GLTF extends GLTF>\n\t\t? Array<_GLTF & NgtObjectMap>\n\t\t: TGltf extends Record<string, infer _GLTF extends GLTF>\n\t\t\t? Record<string, _GLTF & NgtObjectMap>\n\t\t\t: never;\n\n/**\n * @deprecated Use gltfResource instead. Will be removed in v5.0.0\n * @since v4.0.0\n */\nfunction _injectGLTF<\n\tTGltf extends GLTF | GLTF[] | Record<string, GLTF> = GLTF,\n\tTUrl extends string | string[] | Record<string, string> = InjectGLTFUrl<TGltf>,\n>(\n\tpath: () => TUrl,\n\t{\n\t\tuseDraco = true,\n\t\tuseMeshOpt = true,\n\t\tinjector,\n\t\textensions,\n\t\tonLoad,\n\t}: {\n\t\tuseDraco?: boolean | string;\n\t\tuseMeshOpt?: boolean;\n\t\tinjector?: Injector;\n\t\textensions?: (loader: GLTFLoader) => void;\n\t\tonLoad?: (data: InjectGLTFObjectMap<TGltf>) => void;\n\t} = {},\n): Signal<InjectGLTFObjectMap<TGltf> | null> & { scene: Signal<GLTF['scene'] | null> } {\n\treturn assertInjector(_injectGLTF, injector, () => {\n\t\tconst result = injectLoader(() => GLTFLoader, path, {\n\t\t\textensions: _extensions(useDraco, useMeshOpt, extensions),\n\t\t\t// @ts-expect-error - we know the type of the data\n\t\t\tonLoad,\n\t\t});\n\n\t\tObject.defineProperty(result, 'scene', {\n\t\t\tvalue: computed(() => {\n\t\t\t\tconst gltf = result() as unknown as GLTF;\n\t\t\t\tif (!gltf) return null;\n\t\t\t\treturn gltf.scene;\n\t\t\t}),\n\t\t});\n\n\t\treturn result;\n\t}) as Signal<InjectGLTFObjectMap<TGltf> | null> & { scene: Signal<GLTF['scene'] | null> };\n}\n\n_injectGLTF.preload = <TUrl extends string | string[] | Record<string, string>>(\n\tpath: () => TUrl,\n\t{\n\t\tuseDraco = true,\n\t\tuseMeshOpt = true,\n\t\textensions,\n\t\tonLoad,\n\t}: {\n\t\tuseDraco?: boolean | string;\n\t\tuseMeshOpt?: boolean;\n\t\textensions?: (loader: GLTFLoader) => void;\n\t\tonLoad?: (data: NgtLoaderResults<TUrl, GLTF & NgtObjectMap>) => void;\n\t} = {},\n) => {\n\tinjectLoader.preload(\n\t\t() => GLTFLoader,\n\t\tpath,\n\t\t_extensions(useDraco, useMeshOpt, extensions) as any,\n\t\t// @ts-expect-error - we know the type of the data\n\t\tonLoad,\n\t);\n};\n\n_injectGLTF.setDecoderPath = (path: string) => {\n\tdecoderPath = path;\n};\n\nexport type NgtsGLTFLoader = typeof _injectGLTF;\n\n/**\n * @deprecated Use gltfResource instead. Will be removed in v5.0.0\n * @since v4.0.0\n */\nexport const injectGLTF: NgtsGLTFLoader = _injectGLTF;\n","import { computed, Injector, ResourceRef, Signal } from '@angular/core';\nimport { loaderResource, type NgtObjectMap } from 'angular-three';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport * as THREE from 'three';\nimport { DRACOLoader, type GLTF, GLTFLoader, MeshoptDecoder } from 'three-stdlib';\n\nlet dracoLoader: DRACOLoader | null = null;\nlet decoderPath = 'https://www.gstatic.com/draco/versioned/decoders/1.5.5/';\n\ntype GLTFUrl<TGLTF extends GLTF | GLTF[] | Record<string, GLTF>> = TGLTF extends GLTF\n\t? string\n\t: TGLTF extends GLTF[]\n\t\t? string[]\n\t\t: TGLTF extends Record<string, GLTF>\n\t\t\t? Record<string, string>\n\t\t\t: never;\ntype GLTFObjectMap<\n\tTGLTF extends GLTF | GLTF[] | Record<string, GLTF>,\n\tTUrl extends string | string[] | Record<string, string>,\n> = [TGLTF, TUrl] extends [GLTF, string]\n\t? TGLTF & NgtObjectMap\n\t: [TGLTF, TUrl] extends [Array<infer _GLTF extends GLTF>, string[]]\n\t\t? Array<_GLTF & NgtObjectMap>\n\t\t: [TGLTF, TUrl] extends [Record<string, infer _GLTF extends GLTF>, Record<string, string>]\n\t\t\t? { [Key in keyof TGLTF]: _GLTF & NgtObjectMap }\n\t\t\t: [TGLTF, TUrl] extends [GLTF, string[] | Record<string, string>]\n\t\t\t\t? TUrl extends string[]\n\t\t\t\t\t? Array<TGLTF & NgtObjectMap>\n\t\t\t\t\t: { [K in keyof TUrl]: TGLTF & NgtObjectMap }\n\t\t\t\t: never;\ntype GLTFObjectSceneMap<\n\tTGLTF extends GLTF | GLTF[] | Record<string, GLTF>,\n\tTUrl extends string | string[] | Record<string, string>,\n> = [TGLTF, TUrl] extends [GLTF, string]\n\t? GLTF['scene']\n\t: [TGLTF, TUrl] extends [Array<infer _GLTF extends GLTF>, string[]]\n\t\t? Array<_GLTF['scene']>\n\t\t: [TGLTF, TUrl] extends [Record<string, infer _GLTF extends GLTF>, Record<string, string>]\n\t\t\t? { [Key in keyof TGLTF]: _GLTF['scene'] }\n\t\t\t: [TGLTF, TUrl] extends [GLTF, string[] | Record<string, string>]\n\t\t\t\t? TUrl extends string[]\n\t\t\t\t\t? Array<GLTF['scene']>\n\t\t\t\t\t: { [K in keyof TUrl]: GLTF['scene'] }\n\t\t\t\t: never;\n\nfunction _extensions(useDraco: boolean | string, useMeshOpt: boolean, extensions?: (loader: GLTFLoader) => void) {\n\treturn (loader: THREE.Loader) => {\n\t\tif (extensions) {\n\t\t\textensions(loader as GLTFLoader);\n\t\t}\n\n\t\tif (useDraco) {\n\t\t\tif (!dracoLoader) {\n\t\t\t\tdracoLoader = new DRACOLoader();\n\t\t\t}\n\n\t\t\tdracoLoader.setDecoderPath(typeof useDraco === 'string' ? useDraco : decoderPath);\n\t\t\t(loader as GLTFLoader).setDRACOLoader(dracoLoader);\n\t\t}\n\t\tif (useMeshOpt) {\n\t\t\t(loader as GLTFLoader).setMeshoptDecoder(\n\t\t\t\ttypeof MeshoptDecoder === 'function' ? MeshoptDecoder() : MeshoptDecoder,\n\t\t\t);\n\t\t}\n\t};\n}\n\nexport function gltfResource<\n\tTGLTF extends GLTF | GLTF[] | Record<string, GLTF> = GLTF,\n\tTUrl extends string | string[] | Record<string, string> = GLTFUrl<TGLTF>,\n>(\n\tinput: () => TUrl,\n\t{\n\t\tuseDraco = true,\n\t\tuseMeshOpt = true,\n\t\tinjector,\n\t\textensions,\n\t\tonLoad,\n\t}: {\n\t\tuseDraco?: boolean | string;\n\t\tuseMeshOpt?: boolean;\n\t\tinjector?: Injector;\n\t\textensions?: (loader: GLTFLoader) => void;\n\t\tonLoad?: (data: GLTFObjectMap<TGLTF, TUrl>) => void;\n\t} = {},\n) {\n\treturn assertInjector(gltfResource, injector, () => {\n\t\tconst resource = loaderResource(() => GLTFLoader, input, {\n\t\t\textensions: _extensions(useDraco, useMeshOpt, extensions),\n\t\t\t// @ts-expect-error - we know the type of the data\n\t\t\tonLoad,\n\t\t}) as ResourceRef<GLTFObjectMap<TGLTF, TUrl> | undefined> & {\n\t\t\tscene: Signal<GLTFObjectSceneMap<TGLTF, TUrl> | null>;\n\t\t};\n\n\t\tObject.defineProperty(resource, 'scene', {\n\t\t\tvalue: computed(() => {\n\t\t\t\tconst data = resource.value();\n\t\t\t\tif (!data) return null;\n\t\t\t\tif (Array.isArray(data)) {\n\t\t\t\t\treturn data.map((item) => item.scene);\n\t\t\t\t}\n\t\t\t\tif ('parser' in data) {\n\t\t\t\t\treturn data.scene;\n\t\t\t\t}\n\t\t\t\treturn Object.keys(data).reduce(\n\t\t\t\t\t(acc, key) => {\n\t\t\t\t\t\tacc[key] = data[key as keyof typeof data].scene;\n\t\t\t\t\t\treturn acc;\n\t\t\t\t\t},\n\t\t\t\t\t{} as Record<string, THREE.Group>,\n\t\t\t\t);\n\t\t\t}),\n\t\t});\n\n\t\treturn resource;\n\t});\n}\n\ngltfResource.preload = <TUrl extends string | string[] | Record<string, string>>(\n\tinput: TUrl,\n\t{\n\t\tuseDraco = true,\n\t\tuseMeshOpt = true,\n\t\textensions,\n\t}: {\n\t\tuseDraco?: boolean | string;\n\t\tuseMeshOpt?: boolean;\n\t\textensions?: (loader: GLTFLoader) => void;\n\t} = {},\n) => {\n\tloaderResource.preload(GLTFLoader, input, _extensions(useDraco, useMeshOpt, extensions));\n};\n\ngltfResource.setDecoderPath = (path: string) => {\n\tdecoderPath = path;\n};\n","import { DestroyRef, inject, Injector } from '@angular/core';\nimport { signalState } from 'angular-three';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport * as THREE from 'three';\n\nexport function progress(injector?: Injector) {\n\treturn assertInjector(progress, injector, () => {\n\t\tconst progressState = signalState<{\n\t\t\terrors: string[];\n\t\t\tactive: boolean;\n\t\t\tprogress: number;\n\t\t\titem: string;\n\t\t\tloaded: number;\n\t\t\ttotal: number;\n\t\t}>({ errors: [], active: false, progress: 0, item: '', loaded: 0, total: 0 });\n\n\t\tconst defaultOnStart = THREE.DefaultLoadingManager.onStart?.bind(THREE.DefaultLoadingManager);\n\t\tconst defaultOnLoad = THREE.DefaultLoadingManager.onLoad?.bind(THREE.DefaultLoadingManager);\n\t\tconst defaultOnError = THREE.DefaultLoadingManager.onError?.bind(THREE.DefaultLoadingManager);\n\t\tconst defaultOnProgress = THREE.DefaultLoadingManager.onProgress?.bind(THREE.DefaultLoadingManager);\n\n\t\tlet saveLastTotalLoaded = 0;\n\n\t\tTHREE.DefaultLoadingManager.onStart = (item, loaded, total) => {\n\t\t\tprogressState.update({\n\t\t\t\tactive: true,\n\t\t\t\titem,\n\t\t\t\tloaded,\n\t\t\t\ttotal,\n\t\t\t\tprogress: ((loaded - saveLastTotalLoaded) / (total - saveLastTotalLoaded)) * 100,\n\t\t\t});\n\t\t};\n\n\t\tTHREE.DefaultLoadingManager.onLoad = () => {\n\t\t\tprogressState.update({ active: false });\n\t\t};\n\n\t\tTHREE.DefaultLoadingManager.onError = (url) => {\n\t\t\tprogressState.update((prev) => ({ errors: [...prev.errors, url] }));\n\t\t};\n\n\t\tTHREE.DefaultLoadingManager.onProgress = (item, loaded, total) => {\n\t\t\tif (loaded === total) saveLastTotalLoaded = total;\n\n\t\t\tprogressState.update({\n\t\t\t\titem,\n\t\t\t\tloaded,\n\t\t\t\ttotal,\n\t\t\t\tprogress: ((loaded - saveLastTotalLoaded) / (total - saveLastTotalLoaded)) * 100 || 100,\n\t\t\t});\n\t\t};\n\n\t\tinject(DestroyRef).onDestroy(() => {\n\t\t\tTHREE.DefaultLoadingManager.onStart = defaultOnStart;\n\t\t\tTHREE.DefaultLoadingManager.onLoad = defaultOnLoad;\n\t\t\tTHREE.DefaultLoadingManager.onError = defaultOnError;\n\t\t\tTHREE.DefaultLoadingManager.onProgress = defaultOnProgress;\n\t\t});\n\n\t\treturn progressState;\n\t});\n}\n\n/**\n * @deprecated Use `progress` instead. Will be removed in v5.0.0\n * @since v4.0.0\n */\nexport const injectProgress = progress;\n","import {\n\tChangeDetectionStrategy,\n\tComponent,\n\tElementRef,\n\teffect,\n\tinput,\n\tsignal,\n\tuntracked,\n\tviewChild,\n} from '@angular/core';\nimport { pick } from 'angular-three';\nimport { mergeInputs } from 'ngxtension/inject-inputs';\nimport { progress } from './progress';\n\nconst defaultDataInterpolation = (p: number) => `Loading ${p.toFixed(2)}%`;\n\nexport interface NgtsLoaderOptions {\n\tcontainerClass?: string;\n\tinnerClass?: string;\n\tbarClass?: string;\n\tdataClass?: string;\n\tdataInterpolation: (value: number) => string;\n\tinitialState: (value: boolean) => boolean;\n}\n\nconst defaultOptions: NgtsLoaderOptions = {\n\tcontainerClass: '',\n\tinnerClass: '',\n\tbarClass: '',\n\tdataClass: '',\n\tdataInterpolation: defaultDataInterpolation,\n\tinitialState: (value) => value,\n};\n\n@Component({\n\tselector: 'ngts-loader',\n\ttemplate: `\n\t\t@if (shown()) {\n\t\t\t<div\n\t\t\t\tclass=\"ngts-loader-container\"\n\t\t\t\t[class]=\"containerClass() || ''\"\n\t\t\t\t[style.--ngts-loader-container-opacity]=\"active() ? 1 : 0\"\n\t\t\t>\n\t\t\t\t<div>\n\t\t\t\t\t<div class=\"ngts-loader-inner\" [class]=\"innerClass() || ''\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass=\"ngts-loader-bar\"\n\t\t\t\t\t\t\t[class]=\"barClass() || ''\"\n\t\t\t\t\t\t\t[style.--ngts-loader-bar-scale]=\"progress() / 100\"\n\t\t\t\t\t\t></div>\n\t\t\t\t\t\t<span #progressSpanRef class=\"ngts-loader-data\" [class]=\"dataClass() || ''\"></span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t}\n\t`,\n\tstyleUrls: ['./loader.css'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgtsLoader {\n\tprivate progressState = progress();\n\n\tprotected active = this.progressState.active;\n\tprotected progress = this.progressState.progress;\n\n\toptions = input(defaultOptions, { transform: mergeInputs(defaultOptions) });\n\n\tprotected containerClass = pick(this.options, 'containerClass');\n\tprotected innerClass = pick(this.options, 'innerClass');\n\tprotected barClass = pick(this.options, 'barClass');\n\tprotected dataClass = pick(this.options, 'dataClass');\n\tprivate initialState = pick(this.options, 'initialState');\n\tprivate dataInterpolation = pick(this.options, 'dataInterpolation');\n\n\tprivate progressSpanRef = viewChild<ElementRef<HTMLSpanElement>>('progressSpanRef');\n\n\tprotected shown = signal(this.initialState()(this.active()));\n\n\tconstructor() {\n\t\teffect((onCleanup) => {\n\t\t\tconst [active, lastShown] = [this.active(), untracked(this.shown)];\n\t\t\tif (lastShown !== active) {\n\t\t\t\tconst timeoutId = setTimeout(() => {\n\t\t\t\t\tthis.shown.set(active);\n\t\t\t\t}, 300);\n\t\t\t\tonCleanup(() => clearTimeout(timeoutId));\n\t\t\t}\n\t\t});\n\n\t\tlet progressRef = 0;\n\t\tlet rafId: ReturnType<typeof requestAnimationFrame>;\n\t\teffect((onCleanup) => {\n\t\t\tconst [dataInterpolation, progress] = [this.dataInterpolation(), this.progress()];\n\t\t\tconst updateProgress = () => {\n\t\t\t\tconst progressSpan = this.progressSpanRef()?.nativeElement;\n\t\t\t\tif (!progressSpan) return;\n\t\t\t\tprogressRef += (progress - progressRef) / 2;\n\t\t\t\tif (progressRef > 0.95 * progress || progress === 100) progressRef = progress;\n\t\t\t\tprogressSpan.innerText = dataInterpolation(progressRef);\n\t\t\t\tif (progressRef < progress) {\n\t\t\t\t\trafId = requestAnimationFrame(updateProgress);\n\t\t\t\t}\n\t\t\t};\n\t\t\tupdateProgress();\n\t\t\tonCleanup(() => cancelAnimationFrame(rafId));\n\t\t});\n\t}\n}\n","import { effect, Injector, Signal } from '@angular/core';\nimport { injectLoader, injectStore, is, NgtLoaderResults } from 'angular-three';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport * as THREE from 'three';\n\n/**\n * @deprecated Use textureResource instead. Will be removed in v5.0.0\n * @since v4.0.0\n */\nfunction _injectTexture<TInput extends string[] | string | Record<string, string>>(\n\tinput: () => TInput,\n\t{ onLoad, injector }: { onLoad?: (texture: THREE.Texture[]) => void; injector?: Injector } = {},\n): Signal<NgtLoaderResults<TInput, THREE.Texture> | null> {\n\treturn assertInjector(_injectTexture, injector, () => {\n\t\tconst store = injectStore();\n\t\tconst result = injectLoader(() => THREE.TextureLoader, input);\n\n\t\teffect(() => {\n\t\t\tconst textures = result();\n\t\t\tif (!textures) return;\n\t\t\tconst gl = store.snapshot.gl;\n\t\t\tif ('initTexture' in gl) {\n\t\t\t\tconst array = Array.isArray(textures)\n\t\t\t\t\t? textures\n\t\t\t\t\t: is.three<THREE.Texture>(textures, 'isTexture')\n\t\t\t\t\t\t? [textures]\n\t\t\t\t\t\t: Object.values(textures);\n\t\t\t\tif (onLoad) onLoad(array);\n\t\t\t\tarray.forEach(gl.initTexture.bind(gl));\n\t\t\t}\n\t\t});\n\n\t\treturn result;\n\t});\n}\n\n_injectTexture.preload = <TInput extends string[] | string | Record<string, string>>(input: () => TInput) => {\n\tinjectLoader.preload(() => THREE.TextureLoader, input);\n};\n\nexport type NgtsTextureLoader = typeof _injectTexture;\n\n/**\n * @deprecated Use textureResource instead. Will be removed in v5.0.0\n * @since v4.0.0\n */\nexport const injectTexture: NgtsTextureLoader = _injectTexture;\n","import { effect, Injector } from '@angular/core';\nimport { injectStore, is, loaderResource, NgtLoaderResults } from 'angular-three';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport * as THREE from 'three';\n\nexport function textureResource<TUrl extends string[] | string | Record<string, string>>(\n\tinput: () => TUrl,\n\t{\n\t\tonLoad,\n\t\tinjector,\n\t}: { onLoad?: (result: NgtLoaderResults<TUrl, THREE.Texture>) => void; injector?: Injector } = {},\n) {\n\treturn assertInjector(textureResource, injector, () => {\n\t\tconst store = injectStore();\n\t\tconst resource = loaderResource(() => THREE.TextureLoader, input);\n\n\t\teffect(() => {\n\t\t\tif (!resource.hasValue()) return;\n\t\t\tconst result = resource.value();\n\n\t\t\tif (onLoad) onLoad(result);\n\n\t\t\tconst gl = store.snapshot.gl;\n\t\t\tif ('initTexture' in gl) {\n\t\t\t\tlet textures: THREE.Texture[];\n\n\t\t\t\tif (Array.isArray(result)) {\n\t\t\t\t\ttextures = result;\n\t\t\t\t} else if (is.three<THREE.Texture>(result, 'isTexture')) {\n\t\t\t\t\ttextures = [result];\n\t\t\t\t} else {\n\t\t\t\t\ttextures = Object.values(result);\n\t\t\t\t}\n\n\t\t\t\ttextures.forEach(gl.initTexture.bind(gl));\n\t\t\t}\n\t\t});\n\n\t\treturn resource;\n\t});\n}\n\ntextureResource.preload = <TUrl extends string[] | string | Record<string, string>>(input: TUrl) => {\n\tloaderResource.preload(THREE.TextureLoader, input);\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["dracoLoader","decoderPath","_extensions"],"mappings":";;;;;;;;AAKM,SAAU,WAAW,CAC1B,KAAiB,EACjB,EAAE,QAAQ,KAA8B,EAAE,EAAA;AAE1C,IAAA,OAAO,cAAc,CAAC,WAAW,EAAE,QAAQ,EAAE,MAAK;QACjD,OAAO,cAAc,CAAC,MAAM,SAAS,EAAE,KAAK,CAAC;AAC9C,KAAC,CAAC;AACH;AAEA,WAAW,CAAC,OAAO,GAAG,CAA0D,KAAW,KAAI;AAC9F,IAAA,cAAc,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC;AACzC,CAAC;;ACVD;;;AAGG;AACH,SAAS,UAAU,CAClB,KAAiB,EACjB,EAAE,QAAQ,KAA8B,EAAE,EAAA;AAE1C,IAAA,OAAO,cAAc,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAK;QAChD,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC;AACjD,QAAA,OAAO,QAAQ,CAAC,KAAK,CAAC,UAAU,EAAE;AACnC,KAAC,CAAC;AACH;AAEA,UAAU,CAAC,OAAO,GAAG,CAA0D,KAAiB,KAAI;IACnG,YAAY,CAAC,OAAO,CAAC,MAAM,SAAS,EAAE,KAAK,CAAC;AAC7C,CAAC;AAID;;;AAGG;AACI,MAAM,SAAS,GAAkB;;ACLxC,IAAI,UAAU,GAAsB,IAAI;AAExC,eAAe,YAAY,CAAC,IAAmB,EAAA;IAC9C,OAAO,OAAO,IAAI,KAAK,QAAQ,GAAG,MAAM,CA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IAAI,CAAC,EAAE,CAAC,CAAC;;AAE3C,SAAC,CAAC;AAEF,QAAA,OAAO,QAAQ;AAChB,KAAC,CAAC;AACH;AAEA,eAAe,CAAC,OAAO,GAAG,CAA0D,KAAW,KAAI;IAClG,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC;AACnD,CAAC;;AC5CD;;AAEG;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, computed, effect, Component, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, inject, DestroyRef, Directive, viewChild, contentChild, TemplateRef, signal, untracked } from '@angular/core';
|
|
3
|
-
import { omit, is, pick, NgtArgs,
|
|
3
|
+
import { omit, is, pick, NgtArgs, beforeRender, injectStore, getInstanceState, extend, applyProps } from 'angular-three';
|
|
4
4
|
import CustomShaderMaterial from 'three-custom-shader-material/vanilla';
|
|
5
5
|
import { MeshDistortMaterial, MeshPortalMaterial, meshPortalMaterialApplySDF, BlurPass, MeshReflectorMaterial, MeshDiscardMaterial, MeshTransmissionMaterial, MeshWobbleMaterial } from 'angular-three-soba/vanilla-exports';
|
|
6
6
|
import { mergeInputs } from 'ngxtension/inject-inputs';
|
|
7
7
|
import { NgTemplateOutlet } from '@angular/common';
|
|
8
|
-
import {
|
|
8
|
+
import { fbo, getVersion, intersect } from 'angular-three-soba/misc';
|
|
9
9
|
import * as i1 from 'angular-three-soba/staging';
|
|
10
10
|
import { NgtsRenderTexture } from 'angular-three-soba/staging';
|
|
11
11
|
import * as THREE from 'three';
|
|
@@ -86,7 +86,7 @@ class NgtsMeshDistortMaterial {
|
|
|
86
86
|
this.material = new MeshDistortMaterial();
|
|
87
87
|
this.speed = pick(this.options, 'speed');
|
|
88
88
|
inject(DestroyRef).onDestroy(() => this.material.dispose());
|
|
89
|
-
|
|
89
|
+
beforeRender(({ clock }) => {
|
|
90
90
|
this.material.time = clock.elapsedTime * this.speed();
|
|
91
91
|
});
|
|
92
92
|
}
|
|
@@ -123,8 +123,8 @@ class ManagePortalScene {
|
|
|
123
123
|
this.priority = input.required();
|
|
124
124
|
this.worldUnits = input.required();
|
|
125
125
|
const renderTextureStore = injectStore();
|
|
126
|
-
const buffer1 =
|
|
127
|
-
const buffer2 =
|
|
126
|
+
const buffer1 = fbo();
|
|
127
|
+
const buffer2 = fbo();
|
|
128
128
|
const fullScreenQuad = computed(() => {
|
|
129
129
|
// This fullscreen-quad is used to blend the two textures
|
|
130
130
|
const blend = { value: 0 };
|
|
@@ -165,7 +165,7 @@ class ManagePortalScene {
|
|
|
165
165
|
return;
|
|
166
166
|
setEvents({ enabled: events });
|
|
167
167
|
});
|
|
168
|
-
|
|
168
|
+
beforeRender(({ gl, camera }) => {
|
|
169
169
|
const material = this.material();
|
|
170
170
|
const instanceState = getInstanceState(material);
|
|
171
171
|
if (!instanceState)
|
|
@@ -255,7 +255,7 @@ class NgtsMeshPortalMaterial {
|
|
|
255
255
|
]);
|
|
256
256
|
this.resolution = pick(this.options, 'resolution');
|
|
257
257
|
this.parent = signal(null);
|
|
258
|
-
this.visible =
|
|
258
|
+
this.visible = intersect(this.parent, { source: signal(true) });
|
|
259
259
|
this.renderTextureFrames = computed(() => (this.visible() ? Infinity : 0));
|
|
260
260
|
this.renderTextureCompute = (...args) => {
|
|
261
261
|
const [parent, material] = [this.parent(), this.materialRef().nativeElement];
|
|
@@ -306,7 +306,7 @@ class NgtsMeshPortalMaterial {
|
|
|
306
306
|
meshPortalMaterialApplySDF(parent, resolution, gl);
|
|
307
307
|
}
|
|
308
308
|
});
|
|
309
|
-
|
|
309
|
+
beforeRender(() => {
|
|
310
310
|
const material = this.materialRef().nativeElement;
|
|
311
311
|
const priority = 'blend' in material && typeof material.blend === 'number' && material.blend > 0
|
|
312
312
|
? Math.max(1, this.renderPriority())
|
|
@@ -540,7 +540,7 @@ class NgtsMeshReflectorMaterial {
|
|
|
540
540
|
delete material['__ngt_renderer__'];
|
|
541
541
|
}
|
|
542
542
|
});
|
|
543
|
-
|
|
543
|
+
beforeRender(({ gl, scene }) => {
|
|
544
544
|
const material = this.materialRef()?.nativeElement;
|
|
545
545
|
if (!material)
|
|
546
546
|
return;
|
|
@@ -729,7 +729,7 @@ class NgtsMeshRefractionMaterial {
|
|
|
729
729
|
Object.assign(material, { bvh });
|
|
730
730
|
}
|
|
731
731
|
});
|
|
732
|
-
|
|
732
|
+
beforeRender(({ camera }) => {
|
|
733
733
|
const material = this.materialRef()?.nativeElement;
|
|
734
734
|
if (material) {
|
|
735
735
|
Object.assign(material, {
|
|
@@ -833,8 +833,8 @@ class NgtsMeshTransmissionMaterial {
|
|
|
833
833
|
this.side = pick(this.options, 'side');
|
|
834
834
|
this.materialRef = viewChild('material');
|
|
835
835
|
this.backResolution = computed(() => this.backsideResolution() || this.resolution());
|
|
836
|
-
this.fboBack =
|
|
837
|
-
this.fboMain =
|
|
836
|
+
this.fboBack = fbo(() => ({ width: this.backResolution() }));
|
|
837
|
+
this.fboMain = fbo(() => ({ width: this.resolution() }));
|
|
838
838
|
this.bufferTexture = computed(() => this.buffer() || this.fboMain.texture);
|
|
839
839
|
this.anisotropicBlurOption = computed(() => this.anisotropicBlur() || this.anisotropy());
|
|
840
840
|
this.discardMaterial = new MeshDiscardMaterial();
|
|
@@ -860,7 +860,7 @@ class NgtsMeshTransmissionMaterial {
|
|
|
860
860
|
let oldEnvMapIntensity;
|
|
861
861
|
let oldTone;
|
|
862
862
|
let parent;
|
|
863
|
-
|
|
863
|
+
beforeRender(({ clock, gl, scene, camera }) => {
|
|
864
864
|
const material = this.materialRef()?.nativeElement;
|
|
865
865
|
if (!material)
|
|
866
866
|
return;
|
|
@@ -977,7 +977,7 @@ class NgtsMeshWobbleMaterial {
|
|
|
977
977
|
this.parameters = omit(this.options, ['speed']);
|
|
978
978
|
this.material = new MeshWobbleMaterial();
|
|
979
979
|
inject(DestroyRef).onDestroy(() => this.material.dispose());
|
|
980
|
-
|
|
980
|
+
beforeRender(({ clock }) => {
|
|
981
981
|
const material = this.material;
|
|
982
982
|
material.time = clock.elapsedTime * this.options().speed;
|
|
983
983
|
});
|