angular-three-soba 2.0.0-beta.26 → 2.0.0-beta.261
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 +62 -4
- package/abstractions/README.md +278 -2
- package/abstractions/index.d.ts +11 -6
- package/abstractions/lib/catmull-rom-line.d.ts +648 -0
- package/abstractions/lib/cubic-bezier-line.d.ts +19 -0
- package/abstractions/lib/edges.d.ts +850 -0
- package/abstractions/lib/gradient-texture.d.ts +24 -0
- package/abstractions/lib/grid.d.ts +339 -0
- package/abstractions/lib/helper.d.ts +25 -0
- package/abstractions/lib/line.d.ts +41 -0
- package/abstractions/lib/prism-geometry.d.ts +30 -0
- package/abstractions/lib/quadratic-bezier-line.d.ts +21 -0
- package/abstractions/lib/text-3d.d.ts +338 -0
- package/abstractions/lib/text.d.ts +55 -0
- package/cameras/README.md +91 -2
- package/cameras/index.d.ts +4 -4
- package/cameras/lib/camera-content.d.ts +10 -0
- package/cameras/lib/cube-camera.d.ts +38 -0
- package/cameras/lib/orthographic-camera.d.ts +40 -0
- package/cameras/lib/perspective-camera.d.ts +36 -0
- package/controls/README.md +95 -2
- package/controls/index.d.ts +2 -1
- package/controls/lib/camera-controls.d.ts +31 -0
- package/controls/lib/orbit-controls.d.ts +38 -0
- package/esm2022/abstractions/index.mjs +12 -7
- package/esm2022/abstractions/lib/catmull-rom-line.mjs +76 -0
- package/esm2022/abstractions/lib/cubic-bezier-line.mjs +51 -0
- package/esm2022/abstractions/lib/edges.mjs +70 -0
- package/esm2022/abstractions/lib/gradient-texture.mjs +91 -0
- package/esm2022/abstractions/lib/grid.mjs +103 -0
- package/esm2022/abstractions/lib/helper.mjs +80 -0
- package/esm2022/abstractions/lib/line.mjs +123 -0
- package/esm2022/abstractions/lib/prism-geometry.mjs +55 -0
- package/esm2022/abstractions/lib/quadratic-bezier-line.mjs +73 -0
- package/esm2022/abstractions/lib/text-3d.mjs +98 -0
- package/esm2022/abstractions/lib/text.mjs +92 -0
- package/esm2022/cameras/index.mjs +5 -5
- package/esm2022/cameras/lib/camera-content.mjs +14 -0
- package/esm2022/cameras/lib/cube-camera.mjs +111 -0
- package/esm2022/cameras/lib/orthographic-camera.mjs +131 -0
- package/esm2022/cameras/lib/perspective-camera.mjs +104 -0
- package/esm2022/controls/index.mjs +3 -2
- package/esm2022/controls/lib/camera-controls.mjs +127 -0
- package/esm2022/controls/lib/orbit-controls.mjs +126 -0
- package/esm2022/loaders/index.mjs +6 -5
- package/esm2022/loaders/lib/font-loader.mjs +49 -0
- package/esm2022/loaders/lib/gltf-loader.mjs +33 -0
- package/esm2022/loaders/lib/loader.mjs +109 -0
- package/esm2022/loaders/lib/progress.mjs +51 -0
- package/esm2022/loaders/lib/texture-loader.mjs +32 -0
- package/esm2022/materials/index.mjs +7 -7
- package/esm2022/materials/lib/custom-shader-material.mjs +71 -0
- package/esm2022/materials/lib/mesh-distort-material.mjs +42 -0
- package/esm2022/materials/lib/mesh-reflector-material.mjs +278 -0
- package/esm2022/materials/lib/mesh-refraction-material.mjs +144 -0
- package/esm2022/materials/lib/mesh-transmission-material.mjs +188 -0
- package/esm2022/materials/lib/mesh-wobble-material.mjs +42 -0
- package/esm2022/misc/index.mjs +10 -14
- package/esm2022/misc/lib/animations.mjs +74 -0
- package/esm2022/misc/lib/bake-shadows.mjs +26 -0
- package/esm2022/misc/lib/computed-attribute.mjs +56 -0
- package/esm2022/misc/lib/constants.mjs +5 -0
- package/esm2022/misc/lib/decal.mjs +135 -0
- package/esm2022/misc/lib/deprecated.mjs +15 -0
- package/esm2022/misc/lib/depth-buffer.mjs +39 -0
- package/esm2022/misc/lib/fbo.mjs +89 -0
- package/esm2022/misc/lib/sampler.mjs +121 -0
- package/esm2022/shaders/index.mjs +3 -18
- package/esm2022/shaders/lib/grid-material.mjs +81 -0
- package/esm2022/shaders/lib/mesh-refraction-material.mjs +163 -0
- package/esm2022/staging/index.mjs +19 -22
- package/esm2022/staging/lib/accumulative-shadows.mjs +182 -0
- package/esm2022/staging/lib/backdrop.mjs +73 -0
- package/esm2022/staging/lib/bb-anchor.mjs +58 -0
- package/esm2022/staging/lib/bounds.mjs +286 -0
- package/esm2022/staging/lib/camera-shake.mjs +69 -0
- package/esm2022/staging/lib/caustics.mjs +188 -0
- package/esm2022/staging/lib/center.mjs +113 -0
- package/esm2022/staging/lib/contact-shadows.mjs +201 -0
- package/esm2022/staging/lib/environment.mjs +465 -0
- package/esm2022/staging/lib/float.mjs +60 -0
- package/esm2022/staging/lib/lightformer.mjs +107 -0
- package/esm2022/staging/lib/matcap-texture.mjs +81 -0
- package/esm2022/staging/lib/normal-texture.mjs +85 -0
- package/esm2022/staging/lib/randomized-lights.mjs +104 -0
- package/esm2022/staging/lib/render-texture.mjs +213 -0
- package/esm2022/staging/lib/sky.mjs +86 -0
- package/esm2022/staging/lib/spot-light.mjs +450 -0
- package/esm2022/staging/lib/stage.mjs +236 -0
- package/esm2022/vanilla-exports/angular-three-soba-vanilla-exports.mjs +5 -0
- package/esm2022/vanilla-exports/index.mjs +3 -0
- package/fesm2022/angular-three-soba-abstractions.mjs +739 -718
- package/fesm2022/angular-three-soba-abstractions.mjs.map +1 -1
- package/fesm2022/angular-three-soba-cameras.mjs +260 -307
- package/fesm2022/angular-three-soba-cameras.mjs.map +1 -1
- package/fesm2022/angular-three-soba-controls.mjs +174 -110
- package/fesm2022/angular-three-soba-controls.mjs.map +1 -1
- package/fesm2022/angular-three-soba-loaders.mjs +151 -129
- package/fesm2022/angular-three-soba-loaders.mjs.map +1 -1
- package/fesm2022/angular-three-soba-materials.mjs +511 -764
- package/fesm2022/angular-three-soba-materials.mjs.map +1 -1
- package/fesm2022/angular-three-soba-misc.mjs +405 -2149
- package/fesm2022/angular-three-soba-misc.mjs.map +1 -1
- package/fesm2022/angular-three-soba-shaders.mjs +33 -1373
- package/fesm2022/angular-three-soba-shaders.mjs.map +1 -1
- package/fesm2022/angular-three-soba-staging.mjs +2329 -3538
- package/fesm2022/angular-three-soba-staging.mjs.map +1 -1
- package/fesm2022/angular-three-soba-vanilla-exports.mjs +6 -0
- package/fesm2022/angular-three-soba-vanilla-exports.mjs.map +1 -0
- package/loaders/README.md +130 -2
- package/loaders/index.d.ts +5 -4
- package/loaders/lib/font-loader.d.ts +27 -0
- package/loaders/lib/gltf-loader.d.ts +21 -0
- package/loaders/lib/loader.d.ts +29 -0
- package/loaders/lib/progress.d.ts +9 -0
- package/loaders/lib/texture-loader.d.ts +13 -0
- package/materials/README.md +160 -2
- package/materials/index.d.ts +6 -6
- package/materials/lib/custom-shader-material.d.ts +19 -0
- package/materials/lib/mesh-distort-material.d.ts +18 -0
- package/materials/lib/mesh-reflector-material.d.ts +50 -0
- package/materials/lib/mesh-refraction-material.d.ts +42 -0
- package/materials/lib/mesh-transmission-material.d.ts +77 -0
- package/materials/lib/mesh-wobble-material.d.ts +15 -0
- package/metadata.json +1 -1
- package/misc/README.md +217 -2
- package/misc/index.d.ts +9 -13
- package/misc/lib/animations.d.ts +14 -0
- package/misc/lib/computed-attribute.d.ts +69 -0
- package/misc/lib/constants.d.ts +1 -0
- package/misc/lib/decal.d.ts +27 -0
- package/misc/lib/deprecated.d.ts +14 -0
- package/misc/lib/depth-buffer.d.ts +8 -0
- package/misc/lib/fbo.d.ts +47 -0
- package/misc/lib/sampler.d.ts +73 -0
- package/package.json +60 -38
- package/shaders/index.d.ts +2 -17
- package/shaders/lib/grid-material.d.ts +69 -0
- package/shaders/lib/mesh-refraction-material.d.ts +11 -0
- package/staging/README.md +472 -2
- package/staging/index.d.ts +18 -21
- package/staging/lib/accumulative-shadows.d.ts +75 -0
- package/staging/lib/backdrop.d.ts +22 -0
- package/staging/lib/bb-anchor.d.ts +17 -0
- package/staging/lib/bounds.d.ts +47 -0
- package/staging/lib/camera-shake.d.ts +29 -0
- package/staging/lib/caustics.d.ts +53 -0
- package/staging/lib/center.d.ts +422 -0
- package/staging/lib/contact-shadows.d.ts +45 -0
- package/staging/lib/environment.d.ts +159 -0
- package/staging/lib/float.d.ts +19 -0
- package/staging/lib/lightformer.d.ts +334 -0
- package/staging/lib/matcap-texture.d.ts +32 -0
- package/staging/lib/normal-texture.d.ts +37 -0
- package/staging/lib/randomized-lights.d.ts +54 -0
- package/staging/lib/render-texture.d.ts +64 -0
- package/staging/lib/sky.d.ts +32 -0
- package/staging/lib/spot-light.d.ts +120 -0
- package/staging/lib/stage.d.ts +376 -0
- package/vanilla-exports/README.md +3 -0
- package/vanilla-exports/index.d.ts +27 -0
- package/web-types.json +1 -1
- package/abstractions/billboard/billboard.d.ts +0 -28
- package/abstractions/detailed/detailed.d.ts +0 -26
- package/abstractions/edges/edges.d.ts +0 -34
- package/abstractions/grid/grid.d.ts +0 -50
- package/abstractions/text/text.d.ts +0 -82
- package/abstractions/text-3d/text-3d.d.ts +0 -84
- package/assets/distort.vert.glsl +0 -1
- package/cameras/camera/camera-content.d.ts +0 -13
- package/cameras/camera/camera.d.ts +0 -26
- package/cameras/cube-camera/cube-camera.d.ts +0 -69
- package/cameras/orthographic-camera/orthographic-camera.d.ts +0 -37
- package/cameras/perspective-camera/perspective-camera.d.ts +0 -18
- package/controls/orbit-controls/orbit-controls.d.ts +0 -54
- package/esm2022/abstractions/billboard/billboard.mjs +0 -74
- package/esm2022/abstractions/detailed/detailed.mjs +0 -64
- package/esm2022/abstractions/edges/edges.mjs +0 -88
- package/esm2022/abstractions/grid/grid.mjs +0 -180
- package/esm2022/abstractions/text/text.mjs +0 -274
- package/esm2022/abstractions/text-3d/text-3d.mjs +0 -172
- package/esm2022/cameras/camera/camera-content.mjs +0 -21
- package/esm2022/cameras/camera/camera.mjs +0 -77
- package/esm2022/cameras/cube-camera/cube-camera.mjs +0 -161
- package/esm2022/cameras/orthographic-camera/orthographic-camera.mjs +0 -102
- package/esm2022/cameras/perspective-camera/perspective-camera.mjs +0 -46
- package/esm2022/controls/orbit-controls/orbit-controls.mjs +0 -185
- package/esm2022/gizmos/angular-three-soba-gizmos.mjs +0 -5
- package/esm2022/gizmos/gizmo-helper/gizmo-helper.mjs +0 -197
- package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/constants.mjs +0 -31
- package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.mjs +0 -93
- package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.mjs +0 -150
- package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-input.mjs +0 -66
- package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube.mjs +0 -71
- package/esm2022/gizmos/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.mjs +0 -195
- package/esm2022/gizmos/gizmo-helper/gizmo-viewport/gizmo-viewport.mjs +0 -272
- package/esm2022/gizmos/index.mjs +0 -4
- package/esm2022/loaders/gltf-loader/gltf-loader.mjs +0 -30
- package/esm2022/loaders/loader/loader.mjs +0 -138
- package/esm2022/loaders/progress/progress.mjs +0 -52
- package/esm2022/loaders/texture-loader/texture-loader.mjs +0 -28
- package/esm2022/materials/mesh-distort-material/mesh-distort-material.mjs +0 -82
- package/esm2022/materials/mesh-reflector-material/mesh-reflector-material.mjs +0 -367
- package/esm2022/materials/mesh-refraction-material/mesh-refraction-material.mjs +0 -171
- package/esm2022/materials/mesh-transmission-material/mesh-transmission-material.mjs +0 -278
- package/esm2022/materials/mesh-wobble-material/mesh-wobble-material.mjs +0 -68
- package/esm2022/materials/point-material/point-material.mjs +0 -50
- package/esm2022/misc/animations/animations.mjs +0 -59
- package/esm2022/misc/bake-shadows/bake-shadows.mjs +0 -24
- package/esm2022/misc/caustics/caustics.mjs +0 -387
- package/esm2022/misc/decal/decal.mjs +0 -187
- package/esm2022/misc/depth-buffer/depth-buffer.mjs +0 -44
- package/esm2022/misc/example/example.mjs +0 -160
- package/esm2022/misc/fbo/fbo.mjs +0 -47
- package/esm2022/misc/html/html-wrapper.mjs +0 -478
- package/esm2022/misc/html/html.mjs +0 -304
- package/esm2022/misc/sampler/sampler.mjs +0 -142
- package/esm2022/misc/shadow/shadow.mjs +0 -111
- package/esm2022/misc/stats-gl/stats-gl.mjs +0 -61
- package/esm2022/misc/trail/trail.mjs +0 -209
- package/esm2022/misc/trail-texture/inject-trail-texture.mjs +0 -17
- package/esm2022/misc/trail-texture/trail-texture.mjs +0 -106
- package/esm2022/modifiers/angular-three-soba-modifiers.mjs +0 -5
- package/esm2022/modifiers/curve-modifier/curve-modifier.mjs +0 -64
- package/esm2022/modifiers/index.mjs +0 -2
- package/esm2022/performances/adaptive-dpr/adaptive-dpr.mjs +0 -44
- package/esm2022/performances/adaptive-events/adaptive-events.mjs +0 -27
- package/esm2022/performances/angular-three-soba-performances.mjs +0 -5
- package/esm2022/performances/index.mjs +0 -8
- package/esm2022/performances/instances/instances.mjs +0 -220
- package/esm2022/performances/instances/position-mesh.mjs +0 -52
- package/esm2022/performances/points/points-input.mjs +0 -64
- package/esm2022/performances/points/points.mjs +0 -326
- package/esm2022/performances/points/position-point.mjs +0 -54
- package/esm2022/performances/segments/segment-object.mjs +0 -9
- package/esm2022/performances/segments/segments.mjs +0 -182
- package/esm2022/shaders/blur-pass/blur-pass.mjs +0 -61
- package/esm2022/shaders/caustics/caustics-material.mjs +0 -130
- package/esm2022/shaders/caustics/caustics-projection-material.mjs +0 -31
- package/esm2022/shaders/convolution-material/convolution-material.mjs +0 -94
- package/esm2022/shaders/discard-material/discard-material.mjs +0 -3
- package/esm2022/shaders/grid-material/grid-material.mjs +0 -77
- package/esm2022/shaders/mesh-distort-material/mesh-distort-material.mjs +0 -56
- package/esm2022/shaders/mesh-reflector-material/mesh-reflector-material.mjs +0 -223
- package/esm2022/shaders/mesh-refraction-material/mesh-refraction-material.mjs +0 -170
- package/esm2022/shaders/mesh-transmission-material/mesh-transmission-material.mjs +0 -268
- package/esm2022/shaders/mesh-wobble-material/mesh-wobble-material.mjs +0 -37
- package/esm2022/shaders/shader-material/shader-material.mjs +0 -34
- package/esm2022/shaders/soft-shadow-material/soft-shadow-material.mjs +0 -25
- package/esm2022/shaders/sparkles-material/sparkles-material.mjs +0 -33
- package/esm2022/shaders/spot-light-material/spot-light-material.mjs +0 -86
- package/esm2022/shaders/star-field-material/star-field-material.mjs +0 -33
- package/esm2022/shaders/wireframe-material/wireframe-material.mjs +0 -247
- package/esm2022/staging/accumulative-shadows/accumulative-shadows.mjs +0 -267
- package/esm2022/staging/accumulative-shadows/progressive-light-map.mjs +0 -108
- package/esm2022/staging/accumulative-shadows/randomized-lights.mjs +0 -206
- package/esm2022/staging/backdrop/backdrop.mjs +0 -77
- package/esm2022/staging/bb-anchor/bb-anchor.mjs +0 -69
- package/esm2022/staging/bounds/bounds.mjs +0 -308
- package/esm2022/staging/camera-shake/camera-shake.mjs +0 -123
- package/esm2022/staging/center/center.mjs +0 -165
- package/esm2022/staging/cloud/cloud.mjs +0 -158
- package/esm2022/staging/contact-shadows/contact-shadows.mjs +0 -246
- package/esm2022/staging/environment/assets.mjs +0 -13
- package/esm2022/staging/environment/environment-cube.mjs +0 -47
- package/esm2022/staging/environment/environment-ground.mjs +0 -41
- package/esm2022/staging/environment/environment-input.mjs +0 -119
- package/esm2022/staging/environment/environment-map.mjs +0 -53
- package/esm2022/staging/environment/environment-portal.mjs +0 -113
- package/esm2022/staging/environment/environment.mjs +0 -61
- package/esm2022/staging/environment/utils.mjs +0 -106
- package/esm2022/staging/float/float.mjs +0 -94
- package/esm2022/staging/matcap-texture/matcap-texture.mjs +0 -64
- package/esm2022/staging/normal-texture/normal-texture.mjs +0 -53
- package/esm2022/staging/sky/sky.mjs +0 -119
- package/esm2022/staging/sparkles/sparkles.mjs +0 -164
- package/esm2022/staging/spot-light/shadow-mesh-input.mjs +0 -63
- package/esm2022/staging/spot-light/shadow-mesh.mjs +0 -266
- package/esm2022/staging/spot-light/spot-light-input.mjs +0 -84
- package/esm2022/staging/spot-light/spot-light.mjs +0 -81
- package/esm2022/staging/spot-light/volumetric-mesh.mjs +0 -98
- package/esm2022/staging/stage/stage.mjs +0 -389
- package/esm2022/staging/stars/stars.mjs +0 -147
- package/esm2022/staging/wireframe/wireframe-input.mjs +0 -191
- package/esm2022/staging/wireframe/wireframe.mjs +0 -228
- package/esm2022/utils/angular-three-soba-utils.mjs +0 -5
- package/esm2022/utils/content/content.mjs +0 -15
- package/esm2022/utils/index.mjs +0 -2
- package/fesm2022/angular-three-soba-gizmos.mjs +0 -1043
- package/fesm2022/angular-three-soba-gizmos.mjs.map +0 -1
- package/fesm2022/angular-three-soba-modifiers.mjs +0 -71
- package/fesm2022/angular-three-soba-modifiers.mjs.map +0 -1
- package/fesm2022/angular-three-soba-performances.mjs +0 -956
- package/fesm2022/angular-three-soba-performances.mjs.map +0 -1
- package/fesm2022/angular-three-soba-utils.mjs +0 -22
- package/fesm2022/angular-three-soba-utils.mjs.map +0 -1
- package/gizmos/README.md +0 -3
- package/gizmos/gizmo-helper/gizmo-helper.d.ts +0 -69
- package/gizmos/gizmo-helper/gizmo-viewcube/constants.d.ts +0 -12
- package/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.d.ts +0 -22
- package/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.d.ts +0 -29
- package/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-input.d.ts +0 -33
- package/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube.d.ts +0 -10
- package/gizmos/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.d.ts +0 -40
- package/gizmos/gizmo-helper/gizmo-viewport/gizmo-viewport.d.ts +0 -30
- package/gizmos/index.d.ts +0 -3
- package/loaders/gltf-loader/gltf-loader.d.ts +0 -10
- package/loaders/loader/loader.d.ts +0 -33
- package/loaders/progress/progress.d.ts +0 -9
- package/loaders/texture-loader/texture-loader.d.ts +0 -7
- package/materials/mesh-distort-material/mesh-distort-material.d.ts +0 -40
- package/materials/mesh-reflector-material/mesh-reflector-material.d.ts +0 -99
- package/materials/mesh-refraction-material/mesh-refraction-material.d.ts +0 -62
- package/materials/mesh-transmission-material/mesh-transmission-material.d.ts +0 -107
- package/materials/mesh-wobble-material/mesh-wobble-material.d.ts +0 -29
- package/materials/point-material/point-material.d.ts +0 -24
- package/misc/animations/animations.d.ts +0 -15
- package/misc/caustics/caustics.d.ts +0 -87
- package/misc/decal/decal.d.ts +0 -49
- package/misc/depth-buffer/depth-buffer.d.ts +0 -9
- package/misc/example/example.d.ts +0 -81
- package/misc/fbo/fbo.d.ts +0 -17
- package/misc/html/html-wrapper.d.ts +0 -559
- package/misc/html/html.d.ts +0 -214
- package/misc/sampler/sampler.d.ts +0 -67
- package/misc/shadow/shadow.d.ts +0 -37
- package/misc/stats-gl/stats-gl.d.ts +0 -24
- package/misc/trail/trail.d.ts +0 -57
- package/misc/trail-texture/inject-trail-texture.d.ts +0 -9
- package/misc/trail-texture/trail-texture.d.ts +0 -50
- package/modifiers/README.md +0 -3
- package/modifiers/curve-modifier/curve-modifier.d.ts +0 -23
- package/modifiers/index.d.ts +0 -1
- package/performances/README.md +0 -3
- package/performances/adaptive-dpr/adaptive-dpr.d.ts +0 -14
- package/performances/adaptive-events/adaptive-events.d.ts +0 -9
- package/performances/index.d.ts +0 -7
- package/performances/instances/instances.d.ts +0 -79
- package/performances/instances/position-mesh.d.ts +0 -10
- package/performances/points/points-input.d.ts +0 -32
- package/performances/points/points.d.ts +0 -92
- package/performances/points/position-point.d.ts +0 -11
- package/performances/segments/segment-object.d.ts +0 -7
- package/performances/segments/segments.d.ts +0 -124
- package/shaders/blur-pass/blur-pass.d.ts +0 -23
- package/shaders/caustics/caustics-material.d.ts +0 -4
- package/shaders/caustics/caustics-projection-material.d.ts +0 -4
- package/shaders/convolution-material/convolution-material.d.ts +0 -7
- package/shaders/discard-material/discard-material.d.ts +0 -3
- package/shaders/grid-material/grid-material.d.ts +0 -37
- package/shaders/mesh-distort-material/mesh-distort-material.d.ts +0 -295
- package/shaders/mesh-reflector-material/mesh-reflector-material.d.ts +0 -50
- package/shaders/mesh-refraction-material/mesh-refraction-material.d.ts +0 -4
- package/shaders/mesh-transmission-material/mesh-transmission-material.d.ts +0 -25
- package/shaders/mesh-wobble-material/mesh-wobble-material.d.ts +0 -16
- package/shaders/shader-material/shader-material.d.ts +0 -6
- package/shaders/soft-shadow-material/soft-shadow-material.d.ts +0 -19
- package/shaders/sparkles-material/sparkles-material.d.ts +0 -17
- package/shaders/spot-light-material/spot-light-material.d.ts +0 -13
- package/shaders/star-field-material/star-field-material.d.ts +0 -13
- package/shaders/wireframe-material/wireframe-material.d.ts +0 -58
- package/staging/accumulative-shadows/accumulative-shadows.d.ts +0 -146
- package/staging/accumulative-shadows/progressive-light-map.d.ts +0 -34
- package/staging/accumulative-shadows/randomized-lights.d.ts +0 -90
- package/staging/backdrop/backdrop.d.ts +0 -30
- package/staging/bb-anchor/bb-anchor.d.ts +0 -27
- package/staging/bounds/bounds.d.ts +0 -134
- package/staging/camera-shake/camera-shake.d.ts +0 -43
- package/staging/center/center.d.ts +0 -70
- package/staging/cloud/cloud.d.ts +0 -51
- package/staging/contact-shadows/contact-shadows.d.ts +0 -70
- package/staging/environment/assets.d.ts +0 -13
- package/staging/environment/environment-cube.d.ts +0 -15
- package/staging/environment/environment-ground.d.ts +0 -13
- package/staging/environment/environment-input.d.ts +0 -68
- package/staging/environment/environment-map.d.ts +0 -16
- package/staging/environment/environment-portal.d.ts +0 -18
- package/staging/environment/environment.d.ts +0 -8
- package/staging/environment/utils.d.ts +0 -7
- package/staging/float/float.d.ts +0 -31
- package/staging/matcap-texture/matcap-texture.d.ts +0 -13
- package/staging/normal-texture/normal-texture.d.ts +0 -16
- package/staging/sky/sky.d.ts +0 -48
- package/staging/sparkles/sparkles.d.ts +0 -63
- package/staging/spot-light/shadow-mesh-input.d.ts +0 -29
- package/staging/spot-light/shadow-mesh.d.ts +0 -37
- package/staging/spot-light/spot-light-input.d.ts +0 -38
- package/staging/spot-light/spot-light.d.ts +0 -39
- package/staging/spot-light/volumetric-mesh.d.ts +0 -24
- package/staging/stage/stage.d.ts +0 -130
- package/staging/stars/stars.d.ts +0 -45
- package/staging/wireframe/wireframe-input.d.ts +0 -65
- package/staging/wireframe/wireframe.d.ts +0 -28
- package/utils/README.md +0 -3
- package/utils/content/content.d.ts +0 -8
- package/utils/index.d.ts +0 -1
- /package/misc/{bake-shadows → lib}/bake-shadows.d.ts +0 -0
|
@@ -1,838 +1,859 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { input, viewChild, computed, afterNextRender, Component, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, untracked, inject, signal, output, DestroyRef } from '@angular/core';
|
|
3
|
+
import { omit, injectStore, pick, checkNeedsUpdate, NgtArgs, getLocalState, extend, injectBeforeRender, resolveRef } from 'angular-three';
|
|
4
|
+
import { mergeInputs } from 'ngxtension/inject-inputs';
|
|
5
|
+
import { Vector3, Vector4, Vector2, Color, CatmullRomCurve3, CubicBezierCurve3, EdgesGeometry, CanvasTexture, BackSide, Plane, Mesh, PlaneGeometry, Object3D, Shape, ExtrudeGeometry, QuadraticBezierCurve3 } from 'three';
|
|
6
|
+
import { injectAutoEffect } from 'ngxtension/auto-effect';
|
|
7
|
+
import { LineSegments2, Line2, LineMaterial, LineSegmentsGeometry, LineGeometry, TextGeometry, mergeVertices } from 'three-stdlib';
|
|
8
|
+
import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
|
|
8
9
|
import { GridMaterial } from 'angular-three-soba/shaders';
|
|
9
|
-
import {
|
|
10
|
+
import { assertInjector } from 'ngxtension/assert-injector';
|
|
10
11
|
import { Text, preloadFont } from 'troika-three-text';
|
|
12
|
+
import { injectFont } from 'angular-three-soba/loaders';
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
this.inputs.set({ lockY });
|
|
22
|
-
}
|
|
23
|
-
set _lockZ(lockZ) {
|
|
24
|
-
this.inputs.set({ lockZ });
|
|
14
|
+
const defaultOptions$9 = {
|
|
15
|
+
lineWidth: 1,
|
|
16
|
+
segments: false,
|
|
17
|
+
color: 0xffffff,
|
|
18
|
+
};
|
|
19
|
+
class NgtsLine {
|
|
20
|
+
// NOTE: use attached event to call computeLineDistances to ensure the geometry has been attached
|
|
21
|
+
onGeometryAttached({ parent }) {
|
|
22
|
+
parent.computeLineDistances();
|
|
25
23
|
}
|
|
26
24
|
constructor() {
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
25
|
+
this.points = input.required();
|
|
26
|
+
this.options = input(defaultOptions$9, { transform: mergeInputs(defaultOptions$9) });
|
|
27
|
+
this.parameters = omit(this.options, ['color', 'vertexColors', 'lineWidth', 'segments', 'linewidth', 'dashed']);
|
|
28
|
+
this.line = viewChild('line');
|
|
29
|
+
this.store = injectStore();
|
|
30
|
+
this.size = this.store.select('size');
|
|
31
|
+
this.segments = pick(this.options, 'segments');
|
|
32
|
+
this.vertexColors = pick(this.options, 'vertexColors');
|
|
33
|
+
this.dashed = pick(this.options, 'dashed');
|
|
34
|
+
this.color = pick(this.options, 'color');
|
|
35
|
+
this.lineWidth = pick(this.options, 'lineWidth');
|
|
36
|
+
this.linewidth = pick(this.options, 'linewidth');
|
|
37
|
+
this.vertex = computed(() => Boolean(this.vertexColors()));
|
|
38
|
+
this.resolution = computed(() => [this.size().width, this.size().height]);
|
|
39
|
+
this.line2 = computed(() => (this.segments() ? new LineSegments2() : new Line2()));
|
|
40
|
+
this.lineMaterial = computed(() => new LineMaterial());
|
|
41
|
+
this.itemSize = computed(() => (this.vertexColors()?.[0]?.length === 4 ? 4 : 3));
|
|
42
|
+
this.lineGeometry = computed(() => {
|
|
43
|
+
const geom = this.segments() ? new LineSegmentsGeometry() : new LineGeometry();
|
|
44
|
+
const pValues = this.points().map((p) => {
|
|
45
|
+
const isArray = Array.isArray(p);
|
|
46
|
+
return p instanceof Vector3 || p instanceof Vector4
|
|
47
|
+
? [p.x, p.y, p.z]
|
|
48
|
+
: p instanceof Vector2
|
|
49
|
+
? [p.x, p.y, 0]
|
|
50
|
+
: isArray && p.length === 3
|
|
51
|
+
? [p[0], p[1], p[2]]
|
|
52
|
+
: isArray && p.length === 2
|
|
53
|
+
? [p[0], p[1], 0]
|
|
54
|
+
: p;
|
|
55
|
+
});
|
|
56
|
+
geom.setPositions(pValues.flat());
|
|
57
|
+
const vertexColors = this.vertexColors();
|
|
58
|
+
if (vertexColors) {
|
|
59
|
+
const cValues = vertexColors.map((c) => (c instanceof Color ? c.toArray() : c));
|
|
60
|
+
// @ts-expect-error - flat() isn't defined
|
|
61
|
+
geom.setColors(cValues.flat(), this.itemSize());
|
|
62
|
+
}
|
|
63
|
+
return geom;
|
|
64
|
+
});
|
|
65
|
+
const autoEffect = injectAutoEffect();
|
|
66
|
+
afterNextRender(() => {
|
|
67
|
+
autoEffect(() => {
|
|
68
|
+
const [lineMaterial, dashed] = [this.lineMaterial(), this.dashed()];
|
|
69
|
+
if (dashed) {
|
|
70
|
+
lineMaterial.defines['USE_DASH'] = '';
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
delete lineMaterial.defines['USE_DASH'];
|
|
74
|
+
}
|
|
75
|
+
checkNeedsUpdate(lineMaterial);
|
|
76
|
+
});
|
|
77
|
+
autoEffect(() => {
|
|
78
|
+
const lineGeometry = this.lineGeometry();
|
|
79
|
+
return () => lineGeometry.dispose();
|
|
80
|
+
});
|
|
45
81
|
});
|
|
46
82
|
}
|
|
47
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
48
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
49
|
-
<ngt-
|
|
83
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsLine, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
84
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.1.0", type: NgtsLine, isStandalone: true, selector: "ngts-line", inputs: { points: { classPropertyName: "points", publicName: "points", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "line", first: true, predicate: ["line"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
85
|
+
<ngt-primitive *args="[line2()]" #line [parameters]="parameters()">
|
|
86
|
+
<ngt-primitive *args="[lineGeometry()]" attach="geometry" (attached)="onGeometryAttached($any($event))" />
|
|
87
|
+
<ngt-primitive
|
|
88
|
+
*args="[lineMaterial()]"
|
|
89
|
+
attach="material"
|
|
90
|
+
[color]="color()"
|
|
91
|
+
[vertexColors]="vertex()"
|
|
92
|
+
[resolution]="resolution()"
|
|
93
|
+
[linewidth]="linewidth() ?? lineWidth() ?? 1"
|
|
94
|
+
[dashed]="dashed()"
|
|
95
|
+
[transparent]="itemSize() === 4"
|
|
96
|
+
[parameters]="parameters()"
|
|
97
|
+
/>
|
|
50
98
|
<ng-content />
|
|
51
|
-
</ngt-
|
|
52
|
-
`, isInline: true }); }
|
|
99
|
+
</ngt-primitive>
|
|
100
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
53
101
|
}
|
|
54
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsLine, decorators: [{
|
|
55
103
|
type: Component,
|
|
56
104
|
args: [{
|
|
57
|
-
selector: 'ngts-
|
|
105
|
+
selector: 'ngts-line',
|
|
58
106
|
standalone: true,
|
|
59
107
|
template: `
|
|
60
|
-
<ngt-
|
|
108
|
+
<ngt-primitive *args="[line2()]" #line [parameters]="parameters()">
|
|
109
|
+
<ngt-primitive *args="[lineGeometry()]" attach="geometry" (attached)="onGeometryAttached($any($event))" />
|
|
110
|
+
<ngt-primitive
|
|
111
|
+
*args="[lineMaterial()]"
|
|
112
|
+
attach="material"
|
|
113
|
+
[color]="color()"
|
|
114
|
+
[vertexColors]="vertex()"
|
|
115
|
+
[resolution]="resolution()"
|
|
116
|
+
[linewidth]="linewidth() ?? lineWidth() ?? 1"
|
|
117
|
+
[dashed]="dashed()"
|
|
118
|
+
[transparent]="itemSize() === 4"
|
|
119
|
+
[parameters]="parameters()"
|
|
120
|
+
/>
|
|
61
121
|
<ng-content />
|
|
62
|
-
</ngt-
|
|
122
|
+
</ngt-primitive>
|
|
63
123
|
`,
|
|
64
124
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
125
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
126
|
+
imports: [NgtArgs],
|
|
65
127
|
}]
|
|
66
|
-
}], ctorParameters:
|
|
67
|
-
type: Input
|
|
68
|
-
}], _follow: [{
|
|
69
|
-
type: Input,
|
|
70
|
-
args: [{ alias: 'follow' }]
|
|
71
|
-
}], _lockX: [{
|
|
72
|
-
type: Input,
|
|
73
|
-
args: [{ alias: 'lockX' }]
|
|
74
|
-
}], _lockY: [{
|
|
75
|
-
type: Input,
|
|
76
|
-
args: [{ alias: 'lockY' }]
|
|
77
|
-
}], _lockZ: [{
|
|
78
|
-
type: Input,
|
|
79
|
-
args: [{ alias: 'lockZ' }]
|
|
80
|
-
}] } });
|
|
128
|
+
}], ctorParameters: () => [] });
|
|
81
129
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
130
|
+
const defaultOptions$8 = {
|
|
131
|
+
curveType: 'centripetal',
|
|
132
|
+
tension: 0.5,
|
|
133
|
+
segments: 20,
|
|
134
|
+
closed: false,
|
|
135
|
+
lineWidth: 1,
|
|
136
|
+
};
|
|
137
|
+
class NgtsCatmullRomLine {
|
|
90
138
|
constructor() {
|
|
91
|
-
this.
|
|
92
|
-
this.
|
|
93
|
-
this.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
139
|
+
this.points = input.required();
|
|
140
|
+
this.options = input(defaultOptions$8, { transform: mergeInputs(defaultOptions$8) });
|
|
141
|
+
this.parameters = omit(this.options, ['curveType', 'tension', 'segments', 'closed', 'vertexColors']);
|
|
142
|
+
this.line = viewChild.required(NgtsLine);
|
|
143
|
+
this.closed = pick(this.options, 'closed');
|
|
144
|
+
this.curveType = pick(this.options, 'curveType');
|
|
145
|
+
this.tension = pick(this.options, 'tension');
|
|
146
|
+
this.segments = pick(this.options, 'segments');
|
|
147
|
+
this.vertexColors = pick(this.options, 'vertexColors');
|
|
148
|
+
this.curve = computed(() => {
|
|
149
|
+
const [points, closed, curveType, tension] = [this.points(), this.closed(), this.curveType(), this.tension()];
|
|
150
|
+
const mappedPoints = points.map((pt) => pt instanceof Vector3 ? pt : new Vector3(...pt));
|
|
151
|
+
return new CatmullRomCurve3(mappedPoints, closed, curveType, tension);
|
|
152
|
+
});
|
|
153
|
+
this.segmentedPoints = computed(() => {
|
|
154
|
+
const [curve, segments] = [this.curve(), this.segments()];
|
|
155
|
+
return curve.getPoints(segments);
|
|
156
|
+
});
|
|
157
|
+
this.interpolatedVertexColors = computed(() => {
|
|
158
|
+
const [vertexColors, segments] = [this.vertexColors(), this.segments()];
|
|
159
|
+
if (!vertexColors || vertexColors.length < 2)
|
|
160
|
+
return undefined;
|
|
161
|
+
if (vertexColors.length === segments + 1)
|
|
162
|
+
return vertexColors;
|
|
163
|
+
const mappedColors = vertexColors.map((color) => color instanceof Color ? color : new Color(...color));
|
|
164
|
+
if (untracked(this.closed))
|
|
165
|
+
mappedColors.push(mappedColors[0].clone());
|
|
166
|
+
const iColors = [mappedColors[0]];
|
|
167
|
+
const divisions = segments / (mappedColors.length - 1);
|
|
168
|
+
for (let i = 1; i < segments; i++) {
|
|
169
|
+
const alpha = (i % divisions) / divisions;
|
|
170
|
+
const colorIndex = Math.floor(i / divisions);
|
|
171
|
+
iColors.push(mappedColors[colorIndex].clone().lerp(mappedColors[colorIndex + 1], alpha));
|
|
172
|
+
}
|
|
173
|
+
iColors.push(mappedColors[mappedColors.length - 1]);
|
|
174
|
+
return iColors;
|
|
175
|
+
});
|
|
176
|
+
this.lineOptions = computed(() => ({ ...this.parameters(), vertexColors: this.interpolatedVertexColors() }));
|
|
97
177
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
178
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsCatmullRomLine, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
179
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.1.0", type: NgtsCatmullRomLine, isStandalone: true, selector: "ngts-catmull-rom-line", inputs: { points: { classPropertyName: "points", publicName: "points", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "line", first: true, predicate: NgtsLine, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
180
|
+
<ngts-line [points]="segmentedPoints()" [options]="lineOptions()">
|
|
181
|
+
<ng-content />
|
|
182
|
+
</ngts-line>
|
|
183
|
+
`, isInline: true, dependencies: [{ kind: "component", type: NgtsLine, selector: "ngts-line", inputs: ["points", "options"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
184
|
+
}
|
|
185
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsCatmullRomLine, decorators: [{
|
|
186
|
+
type: Component,
|
|
187
|
+
args: [{
|
|
188
|
+
selector: 'ngts-catmull-rom-line',
|
|
189
|
+
standalone: true,
|
|
190
|
+
template: `
|
|
191
|
+
<ngts-line [points]="segmentedPoints()" [options]="lineOptions()">
|
|
192
|
+
<ng-content />
|
|
193
|
+
</ngts-line>
|
|
194
|
+
`,
|
|
195
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
196
|
+
imports: [NgtsLine],
|
|
197
|
+
}]
|
|
198
|
+
}] });
|
|
199
|
+
|
|
200
|
+
const defaultOptions$7 = {
|
|
201
|
+
lineWidth: 1,
|
|
202
|
+
segments: 20,
|
|
203
|
+
};
|
|
204
|
+
class NgtsCubicBezierLine {
|
|
205
|
+
constructor() {
|
|
206
|
+
this.start = input.required();
|
|
207
|
+
this.end = input.required();
|
|
208
|
+
this.midA = input.required();
|
|
209
|
+
this.midB = input.required();
|
|
210
|
+
this.options = input(defaultOptions$7, { transform: mergeInputs(defaultOptions$7) });
|
|
211
|
+
this.parameters = omit(this.options, ['segments']);
|
|
212
|
+
this.line = viewChild.required(NgtsLine);
|
|
213
|
+
this.segments = pick(this.options, 'segments');
|
|
214
|
+
this.points = computed(() => {
|
|
215
|
+
const [start, end, midA, midB, segments] = [this.start(), this.end(), this.midA(), this.midB(), this.segments()];
|
|
216
|
+
const startV = start instanceof Vector3 ? start : new Vector3(...start);
|
|
217
|
+
const endV = end instanceof Vector3 ? end : new Vector3(...end);
|
|
218
|
+
const midAV = midA instanceof Vector3 ? midA : new Vector3(...midA);
|
|
219
|
+
const midBV = midB instanceof Vector3 ? midB : new Vector3(...midB);
|
|
220
|
+
return new CubicBezierCurve3(startV, midAV, midBV, endV).getPoints(segments);
|
|
111
221
|
});
|
|
112
222
|
}
|
|
113
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
114
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
115
|
-
<
|
|
223
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsCubicBezierLine, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
224
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.1.0", type: NgtsCubicBezierLine, isStandalone: true, selector: "ngts-cubic-bezier-line", inputs: { start: { classPropertyName: "start", publicName: "start", isSignal: true, isRequired: true, transformFunction: null }, end: { classPropertyName: "end", publicName: "end", isSignal: true, isRequired: true, transformFunction: null }, midA: { classPropertyName: "midA", publicName: "midA", isSignal: true, isRequired: true, transformFunction: null }, midB: { classPropertyName: "midB", publicName: "midB", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "line", first: true, predicate: NgtsLine, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
225
|
+
<ngts-line [points]="points()" [options]="parameters()">
|
|
116
226
|
<ng-content />
|
|
117
|
-
</
|
|
118
|
-
`, isInline: true }); }
|
|
227
|
+
</ngts-line>
|
|
228
|
+
`, isInline: true, dependencies: [{ kind: "component", type: NgtsLine, selector: "ngts-line", inputs: ["points", "options"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
119
229
|
}
|
|
120
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
230
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsCubicBezierLine, decorators: [{
|
|
121
231
|
type: Component,
|
|
122
232
|
args: [{
|
|
123
|
-
selector: 'ngts-
|
|
233
|
+
selector: 'ngts-cubic-bezier-line',
|
|
124
234
|
standalone: true,
|
|
125
235
|
template: `
|
|
126
|
-
<
|
|
236
|
+
<ngts-line [points]="points()" [options]="parameters()">
|
|
127
237
|
<ng-content />
|
|
128
|
-
</
|
|
238
|
+
</ngts-line>
|
|
129
239
|
`,
|
|
130
|
-
|
|
240
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
241
|
+
imports: [NgtsLine],
|
|
131
242
|
}]
|
|
132
|
-
}]
|
|
133
|
-
type: Input
|
|
134
|
-
}], _distances: [{
|
|
135
|
-
type: Input,
|
|
136
|
-
args: [{ required: true, alias: 'distances' }]
|
|
137
|
-
}], _hysteresis: [{
|
|
138
|
-
type: Input,
|
|
139
|
-
args: [{ alias: 'hysteresis' }]
|
|
140
|
-
}] } });
|
|
243
|
+
}] });
|
|
141
244
|
|
|
142
|
-
|
|
245
|
+
const defaultOptions$6 = {
|
|
246
|
+
lineWidth: 1,
|
|
247
|
+
threshold: 15,
|
|
248
|
+
};
|
|
143
249
|
class NgtsEdges {
|
|
144
|
-
set _threshold(threshold) {
|
|
145
|
-
this.inputs.set({ threshold });
|
|
146
|
-
}
|
|
147
|
-
set _color(color) {
|
|
148
|
-
this.inputs.set({ color });
|
|
149
|
-
}
|
|
150
|
-
set _geometry(geometry) {
|
|
151
|
-
this.inputs.set({ geometry });
|
|
152
|
-
}
|
|
153
|
-
set _userData(userData) {
|
|
154
|
-
this.inputs.set({ userData });
|
|
155
|
-
}
|
|
156
250
|
constructor() {
|
|
157
|
-
this.
|
|
158
|
-
this.
|
|
159
|
-
this.
|
|
160
|
-
this.
|
|
161
|
-
this.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
251
|
+
this.options = input(defaultOptions$6, { transform: mergeInputs(defaultOptions$6) });
|
|
252
|
+
this.parameters = omit(this.options, ['threshold', 'geometry']);
|
|
253
|
+
this.lineOptions = computed(() => ({ ...this.parameters(), raycast: () => null }));
|
|
254
|
+
this.tmpPoints = [0, 0, 0, 1, 0, 0];
|
|
255
|
+
this.line = viewChild.required(NgtsLine);
|
|
256
|
+
const autoEffect = injectAutoEffect();
|
|
257
|
+
afterNextRender(() => {
|
|
258
|
+
autoEffect(() => {
|
|
259
|
+
const line = this.line().line()?.nativeElement;
|
|
260
|
+
if (!line)
|
|
261
|
+
return;
|
|
262
|
+
const lS = getLocalState(line);
|
|
263
|
+
if (!lS)
|
|
264
|
+
return;
|
|
265
|
+
const parent = lS.parent();
|
|
266
|
+
if (!parent)
|
|
267
|
+
return;
|
|
268
|
+
const { geometry: explicitGeometry, threshold } = this.options();
|
|
269
|
+
const geometry = explicitGeometry ?? parent.geometry;
|
|
270
|
+
if (!geometry)
|
|
271
|
+
return;
|
|
272
|
+
const cached = this.memoizedGeometry === geometry && this.memoizedThreshold === threshold;
|
|
273
|
+
if (cached)
|
|
274
|
+
return;
|
|
275
|
+
this.memoizedGeometry = geometry;
|
|
276
|
+
this.memoizedThreshold = threshold;
|
|
277
|
+
const points = new EdgesGeometry(geometry, threshold).attributes['position']
|
|
278
|
+
.array;
|
|
279
|
+
line.geometry.setPositions(points);
|
|
280
|
+
checkNeedsUpdate(line.geometry.attributes['instanceStart']);
|
|
281
|
+
checkNeedsUpdate(line.geometry.attributes['instanceEnd']);
|
|
282
|
+
line.computeLineDistances();
|
|
283
|
+
});
|
|
176
284
|
});
|
|
177
285
|
}
|
|
178
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
179
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
180
|
-
<
|
|
181
|
-
<ng-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
</ng-template>
|
|
185
|
-
</ngt-line-segments>
|
|
186
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
286
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsEdges, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
287
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.1.0", type: NgtsEdges, isStandalone: true, selector: "ngts-edges", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "line", first: true, predicate: NgtsLine, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
288
|
+
<ngts-line [points]="tmpPoints" [options]="lineOptions()">
|
|
289
|
+
<ng-content />
|
|
290
|
+
</ngts-line>
|
|
291
|
+
`, isInline: true, dependencies: [{ kind: "component", type: NgtsLine, selector: "ngts-line", inputs: ["points", "options"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
187
292
|
}
|
|
188
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
293
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsEdges, decorators: [{
|
|
189
294
|
type: Component,
|
|
190
295
|
args: [{
|
|
191
296
|
selector: 'ngts-edges',
|
|
192
297
|
standalone: true,
|
|
193
298
|
template: `
|
|
194
|
-
<
|
|
195
|
-
<ng-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
299
|
+
<ngts-line [points]="tmpPoints" [options]="lineOptions()">
|
|
300
|
+
<ng-content />
|
|
301
|
+
</ngts-line>
|
|
302
|
+
`,
|
|
303
|
+
imports: [NgtsLine],
|
|
304
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
305
|
+
}]
|
|
306
|
+
}], ctorParameters: () => [] });
|
|
307
|
+
|
|
308
|
+
const defaultOptions$5 = {
|
|
309
|
+
size: 1024,
|
|
310
|
+
width: 16,
|
|
311
|
+
type: 'linear',
|
|
312
|
+
innerCircleRadius: 0,
|
|
313
|
+
outerCircleRadius: 'auto',
|
|
314
|
+
};
|
|
315
|
+
class NgtsGradientTexture {
|
|
316
|
+
constructor() {
|
|
317
|
+
this.attach = input('map');
|
|
318
|
+
this.stops = input.required();
|
|
319
|
+
this.colors = input.required();
|
|
320
|
+
this.options = input(defaultOptions$5, { transform: mergeInputs(defaultOptions$5) });
|
|
321
|
+
this.parameters = omit(this.options, ['size', 'width', 'type', 'innerCircleRadius', 'outerCircleRadius']);
|
|
322
|
+
this.store = injectStore();
|
|
323
|
+
this.gl = this.store.select('gl');
|
|
324
|
+
this.document = inject(DOCUMENT);
|
|
325
|
+
this.canvas = computed(() => {
|
|
326
|
+
const canvas = this.document.createElement('canvas');
|
|
327
|
+
const context = canvas.getContext('2d');
|
|
328
|
+
const [{ width, size, type, outerCircleRadius, innerCircleRadius }, stops, colors] = [
|
|
329
|
+
untracked(this.options),
|
|
330
|
+
this.stops(),
|
|
331
|
+
this.colors(),
|
|
332
|
+
];
|
|
333
|
+
canvas.width = width;
|
|
334
|
+
canvas.height = size;
|
|
335
|
+
let gradient;
|
|
336
|
+
if (type === 'linear') {
|
|
337
|
+
gradient = context.createLinearGradient(0, 0, 0, size);
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
const canvasCenterX = canvas.width / 2;
|
|
341
|
+
const canvasCenterY = canvas.height / 2;
|
|
342
|
+
const radius = outerCircleRadius !== 'auto'
|
|
343
|
+
? Math.abs(Number(outerCircleRadius))
|
|
344
|
+
: Math.sqrt(canvasCenterX ** 2 + canvasCenterY ** 2);
|
|
345
|
+
gradient = context.createRadialGradient(canvasCenterX, canvasCenterY, Math.abs(innerCircleRadius), canvasCenterX, canvasCenterY, radius);
|
|
346
|
+
}
|
|
347
|
+
const tempColor = new Color(); // reuse instance for performance
|
|
348
|
+
let i = stops.length;
|
|
349
|
+
while (i--) {
|
|
350
|
+
gradient.addColorStop(stops[i], tempColor.set(colors[i]).getStyle());
|
|
351
|
+
}
|
|
352
|
+
context.save();
|
|
353
|
+
context.fillStyle = gradient;
|
|
354
|
+
context.fillRect(0, 0, width, size);
|
|
355
|
+
context.restore();
|
|
356
|
+
return canvas;
|
|
357
|
+
});
|
|
358
|
+
extend({ CanvasTexture });
|
|
359
|
+
}
|
|
360
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsGradientTexture, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
361
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.1.0", type: NgtsGradientTexture, isStandalone: true, selector: "ngts-gradient-texture", inputs: { attach: { classPropertyName: "attach", publicName: "attach", isSignal: true, isRequired: false, transformFunction: null }, stops: { classPropertyName: "stops", publicName: "stops", isSignal: true, isRequired: true, transformFunction: null }, colors: { classPropertyName: "colors", publicName: "colors", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
362
|
+
<ngt-canvas-texture
|
|
363
|
+
*args="[canvas()]"
|
|
364
|
+
[attach]="attach()"
|
|
365
|
+
[colorSpace]="gl().outputColorSpace"
|
|
366
|
+
[parameters]="parameters()"
|
|
367
|
+
>
|
|
368
|
+
<ng-content />
|
|
369
|
+
</ngt-canvas-texture>
|
|
370
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
371
|
+
}
|
|
372
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsGradientTexture, decorators: [{
|
|
373
|
+
type: Component,
|
|
374
|
+
args: [{
|
|
375
|
+
selector: 'ngts-gradient-texture',
|
|
376
|
+
standalone: true,
|
|
377
|
+
template: `
|
|
378
|
+
<ngt-canvas-texture
|
|
379
|
+
*args="[canvas()]"
|
|
380
|
+
[attach]="attach()"
|
|
381
|
+
[colorSpace]="gl().outputColorSpace"
|
|
382
|
+
[parameters]="parameters()"
|
|
383
|
+
>
|
|
384
|
+
<ng-content />
|
|
385
|
+
</ngt-canvas-texture>
|
|
200
386
|
`,
|
|
201
|
-
imports: [NgIf, NgTemplateOutlet],
|
|
202
387
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
388
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
389
|
+
imports: [NgtArgs],
|
|
203
390
|
}]
|
|
204
|
-
}], ctorParameters:
|
|
205
|
-
type: ContentChild,
|
|
206
|
-
args: [NgtsSobaContent, { read: TemplateRef }]
|
|
207
|
-
}], edgesRef: [{
|
|
208
|
-
type: Input
|
|
209
|
-
}], _threshold: [{
|
|
210
|
-
type: Input,
|
|
211
|
-
args: [{ alias: 'threshold' }]
|
|
212
|
-
}], _color: [{
|
|
213
|
-
type: Input,
|
|
214
|
-
args: [{ alias: 'color' }]
|
|
215
|
-
}], _geometry: [{
|
|
216
|
-
type: Input,
|
|
217
|
-
args: [{ alias: 'geometry' }]
|
|
218
|
-
}], _userData: [{
|
|
219
|
-
type: Input,
|
|
220
|
-
args: [{ alias: 'userData' }]
|
|
221
|
-
}] } });
|
|
391
|
+
}], ctorParameters: () => [] });
|
|
222
392
|
|
|
223
|
-
|
|
393
|
+
const defaultOptions$4 = {
|
|
394
|
+
planeArgs: [],
|
|
395
|
+
cellSize: 0.5,
|
|
396
|
+
cellThickness: 0.5,
|
|
397
|
+
cellColor: 'black',
|
|
398
|
+
sectionSize: 1,
|
|
399
|
+
sectionThickness: 1,
|
|
400
|
+
sectionColor: '#2080ff',
|
|
401
|
+
infiniteGrid: false,
|
|
402
|
+
followCamera: false,
|
|
403
|
+
fadeDistance: 100,
|
|
404
|
+
fadeStrength: 1,
|
|
405
|
+
fadeFrom: 1,
|
|
406
|
+
side: BackSide,
|
|
407
|
+
};
|
|
224
408
|
class NgtsGrid {
|
|
225
|
-
set _cellSize(cellSize) {
|
|
226
|
-
this.inputs.set({ cellSize });
|
|
227
|
-
}
|
|
228
|
-
set _cellThickness(cellThickness) {
|
|
229
|
-
this.inputs.set({ cellThickness });
|
|
230
|
-
}
|
|
231
|
-
set _cellColor(cellColor) {
|
|
232
|
-
this.inputs.set({ cellColor });
|
|
233
|
-
}
|
|
234
|
-
set _sectionSize(sectionSize) {
|
|
235
|
-
this.inputs.set({ sectionSize });
|
|
236
|
-
}
|
|
237
|
-
set _sectionThickness(sectionThickness) {
|
|
238
|
-
this.inputs.set({ sectionThickness });
|
|
239
|
-
}
|
|
240
|
-
set _sectionColor(sectionColor) {
|
|
241
|
-
this.inputs.set({ sectionColor });
|
|
242
|
-
}
|
|
243
|
-
set _followCamera(followCamera) {
|
|
244
|
-
this.inputs.set({ followCamera });
|
|
245
|
-
}
|
|
246
|
-
set _infiniteGrid(infiniteGrid) {
|
|
247
|
-
this.inputs.set({ infiniteGrid });
|
|
248
|
-
}
|
|
249
|
-
set _fadeDistance(fadeDistance) {
|
|
250
|
-
this.inputs.set({ fadeDistance });
|
|
251
|
-
}
|
|
252
|
-
set _fadeStrength(fadeStrength) {
|
|
253
|
-
this.inputs.set({ fadeStrength });
|
|
254
|
-
}
|
|
255
|
-
set _side(side) {
|
|
256
|
-
this.inputs.set({ side });
|
|
257
|
-
}
|
|
258
|
-
set _args(args) {
|
|
259
|
-
this.inputs.set({ args });
|
|
260
|
-
}
|
|
261
409
|
constructor() {
|
|
262
|
-
this.
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
cellSize
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
410
|
+
this.options = input(defaultOptions$4, { transform: mergeInputs(defaultOptions$4) });
|
|
411
|
+
this.parameters = omit(this.options, [
|
|
412
|
+
'planeArgs',
|
|
413
|
+
'cellSize',
|
|
414
|
+
'cellThickness',
|
|
415
|
+
'cellColor',
|
|
416
|
+
'sectionSize',
|
|
417
|
+
'sectionThickness',
|
|
418
|
+
'sectionColor',
|
|
419
|
+
'infiniteGrid',
|
|
420
|
+
'followCamera',
|
|
421
|
+
'fadeDistance',
|
|
422
|
+
'fadeStrength',
|
|
423
|
+
'fadeFrom',
|
|
424
|
+
'side',
|
|
425
|
+
]);
|
|
426
|
+
this.mesh = viewChild.required('mesh');
|
|
427
|
+
this.plane = new Plane();
|
|
428
|
+
this.upVector = new Vector3(0, 1, 0);
|
|
429
|
+
this.zeroVector = new Vector3(0, 0, 0);
|
|
430
|
+
this.planeArgs = pick(this.options, 'planeArgs');
|
|
431
|
+
this.side = pick(this.options, 'side');
|
|
432
|
+
this.uniforms = computed(() => {
|
|
433
|
+
const { cellSize, sectionSize, cellColor, sectionColor, cellThickness, sectionThickness, fadeDistance, fadeStrength, fadeFrom, infiniteGrid, followCamera, } = this.options();
|
|
434
|
+
return {
|
|
435
|
+
cellSize,
|
|
436
|
+
sectionSize,
|
|
437
|
+
cellColor,
|
|
438
|
+
sectionColor,
|
|
439
|
+
cellThickness,
|
|
440
|
+
sectionThickness,
|
|
441
|
+
fadeDistance,
|
|
442
|
+
fadeStrength,
|
|
443
|
+
fadeFrom,
|
|
444
|
+
infiniteGrid,
|
|
445
|
+
followCamera,
|
|
446
|
+
};
|
|
275
447
|
});
|
|
276
|
-
|
|
277
|
-
this.cellSize = this.inputs.select('cellSize');
|
|
278
|
-
this.sectionSize = this.inputs.select('sectionSize');
|
|
279
|
-
this.fadeDistance = this.inputs.select('fadeDistance');
|
|
280
|
-
this.fadeStrength = this.inputs.select('fadeStrength');
|
|
281
|
-
this.cellThickness = this.inputs.select('cellThickness');
|
|
282
|
-
this.sectionThickness = this.inputs.select('sectionThickness');
|
|
283
|
-
this.infiniteGrid = this.inputs.select('infiniteGrid');
|
|
284
|
-
this.followCamera = this.inputs.select('followCamera');
|
|
285
|
-
this.cellColor = this.inputs.select('cellColor');
|
|
286
|
-
this.sectionColor = this.inputs.select('sectionColor');
|
|
287
|
-
this.side = this.inputs.select('side');
|
|
288
|
-
this.args = this.inputs.select('args');
|
|
289
|
-
this.plane = new THREE.Plane();
|
|
290
|
-
this.upVector = new THREE.Vector3(0, 1, 0);
|
|
291
|
-
this.zeroVector = new THREE.Vector3(0, 0, 0);
|
|
448
|
+
extend({ Mesh, PlaneGeometry, GridMaterial });
|
|
292
449
|
injectBeforeRender(({ camera }) => {
|
|
293
|
-
this.
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
const gridMaterial = this.gridRef.nativeElement.material;
|
|
450
|
+
const mesh = this.mesh().nativeElement;
|
|
451
|
+
this.plane.setFromNormalAndCoplanarPoint(this.upVector, this.zeroVector).applyMatrix4(mesh.matrixWorld);
|
|
452
|
+
const gridMaterial = mesh.material;
|
|
297
453
|
const worldCamProjPosition = gridMaterial.uniforms['worldCamProjPosition'];
|
|
298
454
|
const worldPlanePosition = gridMaterial.uniforms['worldPlanePosition'];
|
|
299
455
|
this.plane.projectPoint(camera.position, worldCamProjPosition.value);
|
|
300
|
-
worldPlanePosition.value.set(0, 0, 0).applyMatrix4(
|
|
456
|
+
worldPlanePosition.value.set(0, 0, 0).applyMatrix4(mesh.matrixWorld);
|
|
301
457
|
});
|
|
302
458
|
}
|
|
303
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
304
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
305
|
-
<ngt-mesh
|
|
306
|
-
<ngt-plane-geometry *args="
|
|
307
|
-
<ngt-grid-material
|
|
308
|
-
[
|
|
309
|
-
[side]="side()"
|
|
310
|
-
[cellSize]="cellSize()"
|
|
311
|
-
[cellColor]="cellColor()"
|
|
312
|
-
[cellThickness]="cellThickness()"
|
|
313
|
-
[sectionSize]="sectionSize()"
|
|
314
|
-
[sectionColor]="sectionColor()"
|
|
315
|
-
[sectionThickness]="sectionThickness()"
|
|
316
|
-
[fadeDistance]="fadeDistance()"
|
|
317
|
-
[fadeStrength]="fadeStrength()"
|
|
318
|
-
[infiniteGrid]="infiniteGrid()"
|
|
319
|
-
[followCamera]="followCamera()"
|
|
320
|
-
>
|
|
321
|
-
<ngt-value attach="extensions.derivatives" [rawValue]="false" />
|
|
459
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsGrid, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
460
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.1.0", type: NgtsGrid, isStandalone: true, selector: "ngts-grid", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "mesh", first: true, predicate: ["mesh"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
461
|
+
<ngt-mesh #mesh [frustumCulled]="false" [parameters]="parameters()">
|
|
462
|
+
<ngt-plane-geometry *args="planeArgs()" />
|
|
463
|
+
<ngt-grid-material [transparent]="true" [side]="side()" [parameters]="uniforms()">
|
|
464
|
+
<ngt-value attach="extensions.derivatives" [rawValue]="true" />
|
|
322
465
|
</ngt-grid-material>
|
|
323
466
|
<ng-content />
|
|
324
467
|
</ngt-mesh>
|
|
325
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }] }); }
|
|
468
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
326
469
|
}
|
|
327
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
470
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsGrid, decorators: [{
|
|
328
471
|
type: Component,
|
|
329
472
|
args: [{
|
|
330
473
|
selector: 'ngts-grid',
|
|
331
474
|
standalone: true,
|
|
332
475
|
template: `
|
|
333
|
-
<ngt-mesh
|
|
334
|
-
<ngt-plane-geometry *args="
|
|
335
|
-
<ngt-grid-material
|
|
336
|
-
[
|
|
337
|
-
[side]="side()"
|
|
338
|
-
[cellSize]="cellSize()"
|
|
339
|
-
[cellColor]="cellColor()"
|
|
340
|
-
[cellThickness]="cellThickness()"
|
|
341
|
-
[sectionSize]="sectionSize()"
|
|
342
|
-
[sectionColor]="sectionColor()"
|
|
343
|
-
[sectionThickness]="sectionThickness()"
|
|
344
|
-
[fadeDistance]="fadeDistance()"
|
|
345
|
-
[fadeStrength]="fadeStrength()"
|
|
346
|
-
[infiniteGrid]="infiniteGrid()"
|
|
347
|
-
[followCamera]="followCamera()"
|
|
348
|
-
>
|
|
349
|
-
<ngt-value attach="extensions.derivatives" [rawValue]="false" />
|
|
476
|
+
<ngt-mesh #mesh [frustumCulled]="false" [parameters]="parameters()">
|
|
477
|
+
<ngt-plane-geometry *args="planeArgs()" />
|
|
478
|
+
<ngt-grid-material [transparent]="true" [side]="side()" [parameters]="uniforms()">
|
|
479
|
+
<ngt-value attach="extensions.derivatives" [rawValue]="true" />
|
|
350
480
|
</ngt-grid-material>
|
|
351
481
|
<ng-content />
|
|
352
482
|
</ngt-mesh>
|
|
353
483
|
`,
|
|
354
|
-
imports: [NgtArgs],
|
|
355
484
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
485
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
486
|
+
imports: [NgtArgs],
|
|
356
487
|
}]
|
|
357
|
-
}], ctorParameters:
|
|
358
|
-
type: Input
|
|
359
|
-
}], _cellSize: [{
|
|
360
|
-
type: Input,
|
|
361
|
-
args: [{ alias: 'cellSize' }]
|
|
362
|
-
}], _cellThickness: [{
|
|
363
|
-
type: Input,
|
|
364
|
-
args: [{ alias: 'cellThickness' }]
|
|
365
|
-
}], _cellColor: [{
|
|
366
|
-
type: Input,
|
|
367
|
-
args: [{ alias: 'cellColor' }]
|
|
368
|
-
}], _sectionSize: [{
|
|
369
|
-
type: Input,
|
|
370
|
-
args: [{ alias: 'sectionSize' }]
|
|
371
|
-
}], _sectionThickness: [{
|
|
372
|
-
type: Input,
|
|
373
|
-
args: [{ alias: 'sectionThickness' }]
|
|
374
|
-
}], _sectionColor: [{
|
|
375
|
-
type: Input,
|
|
376
|
-
args: [{ alias: 'sectionColor' }]
|
|
377
|
-
}], _followCamera: [{
|
|
378
|
-
type: Input,
|
|
379
|
-
args: [{ alias: 'followCamera' }]
|
|
380
|
-
}], _infiniteGrid: [{
|
|
381
|
-
type: Input,
|
|
382
|
-
args: [{ alias: 'infiniteGrid' }]
|
|
383
|
-
}], _fadeDistance: [{
|
|
384
|
-
type: Input,
|
|
385
|
-
args: [{ alias: 'fadeDistance' }]
|
|
386
|
-
}], _fadeStrength: [{
|
|
387
|
-
type: Input,
|
|
388
|
-
args: [{ alias: 'fadeStrength' }]
|
|
389
|
-
}], _side: [{
|
|
390
|
-
type: Input,
|
|
391
|
-
args: [{ alias: 'side' }]
|
|
392
|
-
}], _args: [{
|
|
393
|
-
type: Input,
|
|
394
|
-
args: [{ alias: 'args' }]
|
|
395
|
-
}] } });
|
|
488
|
+
}], ctorParameters: () => [] });
|
|
396
489
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}
|
|
490
|
+
function injectHelper(object, helperConstructor, { injector, args = () => [], } = {}) {
|
|
491
|
+
return assertInjector(injectHelper, injector, () => {
|
|
492
|
+
const autoEffect = injectAutoEffect();
|
|
493
|
+
const store = injectStore();
|
|
494
|
+
const scene = store.select('scene');
|
|
495
|
+
const helper = signal(null);
|
|
496
|
+
afterNextRender(() => {
|
|
497
|
+
autoEffect(() => {
|
|
498
|
+
let currentHelper = undefined;
|
|
499
|
+
const maybeObject3D = object();
|
|
500
|
+
if (!maybeObject3D)
|
|
501
|
+
return;
|
|
502
|
+
const object3D = resolveRef(maybeObject3D);
|
|
503
|
+
if (!object3D)
|
|
504
|
+
return;
|
|
505
|
+
currentHelper = new (helperConstructor())(object3D, ...args());
|
|
506
|
+
if (!currentHelper)
|
|
507
|
+
return;
|
|
508
|
+
untracked(() => {
|
|
509
|
+
helper.set(currentHelper);
|
|
510
|
+
});
|
|
511
|
+
// Prevent the helpers from blocking rays
|
|
512
|
+
currentHelper.traverse((child) => (child.raycast = () => null));
|
|
513
|
+
scene().add(currentHelper);
|
|
514
|
+
return () => {
|
|
515
|
+
helper.set(null);
|
|
516
|
+
scene().remove(currentHelper);
|
|
517
|
+
currentHelper.dispose?.();
|
|
518
|
+
};
|
|
519
|
+
});
|
|
520
|
+
});
|
|
521
|
+
injectBeforeRender(() => {
|
|
522
|
+
const currentHelper = helper();
|
|
523
|
+
if (currentHelper)
|
|
524
|
+
currentHelper.update();
|
|
525
|
+
});
|
|
526
|
+
return helper.asReadonly();
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
class NgtsHelper {
|
|
438
530
|
constructor() {
|
|
439
|
-
this.
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
531
|
+
this.type = input.required();
|
|
532
|
+
this.options = input([]);
|
|
533
|
+
this.helperRef = viewChild.required('helper');
|
|
534
|
+
this.parent = computed(() => {
|
|
535
|
+
const helper = this.helperRef().nativeElement;
|
|
536
|
+
if (!helper)
|
|
537
|
+
return;
|
|
538
|
+
const localState = getLocalState(helper);
|
|
539
|
+
if (!localState)
|
|
540
|
+
return;
|
|
541
|
+
return localState.parent();
|
|
450
542
|
});
|
|
451
|
-
this.
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
];
|
|
543
|
+
this.helper = injectHelper(this.parent, this.type, { args: this.options });
|
|
544
|
+
extend({ Object3D });
|
|
545
|
+
}
|
|
546
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsHelper, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
547
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.1.0", type: NgtsHelper, isStandalone: true, selector: "ngts-helper", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "helperRef", first: true, predicate: ["helper"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
548
|
+
<ngt-object-3D #helper />
|
|
549
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
550
|
+
}
|
|
551
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsHelper, decorators: [{
|
|
552
|
+
type: Component,
|
|
553
|
+
args: [{
|
|
554
|
+
standalone: true,
|
|
555
|
+
selector: 'ngts-helper',
|
|
556
|
+
template: `
|
|
557
|
+
<ngt-object-3D #helper />
|
|
558
|
+
`,
|
|
559
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
560
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
561
|
+
}]
|
|
562
|
+
}], ctorParameters: () => [] });
|
|
563
|
+
|
|
564
|
+
const defaultOptions$3 = {
|
|
565
|
+
height: 1,
|
|
566
|
+
bevelEnabled: false,
|
|
567
|
+
};
|
|
568
|
+
class NgtsPrismGeometry {
|
|
569
|
+
constructor() {
|
|
570
|
+
this.vertices = input.required();
|
|
571
|
+
this.options = input(defaultOptions$3, { transform: mergeInputs(defaultOptions$3) });
|
|
572
|
+
this.parameters = computed(() => ({ ...this.options(), depth: this.options().height }));
|
|
573
|
+
this.shape = computed(() => {
|
|
574
|
+
const vertices = this.vertices();
|
|
575
|
+
const interpolatedVertices = vertices.map((v) => (v instanceof Vector2 ? v : new Vector2(...v)));
|
|
576
|
+
return new Shape(interpolatedVertices);
|
|
486
577
|
});
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
}
|
|
578
|
+
this.geometry = viewChild('geometry');
|
|
579
|
+
extend({ ExtrudeGeometry });
|
|
580
|
+
const autoEffect = injectAutoEffect();
|
|
581
|
+
afterNextRender(() => {
|
|
582
|
+
// autoEffect(() => {
|
|
583
|
+
// const geometry = this.geometry()?.nativeElement;
|
|
584
|
+
// if (!geometry) return;
|
|
585
|
+
//
|
|
586
|
+
// geometry.center();
|
|
587
|
+
// });
|
|
497
588
|
});
|
|
498
589
|
}
|
|
499
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
500
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
501
|
-
<ngt-
|
|
502
|
-
<ngt-text-geometry *args="geometryArgs()" />
|
|
590
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsPrismGeometry, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
591
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.1.0", type: NgtsPrismGeometry, isStandalone: true, selector: "ngts-prism-geometry", inputs: { vertices: { classPropertyName: "vertices", publicName: "vertices", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "geometry", first: true, predicate: ["geometry"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
592
|
+
<ngt-extrude-geometry #geometry *args="[shape(), parameters()]">
|
|
503
593
|
<ng-content />
|
|
504
|
-
</ngt-
|
|
505
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }] }); }
|
|
594
|
+
</ngt-extrude-geometry>
|
|
595
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
506
596
|
}
|
|
507
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
597
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsPrismGeometry, decorators: [{
|
|
508
598
|
type: Component,
|
|
509
599
|
args: [{
|
|
510
|
-
selector: 'ngts-
|
|
600
|
+
selector: 'ngts-prism-geometry',
|
|
511
601
|
standalone: true,
|
|
512
602
|
template: `
|
|
513
|
-
<ngt-
|
|
514
|
-
<ngt-text-geometry *args="geometryArgs()" />
|
|
603
|
+
<ngt-extrude-geometry #geometry *args="[shape(), parameters()]">
|
|
515
604
|
<ng-content />
|
|
516
|
-
</ngt-
|
|
605
|
+
</ngt-extrude-geometry>
|
|
517
606
|
`,
|
|
518
|
-
imports: [NgtArgs],
|
|
519
607
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
608
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
609
|
+
imports: [NgtArgs],
|
|
520
610
|
}]
|
|
521
|
-
}], ctorParameters:
|
|
522
|
-
type: Input
|
|
523
|
-
}], _font: [{
|
|
524
|
-
type: Input,
|
|
525
|
-
args: [{ required: true, alias: 'font' }]
|
|
526
|
-
}], _text: [{
|
|
527
|
-
type: Input,
|
|
528
|
-
args: [{ required: true, alias: 'text' }]
|
|
529
|
-
}], _bevelEnabled: [{
|
|
530
|
-
type: Input,
|
|
531
|
-
args: [{ alias: 'bevelEnabled' }]
|
|
532
|
-
}], _bevelOffset: [{
|
|
533
|
-
type: Input,
|
|
534
|
-
args: [{ alias: 'bevelOffset' }]
|
|
535
|
-
}], _bevelSize: [{
|
|
536
|
-
type: Input,
|
|
537
|
-
args: [{ alias: 'bevelSize' }]
|
|
538
|
-
}], _bevelThickness: [{
|
|
539
|
-
type: Input,
|
|
540
|
-
args: [{ alias: 'bevelThickness' }]
|
|
541
|
-
}], _curveSegments: [{
|
|
542
|
-
type: Input,
|
|
543
|
-
args: [{ alias: 'curveSegments' }]
|
|
544
|
-
}], _bevelSegments: [{
|
|
545
|
-
type: Input,
|
|
546
|
-
args: [{ alias: 'bevelSegments' }]
|
|
547
|
-
}], _height: [{
|
|
548
|
-
type: Input,
|
|
549
|
-
args: [{ alias: 'height' }]
|
|
550
|
-
}], _size: [{
|
|
551
|
-
type: Input,
|
|
552
|
-
args: [{ alias: 'size' }]
|
|
553
|
-
}], _lineHeight: [{
|
|
554
|
-
type: Input,
|
|
555
|
-
args: [{ alias: 'lineHeight' }]
|
|
556
|
-
}], _letterSpacing: [{
|
|
557
|
-
type: Input,
|
|
558
|
-
args: [{ alias: 'letterSpacing' }]
|
|
559
|
-
}], _smooth: [{
|
|
560
|
-
type: Input,
|
|
561
|
-
args: [{ alias: 'smooth' }]
|
|
562
|
-
}] } });
|
|
611
|
+
}], ctorParameters: () => [] });
|
|
563
612
|
|
|
613
|
+
const defaultOptions$2 = {
|
|
614
|
+
lineWidth: 1,
|
|
615
|
+
segments: 20,
|
|
616
|
+
};
|
|
617
|
+
class NgtsQuadraticBezierLine {
|
|
618
|
+
constructor() {
|
|
619
|
+
this.start = input([0, 0, 0]);
|
|
620
|
+
this.end = input([0, 0, 0]);
|
|
621
|
+
this.mid = input();
|
|
622
|
+
this.options = input(defaultOptions$2, { transform: mergeInputs(defaultOptions$2) });
|
|
623
|
+
this.parameters = omit(this.options, ['segments']);
|
|
624
|
+
this.segments = pick(this.options, 'segments');
|
|
625
|
+
this.line = viewChild.required(NgtsLine);
|
|
626
|
+
this.points = computed(() => this.getPoints(this.start(), this.end(), this.mid(), this.segments()));
|
|
627
|
+
this.curve = new QuadraticBezierCurve3();
|
|
628
|
+
}
|
|
629
|
+
setPoints(start, end, mid) {
|
|
630
|
+
const points = this.getPoints(start, end, mid);
|
|
631
|
+
const geometry = this.line().lineGeometry();
|
|
632
|
+
if (geometry)
|
|
633
|
+
geometry.setPositions(points.map((p) => p.toArray()).flat());
|
|
634
|
+
}
|
|
635
|
+
getPoints(start, end, mid, segments = 20) {
|
|
636
|
+
if (start instanceof Vector3)
|
|
637
|
+
this.curve.v0.copy(start);
|
|
638
|
+
else
|
|
639
|
+
this.curve.v0.set(...start);
|
|
640
|
+
if (end instanceof Vector3)
|
|
641
|
+
this.curve.v2.copy(end);
|
|
642
|
+
else
|
|
643
|
+
this.curve.v2.set(...end);
|
|
644
|
+
if (mid instanceof Vector3) {
|
|
645
|
+
this.curve.v1.copy(mid);
|
|
646
|
+
}
|
|
647
|
+
else if (Array.isArray(mid)) {
|
|
648
|
+
this.curve.v1.set(...mid);
|
|
649
|
+
}
|
|
650
|
+
else {
|
|
651
|
+
this.curve.v1.copy(this.curve.v0
|
|
652
|
+
.clone()
|
|
653
|
+
.add(this.curve.v2.clone().sub(this.curve.v0))
|
|
654
|
+
.add(new Vector3(0, this.curve.v0.y - this.curve.v2.y, 0)));
|
|
655
|
+
}
|
|
656
|
+
return this.curve.getPoints(segments);
|
|
657
|
+
}
|
|
658
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsQuadraticBezierLine, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
659
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.1.0", type: NgtsQuadraticBezierLine, isStandalone: true, selector: "ngts-quadratic-bezier-line", inputs: { start: { classPropertyName: "start", publicName: "start", isSignal: true, isRequired: false, transformFunction: null }, end: { classPropertyName: "end", publicName: "end", isSignal: true, isRequired: false, transformFunction: null }, mid: { classPropertyName: "mid", publicName: "mid", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "line", first: true, predicate: NgtsLine, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
660
|
+
<ngts-line [points]="points()" [options]="parameters()">
|
|
661
|
+
<ng-content />
|
|
662
|
+
</ngts-line>
|
|
663
|
+
`, isInline: true, dependencies: [{ kind: "component", type: NgtsLine, selector: "ngts-line", inputs: ["points", "options"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
664
|
+
}
|
|
665
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsQuadraticBezierLine, decorators: [{
|
|
666
|
+
type: Component,
|
|
667
|
+
args: [{
|
|
668
|
+
selector: 'ngts-quadratic-bezier-line',
|
|
669
|
+
standalone: true,
|
|
670
|
+
template: `
|
|
671
|
+
<ngts-line [points]="points()" [options]="parameters()">
|
|
672
|
+
<ng-content />
|
|
673
|
+
</ngts-line>
|
|
674
|
+
`,
|
|
675
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
676
|
+
imports: [NgtsLine],
|
|
677
|
+
}]
|
|
678
|
+
}] });
|
|
679
|
+
|
|
680
|
+
const defaultOptions$1 = {
|
|
681
|
+
sdfGlyphSize: 64,
|
|
682
|
+
anchorX: 'center',
|
|
683
|
+
anchorY: 'middle',
|
|
684
|
+
fontSize: 1,
|
|
685
|
+
};
|
|
564
686
|
class NgtsText {
|
|
565
|
-
set text(text) {
|
|
566
|
-
this.inputs.set({ text });
|
|
567
|
-
}
|
|
568
|
-
set font(font) {
|
|
569
|
-
this.inputs.set({ font });
|
|
570
|
-
}
|
|
571
|
-
set fontSize(fontSize) {
|
|
572
|
-
this.inputs.set({ fontSize });
|
|
573
|
-
}
|
|
574
|
-
set anchorX(anchorX) {
|
|
575
|
-
this.inputs.set({ anchorX });
|
|
576
|
-
}
|
|
577
|
-
set anchorY(anchorY) {
|
|
578
|
-
this.inputs.set({ anchorY });
|
|
579
|
-
}
|
|
580
|
-
set sdfGlyphSize(sdfGlyphSize) {
|
|
581
|
-
this.inputs.set({ sdfGlyphSize });
|
|
582
|
-
}
|
|
583
|
-
set characters(characters) {
|
|
584
|
-
this.inputs.set({ characters });
|
|
585
|
-
}
|
|
586
|
-
set color(color) {
|
|
587
|
-
this.inputs.set({ color });
|
|
588
|
-
}
|
|
589
|
-
set maxWidth(maxWidth) {
|
|
590
|
-
this.inputs.set({ maxWidth });
|
|
591
|
-
}
|
|
592
|
-
set lineHeight(lineHeight) {
|
|
593
|
-
this.inputs.set({ lineHeight });
|
|
594
|
-
}
|
|
595
|
-
set letterSpacing(letterSpacing) {
|
|
596
|
-
this.inputs.set({ letterSpacing });
|
|
597
|
-
}
|
|
598
|
-
set textAlign(textAlign) {
|
|
599
|
-
this.inputs.set({ textAlign });
|
|
600
|
-
}
|
|
601
|
-
set clipRect(clipRect) {
|
|
602
|
-
this.inputs.set({ clipRect });
|
|
603
|
-
}
|
|
604
|
-
set depthOffset(depthOffset) {
|
|
605
|
-
this.inputs.set({ depthOffset });
|
|
606
|
-
}
|
|
607
|
-
set direction(direction) {
|
|
608
|
-
this.inputs.set({ direction });
|
|
609
|
-
}
|
|
610
|
-
set overflowWrap(overflowWrap) {
|
|
611
|
-
this.inputs.set({ overflowWrap });
|
|
612
|
-
}
|
|
613
|
-
set whiteSpace(whiteSpace) {
|
|
614
|
-
this.inputs.set({ whiteSpace });
|
|
615
|
-
}
|
|
616
|
-
set outlineWidth(outlineWidth) {
|
|
617
|
-
this.inputs.set({ outlineWidth });
|
|
618
|
-
}
|
|
619
|
-
set outlineOffsetX(outlineOffsetX) {
|
|
620
|
-
this.inputs.set({ outlineOffsetX });
|
|
621
|
-
}
|
|
622
|
-
set outlineOffsetY(outlineOffsetY) {
|
|
623
|
-
this.inputs.set({ outlineOffsetY });
|
|
624
|
-
}
|
|
625
|
-
set outlineBlur(outlineBlur) {
|
|
626
|
-
this.inputs.set({ outlineBlur });
|
|
627
|
-
}
|
|
628
|
-
set outlineColor(outlineColor) {
|
|
629
|
-
this.inputs.set({ outlineColor });
|
|
630
|
-
}
|
|
631
|
-
set outlineOpacity(outlineOpacity) {
|
|
632
|
-
this.inputs.set({ outlineOpacity });
|
|
633
|
-
}
|
|
634
|
-
set strokeWidth(strokeWidth) {
|
|
635
|
-
this.inputs.set({ strokeWidth });
|
|
636
|
-
}
|
|
637
|
-
set strokeColor(strokeColor) {
|
|
638
|
-
this.inputs.set({ strokeColor });
|
|
639
|
-
}
|
|
640
|
-
set strokeOpacity(strokeOpacity) {
|
|
641
|
-
this.inputs.set({ strokeOpacity });
|
|
642
|
-
}
|
|
643
|
-
set fillOpacity(fillOpacity) {
|
|
644
|
-
this.inputs.set({ fillOpacity });
|
|
645
|
-
}
|
|
646
|
-
set debugSDF(debugSDF) {
|
|
647
|
-
this.inputs.set({ debugSDF });
|
|
648
|
-
}
|
|
649
687
|
constructor() {
|
|
650
|
-
this.
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
this.
|
|
657
|
-
this.
|
|
658
|
-
this.
|
|
659
|
-
this.
|
|
688
|
+
this.text = input.required();
|
|
689
|
+
this.options = input(defaultOptions$1, { transform: mergeInputs(defaultOptions$1) });
|
|
690
|
+
this.parameters = omit(this.options, ['font', 'fontSize', 'sdfGlyphSize', 'anchorX', 'anchorY', 'characters']);
|
|
691
|
+
this.synced = output();
|
|
692
|
+
this.autoEffect = injectAutoEffect();
|
|
693
|
+
this.store = injectStore();
|
|
694
|
+
this.invalidate = this.store.select('invalidate');
|
|
695
|
+
this.characters = pick(this.options, 'characters');
|
|
696
|
+
this.font = pick(this.options, 'font');
|
|
697
|
+
this.anchorX = pick(this.options, 'anchorX');
|
|
698
|
+
this.anchorY = pick(this.options, 'anchorY');
|
|
699
|
+
this.sdfGlyphSize = pick(this.options, 'sdfGlyphSize');
|
|
700
|
+
this.fontSize = pick(this.options, 'fontSize');
|
|
701
|
+
this.troikaMesh = computed(() => new Text(), { equal: Object.is });
|
|
702
|
+
this.args = computed(() => [this.troikaMesh()]);
|
|
660
703
|
inject(DestroyRef).onDestroy(() => {
|
|
661
|
-
this.
|
|
704
|
+
this.troikaMesh().dispose();
|
|
662
705
|
});
|
|
663
|
-
this
|
|
664
|
-
this.
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
effect(() => {
|
|
670
|
-
const [font, characters] = [_font(), _characters()];
|
|
671
|
-
const invalidate = this.store.get('invalidate');
|
|
672
|
-
preloadFont({ font, characters }, () => invalidate());
|
|
706
|
+
// NOTE: this could be just effect but autoEffect is used for consistency
|
|
707
|
+
this.autoEffect(() => {
|
|
708
|
+
const [font, characters, invalidate] = [this.font(), this.characters(), this.invalidate()];
|
|
709
|
+
if (font) {
|
|
710
|
+
preloadFont({ font, characters }, () => invalidate());
|
|
711
|
+
}
|
|
673
712
|
});
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
this.sync.emit(this.troikaText);
|
|
682
|
-
}
|
|
713
|
+
afterNextRender(() => {
|
|
714
|
+
this.autoEffect(() => {
|
|
715
|
+
const [invalidate, text] = [this.invalidate(), this.text(), this.options()];
|
|
716
|
+
this.troikaMesh().sync(() => {
|
|
717
|
+
invalidate();
|
|
718
|
+
this.synced.emit(this.troikaMesh());
|
|
719
|
+
});
|
|
683
720
|
});
|
|
684
721
|
});
|
|
685
722
|
}
|
|
686
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
687
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
723
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsText, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
724
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.1.0", type: NgtsText, isStandalone: true, selector: "ngts-text", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { synced: "synced" }, ngImport: i0, template: `
|
|
688
725
|
<ngt-primitive
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
[
|
|
692
|
-
[
|
|
693
|
-
[
|
|
694
|
-
[
|
|
695
|
-
[
|
|
696
|
-
[
|
|
697
|
-
[sdfGlyphSize]="inputs.state().sdfGlyphSize"
|
|
698
|
-
[characters]="inputs.state().characters"
|
|
699
|
-
[color]="inputs.state().color"
|
|
700
|
-
[maxWidth]="inputs.state().maxWidth"
|
|
701
|
-
[lineHeight]="inputs.state().lineHeight"
|
|
702
|
-
[letterSpacing]="inputs.state().letterSpacing"
|
|
703
|
-
[textAlign]="inputs.state().textAlign"
|
|
704
|
-
[clipRect]="inputs.state().clipRect"
|
|
705
|
-
[depthOffset]="inputs.state().depthOffset"
|
|
706
|
-
[direction]="inputs.state().direction"
|
|
707
|
-
[overflowWrap]="inputs.state().overflowWrap"
|
|
708
|
-
[whiteSpace]="inputs.state().whiteSpace"
|
|
709
|
-
[outlineWidth]="inputs.state().outlineWidth"
|
|
710
|
-
[outlineOffsetX]="inputs.state().outlineOffsetX"
|
|
711
|
-
[outlineOffsetY]="inputs.state().outlineOffsetY"
|
|
712
|
-
[outlineBlur]="inputs.state().outlineBlur"
|
|
713
|
-
[outlineColor]="inputs.state().outlineColor"
|
|
714
|
-
[outlineOpacity]="inputs.state().outlineOpacity"
|
|
715
|
-
[strokeWidth]="inputs.state().strokeWidth"
|
|
716
|
-
[strokeColor]="inputs.state().strokeColor"
|
|
717
|
-
[strokeOpacity]="inputs.state().strokeOpacity"
|
|
718
|
-
[fillOpacity]="inputs.state().fillOpacity"
|
|
719
|
-
[debugSDF]="inputs.state().debugSDF"
|
|
726
|
+
*args="args()"
|
|
727
|
+
[text]="text()"
|
|
728
|
+
[font]="font()"
|
|
729
|
+
[anchorX]="anchorX()"
|
|
730
|
+
[anchorY]="anchorY()"
|
|
731
|
+
[sdfGlyphSize]="sdfGlyphSize()"
|
|
732
|
+
[fontSize]="fontSize()"
|
|
733
|
+
[parameters]="parameters()"
|
|
720
734
|
>
|
|
721
735
|
<ng-content />
|
|
722
736
|
</ngt-primitive>
|
|
723
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }] }); }
|
|
737
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
724
738
|
}
|
|
725
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
739
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsText, decorators: [{
|
|
726
740
|
type: Component,
|
|
727
741
|
args: [{
|
|
728
742
|
selector: 'ngts-text',
|
|
729
743
|
standalone: true,
|
|
730
744
|
template: `
|
|
731
745
|
<ngt-primitive
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
[
|
|
735
|
-
[
|
|
736
|
-
[
|
|
737
|
-
[
|
|
738
|
-
[
|
|
739
|
-
[
|
|
740
|
-
[sdfGlyphSize]="inputs.state().sdfGlyphSize"
|
|
741
|
-
[characters]="inputs.state().characters"
|
|
742
|
-
[color]="inputs.state().color"
|
|
743
|
-
[maxWidth]="inputs.state().maxWidth"
|
|
744
|
-
[lineHeight]="inputs.state().lineHeight"
|
|
745
|
-
[letterSpacing]="inputs.state().letterSpacing"
|
|
746
|
-
[textAlign]="inputs.state().textAlign"
|
|
747
|
-
[clipRect]="inputs.state().clipRect"
|
|
748
|
-
[depthOffset]="inputs.state().depthOffset"
|
|
749
|
-
[direction]="inputs.state().direction"
|
|
750
|
-
[overflowWrap]="inputs.state().overflowWrap"
|
|
751
|
-
[whiteSpace]="inputs.state().whiteSpace"
|
|
752
|
-
[outlineWidth]="inputs.state().outlineWidth"
|
|
753
|
-
[outlineOffsetX]="inputs.state().outlineOffsetX"
|
|
754
|
-
[outlineOffsetY]="inputs.state().outlineOffsetY"
|
|
755
|
-
[outlineBlur]="inputs.state().outlineBlur"
|
|
756
|
-
[outlineColor]="inputs.state().outlineColor"
|
|
757
|
-
[outlineOpacity]="inputs.state().outlineOpacity"
|
|
758
|
-
[strokeWidth]="inputs.state().strokeWidth"
|
|
759
|
-
[strokeColor]="inputs.state().strokeColor"
|
|
760
|
-
[strokeOpacity]="inputs.state().strokeOpacity"
|
|
761
|
-
[fillOpacity]="inputs.state().fillOpacity"
|
|
762
|
-
[debugSDF]="inputs.state().debugSDF"
|
|
746
|
+
*args="args()"
|
|
747
|
+
[text]="text()"
|
|
748
|
+
[font]="font()"
|
|
749
|
+
[anchorX]="anchorX()"
|
|
750
|
+
[anchorY]="anchorY()"
|
|
751
|
+
[sdfGlyphSize]="sdfGlyphSize()"
|
|
752
|
+
[fontSize]="fontSize()"
|
|
753
|
+
[parameters]="parameters()"
|
|
763
754
|
>
|
|
764
755
|
<ng-content />
|
|
765
756
|
</ngt-primitive>
|
|
757
|
+
`,
|
|
758
|
+
imports: [NgtArgs, NgTemplateOutlet],
|
|
759
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
760
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
761
|
+
}]
|
|
762
|
+
}], ctorParameters: () => [] });
|
|
763
|
+
|
|
764
|
+
const defaultOptions = {
|
|
765
|
+
letterSpacing: 0,
|
|
766
|
+
lineHeight: 1,
|
|
767
|
+
size: 1,
|
|
768
|
+
height: 0.2,
|
|
769
|
+
bevelThickness: 0.1,
|
|
770
|
+
bevelSize: 0.01,
|
|
771
|
+
bevelEnabled: false,
|
|
772
|
+
bevelOffset: 0,
|
|
773
|
+
bevelSegments: 4,
|
|
774
|
+
curveSegments: 8,
|
|
775
|
+
};
|
|
776
|
+
class NgtsText3D {
|
|
777
|
+
constructor() {
|
|
778
|
+
this.font = input.required();
|
|
779
|
+
this.text = input.required();
|
|
780
|
+
this.options = input(defaultOptions, { transform: mergeInputs(defaultOptions) });
|
|
781
|
+
this.parameters = omit(this.options, [
|
|
782
|
+
'letterSpacing',
|
|
783
|
+
'lineHeight',
|
|
784
|
+
'size',
|
|
785
|
+
'height',
|
|
786
|
+
'bevelThickness',
|
|
787
|
+
'bevelSize',
|
|
788
|
+
'bevelEnabled',
|
|
789
|
+
'bevelOffset',
|
|
790
|
+
'bevelSegments',
|
|
791
|
+
'curveSegments',
|
|
792
|
+
'smooth',
|
|
793
|
+
]);
|
|
794
|
+
this.mesh = viewChild('mesh');
|
|
795
|
+
this.loadedFont = injectFont(this.font);
|
|
796
|
+
this.smooth = pick(this.options, 'smooth');
|
|
797
|
+
this.textOptions = pick(this.options, [
|
|
798
|
+
'letterSpacing',
|
|
799
|
+
'lineHeight',
|
|
800
|
+
'size',
|
|
801
|
+
'height',
|
|
802
|
+
'bevelThickness',
|
|
803
|
+
'bevelSize',
|
|
804
|
+
'bevelEnabled',
|
|
805
|
+
'bevelOffset',
|
|
806
|
+
'bevelSegments',
|
|
807
|
+
'curveSegments',
|
|
808
|
+
]);
|
|
809
|
+
this.textArgs = computed(() => {
|
|
810
|
+
const [text, font, textOptions] = [this.text(), this.loadedFont(), this.textOptions()];
|
|
811
|
+
if (!font)
|
|
812
|
+
return null;
|
|
813
|
+
return [text, { font, ...textOptions }];
|
|
814
|
+
});
|
|
815
|
+
extend({ Mesh, TextGeometry });
|
|
816
|
+
const autoEffect = injectAutoEffect();
|
|
817
|
+
afterNextRender(() => {
|
|
818
|
+
autoEffect(() => {
|
|
819
|
+
const [mesh, smooth, textArgs] = [this.mesh()?.nativeElement, this.smooth(), this.textArgs()];
|
|
820
|
+
if (!textArgs || !mesh)
|
|
821
|
+
return;
|
|
822
|
+
if (smooth) {
|
|
823
|
+
mesh.geometry = mergeVertices(mesh.geometry, smooth);
|
|
824
|
+
mesh.geometry.computeVertexNormals();
|
|
825
|
+
}
|
|
826
|
+
});
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsText3D, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
830
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.1.0", type: NgtsText3D, isStandalone: true, selector: "ngts-text-3d", inputs: { font: { classPropertyName: "font", publicName: "font", isSignal: true, isRequired: true, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "mesh", first: true, predicate: ["mesh"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
831
|
+
<ngt-mesh #mesh [parameters]="parameters()">
|
|
832
|
+
<ngt-text-geometry *args="textArgs()" />
|
|
833
|
+
<ng-content />
|
|
834
|
+
</ngt-mesh>
|
|
835
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
836
|
+
}
|
|
837
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgtsText3D, decorators: [{
|
|
838
|
+
type: Component,
|
|
839
|
+
args: [{
|
|
840
|
+
selector: 'ngts-text-3d',
|
|
841
|
+
standalone: true,
|
|
842
|
+
template: `
|
|
843
|
+
<ngt-mesh #mesh [parameters]="parameters()">
|
|
844
|
+
<ngt-text-geometry *args="textArgs()" />
|
|
845
|
+
<ng-content />
|
|
846
|
+
</ngt-mesh>
|
|
766
847
|
`,
|
|
767
848
|
imports: [NgtArgs],
|
|
768
849
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
850
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
769
851
|
}]
|
|
770
|
-
}], ctorParameters:
|
|
771
|
-
type: Input
|
|
772
|
-
}], text: [{
|
|
773
|
-
type: Input,
|
|
774
|
-
args: [{ required: true }]
|
|
775
|
-
}], font: [{
|
|
776
|
-
type: Input
|
|
777
|
-
}], fontSize: [{
|
|
778
|
-
type: Input
|
|
779
|
-
}], anchorX: [{
|
|
780
|
-
type: Input
|
|
781
|
-
}], anchorY: [{
|
|
782
|
-
type: Input
|
|
783
|
-
}], sdfGlyphSize: [{
|
|
784
|
-
type: Input
|
|
785
|
-
}], characters: [{
|
|
786
|
-
type: Input
|
|
787
|
-
}], color: [{
|
|
788
|
-
type: Input
|
|
789
|
-
}], maxWidth: [{
|
|
790
|
-
type: Input
|
|
791
|
-
}], lineHeight: [{
|
|
792
|
-
type: Input
|
|
793
|
-
}], letterSpacing: [{
|
|
794
|
-
type: Input
|
|
795
|
-
}], textAlign: [{
|
|
796
|
-
type: Input
|
|
797
|
-
}], clipRect: [{
|
|
798
|
-
type: Input
|
|
799
|
-
}], depthOffset: [{
|
|
800
|
-
type: Input
|
|
801
|
-
}], direction: [{
|
|
802
|
-
type: Input
|
|
803
|
-
}], overflowWrap: [{
|
|
804
|
-
type: Input
|
|
805
|
-
}], whiteSpace: [{
|
|
806
|
-
type: Input
|
|
807
|
-
}], outlineWidth: [{
|
|
808
|
-
type: Input
|
|
809
|
-
}], outlineOffsetX: [{
|
|
810
|
-
type: Input
|
|
811
|
-
}], outlineOffsetY: [{
|
|
812
|
-
type: Input
|
|
813
|
-
}], outlineBlur: [{
|
|
814
|
-
type: Input
|
|
815
|
-
}], outlineColor: [{
|
|
816
|
-
type: Input
|
|
817
|
-
}], outlineOpacity: [{
|
|
818
|
-
type: Input
|
|
819
|
-
}], strokeWidth: [{
|
|
820
|
-
type: Input
|
|
821
|
-
}], strokeColor: [{
|
|
822
|
-
type: Input
|
|
823
|
-
}], strokeOpacity: [{
|
|
824
|
-
type: Input
|
|
825
|
-
}], fillOpacity: [{
|
|
826
|
-
type: Input
|
|
827
|
-
}], debugSDF: [{
|
|
828
|
-
type: Input
|
|
829
|
-
}], sync: [{
|
|
830
|
-
type: Output
|
|
831
|
-
}] } });
|
|
852
|
+
}], ctorParameters: () => [] });
|
|
832
853
|
|
|
833
854
|
/**
|
|
834
855
|
* Generated bundle index. Do not edit.
|
|
835
856
|
*/
|
|
836
857
|
|
|
837
|
-
export {
|
|
858
|
+
export { NgtsCatmullRomLine, NgtsCubicBezierLine, NgtsEdges, NgtsGradientTexture, NgtsGrid, NgtsHelper, NgtsLine, NgtsPrismGeometry, NgtsQuadraticBezierLine, NgtsText, NgtsText3D, injectHelper };
|
|
838
859
|
//# sourceMappingURL=angular-three-soba-abstractions.mjs.map
|