angular-three-soba 3.2.4 → 3.3.0
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/fesm2022/angular-three-soba-loaders.mjs.map +1 -1
- package/loaders/lib/gltf-loader.d.ts +5 -3
- package/materials/lib/custom-shader-material.d.ts +2 -2
- package/materials/lib/mesh-portal-material.d.ts +24 -24
- package/materials/lib/mesh-refraction-material.d.ts +2 -2
- package/materials/lib/mesh-transmission-material.d.ts +1 -1
- package/package.json +8 -8
- package/staging/lib/lightformer.d.ts +1 -1
- package/staging/lib/spot-light.d.ts +2 -2
|
@@ -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 { Loader } 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: 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\nfunction _injectGLTF<TUrl extends string | string[] | Record<string, string>>(\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: NgtLoaderResults<TUrl, GLTF & NgtObjectMap>) => void;\n\t} = {},\n): Signal<NgtLoaderResults<TUrl, GLTF & NgtObjectMap> | 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<NgtLoaderResults<TUrl, GLTF & NgtObjectMap> | 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 { ChangeDetectorRef, Injector, inject, signal } from '@angular/core';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport { DefaultLoadingManager } from 'three';\n\nexport function injectProgress(injector?: Injector) {\n\treturn assertInjector(injectProgress, injector, () => {\n\t\tconst cdr = inject(ChangeDetectorRef);\n\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\tlet saveLastTotalLoaded = 0;\n\n\t\tDefaultLoadingManager.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\n\t\t\tcdr.detectChanges();\n\t\t};\n\n\t\tDefaultLoadingManager.onLoad = () => {\n\t\t\tprogress.update((prev) => ({ ...prev, active: false }));\n\t\t\tcdr.detectChanges();\n\t\t};\n\n\t\tDefaultLoadingManager.onError = (url) => {\n\t\t\tprogress.update((prev) => ({ ...prev, errors: [...prev.errors, url] }));\n\t\t\tcdr.detectChanges();\n\t\t};\n\n\t\tDefaultLoadingManager.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\n\t\t\tcdr.detectChanges();\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\tactive = computed(() => this.progressState().active);\n\tprogress = computed(() => this.progressState().progress);\n\n\toptions = input(defaultOptions, { transform: mergeInputs(defaultOptions) });\n\n\tcontainerClass = pick(this.options, 'containerClass');\n\tinnerClass = pick(this.options, 'innerClass');\n\tbarClass = pick(this.options, 'barClass');\n\tdataClass = pick(this.options, 'dataClass');\n\tinitialState = pick(this.options, 'initialState');\n\tdataInterpolation = pick(this.options, 'dataInterpolation');\n\n\tprogressSpanRef = viewChild<ElementRef<HTMLSpanElement>>('progressSpanRef');\n\n\tshown = 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, NgtLoaderResults } from 'angular-three';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport { Texture, TextureLoader } from 'three';\n\nfunction _injectTexture<TInput extends string[] | string | Record<string, string>>(\n\tinput: () => TInput,\n\t{ onLoad, injector }: { onLoad?: (texture: Texture[]) => void; injector?: Injector } = {},\n): Signal<NgtLoaderResults<TInput, Texture> | null> {\n\treturn assertInjector(_injectTexture, injector, () => {\n\t\tconst store = injectStore();\n\t\tconst result = injectLoader(() => TextureLoader, input);\n\n\t\teffect(() => {\n\t\t\tconst textures = result();\n\t\t\tif (!textures) return;\n\t\t\tconst gl = store.get('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: textures instanceof Texture\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(() => TextureLoader, input);\n};\n\nexport type NgtsTextureLoader = typeof _injectTexture;\nexport const injectTexture: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AAC;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;IAC3G,YAAY,CAAC,OAAO,CAAC,MAAM,aAAa,EAAE,KAAK,CAAC;AACjD,CAAC;AAGM,MAAM,aAAa,GAAsB;;ACrChD;;AAEG;;;;"}
|
|
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 { Loader } 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: 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 { ChangeDetectorRef, Injector, inject, signal } from '@angular/core';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport { DefaultLoadingManager } from 'three';\n\nexport function injectProgress(injector?: Injector) {\n\treturn assertInjector(injectProgress, injector, () => {\n\t\tconst cdr = inject(ChangeDetectorRef);\n\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\tlet saveLastTotalLoaded = 0;\n\n\t\tDefaultLoadingManager.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\n\t\t\tcdr.detectChanges();\n\t\t};\n\n\t\tDefaultLoadingManager.onLoad = () => {\n\t\t\tprogress.update((prev) => ({ ...prev, active: false }));\n\t\t\tcdr.detectChanges();\n\t\t};\n\n\t\tDefaultLoadingManager.onError = (url) => {\n\t\t\tprogress.update((prev) => ({ ...prev, errors: [...prev.errors, url] }));\n\t\t\tcdr.detectChanges();\n\t\t};\n\n\t\tDefaultLoadingManager.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\n\t\t\tcdr.detectChanges();\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\tactive = computed(() => this.progressState().active);\n\tprogress = computed(() => this.progressState().progress);\n\n\toptions = input(defaultOptions, { transform: mergeInputs(defaultOptions) });\n\n\tcontainerClass = pick(this.options, 'containerClass');\n\tinnerClass = pick(this.options, 'innerClass');\n\tbarClass = pick(this.options, 'barClass');\n\tdataClass = pick(this.options, 'dataClass');\n\tinitialState = pick(this.options, 'initialState');\n\tdataInterpolation = pick(this.options, 'dataInterpolation');\n\n\tprogressSpanRef = viewChild<ElementRef<HTMLSpanElement>>('progressSpanRef');\n\n\tshown = 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, NgtLoaderResults } from 'angular-three';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport { Texture, TextureLoader } from 'three';\n\nfunction _injectTexture<TInput extends string[] | string | Record<string, string>>(\n\tinput: () => TInput,\n\t{ onLoad, injector }: { onLoad?: (texture: Texture[]) => void; injector?: Injector } = {},\n): Signal<NgtLoaderResults<TInput, Texture> | null> {\n\treturn assertInjector(_injectTexture, injector, () => {\n\t\tconst store = injectStore();\n\t\tconst result = injectLoader(() => TextureLoader, input);\n\n\t\teffect(() => {\n\t\t\tconst textures = result();\n\t\t\tif (!textures) return;\n\t\t\tconst gl = store.get('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: textures instanceof Texture\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(() => 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,IAAmB,EAAA;IAC9C,OAAO,OAAO,IAAI,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI;AAC1E;AAEA,SAAS,aAAa,CAAC,QAAkB,EAAA;IACxC,IAAI,CAAC,UAAU,EAAE;AAChB,QAAA,UAAU,GAAG,IAAI,UAAU,EAAE;;AAE9B,IAAA,OAAO,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC;AAClC;AAEA,MAAM,KAAK,GAAG,IAAI,GAAG,EAAuB;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MAAM,EAAE;AACzB,YAAA,IAAI,CAAC,QAAQ;gBAAE;YACf,MAAM,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;AAC1B,YAAA,IAAI,aAAa,IAAI,EAAE,EAAE;AACxB,gBAAA,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ;AACnC,sBAAE;sBACA,QAAQ,YAAY;0BACnB,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;IAC3G,YAAY,CAAC,OAAO,CAAC,MAAM,aAAa,EAAE,KAAK,CAAC;AACjD,CAAC;AAGM,MAAM,aAAa,GAAsB;;ACrChD;;AAEG;;;;"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { Injector, Signal } from '@angular/core';
|
|
2
2
|
import { NgtLoaderResults, NgtObjectMap } from 'angular-three';
|
|
3
3
|
import { GLTF, GLTFLoader } from 'three-stdlib';
|
|
4
|
-
|
|
4
|
+
type InjectGLTFUrl<TGltf extends GLTF | GLTF[] | Record<string, GLTF>> = TGltf extends GLTF ? string : TGltf extends GLTF[] ? string[] : TGltf extends Record<string, GLTF> ? Record<string, string> : never;
|
|
5
|
+
type InjectGLTFObjectMap<TGltf extends GLTF | GLTF[] | Record<string, GLTF>> = TGltf extends GLTF ? TGltf & NgtObjectMap : TGltf extends Array<infer _GLTF extends GLTF> ? Array<_GLTF & NgtObjectMap> : TGltf extends Record<string, infer _GLTF extends GLTF> ? Record<string, _GLTF & NgtObjectMap> : never;
|
|
6
|
+
declare function _injectGLTF<TGltf extends GLTF | GLTF[] | Record<string, GLTF> = GLTF, TUrl extends string | string[] | Record<string, string> = InjectGLTFUrl<TGltf>>(path: () => TUrl, { useDraco, useMeshOpt, injector, extensions, onLoad, }?: {
|
|
5
7
|
useDraco?: boolean | string;
|
|
6
8
|
useMeshOpt?: boolean;
|
|
7
9
|
injector?: Injector;
|
|
8
10
|
extensions?: (loader: GLTFLoader) => void;
|
|
9
|
-
onLoad?: (data:
|
|
10
|
-
}): Signal<
|
|
11
|
+
onLoad?: (data: InjectGLTFObjectMap<TGltf>) => void;
|
|
12
|
+
}): Signal<InjectGLTFObjectMap<TGltf> | null> & {
|
|
11
13
|
scene: Signal<GLTF['scene'] | null>;
|
|
12
14
|
};
|
|
13
15
|
declare namespace _injectGLTF {
|
|
@@ -4,10 +4,10 @@ import { Material } from 'three';
|
|
|
4
4
|
import CustomShaderMaterial from 'three-custom-shader-material/vanilla';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class NgtsCustomShaderMaterial {
|
|
7
|
-
baseMaterial: import("@angular/core").InputSignal<Material |
|
|
7
|
+
baseMaterial: import("@angular/core").InputSignal<typeof Material | Material | ElementRef<Material>>;
|
|
8
8
|
attach: import("@angular/core").InputSignal<NgtAttachable>;
|
|
9
9
|
options: import("@angular/core").InputSignal<Omit<any, "baseMaterial">>;
|
|
10
|
-
parameters: import("@angular/core").Signal<Omit<Omit<any, "baseMaterial">, "
|
|
10
|
+
parameters: import("@angular/core").Signal<Omit<Omit<any, "baseMaterial">, "uniforms" | "vertexShader" | "fragmentShader" | "cacheKey">>;
|
|
11
11
|
private base;
|
|
12
12
|
private fragmentShader;
|
|
13
13
|
private vertexShader;
|
|
@@ -9,19 +9,37 @@ export declare class ManagePortalScene {
|
|
|
9
9
|
events: import("@angular/core").InputSignal<boolean | undefined>;
|
|
10
10
|
rootScene: import("@angular/core").InputSignal<Scene>;
|
|
11
11
|
material: import("@angular/core").InputSignal<import("angular-three").NgtExtendedColors<import("angular-three").NgtOverwrite<Partial<{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
resolution: import("three").Vector2;
|
|
13
|
+
blur: number;
|
|
14
|
+
size?: number | undefined;
|
|
15
|
+
sdf?: (import("three").Texture | null) | undefined;
|
|
16
|
+
map?: (import("three").Texture | null) | undefined;
|
|
17
|
+
readonly isShaderMaterial: true;
|
|
17
18
|
defines: {
|
|
18
19
|
[key: string]: any;
|
|
19
20
|
};
|
|
20
|
-
|
|
21
|
+
uniforms: {
|
|
22
|
+
[uniform: string]: import("three").IUniform;
|
|
23
|
+
};
|
|
24
|
+
uniformsGroups: import("three").UniformsGroup[];
|
|
25
|
+
vertexShader: string;
|
|
26
|
+
fragmentShader: string;
|
|
27
|
+
linewidth: number;
|
|
21
28
|
wireframe: boolean;
|
|
22
29
|
wireframeLinewidth: number;
|
|
23
30
|
fog: boolean;
|
|
31
|
+
lights: boolean;
|
|
32
|
+
clipping: boolean;
|
|
33
|
+
extensions: {
|
|
34
|
+
clipCullDistance: boolean;
|
|
35
|
+
multiDraw: boolean;
|
|
36
|
+
};
|
|
37
|
+
defaultAttributeValues: any;
|
|
38
|
+
index0AttributeName: string | undefined;
|
|
39
|
+
uniformsNeedUpdate: boolean;
|
|
40
|
+
glslVersion: import("three").GLSLVersion | null;
|
|
24
41
|
setValues: (parameters: import("three").ShaderMaterialParameters) => void;
|
|
42
|
+
toJSON: (meta?: import("three").JSONMeta) => import("three").ShaderMaterialJSON;
|
|
25
43
|
readonly isMaterial: true;
|
|
26
44
|
type: string;
|
|
27
45
|
alphaHash: boolean;
|
|
@@ -73,7 +91,6 @@ export declare class ManagePortalScene {
|
|
|
73
91
|
onBeforeRender: (renderer: import("three").WebGLRenderer, scene: Scene, camera: import("three").Camera, geometry: import("three").BufferGeometry, object: import("three").Object3D, group: import("three").Group) => void;
|
|
74
92
|
onBeforeCompile: (parameters: import("three").WebGLProgramParametersWithUniforms, renderer: import("three").WebGLRenderer) => void;
|
|
75
93
|
customProgramCacheKey: () => string;
|
|
76
|
-
toJSON: (meta?: import("three").JSONMeta) => import("three").ShaderMaterialJSON;
|
|
77
94
|
clone: () => ShaderMaterial & import("@pmndrs/vanilla").PortalMaterialType;
|
|
78
95
|
copy: (material: import("three").Material) => ShaderMaterial & import("@pmndrs/vanilla").PortalMaterialType;
|
|
79
96
|
dispose: () => void;
|
|
@@ -85,23 +102,6 @@ export declare class ManagePortalScene {
|
|
|
85
102
|
dispatchEvent: <T extends "dispose">(event: import("three").BaseEvent<T> & {
|
|
86
103
|
dispose: {};
|
|
87
104
|
}[T]) => void;
|
|
88
|
-
resolution: import("three").Vector2;
|
|
89
|
-
blur: number;
|
|
90
|
-
size?: number | undefined;
|
|
91
|
-
sdf?: (import("three").Texture | null) | undefined;
|
|
92
|
-
readonly isShaderMaterial: true;
|
|
93
|
-
uniformsGroups: import("three").UniformsGroup[];
|
|
94
|
-
linewidth: number;
|
|
95
|
-
lights: boolean;
|
|
96
|
-
clipping: boolean;
|
|
97
|
-
extensions: {
|
|
98
|
-
clipCullDistance: boolean;
|
|
99
|
-
multiDraw: boolean;
|
|
100
|
-
};
|
|
101
|
-
defaultAttributeValues: any;
|
|
102
|
-
index0AttributeName: string | undefined;
|
|
103
|
-
uniformsNeedUpdate: boolean;
|
|
104
|
-
glslVersion: import("three").GLSLVersion | null;
|
|
105
105
|
}>, import("angular-three").NgtNodeElement<ShaderMaterial & import("@pmndrs/vanilla").PortalMaterialType, (new (parameters?: (import("three").ShaderMaterialParameters & Partial<import("@pmndrs/vanilla").PortalMaterialType>) | undefined) => ShaderMaterial & import("@pmndrs/vanilla").PortalMaterialType) & {
|
|
106
106
|
key: string;
|
|
107
107
|
}>>>>;
|
|
@@ -24,7 +24,7 @@ export declare class NgtsMeshRefractionMaterial {
|
|
|
24
24
|
private fastChroma;
|
|
25
25
|
aberrationStrength: import("@angular/core").Signal<number>;
|
|
26
26
|
materialRef: import("@angular/core").Signal<ElementRef<import("three").ShaderMaterial & {
|
|
27
|
-
[name: string]: number | boolean | any[] | import("three").Color |
|
|
27
|
+
[name: string]: number | boolean | any[] | Texture | import("three").Color | import("three").Vector3 | import("three").Quaternion | import("three").Matrix4 | import("three").Matrix3 | import("three").Vector2 | import("three").Vector4 | CubeTexture | Int32Array | Float32Array | null;
|
|
28
28
|
}> | undefined>;
|
|
29
29
|
private store;
|
|
30
30
|
private size;
|
|
@@ -34,7 +34,7 @@ export declare class NgtsMeshRefractionMaterial {
|
|
|
34
34
|
}>;
|
|
35
35
|
private defineKeys;
|
|
36
36
|
material: import("@angular/core").Signal<import("three").ShaderMaterial & {
|
|
37
|
-
[name: string]: number | boolean | any[] | import("three").Color |
|
|
37
|
+
[name: string]: number | boolean | any[] | Texture | import("three").Color | import("three").Vector3 | import("three").Quaternion | import("three").Matrix4 | import("three").Matrix3 | import("three").Vector2 | import("three").Vector4 | CubeTexture | Int32Array | Float32Array | null;
|
|
38
38
|
}>;
|
|
39
39
|
constructor();
|
|
40
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgtsMeshRefractionMaterial, never>;
|
|
@@ -29,7 +29,7 @@ export type NgtsMeshTransmissionMaterialOptions = Partial<NgtMeshPhysicalMateria
|
|
|
29
29
|
export declare class NgtsMeshTransmissionMaterial {
|
|
30
30
|
attach: import("@angular/core").InputSignal<NgtAttachable>;
|
|
31
31
|
options: import("@angular/core").InputSignalWithTransform<NgtsMeshTransmissionMaterialOptions, "" | Partial<NgtsMeshTransmissionMaterialOptions>>;
|
|
32
|
-
parameters: import("@angular/core").Signal<Omit<NgtsMeshTransmissionMaterialOptions, "
|
|
32
|
+
parameters: import("@angular/core").Signal<Omit<NgtsMeshTransmissionMaterialOptions, "resolution" | "side" | "thickness" | "anisotropy" | "transmission" | "buffer" | "anisotropicBlur" | "samples" | "transmissionSampler" | "backside" | "backsideThickness" | "backsideEnvMapIntensity" | "backsideResolution" | "background">>;
|
|
33
33
|
private resolution;
|
|
34
34
|
private backsideResolution;
|
|
35
35
|
private samples;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-three-soba",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -47,13 +47,17 @@
|
|
|
47
47
|
"types": "./index.d.ts",
|
|
48
48
|
"default": "./fesm2022/angular-three-soba.mjs"
|
|
49
49
|
},
|
|
50
|
+
"./cameras": {
|
|
51
|
+
"types": "./cameras/index.d.ts",
|
|
52
|
+
"default": "./fesm2022/angular-three-soba-cameras.mjs"
|
|
53
|
+
},
|
|
50
54
|
"./abstractions": {
|
|
51
55
|
"types": "./abstractions/index.d.ts",
|
|
52
56
|
"default": "./fesm2022/angular-three-soba-abstractions.mjs"
|
|
53
57
|
},
|
|
54
|
-
"./
|
|
55
|
-
"types": "./
|
|
56
|
-
"default": "./fesm2022/angular-three-soba-
|
|
58
|
+
"./controls": {
|
|
59
|
+
"types": "./controls/index.d.ts",
|
|
60
|
+
"default": "./fesm2022/angular-three-soba-controls.mjs"
|
|
57
61
|
},
|
|
58
62
|
"./gizmos": {
|
|
59
63
|
"types": "./gizmos/index.d.ts",
|
|
@@ -63,10 +67,6 @@
|
|
|
63
67
|
"types": "./materials/index.d.ts",
|
|
64
68
|
"default": "./fesm2022/angular-three-soba-materials.mjs"
|
|
65
69
|
},
|
|
66
|
-
"./controls": {
|
|
67
|
-
"types": "./controls/index.d.ts",
|
|
68
|
-
"default": "./fesm2022/angular-three-soba-controls.mjs"
|
|
69
|
-
},
|
|
70
70
|
"./performances": {
|
|
71
71
|
"types": "./performances/index.d.ts",
|
|
72
72
|
"default": "./fesm2022/angular-three-soba-performances.mjs"
|
|
@@ -293,7 +293,7 @@ export declare class NgtsLightformer {
|
|
|
293
293
|
layers: import("angular-three").NgtLayers;
|
|
294
294
|
dispose: (() => void) | null;
|
|
295
295
|
raycast: import("three").Object3D["raycast"] | null;
|
|
296
|
-
}, "scale">> & NgtsLightformerOptions, "scale" | "
|
|
296
|
+
}, "scale">> & NgtsLightformerOptions, "scale" | "color" | "toneMapped" | "map" | "target" | "intensity" | "form">>;
|
|
297
297
|
private intensity;
|
|
298
298
|
private color;
|
|
299
299
|
private target;
|
|
@@ -104,8 +104,8 @@ export declare class NgtsSpotLightShadow {
|
|
|
104
104
|
export declare class NgtsSpotLight {
|
|
105
105
|
protected readonly SpotLightHelper: typeof SpotLightHelper;
|
|
106
106
|
options: import("@angular/core").InputSignalWithTransform<NgtsSpotLightOptions, "" | Partial<NgtsSpotLightOptions>>;
|
|
107
|
-
parameters: import("@angular/core").Signal<Omit<NgtsSpotLightOptions, "
|
|
108
|
-
volumetricOptions: import("@angular/core").Signal<Pick<NgtsSpotLightOptions, "
|
|
107
|
+
parameters: import("@angular/core").Signal<Omit<NgtsSpotLightOptions, "opacity" | "color" | "distance" | "debug" | "depthBuffer" | "angle" | "attenuation" | "anglePower" | "radiusTop" | "radiusBottom" | "volumetric">>;
|
|
108
|
+
volumetricOptions: import("@angular/core").Signal<Pick<NgtsSpotLightOptions, "opacity" | "color" | "distance" | "debug" | "depthBuffer" | "angle" | "attenuation" | "anglePower" | "radiusTop" | "radiusBottom">>;
|
|
109
109
|
spotLight: import("@angular/core").Signal<ElementRef<SpotLight>>;
|
|
110
110
|
debug: import("@angular/core").Signal<boolean | undefined>;
|
|
111
111
|
angle: import("@angular/core").Signal<number | undefined>;
|