angular-three-soba 1.14.0 → 2.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/abstractions/{lib/billboard → billboard}/billboard.d.ts +14 -4
- package/abstractions/catmull-rom-line/catmull-rom-line.d.ts +25 -0
- package/abstractions/cubic-bezier-line/cubic-bezier-line.d.ts +25 -0
- package/abstractions/{lib/edges → edges}/edges.d.ts +11 -7
- package/abstractions/{lib/gizmo-helper → gizmo-helper}/gizmo-helper.d.ts +16 -23
- package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.d.ts +22 -0
- package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.d.ts +30 -0
- package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.d.ts +32 -0
- package/abstractions/{lib/gizmo-helper → gizmo-helper}/gizmo-viewcube/gizmo-viewcube.d.ts +2 -3
- package/abstractions/{lib/gizmo-helper → gizmo-helper}/gizmo-viewport/gizmo-viewport-axis.d.ts +28 -9
- package/abstractions/{lib/gizmo-helper → gizmo-helper}/gizmo-viewport/gizmo-viewport.d.ts +23 -4
- package/abstractions/index.d.ts +11 -11
- package/abstractions/line/line-input.d.ts +42 -0
- package/abstractions/line/line.d.ts +35 -0
- package/abstractions/{lib/quadratic-bezier-line → quadratic-bezier-line}/quadratic-bezier-line.d.ts +12 -8
- package/abstractions/text/text.d.ts +77 -0
- package/abstractions/text-3d/text-3d.d.ts +74 -0
- package/cameras/{lib/camera → camera}/camera-content.d.ts +1 -1
- package/cameras/{lib/camera → camera}/camera.d.ts +12 -8
- package/cameras/cube-camera/cube-camera.d.ts +42 -0
- package/cameras/index.d.ts +5 -4
- package/cameras/{lib/orthographic-camera → orthographic-camera}/orthographic-camera.d.ts +14 -5
- package/controls/index.d.ts +1 -1
- package/controls/{lib/orbit-controls → orbit-controls}/orbit-controls.d.ts +19 -11
- package/esm2022/abstractions/angular-three-soba-abstractions.mjs +1 -1
- package/esm2022/abstractions/billboard/billboard.mjs +71 -0
- package/esm2022/abstractions/catmull-rom-line/catmull-rom-line.mjs +131 -0
- package/esm2022/abstractions/cubic-bezier-line/cubic-bezier-line.mjs +113 -0
- package/esm2022/abstractions/edges/edges.mjs +93 -0
- package/esm2022/abstractions/gizmo-helper/gizmo-helper.mjs +210 -0
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/constants.mjs +31 -0
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.mjs +95 -0
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.mjs +155 -0
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.mjs +62 -0
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube.mjs +80 -0
- package/esm2022/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.mjs +206 -0
- package/esm2022/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport.mjs +273 -0
- package/esm2022/abstractions/index.mjs +12 -12
- package/esm2022/abstractions/line/line-input.mjs +113 -0
- package/esm2022/abstractions/line/line.mjs +165 -0
- package/esm2022/abstractions/quadratic-bezier-line/quadratic-bezier-line.mjs +128 -0
- package/esm2022/abstractions/text/text.mjs +275 -0
- package/esm2022/abstractions/text-3d/text-3d.mjs +167 -0
- package/esm2022/angular-three-soba.mjs +1 -1
- package/esm2022/cameras/angular-three-soba-cameras.mjs +1 -1
- package/esm2022/cameras/camera/camera-content.mjs +21 -0
- package/esm2022/cameras/camera/camera.mjs +71 -0
- package/esm2022/cameras/cube-camera/cube-camera.mjs +131 -0
- package/esm2022/cameras/index.mjs +6 -5
- package/esm2022/cameras/orthographic-camera/orthographic-camera.mjs +99 -0
- package/esm2022/cameras/perspective-camera/perspective-camera.mjs +47 -0
- package/esm2022/controls/angular-three-soba-controls.mjs +1 -1
- package/esm2022/controls/index.mjs +2 -2
- package/esm2022/controls/orbit-controls/orbit-controls.mjs +165 -0
- package/esm2022/index.mjs +1 -1
- package/esm2022/loaders/angular-three-soba-loaders.mjs +1 -1
- package/esm2022/loaders/gltf-loader/gltf-loader.mjs +33 -0
- package/esm2022/loaders/index.mjs +5 -6
- package/esm2022/loaders/loader/loader.mjs +133 -0
- package/esm2022/loaders/progress/progress.mjs +52 -0
- package/esm2022/loaders/texture-loader/texture-loader.mjs +28 -0
- package/esm2022/materials/angular-three-soba-materials.mjs +1 -1
- package/esm2022/materials/index.mjs +6 -6
- package/esm2022/materials/mesh-distort-material/mesh-distort-material.mjs +73 -0
- package/esm2022/materials/mesh-reflector-material/mesh-reflector-material.mjs +383 -0
- package/esm2022/materials/mesh-refraction-material/mesh-refraction-material.mjs +168 -0
- package/esm2022/materials/mesh-transmission-material/mesh-transmission-material.mjs +257 -0
- package/esm2022/materials/mesh-wobble-material/mesh-wobble-material.mjs +66 -0
- package/esm2022/misc/angular-three-soba-misc.mjs +1 -1
- package/esm2022/misc/animations/animations.mjs +55 -0
- package/esm2022/misc/bake-shadows/bake-shadows.mjs +24 -0
- package/esm2022/misc/depth-buffer/depth-buffer.mjs +46 -0
- package/esm2022/misc/fbo/fbo.mjs +47 -0
- package/esm2022/misc/index.mjs +5 -5
- package/esm2022/performance/adaptive/adaptive-dpr.mjs +46 -0
- package/esm2022/performance/adaptive/adaptive-events.mjs +31 -0
- package/esm2022/performance/angular-three-soba-performance.mjs +1 -1
- package/esm2022/performance/detailed/detailed.mjs +61 -0
- package/esm2022/performance/index.mjs +7 -5
- package/esm2022/performance/instances/instance.mjs +48 -0
- package/esm2022/performance/instances/instances.mjs +189 -0
- package/esm2022/performance/instances/position-mesh.mjs +52 -0
- package/esm2022/performance/stats/stats.mjs +79 -0
- package/esm2022/shaders/angular-three-soba-shaders.mjs +1 -1
- package/esm2022/shaders/blur-pass/blur-pass.mjs +61 -0
- package/esm2022/shaders/caustics-material/caustics-material.mjs +128 -0
- package/esm2022/shaders/caustics-material/caustics-projection-material.mjs +33 -0
- package/esm2022/shaders/convolution-material/convolution-material.mjs +94 -0
- package/esm2022/shaders/discard-material/discard-material.mjs +3 -0
- package/esm2022/shaders/index.mjs +15 -15
- package/esm2022/shaders/mesh-distort-material/mesh-distort-material.mjs +55 -0
- package/esm2022/shaders/mesh-reflector-material/mesh-reflector-material.mjs +223 -0
- package/esm2022/shaders/mesh-refraction-material/mesh-refraction-material.mjs +170 -0
- package/esm2022/shaders/mesh-transmission-material/mesh-transmission-material.mjs +268 -0
- package/esm2022/shaders/mesh-wobble-material/mesh-wobble-material.mjs +37 -0
- package/esm2022/shaders/shader-material/shader-material.mjs +34 -0
- package/esm2022/shaders/soft-shadow-material/soft-shadow-material.mjs +33 -0
- package/esm2022/shaders/sparkles-material/sparkles-material.mjs +47 -0
- package/esm2022/shaders/spot-light-material/spot-light-material.mjs +86 -0
- package/esm2022/shaders/star-field-material/star-field-material.mjs +32 -0
- package/esm2022/staging/accumulative-shadows/accumulative-shadows.mjs +283 -0
- package/esm2022/staging/accumulative-shadows/progressive-light-map.mjs +108 -0
- package/esm2022/staging/accumulative-shadows/randomized-lights.mjs +208 -0
- package/esm2022/staging/angular-three-soba-staging.mjs +1 -1
- package/esm2022/staging/bounds/bounds.mjs +307 -0
- package/esm2022/staging/camera-shake/camera-shake.mjs +117 -0
- package/esm2022/staging/caustics/caustisc.mjs +384 -0
- package/esm2022/staging/center/center.mjs +148 -0
- package/esm2022/staging/cloud/cloud.mjs +164 -0
- package/esm2022/staging/contact-shadows/contact-shadows.mjs +249 -0
- package/esm2022/staging/environment/assets.mjs +13 -0
- package/esm2022/staging/environment/environment-cube.mjs +49 -0
- package/esm2022/staging/environment/environment-ground.mjs +43 -0
- package/esm2022/staging/environment/environment-input.mjs +106 -0
- package/esm2022/staging/environment/environment-map.mjs +53 -0
- package/esm2022/staging/environment/environment-portal.mjs +135 -0
- package/esm2022/staging/environment/environment.mjs +78 -0
- package/esm2022/staging/environment/utils.mjs +84 -0
- package/esm2022/staging/float/float.mjs +82 -0
- package/esm2022/staging/index.mjs +18 -18
- package/esm2022/staging/sky/sky.mjs +114 -0
- package/esm2022/staging/sparkles/sparkles.mjs +161 -0
- package/esm2022/staging/spot-light/spot-light-input.mjs +75 -0
- package/esm2022/staging/spot-light/spot-light-shadow-mesh-input.mjs +57 -0
- package/esm2022/staging/spot-light/spot-light-shadow-mesh.mjs +256 -0
- package/esm2022/staging/spot-light/spot-light.mjs +94 -0
- package/esm2022/staging/spot-light/volumetric-mesh.mjs +101 -0
- package/esm2022/staging/stage/stage.mjs +374 -0
- package/esm2022/staging/stars/stars.mjs +148 -0
- package/fesm2022/angular-three-soba-abstractions.mjs +1116 -890
- package/fesm2022/angular-three-soba-abstractions.mjs.map +1 -1
- package/fesm2022/angular-three-soba-cameras.mjs +126 -122
- package/fesm2022/angular-three-soba-cameras.mjs.map +1 -1
- package/fesm2022/angular-three-soba-controls.mjs +72 -54
- package/fesm2022/angular-three-soba-controls.mjs.map +1 -1
- package/fesm2022/angular-three-soba-loaders.mjs +147 -131
- package/fesm2022/angular-three-soba-loaders.mjs.map +1 -1
- package/fesm2022/angular-three-soba-materials.mjs +340 -258
- package/fesm2022/angular-three-soba-materials.mjs.map +1 -1
- package/fesm2022/angular-three-soba-misc.mjs +140 -123
- package/fesm2022/angular-three-soba-misc.mjs.map +1 -1
- package/fesm2022/angular-three-soba-performance.mjs +383 -106
- package/fesm2022/angular-three-soba-performance.mjs.map +1 -1
- package/fesm2022/angular-three-soba-shaders.mjs +57 -9
- package/fesm2022/angular-three-soba-shaders.mjs.map +1 -1
- package/fesm2022/angular-three-soba-staging.mjs +1609 -1561
- package/fesm2022/angular-three-soba-staging.mjs.map +1 -1
- package/fesm2022/angular-three-soba.mjs.map +1 -1
- package/loaders/gltf-loader/gltf-loader.d.ts +9 -0
- package/loaders/index.d.ts +4 -5
- package/loaders/{lib/loader → loader}/loader.d.ts +20 -15
- package/loaders/progress/progress.d.ts +9 -0
- package/loaders/texture-loader/texture-loader.d.ts +7 -0
- package/materials/index.d.ts +5 -5
- package/materials/{lib/mesh-distort-material → mesh-distort-material}/mesh-distort-material.d.ts +11 -5
- package/materials/mesh-reflector-material/mesh-reflector-material.d.ts +81 -0
- package/materials/mesh-refraction-material/mesh-refraction-material.d.ts +50 -0
- package/materials/{lib/mesh-transmission-material → mesh-transmission-material}/mesh-transmission-material.d.ts +51 -6
- package/materials/{lib/mesh-wobble-material → mesh-wobble-material}/mesh-wobble-material.d.ts +9 -3
- package/misc/animations/animations.d.ts +13 -0
- package/misc/{lib/bake-shadows → bake-shadows}/bake-shadows.d.ts +2 -5
- package/misc/depth-buffer/depth-buffer.d.ts +9 -0
- package/misc/{lib/fbo → fbo}/fbo.d.ts +4 -2
- package/misc/index.d.ts +4 -4
- package/package.json +25 -23
- package/performance/{lib/adaptive → adaptive}/adaptive-dpr.d.ts +4 -7
- package/performance/{lib/adaptive → adaptive}/adaptive-events.d.ts +2 -6
- package/performance/detailed/detailed.d.ts +20 -0
- package/performance/index.d.ts +6 -4
- package/performance/instances/instance.d.ts +9 -0
- package/performance/instances/instances.d.ts +35 -0
- package/performance/instances/position-mesh.d.ts +10 -0
- package/performance/{lib/stats → stats}/stats.d.ts +10 -7
- package/plugin/package.json +1 -1
- package/plugin/src/generators/init/compat.js.map +1 -1
- package/plugin/src/generators/init/init.d.ts +1 -1
- package/plugin/src/generators/init/init.js +1 -1
- package/plugin/src/generators/init/init.js.map +1 -1
- package/plugin/src/index.js.map +1 -1
- package/shaders/{lib/blur-pass → blur-pass}/blur-pass.d.ts +2 -2
- package/shaders/index.d.ts +14 -14
- package/shaders/{lib/mesh-distort-material → mesh-distort-material}/mesh-distort-material.d.ts +1 -1
- package/shaders/{lib/mesh-wobble-material → mesh-wobble-material}/mesh-wobble-material.d.ts +1 -0
- package/shaders/{lib/soft-shadow-material → soft-shadow-material}/soft-shadow-material.d.ts +2 -2
- package/shaders/sparkles-material/sparkles-material.d.ts +3 -0
- package/staging/{lib/accumulative-shadows → accumulative-shadows}/accumulative-shadows.d.ts +55 -17
- package/staging/{lib/accumulative-shadows → accumulative-shadows}/progressive-light-map.d.ts +2 -2
- package/staging/{lib/accumulative-shadows → accumulative-shadows}/randomized-lights.d.ts +45 -10
- package/staging/{lib/bounds → bounds}/bounds.d.ts +32 -22
- package/staging/{lib/camera-shake → camera-shake}/camera-shake.d.ts +15 -11
- package/staging/{lib/caustics/caustics.d.ts → caustics/caustisc.d.ts} +36 -13
- package/staging/{lib/center → center}/center.d.ts +30 -8
- package/staging/cloud/cloud.d.ts +48 -0
- package/staging/{lib/contact-shadows → contact-shadows}/contact-shadows.d.ts +38 -10
- package/staging/environment/environment-cube.d.ts +11 -0
- package/staging/environment/environment-ground.d.ts +13 -0
- package/staging/environment/environment-input.d.ts +68 -0
- package/staging/environment/environment-map.d.ts +11 -0
- package/staging/{lib/environment → environment}/environment-portal.d.ts +5 -7
- package/staging/{lib/environment → environment}/environment.d.ts +2 -2
- package/staging/environment/utils.d.ts +7 -0
- package/staging/float/float.d.ts +27 -0
- package/staging/index.d.ts +17 -17
- package/staging/{lib/sky → sky}/sky.d.ts +26 -5
- package/staging/{lib/sparkles → sparkles}/sparkles.d.ts +30 -10
- package/staging/{lib/spot-light → spot-light}/spot-light-input.d.ts +24 -2
- package/staging/{lib/spot-light/shadow-mesh-input.d.ts → spot-light/spot-light-shadow-mesh-input.d.ts} +18 -3
- package/staging/spot-light/spot-light-shadow-mesh.d.ts +38 -0
- package/staging/{lib/spot-light → spot-light}/spot-light.d.ts +11 -5
- package/staging/{lib/spot-light → spot-light}/volumetric-mesh.d.ts +8 -5
- package/staging/{lib/stage → stage}/stage.d.ts +33 -14
- package/staging/{lib/stars → stars}/stars.d.ts +21 -7
- package/abstractions/lib/catmull-rom-line/catmull-rom-line.d.ts +0 -15
- package/abstractions/lib/cubic-bezier-line/cubic-bezier-line.d.ts +0 -15
- package/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.d.ts +0 -16
- package/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.d.ts +0 -24
- package/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.d.ts +0 -14
- package/abstractions/lib/line/line-input.d.ts +0 -19
- package/abstractions/lib/line/line.d.ts +0 -21
- package/abstractions/lib/text/text.d.ts +0 -21
- package/abstractions/lib/text-3d/text-3d.d.ts +0 -39
- package/assets/default-spot-light-shadow.glsl +0 -10
- package/cameras/lib/cube-camera/cube-camera.d.ts +0 -27
- package/esm2022/abstractions/lib/billboard/billboard.mjs +0 -74
- package/esm2022/abstractions/lib/catmull-rom-line/catmull-rom-line.mjs +0 -120
- package/esm2022/abstractions/lib/cubic-bezier-line/cubic-bezier-line.mjs +0 -99
- package/esm2022/abstractions/lib/edges/edges.mjs +0 -96
- package/esm2022/abstractions/lib/gizmo-helper/gizmo-helper.mjs +0 -213
- package/esm2022/abstractions/lib/gizmo-helper/gizmo-viewcube/constants.mjs +0 -31
- package/esm2022/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.mjs +0 -92
- package/esm2022/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.mjs +0 -184
- package/esm2022/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.mjs +0 -46
- package/esm2022/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube.mjs +0 -134
- package/esm2022/abstractions/lib/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.mjs +0 -195
- package/esm2022/abstractions/lib/gizmo-helper/gizmo-viewport/gizmo-viewport.mjs +0 -267
- package/esm2022/abstractions/lib/line/line-input.mjs +0 -76
- package/esm2022/abstractions/lib/line/line.mjs +0 -133
- package/esm2022/abstractions/lib/quadratic-bezier-line/quadratic-bezier-line.mjs +0 -128
- package/esm2022/abstractions/lib/text/text.mjs +0 -115
- package/esm2022/abstractions/lib/text-3d/text-3d.mjs +0 -145
- package/esm2022/cameras/lib/camera/camera-content.mjs +0 -21
- package/esm2022/cameras/lib/camera/camera.mjs +0 -75
- package/esm2022/cameras/lib/cube-camera/cube-camera.mjs +0 -131
- package/esm2022/cameras/lib/orthographic-camera/orthographic-camera.mjs +0 -93
- package/esm2022/cameras/lib/perspective-camera/perspective-camera.mjs +0 -47
- package/esm2022/controls/lib/orbit-controls/orbit-controls.mjs +0 -147
- package/esm2022/loaders/lib/cube-texture-loader/cube-texture-loader.mjs +0 -10
- package/esm2022/loaders/lib/gltf-loader/gltf-loader.mjs +0 -32
- package/esm2022/loaders/lib/loader/loader.mjs +0 -134
- package/esm2022/loaders/lib/progress/progress.mjs +0 -39
- package/esm2022/loaders/lib/texture-loader/texture-loader.mjs +0 -19
- package/esm2022/materials/lib/mesh-distort-material/mesh-distort-material.mjs +0 -75
- package/esm2022/materials/lib/mesh-reflector-material/mesh-reflector-material.mjs +0 -328
- package/esm2022/materials/lib/mesh-refraction-material/mesh-refraction-material.mjs +0 -158
- package/esm2022/materials/lib/mesh-transmission-material/mesh-transmission-material.mjs +0 -238
- package/esm2022/materials/lib/mesh-wobble-material/mesh-wobble-material.mjs +0 -68
- package/esm2022/misc/lib/animations/animations.mjs +0 -52
- package/esm2022/misc/lib/bake-shadows/bake-shadows.mjs +0 -26
- package/esm2022/misc/lib/depth-buffer/depth-buffer.mjs +0 -39
- package/esm2022/misc/lib/fbo/fbo.mjs +0 -39
- package/esm2022/performance/lib/adaptive/adaptive-dpr.mjs +0 -47
- package/esm2022/performance/lib/adaptive/adaptive-events.mjs +0 -37
- package/esm2022/performance/lib/detailed/detailed.mjs +0 -54
- package/esm2022/performance/lib/stats/stats.mjs +0 -80
- package/esm2022/shaders/lib/blur-pass/blur-pass.mjs +0 -61
- package/esm2022/shaders/lib/caustics-material/caustics-material.mjs +0 -128
- package/esm2022/shaders/lib/caustics-projection-material/caustics-projection-material.mjs +0 -33
- package/esm2022/shaders/lib/convolution-material/convolution-material.mjs +0 -94
- package/esm2022/shaders/lib/discard-material/discard-material.mjs +0 -3
- package/esm2022/shaders/lib/mesh-distort-material/mesh-distort-material.mjs +0 -55
- package/esm2022/shaders/lib/mesh-reflector-material/mesh-reflector-material.mjs +0 -223
- package/esm2022/shaders/lib/mesh-refraction-material/mesh-refraction-material.mjs +0 -169
- package/esm2022/shaders/lib/mesh-transmission-material/mesh-transmission-material.mjs +0 -268
- package/esm2022/shaders/lib/mesh-wobble-material/mesh-wobble-material.mjs +0 -37
- package/esm2022/shaders/lib/shader-material/shader-material.mjs +0 -34
- package/esm2022/shaders/lib/soft-shadow-material/soft-shadow-material.mjs +0 -33
- package/esm2022/shaders/lib/spot-light-material/spot-light-material.mjs +0 -86
- package/esm2022/shaders/lib/star-field-material/star-field-material.mjs +0 -32
- package/esm2022/staging/lib/accumulative-shadows/accumulative-shadows.mjs +0 -249
- package/esm2022/staging/lib/accumulative-shadows/progressive-light-map.mjs +0 -108
- package/esm2022/staging/lib/accumulative-shadows/randomized-lights.mjs +0 -201
- package/esm2022/staging/lib/bounds/bounds.mjs +0 -284
- package/esm2022/staging/lib/camera-shake/camera-shake.mjs +0 -122
- package/esm2022/staging/lib/caustics/caustics.mjs +0 -364
- package/esm2022/staging/lib/center/center.mjs +0 -143
- package/esm2022/staging/lib/cloud/cloud.mjs +0 -160
- package/esm2022/staging/lib/contact-shadows/contact-shadows.mjs +0 -228
- package/esm2022/staging/lib/environment/assets.mjs +0 -13
- package/esm2022/staging/lib/environment/environment-cube.mjs +0 -41
- package/esm2022/staging/lib/environment/environment-ground.mjs +0 -67
- package/esm2022/staging/lib/environment/environment-inputs.mjs +0 -87
- package/esm2022/staging/lib/environment/environment-map.mjs +0 -39
- package/esm2022/staging/lib/environment/environment-portal.mjs +0 -111
- package/esm2022/staging/lib/environment/environment.mjs +0 -165
- package/esm2022/staging/lib/environment/utils.mjs +0 -70
- package/esm2022/staging/lib/float/float.mjs +0 -77
- package/esm2022/staging/lib/sky/sky.mjs +0 -109
- package/esm2022/staging/lib/sparkles/sparkles.mjs +0 -210
- package/esm2022/staging/lib/spot-light/common.mjs +0 -42
- package/esm2022/staging/lib/spot-light/shadow-mesh-input.mjs +0 -51
- package/esm2022/staging/lib/spot-light/spot-light-input.mjs +0 -62
- package/esm2022/staging/lib/spot-light/spot-light-shadow-no-shader.mjs +0 -74
- package/esm2022/staging/lib/spot-light/spot-light-shadow-shader.mjs +0 -126
- package/esm2022/staging/lib/spot-light/spot-light-shadow.mjs +0 -63
- package/esm2022/staging/lib/spot-light/spot-light.mjs +0 -117
- package/esm2022/staging/lib/spot-light/volumetric-mesh.mjs +0 -86
- package/esm2022/staging/lib/stage/stage.mjs +0 -368
- package/esm2022/staging/lib/stars/stars.mjs +0 -140
- package/loaders/lib/cube-texture-loader/cube-texture-loader.d.ts +0 -3
- package/loaders/lib/gltf-loader/gltf-loader.d.ts +0 -8
- package/loaders/lib/progress/progress.d.ts +0 -16
- package/loaders/lib/texture-loader/texture-loader.d.ts +0 -5
- package/materials/lib/mesh-reflector-material/mesh-reflector-material.d.ts +0 -41
- package/materials/lib/mesh-refraction-material/mesh-refraction-material.d.ts +0 -28
- package/misc/lib/animations/animations.d.ts +0 -13
- package/misc/lib/depth-buffer/depth-buffer.d.ts +0 -7
- package/performance/lib/detailed/detailed.d.ts +0 -13
- package/staging/lib/cloud/cloud.d.ts +0 -23
- package/staging/lib/environment/environment-cube.d.ts +0 -11
- package/staging/lib/environment/environment-ground.d.ts +0 -9
- package/staging/lib/environment/environment-inputs.d.ts +0 -28
- package/staging/lib/environment/environment-map.d.ts +0 -10
- package/staging/lib/environment/utils.d.ts +0 -8
- package/staging/lib/float/float.d.ts +0 -16
- package/staging/lib/spot-light/common.d.ts +0 -3
- package/staging/lib/spot-light/spot-light-shadow-no-shader.d.ts +0 -14
- package/staging/lib/spot-light/spot-light-shadow-shader.d.ts +0 -25
- package/staging/lib/spot-light/spot-light-shadow.d.ts +0 -6
- /package/abstractions/{lib/gizmo-helper → gizmo-helper}/gizmo-viewcube/constants.d.ts +0 -0
- /package/cameras/{lib/perspective-camera → perspective-camera}/perspective-camera.d.ts +0 -0
- /package/plugin/{README.md → libs/plugin/README.md} +0 -0
- /package/shaders/{lib/caustics-material → caustics-material}/caustics-material.d.ts +0 -0
- /package/shaders/{lib/caustics-projection-material → caustics-material}/caustics-projection-material.d.ts +0 -0
- /package/shaders/{lib/convolution-material → convolution-material}/convolution-material.d.ts +0 -0
- /package/shaders/{lib/discard-material → discard-material}/discard-material.d.ts +0 -0
- /package/shaders/{lib/mesh-reflector-material → mesh-reflector-material}/mesh-reflector-material.d.ts +0 -0
- /package/shaders/{lib/mesh-refraction-material → mesh-refraction-material}/mesh-refraction-material.d.ts +0 -0
- /package/shaders/{lib/mesh-transmission-material → mesh-transmission-material}/mesh-transmission-material.d.ts +0 -0
- /package/shaders/{lib/shader-material → shader-material}/shader-material.d.ts +0 -0
- /package/shaders/{lib/spot-light-material → spot-light-material}/spot-light-material.d.ts +0 -0
- /package/shaders/{lib/star-field-material → star-field-material}/star-field-material.d.ts +0 -0
- /package/staging/{lib/environment → environment}/assets.d.ts +0 -0
|
@@ -1,112 +1,113 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Directive, Input, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { LOD } from 'three';
|
|
2
|
+
import { signal, inject, effect, untracked, Directive, Input, computed, Component, CUSTOM_ELEMENTS_SCHEMA, InjectionToken, ElementRef } from '@angular/core';
|
|
3
|
+
import { NgtStore, extend, NgtSignalStore, injectNgtRef, requestAnimationInInjectionContext, checkUpdate, injectBeforeRender, NgtArgs, is, addEffect, addAfterEffect } from 'angular-three';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { LOD, InstancedMesh, InstancedBufferAttribute } from 'three';
|
|
7
6
|
import { DOCUMENT } from '@angular/common';
|
|
8
7
|
import * as Stats from 'stats.js';
|
|
9
8
|
|
|
10
|
-
class NgtsAdaptiveDpr
|
|
9
|
+
class NgtsAdaptiveDpr {
|
|
10
|
+
#pixelated = signal(false);
|
|
11
|
+
set pixelated(pixelated) {
|
|
12
|
+
this.#pixelated.set(pixelated);
|
|
13
|
+
}
|
|
11
14
|
constructor() {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const domElement = this.store.get('gl', 'domElement');
|
|
20
|
-
return () => {
|
|
21
|
-
const active = this.store.get('internal', 'active');
|
|
22
|
-
const setDpr = this.store.get('setDpr');
|
|
23
|
-
const initialDpr = this.store.get('viewport', 'initialDpr');
|
|
15
|
+
const store = inject(NgtStore);
|
|
16
|
+
effect((onCleanup) => {
|
|
17
|
+
const domElement = store.get('gl', 'domElement');
|
|
18
|
+
onCleanup(() => {
|
|
19
|
+
const active = store.get('internal', 'active');
|
|
20
|
+
const setDpr = store.get('setDpr');
|
|
21
|
+
const initialDpr = store.get('viewport', 'initialDpr');
|
|
24
22
|
if (active)
|
|
25
23
|
setDpr(initialDpr);
|
|
26
|
-
if (this
|
|
24
|
+
if (untracked(this.#pixelated) && domElement)
|
|
27
25
|
domElement.style.imageRendering = 'auto';
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
});
|
|
27
|
+
}, { allowSignalWrites: true });
|
|
28
|
+
const performanceCurrent = store.select('performance', 'current');
|
|
29
|
+
// TODO: mousemove event doesn't seem to trigger change detection. investigate later
|
|
30
|
+
effect(() => {
|
|
31
|
+
const current = performanceCurrent();
|
|
32
|
+
const { gl, viewport, setDpr } = store.get();
|
|
33
|
+
setDpr(current * viewport.initialDpr);
|
|
34
|
+
if (untracked(this.#pixelated) && gl.domElement)
|
|
35
|
+
gl.domElement.style.imageRendering = current === 1 ? 'auto' : 'pixelated';
|
|
36
|
+
}, { allowSignalWrites: true });
|
|
37
37
|
}
|
|
38
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsAdaptiveDpr, deps:
|
|
39
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: NgtsAdaptiveDpr, isStandalone: true, selector: "ngts-adaptive-dpr", inputs: { pixelated: "pixelated" },
|
|
38
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsAdaptiveDpr, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
39
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: NgtsAdaptiveDpr, isStandalone: true, selector: "ngts-adaptive-dpr", inputs: { pixelated: "pixelated" }, ngImport: i0 }); }
|
|
40
40
|
}
|
|
41
41
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsAdaptiveDpr, decorators: [{
|
|
42
42
|
type: Directive,
|
|
43
43
|
args: [{
|
|
44
44
|
selector: 'ngts-adaptive-dpr',
|
|
45
45
|
standalone: true,
|
|
46
|
-
providers: [RxActionFactory],
|
|
47
46
|
}]
|
|
48
|
-
}], propDecorators: { pixelated: [{
|
|
47
|
+
}], ctorParameters: function () { return []; }, propDecorators: { pixelated: [{
|
|
49
48
|
type: Input
|
|
50
49
|
}] } });
|
|
51
50
|
|
|
52
|
-
class NgtsAdaptiveEvents
|
|
51
|
+
class NgtsAdaptiveEvents {
|
|
53
52
|
constructor() {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
this.effect(this.actions.setEvents$, () => {
|
|
60
|
-
const enabled = this.store.get('events', 'enabled');
|
|
61
|
-
return () => {
|
|
62
|
-
const setEvents = this.store.get('setEvents');
|
|
53
|
+
const store = inject(NgtStore);
|
|
54
|
+
effect((onCleanup) => {
|
|
55
|
+
const enabled = store.get('events', 'enabled');
|
|
56
|
+
onCleanup(() => {
|
|
57
|
+
const setEvents = store.get('setEvents');
|
|
63
58
|
setEvents({ enabled });
|
|
64
|
-
};
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const setEvents =
|
|
69
|
-
setEvents({ enabled:
|
|
70
|
-
});
|
|
59
|
+
});
|
|
60
|
+
}, { allowSignalWrites: true });
|
|
61
|
+
const performanceCurrent = store.select('performance', 'current');
|
|
62
|
+
effect(() => {
|
|
63
|
+
const setEvents = store.get('setEvents');
|
|
64
|
+
setEvents({ enabled: performanceCurrent() === 1 });
|
|
65
|
+
}, { allowSignalWrites: true });
|
|
71
66
|
}
|
|
72
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsAdaptiveEvents, deps:
|
|
73
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: NgtsAdaptiveEvents, isStandalone: true, selector: "ngts-adaptive-events",
|
|
67
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsAdaptiveEvents, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
68
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: NgtsAdaptiveEvents, isStandalone: true, selector: "ngts-adaptive-events", ngImport: i0 }); }
|
|
74
69
|
}
|
|
75
70
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsAdaptiveEvents, decorators: [{
|
|
76
71
|
type: Directive,
|
|
77
72
|
args: [{
|
|
78
73
|
selector: 'ngts-adaptive-events',
|
|
79
74
|
standalone: true,
|
|
80
|
-
providers: [RxActionFactory],
|
|
81
75
|
}]
|
|
82
|
-
}] });
|
|
76
|
+
}], ctorParameters: function () { return []; } });
|
|
83
77
|
|
|
84
78
|
extend({ LOD });
|
|
85
|
-
class NgtsDetailed extends
|
|
86
|
-
constructor() {
|
|
87
|
-
super(...arguments);
|
|
88
|
-
this.lodRef = injectNgtRef();
|
|
89
|
-
}
|
|
79
|
+
class NgtsDetailed extends NgtSignalStore {
|
|
90
80
|
set distances(distances) {
|
|
91
81
|
this.set({ distances });
|
|
92
82
|
}
|
|
93
|
-
|
|
94
|
-
|
|
83
|
+
constructor() {
|
|
84
|
+
super();
|
|
85
|
+
this.lodRef = injectNgtRef();
|
|
86
|
+
this.#updateChildren();
|
|
95
87
|
}
|
|
96
88
|
onLODBeforeRender({ object, state }) {
|
|
97
89
|
object.update(state.camera);
|
|
98
90
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
children.
|
|
103
|
-
|
|
104
|
-
|
|
91
|
+
#updateChildren() {
|
|
92
|
+
const distances = this.select('distances');
|
|
93
|
+
const trigger = computed(() => {
|
|
94
|
+
const children = this.lodRef.children();
|
|
95
|
+
return { children: children(), distances: distances() };
|
|
96
|
+
});
|
|
97
|
+
effect(() => {
|
|
98
|
+
const { children, distances } = trigger();
|
|
99
|
+
const lod = this.lodRef.untracked;
|
|
100
|
+
if (lod) {
|
|
101
|
+
lod.levels.length = 0;
|
|
102
|
+
children.forEach((child, index) => {
|
|
103
|
+
lod.addLevel(child, distances[index]);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsDetailed, deps:
|
|
108
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsDetailed, isStandalone: true, selector: "ngts-detailed
|
|
109
|
-
<ngt-lOD [ref]="lodRef"
|
|
108
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsDetailed, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
109
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsDetailed, isStandalone: true, selector: "ngts-detailed", inputs: { lodRef: "lodRef", distances: "distances" }, usesInheritance: true, ngImport: i0, template: `
|
|
110
|
+
<ngt-lOD ngtCompound [ref]="lodRef" (beforeRender)="onLODBeforeRender($event)">
|
|
110
111
|
<ng-content />
|
|
111
112
|
</ngt-lOD>
|
|
112
113
|
`, isInline: true }); }
|
|
@@ -114,31 +115,300 @@ class NgtsDetailed extends NgtRxStore {
|
|
|
114
115
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsDetailed, decorators: [{
|
|
115
116
|
type: Component,
|
|
116
117
|
args: [{
|
|
117
|
-
selector: 'ngts-detailed
|
|
118
|
+
selector: 'ngts-detailed',
|
|
118
119
|
standalone: true,
|
|
119
120
|
template: `
|
|
120
|
-
<ngt-lOD [ref]="lodRef"
|
|
121
|
+
<ngt-lOD ngtCompound [ref]="lodRef" (beforeRender)="onLODBeforeRender($event)">
|
|
121
122
|
<ng-content />
|
|
122
123
|
</ngt-lOD>
|
|
123
124
|
`,
|
|
124
125
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
125
126
|
}]
|
|
126
|
-
}], propDecorators: { lodRef: [{
|
|
127
|
+
}], ctorParameters: function () { return []; }, propDecorators: { lodRef: [{
|
|
127
128
|
type: Input
|
|
128
129
|
}], distances: [{
|
|
130
|
+
type: Input,
|
|
131
|
+
args: [{ required: true }]
|
|
132
|
+
}] } });
|
|
133
|
+
|
|
134
|
+
extend({ InstancedMesh, InstancedBufferAttribute });
|
|
135
|
+
const NGTS_INSTANCES_API = new InjectionToken('NgtsInstances API');
|
|
136
|
+
class NgtsInstances extends NgtSignalStore {
|
|
137
|
+
set range(range) {
|
|
138
|
+
this.set({ range });
|
|
139
|
+
}
|
|
140
|
+
set limit(limit) {
|
|
141
|
+
this.set({ limit });
|
|
142
|
+
}
|
|
143
|
+
set frames(frames) {
|
|
144
|
+
this.set({ frames });
|
|
145
|
+
}
|
|
146
|
+
#parentMatrix;
|
|
147
|
+
#instanceMatrix;
|
|
148
|
+
#tempMatrix;
|
|
149
|
+
#translation;
|
|
150
|
+
#rotation;
|
|
151
|
+
#scale;
|
|
152
|
+
#limit;
|
|
153
|
+
constructor() {
|
|
154
|
+
super({ limit: 1000, frames: Infinity });
|
|
155
|
+
this.nullRaycast = () => null;
|
|
156
|
+
this.DynamicDrawUsage = THREE.DynamicDrawUsage;
|
|
157
|
+
this.instancesRef = injectNgtRef();
|
|
158
|
+
this.#parentMatrix = new THREE.Matrix4();
|
|
159
|
+
this.#instanceMatrix = new THREE.Matrix4();
|
|
160
|
+
this.#tempMatrix = new THREE.Matrix4();
|
|
161
|
+
this.#translation = new THREE.Vector3();
|
|
162
|
+
this.#rotation = new THREE.Quaternion();
|
|
163
|
+
this.#scale = new THREE.Vector3();
|
|
164
|
+
this.#limit = this.select('limit');
|
|
165
|
+
this.matrices = computed(() => {
|
|
166
|
+
const limit = this.#limit();
|
|
167
|
+
const mArray = new Float32Array(limit * 16);
|
|
168
|
+
for (let i = 0; i < limit; i++)
|
|
169
|
+
this.#tempMatrix.identity().toArray(mArray, i * 16);
|
|
170
|
+
return mArray;
|
|
171
|
+
});
|
|
172
|
+
this.colors = computed(() => {
|
|
173
|
+
const limit = this.#limit();
|
|
174
|
+
return new Float32Array([...new Array(limit * 3)].map(() => 1));
|
|
175
|
+
});
|
|
176
|
+
this.instances = signal([]);
|
|
177
|
+
this.api = computed(() => ({
|
|
178
|
+
getParent: () => this.instancesRef,
|
|
179
|
+
subscribe: (ref) => {
|
|
180
|
+
this.instances.update((prev) => [...prev, ref]);
|
|
181
|
+
return () => this.instances.update((prev) => prev.filter((instance) => instance.nativeElement !== ref.nativeElement));
|
|
182
|
+
},
|
|
183
|
+
}));
|
|
184
|
+
requestAnimationInInjectionContext(() => {
|
|
185
|
+
this.#checkUpdate();
|
|
186
|
+
this.#setBeforeRender();
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
#checkUpdate() {
|
|
190
|
+
effect(() => {
|
|
191
|
+
const instances = this.instancesRef.nativeElement;
|
|
192
|
+
if (!instances)
|
|
193
|
+
return;
|
|
194
|
+
checkUpdate(instances.instanceMatrix);
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
#setBeforeRender() {
|
|
198
|
+
let count = 0;
|
|
199
|
+
let updateRange = 0;
|
|
200
|
+
injectBeforeRender(() => {
|
|
201
|
+
const instances = this.instancesRef.nativeElement;
|
|
202
|
+
if (!instances)
|
|
203
|
+
return;
|
|
204
|
+
const { frames, range, limit } = this.get();
|
|
205
|
+
const meshes = this.instances();
|
|
206
|
+
const colors = this.colors();
|
|
207
|
+
const matrices = this.matrices();
|
|
208
|
+
if (frames === Infinity || count < frames) {
|
|
209
|
+
instances.updateMatrix();
|
|
210
|
+
instances.updateMatrixWorld();
|
|
211
|
+
this.#parentMatrix.copy(instances.matrixWorld).invert();
|
|
212
|
+
updateRange = Math.min(limit, range !== undefined ? range : limit, meshes.length);
|
|
213
|
+
instances.count = updateRange;
|
|
214
|
+
instances.instanceMatrix.updateRange.count = updateRange * 16;
|
|
215
|
+
if (instances.instanceColor) {
|
|
216
|
+
instances.instanceColor.updateRange.count = updateRange * 3;
|
|
217
|
+
}
|
|
218
|
+
for (let i = 0; i < meshes.length; i++) {
|
|
219
|
+
const instance = meshes[i].nativeElement;
|
|
220
|
+
// Multiply the inverse of the InstancedMesh world matrix or else
|
|
221
|
+
// Instances will be double-transformed if <Instances> isn't at identity
|
|
222
|
+
instance.matrixWorld.decompose(this.#translation, this.#rotation, this.#scale);
|
|
223
|
+
this.#instanceMatrix
|
|
224
|
+
.compose(this.#translation, this.#rotation, this.#scale)
|
|
225
|
+
.premultiply(this.#parentMatrix);
|
|
226
|
+
this.#instanceMatrix.toArray(matrices, i * 16);
|
|
227
|
+
instances.instanceMatrix.needsUpdate = true;
|
|
228
|
+
instance.color.toArray(colors, i * 3);
|
|
229
|
+
if (instances.instanceColor) {
|
|
230
|
+
checkUpdate(instances.instanceColor);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
count++;
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsInstances, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
238
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsInstances, isStandalone: true, selector: "ngts-instances", inputs: { instancesRef: "instancesRef", range: "range", limit: "limit", frames: "frames" }, providers: [
|
|
239
|
+
{ provide: NGTS_INSTANCES_API, useFactory: (instances) => instances.api, deps: [NgtsInstances] },
|
|
240
|
+
], usesInheritance: true, ngImport: i0, template: `
|
|
241
|
+
<ngt-instanced-mesh
|
|
242
|
+
*args="[undefined, undefined, 0]"
|
|
243
|
+
ngtCompound
|
|
244
|
+
[ref]="instancesRef"
|
|
245
|
+
[matrixAutoUpdate]="false"
|
|
246
|
+
[raycast]="nullRaycast"
|
|
247
|
+
[userData]="{ instances }"
|
|
248
|
+
>
|
|
249
|
+
<ngt-instanced-buffer-attribute
|
|
250
|
+
attach="instanceMatrix"
|
|
251
|
+
[count]="matrices().length / 16"
|
|
252
|
+
[array]="matrices()"
|
|
253
|
+
[itemSize]="16"
|
|
254
|
+
[usage]="DynamicDrawUsage"
|
|
255
|
+
/>
|
|
256
|
+
<ngt-instanced-buffer-attribute
|
|
257
|
+
attach="instanceColor"
|
|
258
|
+
[count]="colors().length / 3"
|
|
259
|
+
[array]="colors()"
|
|
260
|
+
[itemSize]="3"
|
|
261
|
+
[usage]="DynamicDrawUsage"
|
|
262
|
+
/>
|
|
263
|
+
|
|
264
|
+
<ng-content />
|
|
265
|
+
</ngt-instanced-mesh>
|
|
266
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "[args]", inputs: ["args"] }] }); }
|
|
267
|
+
}
|
|
268
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsInstances, decorators: [{
|
|
269
|
+
type: Component,
|
|
270
|
+
args: [{
|
|
271
|
+
selector: 'ngts-instances',
|
|
272
|
+
standalone: true,
|
|
273
|
+
template: `
|
|
274
|
+
<ngt-instanced-mesh
|
|
275
|
+
*args="[undefined, undefined, 0]"
|
|
276
|
+
ngtCompound
|
|
277
|
+
[ref]="instancesRef"
|
|
278
|
+
[matrixAutoUpdate]="false"
|
|
279
|
+
[raycast]="nullRaycast"
|
|
280
|
+
[userData]="{ instances }"
|
|
281
|
+
>
|
|
282
|
+
<ngt-instanced-buffer-attribute
|
|
283
|
+
attach="instanceMatrix"
|
|
284
|
+
[count]="matrices().length / 16"
|
|
285
|
+
[array]="matrices()"
|
|
286
|
+
[itemSize]="16"
|
|
287
|
+
[usage]="DynamicDrawUsage"
|
|
288
|
+
/>
|
|
289
|
+
<ngt-instanced-buffer-attribute
|
|
290
|
+
attach="instanceColor"
|
|
291
|
+
[count]="colors().length / 3"
|
|
292
|
+
[array]="colors()"
|
|
293
|
+
[itemSize]="3"
|
|
294
|
+
[usage]="DynamicDrawUsage"
|
|
295
|
+
/>
|
|
296
|
+
|
|
297
|
+
<ng-content />
|
|
298
|
+
</ngt-instanced-mesh>
|
|
299
|
+
`,
|
|
300
|
+
imports: [NgtArgs],
|
|
301
|
+
providers: [
|
|
302
|
+
{ provide: NGTS_INSTANCES_API, useFactory: (instances) => instances.api, deps: [NgtsInstances] },
|
|
303
|
+
],
|
|
304
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
305
|
+
}]
|
|
306
|
+
}], ctorParameters: function () { return []; }, propDecorators: { instancesRef: [{
|
|
307
|
+
type: Input
|
|
308
|
+
}], range: [{
|
|
309
|
+
type: Input,
|
|
310
|
+
args: [{ required: true }]
|
|
311
|
+
}], limit: [{
|
|
312
|
+
type: Input
|
|
313
|
+
}], frames: [{
|
|
129
314
|
type: Input
|
|
130
315
|
}] } });
|
|
131
316
|
|
|
132
|
-
|
|
317
|
+
const _instanceLocalMatrix = /*@__PURE__*/ new THREE.Matrix4();
|
|
318
|
+
const _instanceWorldMatrix = /*@__PURE__*/ new THREE.Matrix4();
|
|
319
|
+
const _instanceIntersects = [];
|
|
320
|
+
const _mesh = /*@__PURE__*/ new THREE.Mesh();
|
|
321
|
+
class PositionMesh extends THREE.Group {
|
|
133
322
|
constructor() {
|
|
134
|
-
super(
|
|
135
|
-
this.
|
|
136
|
-
this.
|
|
137
|
-
|
|
138
|
-
|
|
323
|
+
super();
|
|
324
|
+
this.color = new THREE.Color('white');
|
|
325
|
+
this.instance = new ElementRef(undefined);
|
|
326
|
+
this.instanceKey = new ElementRef(undefined);
|
|
327
|
+
}
|
|
328
|
+
// This will allow the virtual instance have bounds
|
|
329
|
+
get geometry() {
|
|
330
|
+
return this.instance.nativeElement?.geometry;
|
|
139
331
|
}
|
|
332
|
+
// And this will allow the virtual instance to receive events
|
|
333
|
+
raycast(raycaster, intersects) {
|
|
334
|
+
const parent = this.instance.nativeElement;
|
|
335
|
+
if (!parent)
|
|
336
|
+
return;
|
|
337
|
+
if (!parent.geometry || !parent.material)
|
|
338
|
+
return;
|
|
339
|
+
_mesh.geometry = parent.geometry;
|
|
340
|
+
const matrixWorld = parent.matrixWorld;
|
|
341
|
+
const instanceId = parent.userData['instances']().indexOf(this.instanceKey);
|
|
342
|
+
// If the instance wasn't found or exceeds the parents draw range, bail out
|
|
343
|
+
if (instanceId === -1 || instanceId > parent.count)
|
|
344
|
+
return;
|
|
345
|
+
// calculate the world matrix for each instance
|
|
346
|
+
parent.getMatrixAt(instanceId, _instanceLocalMatrix);
|
|
347
|
+
_instanceWorldMatrix.multiplyMatrices(matrixWorld, _instanceLocalMatrix);
|
|
348
|
+
// the mesh represents this single instance
|
|
349
|
+
_mesh.matrixWorld = _instanceWorldMatrix;
|
|
350
|
+
// raycast side according to instance material
|
|
351
|
+
if (parent.material instanceof THREE.Material)
|
|
352
|
+
_mesh.material.side = parent.material.side;
|
|
353
|
+
else
|
|
354
|
+
_mesh.material.side = parent.material[0].side;
|
|
355
|
+
_mesh.raycast(raycaster, _instanceIntersects);
|
|
356
|
+
// process the result of raycast
|
|
357
|
+
for (let i = 0, l = _instanceIntersects.length; i < l; i++) {
|
|
358
|
+
const intersect = _instanceIntersects[i];
|
|
359
|
+
intersect.instanceId = instanceId;
|
|
360
|
+
intersect.object = this;
|
|
361
|
+
intersects.push(intersect);
|
|
362
|
+
}
|
|
363
|
+
_instanceIntersects.length = 0;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
extend({ PositionMesh });
|
|
368
|
+
class NgtsInstance {
|
|
369
|
+
constructor() {
|
|
370
|
+
this.positionMeshRef = injectNgtRef();
|
|
371
|
+
this.instancesApi = inject(NGTS_INSTANCES_API);
|
|
372
|
+
requestAnimationInInjectionContext(() => {
|
|
373
|
+
effect((onCleanup) => {
|
|
374
|
+
onCleanup(this.instancesApi().subscribe(this.positionMeshRef));
|
|
375
|
+
});
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsInstance, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
379
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsInstance, isStandalone: true, selector: "ngts-instance", ngImport: i0, template: `
|
|
380
|
+
<ngt-position-mesh
|
|
381
|
+
ngtCompound
|
|
382
|
+
[ref]="positionMeshRef"
|
|
383
|
+
[instanceKey]="positionMeshRef"
|
|
384
|
+
[instance]="instancesApi().getParent()"
|
|
385
|
+
>
|
|
386
|
+
<ng-content />
|
|
387
|
+
</ngt-position-mesh>
|
|
388
|
+
`, isInline: true }); }
|
|
389
|
+
}
|
|
390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsInstance, decorators: [{
|
|
391
|
+
type: Component,
|
|
392
|
+
args: [{
|
|
393
|
+
selector: 'ngts-instance',
|
|
394
|
+
standalone: true,
|
|
395
|
+
template: `
|
|
396
|
+
<ngt-position-mesh
|
|
397
|
+
ngtCompound
|
|
398
|
+
[ref]="positionMeshRef"
|
|
399
|
+
[instanceKey]="positionMeshRef"
|
|
400
|
+
[instance]="instancesApi().getParent()"
|
|
401
|
+
>
|
|
402
|
+
<ng-content />
|
|
403
|
+
</ngt-position-mesh>
|
|
404
|
+
`,
|
|
405
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
406
|
+
}]
|
|
407
|
+
}], ctorParameters: function () { return []; } });
|
|
408
|
+
|
|
409
|
+
class NgtsStats extends NgtSignalStore {
|
|
140
410
|
set showPanel(showPanel) {
|
|
141
|
-
this.set({ showPanel
|
|
411
|
+
this.set({ showPanel });
|
|
142
412
|
}
|
|
143
413
|
set parent(parent) {
|
|
144
414
|
this.set({ parent: is.ref(parent) ? parent.nativeElement : parent });
|
|
@@ -149,41 +419,48 @@ class NgtsStats extends NgtRxStore {
|
|
|
149
419
|
set right(right) {
|
|
150
420
|
this.set({ right });
|
|
151
421
|
}
|
|
152
|
-
|
|
153
|
-
super
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
422
|
+
constructor() {
|
|
423
|
+
super({ showPanel: 0, right: false });
|
|
424
|
+
const document = inject(DOCUMENT);
|
|
425
|
+
const stats = Stats['default']
|
|
426
|
+
? new Stats['default']()
|
|
427
|
+
: new Stats();
|
|
428
|
+
const showPanel = this.select('showPanel');
|
|
429
|
+
const right = this.select('right');
|
|
430
|
+
const parent = this.select('parent');
|
|
431
|
+
const classes = this.select('classes');
|
|
432
|
+
const trigger = computed(() => ({
|
|
433
|
+
showPanel: showPanel(),
|
|
434
|
+
right: right(),
|
|
435
|
+
parent: parent(),
|
|
436
|
+
classes: classes(),
|
|
437
|
+
}));
|
|
438
|
+
effect((onCleanup) => {
|
|
439
|
+
const { showPanel, right, parent, classes } = trigger();
|
|
440
|
+
const node = parent ?? document.body;
|
|
441
|
+
stats.showPanel(showPanel);
|
|
442
|
+
node.appendChild(stats.dom);
|
|
166
443
|
if (classes) {
|
|
167
|
-
|
|
444
|
+
stats.dom.classList.add(...classes.split(' ').filter((cls) => cls));
|
|
168
445
|
}
|
|
169
446
|
if (right) {
|
|
170
|
-
|
|
171
|
-
|
|
447
|
+
stats.dom.style.right = '0px';
|
|
448
|
+
stats.dom.style.left = 'inherit';
|
|
172
449
|
}
|
|
173
450
|
else {
|
|
174
|
-
|
|
175
|
-
|
|
451
|
+
stats.dom.style.left = '0px';
|
|
452
|
+
stats.dom.style.right = 'inherit';
|
|
176
453
|
}
|
|
177
|
-
const begin = addEffect(() =>
|
|
178
|
-
const end = addAfterEffect(() =>
|
|
179
|
-
|
|
180
|
-
node.removeChild(
|
|
454
|
+
const begin = addEffect(() => stats.begin());
|
|
455
|
+
const end = addAfterEffect(() => stats.end());
|
|
456
|
+
onCleanup(() => {
|
|
457
|
+
node.removeChild(stats.dom);
|
|
181
458
|
begin();
|
|
182
459
|
end();
|
|
183
|
-
};
|
|
460
|
+
});
|
|
184
461
|
});
|
|
185
462
|
}
|
|
186
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsStats, deps:
|
|
463
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsStats, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
187
464
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: NgtsStats, isStandalone: true, selector: "ngts-stats", inputs: { showPanel: "showPanel", parent: "parent", classes: "classes", right: "right" }, usesInheritance: true, ngImport: i0 }); }
|
|
188
465
|
}
|
|
189
466
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsStats, decorators: [{
|
|
@@ -192,7 +469,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
|
|
|
192
469
|
selector: 'ngts-stats',
|
|
193
470
|
standalone: true,
|
|
194
471
|
}]
|
|
195
|
-
}], propDecorators: { showPanel: [{
|
|
472
|
+
}], ctorParameters: function () { return []; }, propDecorators: { showPanel: [{
|
|
196
473
|
type: Input
|
|
197
474
|
}], parent: [{
|
|
198
475
|
type: Input
|
|
@@ -206,5 +483,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
|
|
|
206
483
|
* Generated bundle index. Do not edit.
|
|
207
484
|
*/
|
|
208
485
|
|
|
209
|
-
export { NgtsAdaptiveDpr, NgtsAdaptiveEvents, NgtsDetailed, NgtsStats };
|
|
486
|
+
export { NGTS_INSTANCES_API, NgtsAdaptiveDpr, NgtsAdaptiveEvents, NgtsDetailed, NgtsInstance, NgtsInstances, NgtsStats };
|
|
210
487
|
//# sourceMappingURL=angular-three-soba-performance.mjs.map
|