angular-three-soba 2.0.0-beta.4 → 2.0.0-beta.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abstractions/billboard/billboard.d.ts +12 -8
- package/abstractions/detailed/detailed.d.ts +26 -0
- package/abstractions/edges/edges.d.ts +24 -12
- package/abstractions/grid/grid.d.ts +42 -51
- package/abstractions/index.d.ts +1 -7
- package/abstractions/text/text.d.ts +10 -4
- package/abstractions/text-3d/text-3d.d.ts +51 -41
- package/cameras/camera/camera-content.d.ts +1 -1
- package/cameras/camera/camera.d.ts +16 -13
- package/cameras/cube-camera/cube-camera.d.ts +49 -23
- package/cameras/index.d.ts +0 -1
- package/cameras/orthographic-camera/orthographic-camera.d.ts +29 -18
- package/cameras/perspective-camera/perspective-camera.d.ts +10 -1
- package/controls/orbit-controls/orbit-controls.d.ts +34 -15
- package/esm2022/abstractions/billboard/billboard.mjs +36 -33
- package/esm2022/abstractions/detailed/detailed.mjs +64 -0
- package/esm2022/abstractions/edges/edges.mjs +58 -63
- package/esm2022/abstractions/grid/grid.mjs +140 -110
- package/esm2022/abstractions/index.mjs +2 -8
- package/esm2022/abstractions/text/text.mjs +123 -122
- package/esm2022/abstractions/text-3d/text-3d.mjs +120 -115
- package/esm2022/cameras/camera/camera-content.mjs +6 -6
- package/esm2022/cameras/camera/camera.mjs +48 -42
- package/esm2022/cameras/cube-camera/cube-camera.mjs +120 -100
- package/esm2022/cameras/index.mjs +1 -2
- package/esm2022/cameras/orthographic-camera/orthographic-camera.mjs +78 -75
- package/esm2022/cameras/perspective-camera/perspective-camera.mjs +25 -26
- package/esm2022/controls/orbit-controls/orbit-controls.mjs +109 -85
- package/esm2022/gizmos/angular-three-soba-gizmos.mjs +5 -0
- package/esm2022/gizmos/gizmo-helper/gizmo-helper.mjs +198 -0
- package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/constants.mjs +31 -0
- package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.mjs +93 -0
- package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.mjs +151 -0
- package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-input.mjs +66 -0
- package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube.mjs +71 -0
- package/esm2022/gizmos/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.mjs +195 -0
- package/esm2022/gizmos/gizmo-helper/gizmo-viewport/gizmo-viewport.mjs +272 -0
- package/esm2022/gizmos/index.mjs +4 -0
- package/esm2022/loaders/gltf-loader/gltf-loader.mjs +14 -9
- package/esm2022/loaders/loader/loader.mjs +92 -87
- package/esm2022/loaders/progress/progress.mjs +31 -30
- package/esm2022/loaders/texture-loader/texture-loader.mjs +20 -15
- package/esm2022/materials/index.mjs +2 -1
- package/esm2022/materials/mesh-distort-material/mesh-distort-material.mjs +60 -51
- package/esm2022/materials/mesh-reflector-material/mesh-reflector-material.mjs +239 -255
- package/esm2022/materials/mesh-refraction-material/mesh-refraction-material.mjs +99 -97
- package/esm2022/materials/mesh-transmission-material/mesh-transmission-material.mjs +164 -144
- package/esm2022/materials/mesh-wobble-material/mesh-wobble-material.mjs +44 -42
- package/esm2022/materials/point-material/point-material.mjs +50 -0
- package/esm2022/misc/animations/animations.mjs +28 -23
- package/esm2022/misc/bake-shadows/bake-shadows.mjs +13 -13
- package/esm2022/misc/caustics/caustics.mjs +387 -0
- package/esm2022/misc/decal/decal.mjs +187 -0
- package/esm2022/misc/depth-buffer/depth-buffer.mjs +41 -37
- package/esm2022/misc/example/example.mjs +161 -0
- package/esm2022/misc/fbo/fbo.mjs +42 -36
- package/esm2022/misc/html/html-wrapper.mjs +478 -0
- package/esm2022/misc/html/html.mjs +305 -0
- package/esm2022/misc/index.mjs +10 -1
- package/esm2022/misc/sampler/sampler.mjs +132 -0
- package/esm2022/misc/shadow/shadow.mjs +111 -0
- package/esm2022/misc/stats-gl/stats-gl.mjs +61 -0
- package/esm2022/misc/trail/trail.mjs +204 -0
- package/esm2022/misc/trail-texture/inject-trail-texture.mjs +17 -0
- package/esm2022/misc/trail-texture/trail-texture.mjs +106 -0
- package/esm2022/modifiers/angular-three-soba-modifiers.mjs +5 -0
- package/esm2022/modifiers/curve-modifier/curve-modifier.mjs +64 -0
- package/esm2022/modifiers/index.mjs +2 -0
- package/esm2022/performances/adaptive-dpr/adaptive-dpr.mjs +44 -0
- package/esm2022/performances/adaptive-events/adaptive-events.mjs +27 -0
- package/esm2022/performances/angular-three-soba-performances.mjs +5 -0
- package/esm2022/performances/index.mjs +8 -0
- package/esm2022/performances/instances/instances.mjs +221 -0
- package/esm2022/performances/instances/position-mesh.mjs +52 -0
- package/esm2022/performances/points/points-input.mjs +64 -0
- package/esm2022/performances/points/points.mjs +327 -0
- package/esm2022/performances/points/position-point.mjs +54 -0
- package/esm2022/performances/segments/segment-object.mjs +9 -0
- package/esm2022/performances/segments/segments.mjs +183 -0
- package/esm2022/shaders/blur-pass/blur-pass.mjs +2 -2
- package/esm2022/shaders/caustics/caustics-material.mjs +130 -0
- package/esm2022/shaders/caustics/caustics-projection-material.mjs +32 -0
- package/esm2022/shaders/convolution-material/convolution-material.mjs +3 -2
- package/esm2022/shaders/discard-material/discard-material.mjs +1 -1
- package/esm2022/shaders/grid-material/grid-material.mjs +30 -14
- package/esm2022/shaders/index.mjs +5 -3
- package/esm2022/shaders/mesh-distort-material/mesh-distort-material.mjs +42 -41
- package/esm2022/shaders/mesh-reflector-material/mesh-reflector-material.mjs +2 -2
- package/esm2022/shaders/mesh-refraction-material/mesh-refraction-material.mjs +3 -2
- package/esm2022/shaders/mesh-transmission-material/mesh-transmission-material.mjs +7 -4
- package/esm2022/shaders/mesh-wobble-material/mesh-wobble-material.mjs +1 -1
- package/esm2022/shaders/shader-material/shader-material.mjs +3 -5
- package/esm2022/shaders/soft-shadow-material/soft-shadow-material.mjs +18 -25
- package/esm2022/shaders/sparkles-material/sparkles-material.mjs +32 -46
- package/esm2022/shaders/spot-light-material/spot-light-material.mjs +8 -7
- package/esm2022/shaders/star-field-material/star-field-material.mjs +3 -2
- package/esm2022/shaders/wireframe-material/wireframe-material.mjs +247 -0
- package/esm2022/staging/accumulative-shadows/accumulative-shadows.mjs +161 -176
- package/esm2022/staging/accumulative-shadows/progressive-light-map.mjs +8 -8
- package/esm2022/staging/accumulative-shadows/randomized-lights.mjs +129 -129
- package/esm2022/staging/backdrop/backdrop.mjs +77 -0
- package/esm2022/staging/bb-anchor/bb-anchor.mjs +69 -0
- package/esm2022/staging/bounds/bounds.mjs +145 -143
- package/esm2022/staging/camera-shake/camera-shake.mjs +86 -80
- package/esm2022/staging/center/center.mjs +129 -112
- package/esm2022/staging/cloud/cloud.mjs +118 -124
- package/esm2022/staging/contact-shadows/contact-shadows.mjs +131 -136
- package/esm2022/staging/environment/assets.mjs +12 -12
- package/esm2022/staging/environment/environment-cube.mjs +28 -30
- package/esm2022/staging/environment/environment-ground.mjs +17 -19
- package/esm2022/staging/environment/environment-input.mjs +98 -85
- package/esm2022/staging/environment/environment-map.mjs +33 -33
- package/esm2022/staging/environment/environment-portal.mjs +75 -97
- package/esm2022/staging/environment/environment.mjs +34 -51
- package/esm2022/staging/environment/utils.mjs +40 -17
- package/esm2022/staging/float/float.mjs +70 -58
- package/esm2022/staging/index.mjs +7 -3
- package/esm2022/staging/matcap-texture/matcap-texture.mjs +64 -0
- package/esm2022/staging/normal-texture/normal-texture.mjs +53 -0
- package/esm2022/staging/sky/sky.mjs +85 -80
- package/esm2022/staging/sparkles/sparkles.mjs +108 -105
- package/esm2022/staging/spot-light/shadow-mesh-input.mjs +63 -0
- package/esm2022/staging/spot-light/shadow-mesh.mjs +267 -0
- package/esm2022/staging/spot-light/spot-light-input.mjs +67 -58
- package/esm2022/staging/spot-light/spot-light.mjs +51 -63
- package/esm2022/staging/spot-light/volumetric-mesh.mjs +67 -70
- package/esm2022/staging/stage/stage.mjs +305 -290
- package/esm2022/staging/stars/stars.mjs +101 -102
- package/esm2022/staging/wireframe/wireframe-input.mjs +191 -0
- package/esm2022/staging/wireframe/wireframe.mjs +228 -0
- package/esm2022/utils/angular-three-soba-utils.mjs +5 -0
- package/esm2022/utils/constants.mjs +3 -0
- package/esm2022/utils/content/content.mjs +15 -0
- package/esm2022/utils/index.mjs +3 -0
- package/fesm2022/angular-three-soba-abstractions.mjs +504 -2079
- package/fesm2022/angular-three-soba-abstractions.mjs.map +1 -1
- package/fesm2022/angular-three-soba-cameras.mjs +293 -260
- package/fesm2022/angular-three-soba-cameras.mjs.map +1 -1
- package/fesm2022/angular-three-soba-controls.mjs +108 -83
- package/fesm2022/angular-three-soba-controls.mjs.map +1 -1
- package/fesm2022/angular-three-soba-gizmos.mjs +1045 -0
- package/fesm2022/angular-three-soba-gizmos.mjs.map +1 -0
- package/fesm2022/angular-three-soba-loaders.mjs +148 -132
- package/fesm2022/angular-three-soba-loaders.mjs.map +1 -1
- package/fesm2022/angular-three-soba-materials.mjs +656 -588
- package/fesm2022/angular-three-soba-materials.mjs.map +1 -1
- package/fesm2022/angular-three-soba-misc.mjs +2202 -99
- package/fesm2022/angular-three-soba-misc.mjs.map +1 -1
- package/fesm2022/angular-three-soba-modifiers.mjs +71 -0
- package/fesm2022/angular-three-soba-modifiers.mjs.map +1 -0
- package/fesm2022/angular-three-soba-performances.mjs +957 -0
- package/fesm2022/angular-three-soba-performances.mjs.map +1 -0
- package/fesm2022/angular-three-soba-shaders.mjs +508 -269
- package/fesm2022/angular-three-soba-shaders.mjs.map +1 -1
- package/fesm2022/angular-three-soba-staging.mjs +2910 -2573
- package/fesm2022/angular-three-soba-staging.mjs.map +1 -1
- package/fesm2022/angular-three-soba-utils.mjs +25 -0
- package/fesm2022/angular-three-soba-utils.mjs.map +1 -0
- package/gizmos/README.md +3 -0
- package/gizmos/gizmo-helper/gizmo-helper.d.ts +73 -0
- package/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.d.ts +22 -0
- package/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.d.ts +29 -0
- package/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-input.d.ts +33 -0
- package/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube.d.ts +10 -0
- package/gizmos/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.d.ts +40 -0
- package/gizmos/gizmo-helper/gizmo-viewport/gizmo-viewport.d.ts +30 -0
- package/gizmos/index.d.ts +3 -0
- package/loaders/gltf-loader/gltf-loader.d.ts +15 -4
- package/loaders/loader/loader.d.ts +19 -17
- package/loaders/progress/progress.d.ts +1 -1
- package/loaders/texture-loader/texture-loader.d.ts +8 -3
- package/materials/index.d.ts +1 -0
- package/materials/mesh-distort-material/mesh-distort-material.d.ts +25 -15
- package/materials/mesh-reflector-material/mesh-reflector-material.d.ts +74 -56
- package/materials/mesh-refraction-material/mesh-refraction-material.d.ts +33 -21
- package/materials/mesh-transmission-material/mesh-transmission-material.d.ts +55 -39
- package/materials/mesh-wobble-material/mesh-wobble-material.d.ts +19 -10
- package/materials/point-material/point-material.d.ts +24 -0
- package/metadata.json +1 -0
- package/misc/animations/animations.d.ts +6 -4
- package/misc/caustics/caustics.d.ts +87 -0
- package/misc/decal/decal.d.ts +49 -0
- package/misc/depth-buffer/depth-buffer.d.ts +2 -2
- package/misc/example/example.d.ts +85 -0
- package/misc/fbo/fbo.d.ts +2 -2
- package/misc/html/html-wrapper.d.ts +559 -0
- package/misc/html/html.d.ts +218 -0
- package/misc/index.d.ts +9 -0
- package/misc/sampler/sampler.d.ts +67 -0
- package/misc/shadow/shadow.d.ts +37 -0
- package/misc/stats-gl/stats-gl.d.ts +24 -0
- package/misc/trail/trail.d.ts +57 -0
- package/misc/trail-texture/inject-trail-texture.d.ts +9 -0
- package/misc/trail-texture/trail-texture.d.ts +50 -0
- package/modifiers/README.md +3 -0
- package/modifiers/curve-modifier/curve-modifier.d.ts +23 -0
- package/modifiers/index.d.ts +1 -0
- package/package.json +42 -24
- package/performances/README.md +3 -0
- package/performances/adaptive-dpr/adaptive-dpr.d.ts +14 -0
- package/{performance/adaptive → performances/adaptive-events}/adaptive-events.d.ts +3 -0
- package/performances/index.d.ts +7 -0
- package/performances/instances/instances.d.ts +83 -0
- package/{performance → performances}/instances/position-mesh.d.ts +1 -1
- package/performances/points/points-input.d.ts +32 -0
- package/performances/points/points.d.ts +96 -0
- package/performances/points/position-point.d.ts +11 -0
- package/performances/segments/segment-object.d.ts +7 -0
- package/performances/segments/segments.d.ts +128 -0
- package/shaders/grid-material/grid-material.d.ts +33 -0
- package/shaders/index.d.ts +4 -2
- package/shaders/mesh-distort-material/mesh-distort-material.d.ts +173 -6
- package/shaders/mesh-transmission-material/mesh-transmission-material.d.ts +1 -1
- package/shaders/shader-material/shader-material.d.ts +2 -2
- package/shaders/soft-shadow-material/soft-shadow-material.d.ts +10 -1
- package/shaders/sparkles-material/sparkles-material.d.ts +13 -0
- package/shaders/spot-light-material/spot-light-material.d.ts +11 -2
- package/shaders/star-field-material/star-field-material.d.ts +9 -0
- package/shaders/wireframe-material/wireframe-material.d.ts +58 -0
- package/staging/accumulative-shadows/accumulative-shadows.d.ts +93 -39
- package/staging/accumulative-shadows/randomized-lights.d.ts +41 -28
- package/staging/backdrop/backdrop.d.ts +30 -0
- package/staging/bb-anchor/bb-anchor.d.ts +27 -0
- package/staging/bounds/bounds.d.ts +105 -25
- package/staging/camera-shake/camera-shake.d.ts +30 -19
- package/staging/center/center.d.ts +43 -35
- package/staging/cloud/cloud.d.ts +27 -24
- package/staging/contact-shadows/contact-shadows.d.ts +43 -30
- package/staging/environment/assets.d.ts +9 -9
- package/staging/environment/environment-cube.d.ts +9 -5
- package/staging/environment/environment-ground.d.ts +7 -7
- package/staging/environment/environment-input.d.ts +38 -38
- package/staging/environment/environment-map.d.ts +10 -5
- package/staging/environment/environment-portal.d.ts +10 -5
- package/staging/environment/environment.d.ts +0 -4
- package/staging/environment/utils.d.ts +2 -2
- package/staging/float/float.d.ts +15 -11
- package/staging/index.d.ts +6 -2
- package/staging/matcap-texture/matcap-texture.d.ts +13 -0
- package/staging/normal-texture/normal-texture.d.ts +16 -0
- package/staging/sky/sky.d.ts +28 -21
- package/staging/sparkles/sparkles.d.ts +36 -22
- package/staging/spot-light/shadow-mesh-input.d.ts +29 -0
- package/staging/spot-light/shadow-mesh.d.ts +37 -0
- package/staging/spot-light/spot-light-input.d.ts +25 -25
- package/staging/spot-light/spot-light.d.ts +35 -15
- package/staging/spot-light/volumetric-mesh.d.ts +15 -9
- package/staging/stage/stage.d.ts +89 -65
- package/staging/stars/stars.d.ts +28 -17
- package/staging/wireframe/wireframe-input.d.ts +65 -0
- package/staging/wireframe/wireframe.d.ts +28 -0
- package/utils/README.md +3 -0
- package/utils/constants.d.ts +1 -0
- package/utils/content/content.d.ts +8 -0
- package/utils/index.d.ts +2 -0
- package/web-types.json +1 -0
- package/abstractions/catmull-rom-line/catmull-rom-line.d.ts +0 -25
- package/abstractions/cubic-bezier-line/cubic-bezier-line.d.ts +0 -25
- package/abstractions/gizmo-helper/gizmo-helper.d.ts +0 -34
- package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.d.ts +0 -22
- package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.d.ts +0 -30
- package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.d.ts +0 -32
- package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube.d.ts +0 -14
- package/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.d.ts +0 -47
- package/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport.d.ts +0 -40
- package/abstractions/line/line-input.d.ts +0 -42
- package/abstractions/line/line.d.ts +0 -35
- package/abstractions/quadratic-bezier-line/quadratic-bezier-line.d.ts +0 -23
- package/esm2022/abstractions/catmull-rom-line/catmull-rom-line.mjs +0 -131
- package/esm2022/abstractions/cubic-bezier-line/cubic-bezier-line.mjs +0 -113
- package/esm2022/abstractions/gizmo-helper/gizmo-helper.mjs +0 -210
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/constants.mjs +0 -31
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.mjs +0 -95
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.mjs +0 -155
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.mjs +0 -62
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube.mjs +0 -80
- package/esm2022/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.mjs +0 -206
- package/esm2022/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport.mjs +0 -273
- package/esm2022/abstractions/line/line-input.mjs +0 -113
- package/esm2022/abstractions/line/line.mjs +0 -165
- package/esm2022/abstractions/quadratic-bezier-line/quadratic-bezier-line.mjs +0 -128
- package/esm2022/performance/adaptive/adaptive-dpr.mjs +0 -46
- package/esm2022/performance/adaptive/adaptive-events.mjs +0 -31
- package/esm2022/performance/angular-three-soba-performance.mjs +0 -5
- package/esm2022/performance/detailed/detailed.mjs +0 -61
- package/esm2022/performance/index.mjs +0 -7
- package/esm2022/performance/instances/instance.mjs +0 -48
- package/esm2022/performance/instances/instances.mjs +0 -189
- package/esm2022/performance/instances/position-mesh.mjs +0 -52
- package/esm2022/performance/stats/stats.mjs +0 -79
- package/esm2022/shaders/caustics-material/caustics-material.mjs +0 -128
- package/esm2022/shaders/caustics-material/caustics-projection-material.mjs +0 -33
- package/esm2022/staging/caustics/caustisc.mjs +0 -384
- package/esm2022/staging/spot-light/spot-light-shadow-mesh-input.mjs +0 -57
- package/esm2022/staging/spot-light/spot-light-shadow-mesh.mjs +0 -256
- package/fesm2022/angular-three-soba-performance.mjs +0 -487
- package/fesm2022/angular-three-soba-performance.mjs.map +0 -1
- package/performance/README.md +0 -3
- package/performance/adaptive/adaptive-dpr.d.ts +0 -8
- package/performance/detailed/detailed.d.ts +0 -20
- package/performance/index.d.ts +0 -6
- package/performance/instances/instance.d.ts +0 -9
- package/performance/instances/instances.d.ts +0 -35
- package/performance/stats/stats.d.ts +0 -18
- package/plugin/generators.json +0 -19
- package/plugin/libs/plugin/README.md +0 -11
- package/plugin/package.json +0 -9
- package/plugin/src/generators/init/compat.d.ts +0 -2
- package/plugin/src/generators/init/compat.js +0 -6
- package/plugin/src/generators/init/compat.js.map +0 -1
- package/plugin/src/generators/init/init.d.ts +0 -7
- package/plugin/src/generators/init/init.js +0 -28
- package/plugin/src/generators/init/init.js.map +0 -1
- package/plugin/src/generators/init/schema.json +0 -6
- package/plugin/src/index.d.ts +0 -1
- package/plugin/src/index.js +0 -6
- package/plugin/src/index.js.map +0 -1
- package/staging/caustics/caustisc.d.ts +0 -70
- package/staging/spot-light/spot-light-shadow-mesh-input.d.ts +0 -29
- package/staging/spot-light/spot-light-shadow-mesh.d.ts +0 -38
- /package/{abstractions → gizmos}/gizmo-helper/gizmo-viewcube/constants.d.ts +0 -0
- /package/shaders/{caustics-material → caustics}/caustics-material.d.ts +0 -0
- /package/shaders/{caustics-material → caustics}/caustics-projection-material.d.ts +0 -0
|
@@ -0,0 +1,1045 @@
|
|
|
1
|
+
import { NgTemplateOutlet, DOCUMENT, NgFor, NgIf } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { forwardRef, EventEmitter, computed, effect, TemplateRef, Component, CUSTOM_ELEMENTS_SCHEMA, Input, Output, ContentChild, Directive, inject, signal } from '@angular/core';
|
|
4
|
+
import { extend, signalStore, injectNgtRef, injectNgtStore, injectBeforeRender, NgtPortal, NgtPortalContent, NgtArgs } from 'angular-three';
|
|
5
|
+
import { NgtsOrthographicCamera } from 'angular-three-soba/cameras';
|
|
6
|
+
import { NgtsSobaContent } from 'angular-three-soba/utils';
|
|
7
|
+
import { createInjectionToken } from 'ngxtension/create-injection-token';
|
|
8
|
+
import * as THREE from 'three';
|
|
9
|
+
import { Group, Quaternion, Matrix4, Vector3, Object3D, Mesh, BoxGeometry, MeshBasicMaterial, MeshLambertMaterial, CanvasTexture, AmbientLight, PointLight, Sprite, SpriteMaterial } from 'three';
|
|
10
|
+
import 'three-stdlib';
|
|
11
|
+
import { Repeat } from 'ngxtension/repeat';
|
|
12
|
+
|
|
13
|
+
const isOrbitControls = (controls) => {
|
|
14
|
+
return 'minPolarAngle' in controls;
|
|
15
|
+
};
|
|
16
|
+
extend({ Group });
|
|
17
|
+
const [injectNgtsGizmoHelperApi, provideNgtsGizmoHelperApi] = createInjectionToken((gizmoHelper) => gizmoHelper.api, { isRoot: false, deps: [forwardRef(() => NgtsGizmoHelper)] });
|
|
18
|
+
class NgtsGizmoHelper {
|
|
19
|
+
set _alignment(alignment) {
|
|
20
|
+
this.inputs.set({ alignment });
|
|
21
|
+
}
|
|
22
|
+
set _margin(margin) {
|
|
23
|
+
this.inputs.set({ margin });
|
|
24
|
+
}
|
|
25
|
+
set _renderPriority(renderPriority) {
|
|
26
|
+
this.inputs.set({ renderPriority });
|
|
27
|
+
}
|
|
28
|
+
set _autoClear(autoClear) {
|
|
29
|
+
this.inputs.set({ autoClear });
|
|
30
|
+
}
|
|
31
|
+
constructor() {
|
|
32
|
+
this.inputs = signalStore({
|
|
33
|
+
alignment: 'bottom-right',
|
|
34
|
+
margin: [80, 80],
|
|
35
|
+
renderPriority: 1,
|
|
36
|
+
});
|
|
37
|
+
this.gizmoRef = injectNgtRef();
|
|
38
|
+
this.update = new EventEmitter();
|
|
39
|
+
this.store = injectNgtStore();
|
|
40
|
+
this.mainCamera = this.store.select('camera');
|
|
41
|
+
// @ts-expect-error
|
|
42
|
+
this.defaultControls = this.store.select('controls');
|
|
43
|
+
this.invalidate = this.store.select('invalidate');
|
|
44
|
+
this.size = this.store.select('size');
|
|
45
|
+
this.animating = false;
|
|
46
|
+
this.q1 = new Quaternion();
|
|
47
|
+
this.q2 = new Quaternion();
|
|
48
|
+
this.turnRate = 2 * Math.PI; // turn rate in angles per second
|
|
49
|
+
this.matrix = new Matrix4();
|
|
50
|
+
this.radius = 0;
|
|
51
|
+
this.focusPoint = new Vector3(0, 0, 0);
|
|
52
|
+
this.defaultUp = new Vector3(0, 0, 0);
|
|
53
|
+
this.target = new Vector3();
|
|
54
|
+
this.targetPosition = new Vector3();
|
|
55
|
+
this.dummy = new Object3D();
|
|
56
|
+
this.margin = this.inputs.select('margin');
|
|
57
|
+
this.alignment = this.inputs.select('alignment');
|
|
58
|
+
this.virtualCamRef = injectNgtRef();
|
|
59
|
+
this.renderPriority = this.inputs.select('renderPriority');
|
|
60
|
+
this.gizmoPosition = computed(() => {
|
|
61
|
+
const [{ width, height }, [marginX, marginY], alignment] = [this.size(), this.margin(), this.alignment()];
|
|
62
|
+
const x = alignment.endsWith('-center')
|
|
63
|
+
? 0
|
|
64
|
+
: alignment.endsWith('-left')
|
|
65
|
+
? -width / 2 + marginX
|
|
66
|
+
: width / 2 - marginX;
|
|
67
|
+
const y = alignment.startsWith('center-')
|
|
68
|
+
? 0
|
|
69
|
+
: alignment.startsWith('top-')
|
|
70
|
+
? height / 2 - marginY
|
|
71
|
+
: -height / 2 + marginY;
|
|
72
|
+
return [x, y, 0];
|
|
73
|
+
});
|
|
74
|
+
this.api = {
|
|
75
|
+
tweenCamera: (direction) => {
|
|
76
|
+
const [defaultControls, mainCamera, invalidate] = [
|
|
77
|
+
this.defaultControls(),
|
|
78
|
+
this.mainCamera(),
|
|
79
|
+
this.invalidate(),
|
|
80
|
+
];
|
|
81
|
+
this.animating = true;
|
|
82
|
+
if (defaultControls)
|
|
83
|
+
this.focusPoint = defaultControls?.target;
|
|
84
|
+
this.radius = mainCamera.position.distanceTo(this.target);
|
|
85
|
+
// Rotate from current camera orientation
|
|
86
|
+
this.q1.copy(mainCamera.quaternion);
|
|
87
|
+
// To new current camera orientation
|
|
88
|
+
this.targetPosition.copy(direction).multiplyScalar(this.radius).add(this.target);
|
|
89
|
+
this.dummy.lookAt(this.targetPosition);
|
|
90
|
+
this.dummy.up.copy(mainCamera.up);
|
|
91
|
+
this.q2.copy(this.dummy.quaternion);
|
|
92
|
+
invalidate();
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
this.trackMainCameraUp();
|
|
96
|
+
this.beforeRender();
|
|
97
|
+
}
|
|
98
|
+
trackMainCameraUp() {
|
|
99
|
+
effect(() => {
|
|
100
|
+
const mainCamera = this.mainCamera();
|
|
101
|
+
this.defaultUp.copy(mainCamera.up);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
beforeRender() {
|
|
105
|
+
injectBeforeRender(({ delta }) => {
|
|
106
|
+
const [gizmo, virtualCam, defaultControls, mainCamera, invalidate] = [
|
|
107
|
+
this.gizmoRef.nativeElement,
|
|
108
|
+
this.virtualCamRef.nativeElement,
|
|
109
|
+
this.defaultControls(),
|
|
110
|
+
this.mainCamera(),
|
|
111
|
+
this.invalidate(),
|
|
112
|
+
];
|
|
113
|
+
if (gizmo && virtualCam) {
|
|
114
|
+
// Animate step
|
|
115
|
+
if (this.animating) {
|
|
116
|
+
if (this.q1.angleTo(this.q2) < 0.01) {
|
|
117
|
+
this.animating = false;
|
|
118
|
+
// Orbit controls uses UP vector as the orbit axes,
|
|
119
|
+
// so we need to reset it after the animation is done
|
|
120
|
+
// moving it around for the controls to work correctly
|
|
121
|
+
if (isOrbitControls(defaultControls)) {
|
|
122
|
+
mainCamera.up.copy(this.defaultUp);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
const step = delta * this.turnRate;
|
|
127
|
+
// animate position by doing a slerp and then scaling the position on the unit sphere
|
|
128
|
+
this.q1.rotateTowards(this.q2, step);
|
|
129
|
+
// animate orientation
|
|
130
|
+
mainCamera.position
|
|
131
|
+
.set(0, 0, 1)
|
|
132
|
+
.applyQuaternion(this.q1)
|
|
133
|
+
.multiplyScalar(this.radius)
|
|
134
|
+
.add(this.focusPoint);
|
|
135
|
+
mainCamera.up.set(0, 1, 0).applyQuaternion(this.q1).normalize();
|
|
136
|
+
mainCamera.quaternion.copy(this.q1);
|
|
137
|
+
if (this.update.observed)
|
|
138
|
+
this.update.emit();
|
|
139
|
+
else if (defaultControls)
|
|
140
|
+
defaultControls.update();
|
|
141
|
+
invalidate();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// Sync Gizmo with main camera orientation
|
|
145
|
+
this.matrix.copy(mainCamera.matrix).invert();
|
|
146
|
+
gizmo.quaternion.setFromRotationMatrix(this.matrix);
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGizmoHelper, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
151
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.3", type: NgtsGizmoHelper, isStandalone: true, selector: "ngts-gizmo-helper", inputs: { gizmoRef: "gizmoRef", _alignment: ["alignment", "_alignment"], _margin: ["margin", "_margin"], _renderPriority: ["renderPriority", "_renderPriority"], _autoClear: ["autoClear", "_autoClear"] }, outputs: { update: "update" }, providers: [provideNgtsGizmoHelperApi()], queries: [{ propertyName: "content", first: true, predicate: NgtsSobaContent, descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: `
|
|
152
|
+
<ngt-portal [renderPriority]="renderPriority()">
|
|
153
|
+
<ng-template ngtPortalContent>
|
|
154
|
+
<ngts-orthographic-camera [makeDefault]="true" [position]="[0, 0, 200]" [cameraRef]="virtualCamRef" />
|
|
155
|
+
<ngt-group [ref]="gizmoRef" [position]="gizmoPosition()">
|
|
156
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
157
|
+
</ngt-group>
|
|
158
|
+
</ng-template>
|
|
159
|
+
</ngt-portal>
|
|
160
|
+
`, isInline: true, dependencies: [{ kind: "component", type: NgtPortal, selector: "ngt-portal", inputs: ["container", "state", "autoRender", "autoRenderPriority"], outputs: ["beforeRender"] }, { kind: "directive", type: NgtPortalContent, selector: "ng-template[ngtPortalContent]" }, { kind: "component", type: NgtsOrthographicCamera, selector: "ngts-orthographic-camera", inputs: ["left", "right", "top", "bottom"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
161
|
+
}
|
|
162
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGizmoHelper, decorators: [{
|
|
163
|
+
type: Component,
|
|
164
|
+
args: [{
|
|
165
|
+
selector: 'ngts-gizmo-helper',
|
|
166
|
+
standalone: true,
|
|
167
|
+
template: `
|
|
168
|
+
<ngt-portal [renderPriority]="renderPriority()">
|
|
169
|
+
<ng-template ngtPortalContent>
|
|
170
|
+
<ngts-orthographic-camera [makeDefault]="true" [position]="[0, 0, 200]" [cameraRef]="virtualCamRef" />
|
|
171
|
+
<ngt-group [ref]="gizmoRef" [position]="gizmoPosition()">
|
|
172
|
+
<ng-container *ngTemplateOutlet="content" />
|
|
173
|
+
</ngt-group>
|
|
174
|
+
</ng-template>
|
|
175
|
+
</ngt-portal>
|
|
176
|
+
`,
|
|
177
|
+
imports: [NgtPortal, NgtPortalContent, NgtsOrthographicCamera, NgTemplateOutlet],
|
|
178
|
+
providers: [provideNgtsGizmoHelperApi()],
|
|
179
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
180
|
+
}]
|
|
181
|
+
}], ctorParameters: function () { return []; }, propDecorators: { gizmoRef: [{
|
|
182
|
+
type: Input
|
|
183
|
+
}], _alignment: [{
|
|
184
|
+
type: Input,
|
|
185
|
+
args: [{ alias: 'alignment' }]
|
|
186
|
+
}], _margin: [{
|
|
187
|
+
type: Input,
|
|
188
|
+
args: [{ alias: 'margin' }]
|
|
189
|
+
}], _renderPriority: [{
|
|
190
|
+
type: Input,
|
|
191
|
+
args: [{ alias: 'renderPriority' }]
|
|
192
|
+
}], _autoClear: [{
|
|
193
|
+
type: Input,
|
|
194
|
+
args: [{ alias: 'autoClear' }]
|
|
195
|
+
}], update: [{
|
|
196
|
+
type: Output
|
|
197
|
+
}], content: [{
|
|
198
|
+
type: ContentChild,
|
|
199
|
+
args: [NgtsSobaContent, { static: true, read: TemplateRef }]
|
|
200
|
+
}] } });
|
|
201
|
+
|
|
202
|
+
const colors = { bg: '#f0f0f0', hover: '#999', text: 'black', stroke: 'black' };
|
|
203
|
+
const defaultFaces = ['Right', 'Left', 'Top', 'Bottom', 'Front', 'Back'];
|
|
204
|
+
const makePositionVector = (xyz) => new THREE.Vector3(...xyz).multiplyScalar(0.38);
|
|
205
|
+
const corners = [
|
|
206
|
+
[1, 1, 1],
|
|
207
|
+
[1, 1, -1],
|
|
208
|
+
[1, -1, 1],
|
|
209
|
+
[1, -1, -1],
|
|
210
|
+
[-1, 1, 1],
|
|
211
|
+
[-1, 1, -1],
|
|
212
|
+
[-1, -1, 1],
|
|
213
|
+
[-1, -1, -1],
|
|
214
|
+
].map(makePositionVector);
|
|
215
|
+
const cornerDimensions = [0.25, 0.25, 0.25];
|
|
216
|
+
const edges = [
|
|
217
|
+
[1, 1, 0],
|
|
218
|
+
[1, 0, 1],
|
|
219
|
+
[1, 0, -1],
|
|
220
|
+
[1, -1, 0],
|
|
221
|
+
[0, 1, 1],
|
|
222
|
+
[0, 1, -1],
|
|
223
|
+
[0, -1, 1],
|
|
224
|
+
[0, -1, -1],
|
|
225
|
+
[-1, 1, 0],
|
|
226
|
+
[-1, 0, 1],
|
|
227
|
+
[-1, 0, -1],
|
|
228
|
+
[-1, -1, 0],
|
|
229
|
+
].map(makePositionVector);
|
|
230
|
+
const edgeDimensions = edges.map((edge) => edge.toArray().map((axis) => (axis == 0 ? 0.5 : 0.25)));
|
|
231
|
+
|
|
232
|
+
class NgtsGizmoViewcubeInput {
|
|
233
|
+
constructor() {
|
|
234
|
+
this.inputs = signalStore({});
|
|
235
|
+
this.viewcubeClick = new EventEmitter();
|
|
236
|
+
this.hoverColor = this.inputs.select('hoverColor');
|
|
237
|
+
this.opacity = this.inputs.select('opacity');
|
|
238
|
+
this.textColor = this.inputs.select('textColor');
|
|
239
|
+
this.strokeColor = this.inputs.select('strokeColor');
|
|
240
|
+
this.faces = this.inputs.select('faces');
|
|
241
|
+
this.font = this.inputs.select('font');
|
|
242
|
+
this.color = this.inputs.select('color');
|
|
243
|
+
}
|
|
244
|
+
set _opacity(opacity) {
|
|
245
|
+
this.inputs.set({ opacity });
|
|
246
|
+
}
|
|
247
|
+
set _hoverColor(hoverColor) {
|
|
248
|
+
this.inputs.set({ hoverColor });
|
|
249
|
+
}
|
|
250
|
+
set _textColor(textColor) {
|
|
251
|
+
this.inputs.set({ textColor });
|
|
252
|
+
}
|
|
253
|
+
set _strokeColor(strokeColor) {
|
|
254
|
+
this.inputs.set({ strokeColor });
|
|
255
|
+
}
|
|
256
|
+
set _faces(faces) {
|
|
257
|
+
this.inputs.set({ faces });
|
|
258
|
+
}
|
|
259
|
+
set _font(font) {
|
|
260
|
+
this.inputs.set({ font });
|
|
261
|
+
}
|
|
262
|
+
set _color(color) {
|
|
263
|
+
this.inputs.set({ color });
|
|
264
|
+
}
|
|
265
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGizmoViewcubeInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
266
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.3", type: NgtsGizmoViewcubeInput, inputs: { _opacity: ["opacity", "_opacity"], _hoverColor: ["hoverColor", "_hoverColor"], _textColor: ["textColor", "_textColor"], _strokeColor: ["strokeColor", "_strokeColor"], _faces: ["faces", "_faces"], _font: ["font", "_font"], _color: ["color", "_color"] }, outputs: { viewcubeClick: "viewcubeClick" }, ngImport: i0 }); }
|
|
267
|
+
}
|
|
268
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGizmoViewcubeInput, decorators: [{
|
|
269
|
+
type: Directive
|
|
270
|
+
}], propDecorators: { _opacity: [{
|
|
271
|
+
type: Input,
|
|
272
|
+
args: [{ alias: 'opacity' }]
|
|
273
|
+
}], _hoverColor: [{
|
|
274
|
+
type: Input,
|
|
275
|
+
args: [{ alias: 'hoverColor' }]
|
|
276
|
+
}], _textColor: [{
|
|
277
|
+
type: Input,
|
|
278
|
+
args: [{ alias: 'textColor' }]
|
|
279
|
+
}], _strokeColor: [{
|
|
280
|
+
type: Input,
|
|
281
|
+
args: [{ alias: 'strokeColor' }]
|
|
282
|
+
}], _faces: [{
|
|
283
|
+
type: Input,
|
|
284
|
+
args: [{ alias: 'faces' }]
|
|
285
|
+
}], _font: [{
|
|
286
|
+
type: Input,
|
|
287
|
+
args: [{ alias: 'font' }]
|
|
288
|
+
}], _color: [{
|
|
289
|
+
type: Input,
|
|
290
|
+
args: [{ alias: 'color' }]
|
|
291
|
+
}], viewcubeClick: [{
|
|
292
|
+
type: Output
|
|
293
|
+
}] } });
|
|
294
|
+
|
|
295
|
+
extend({ Mesh, BoxGeometry, MeshBasicMaterial });
|
|
296
|
+
class NgtsGizmoViewcubeEdgeCube {
|
|
297
|
+
set _dimensions(dimensions) {
|
|
298
|
+
this.inputs.set({ dimensions });
|
|
299
|
+
}
|
|
300
|
+
set _position(position) {
|
|
301
|
+
this.inputs.set({ position });
|
|
302
|
+
}
|
|
303
|
+
constructor() {
|
|
304
|
+
this.inputs = signalStore();
|
|
305
|
+
this.gizmoApi = injectNgtsGizmoHelperApi();
|
|
306
|
+
this.viewcubeInput = inject(NgtsGizmoViewcubeInput);
|
|
307
|
+
this.hover = signal(false);
|
|
308
|
+
this.position = this.inputs.select('position');
|
|
309
|
+
this.dimensions = this.inputs.select('dimensions');
|
|
310
|
+
this.viewcubeInput.inputs.patch({ hoverColor: colors.hover });
|
|
311
|
+
}
|
|
312
|
+
onPointerMove(event) {
|
|
313
|
+
event.stopPropagation();
|
|
314
|
+
this.hover.set(true);
|
|
315
|
+
}
|
|
316
|
+
onPointerOut(event) {
|
|
317
|
+
event.stopPropagation();
|
|
318
|
+
this.hover.set(false);
|
|
319
|
+
}
|
|
320
|
+
onClick(event) {
|
|
321
|
+
if (this.viewcubeInput.viewcubeClick.observed) {
|
|
322
|
+
this.viewcubeInput.viewcubeClick.emit(event);
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
event.stopPropagation();
|
|
326
|
+
this.gizmoApi.tweenCamera(this.position());
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGizmoViewcubeEdgeCube, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
330
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.3", type: NgtsGizmoViewcubeEdgeCube, isStandalone: true, selector: "ngts-gizmo-viewcube-edge-cube", inputs: { _dimensions: ["dimensions", "_dimensions"], _position: ["position", "_position"] }, ngImport: i0, template: `
|
|
331
|
+
<ngt-mesh
|
|
332
|
+
[scale]="1.01"
|
|
333
|
+
[position]="position()"
|
|
334
|
+
(pointermove)="onPointerMove($event)"
|
|
335
|
+
(pointerout)="onPointerOut($event)"
|
|
336
|
+
(click)="onClick($event)"
|
|
337
|
+
>
|
|
338
|
+
<ngt-box-geometry *args="dimensions()" />
|
|
339
|
+
<ngt-mesh-basic-material
|
|
340
|
+
[color]="hover() ? viewcubeInput.hoverColor() : 'white'"
|
|
341
|
+
[transparent]="true"
|
|
342
|
+
[opacity]="0.6"
|
|
343
|
+
[visible]="hover()"
|
|
344
|
+
/>
|
|
345
|
+
</ngt-mesh>
|
|
346
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }] }); }
|
|
347
|
+
}
|
|
348
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGizmoViewcubeEdgeCube, decorators: [{
|
|
349
|
+
type: Component,
|
|
350
|
+
args: [{
|
|
351
|
+
selector: 'ngts-gizmo-viewcube-edge-cube',
|
|
352
|
+
standalone: true,
|
|
353
|
+
template: `
|
|
354
|
+
<ngt-mesh
|
|
355
|
+
[scale]="1.01"
|
|
356
|
+
[position]="position()"
|
|
357
|
+
(pointermove)="onPointerMove($event)"
|
|
358
|
+
(pointerout)="onPointerOut($event)"
|
|
359
|
+
(click)="onClick($event)"
|
|
360
|
+
>
|
|
361
|
+
<ngt-box-geometry *args="dimensions()" />
|
|
362
|
+
<ngt-mesh-basic-material
|
|
363
|
+
[color]="hover() ? viewcubeInput.hoverColor() : 'white'"
|
|
364
|
+
[transparent]="true"
|
|
365
|
+
[opacity]="0.6"
|
|
366
|
+
[visible]="hover()"
|
|
367
|
+
/>
|
|
368
|
+
</ngt-mesh>
|
|
369
|
+
`,
|
|
370
|
+
imports: [NgtArgs],
|
|
371
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
372
|
+
}]
|
|
373
|
+
}], ctorParameters: function () { return []; }, propDecorators: { _dimensions: [{
|
|
374
|
+
type: Input,
|
|
375
|
+
args: [{ required: true, alias: 'dimensions' }]
|
|
376
|
+
}], _position: [{
|
|
377
|
+
type: Input,
|
|
378
|
+
args: [{ required: true, alias: 'position' }]
|
|
379
|
+
}] } });
|
|
380
|
+
|
|
381
|
+
extend({ MeshLambertMaterial, Mesh, BoxGeometry });
|
|
382
|
+
class NgtsGizmoViewcubeFaceMaterial {
|
|
383
|
+
set _index(index) {
|
|
384
|
+
this.inputs.set({ index });
|
|
385
|
+
}
|
|
386
|
+
set _hover(hover) {
|
|
387
|
+
this.inputs.set({ hover });
|
|
388
|
+
}
|
|
389
|
+
constructor() {
|
|
390
|
+
this.inputs = signalStore();
|
|
391
|
+
this.document = inject(DOCUMENT);
|
|
392
|
+
this.store = injectNgtStore();
|
|
393
|
+
this.gl = this.store.select('gl');
|
|
394
|
+
this.viewcubeInput = inject(NgtsGizmoViewcubeInput);
|
|
395
|
+
this.index = this.inputs.select('index');
|
|
396
|
+
this.hover = this.inputs.select('hover');
|
|
397
|
+
this.texture = computed(() => {
|
|
398
|
+
const [index, color, font, faces, textColor, strokeColor] = [
|
|
399
|
+
this.index(),
|
|
400
|
+
this.viewcubeInput.color(),
|
|
401
|
+
this.viewcubeInput.font(),
|
|
402
|
+
this.viewcubeInput.faces(),
|
|
403
|
+
this.viewcubeInput.textColor(),
|
|
404
|
+
this.viewcubeInput.strokeColor(),
|
|
405
|
+
];
|
|
406
|
+
const canvas = this.document.createElement('canvas');
|
|
407
|
+
canvas.width = 128;
|
|
408
|
+
canvas.height = 128;
|
|
409
|
+
const context = canvas.getContext('2d');
|
|
410
|
+
context.fillStyle = color;
|
|
411
|
+
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
412
|
+
context.strokeStyle = strokeColor;
|
|
413
|
+
context.strokeRect(0, 0, canvas.width, canvas.height);
|
|
414
|
+
context.font = font;
|
|
415
|
+
context.textAlign = 'center';
|
|
416
|
+
context.fillStyle = textColor;
|
|
417
|
+
context.fillText(faces[index].toUpperCase(), 64, 76);
|
|
418
|
+
return new CanvasTexture(canvas);
|
|
419
|
+
});
|
|
420
|
+
this.viewcubeInput.inputs.patch({
|
|
421
|
+
color: colors.bg,
|
|
422
|
+
font: '20px Inter var, Arial, sans-serif',
|
|
423
|
+
faces: defaultFaces,
|
|
424
|
+
hoverColor: colors.hover,
|
|
425
|
+
textColor: colors.text,
|
|
426
|
+
strokeColor: colors.stroke,
|
|
427
|
+
opacity: 1,
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGizmoViewcubeFaceMaterial, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
431
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.3", type: NgtsGizmoViewcubeFaceMaterial, isStandalone: true, selector: "ngts-gizmo-viewcube-face-material", inputs: { _index: ["index", "_index"], _hover: ["hover", "_hover"] }, ngImport: i0, template: `
|
|
432
|
+
<ngt-mesh-lambert-material
|
|
433
|
+
[attach]="['material', index()]"
|
|
434
|
+
[map]="texture()"
|
|
435
|
+
[color]="hover() ? viewcubeInput.hoverColor() : viewcubeInput.color()"
|
|
436
|
+
[opacity]="viewcubeInput.opacity()"
|
|
437
|
+
[transparent]="true"
|
|
438
|
+
>
|
|
439
|
+
<ngt-value [rawValue]="gl().capabilities.getMaxAnisotropy() || 1" attach="map.anisotrophy" />
|
|
440
|
+
</ngt-mesh-lambert-material>
|
|
441
|
+
`, isInline: true }); }
|
|
442
|
+
}
|
|
443
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGizmoViewcubeFaceMaterial, decorators: [{
|
|
444
|
+
type: Component,
|
|
445
|
+
args: [{
|
|
446
|
+
selector: 'ngts-gizmo-viewcube-face-material',
|
|
447
|
+
standalone: true,
|
|
448
|
+
template: `
|
|
449
|
+
<ngt-mesh-lambert-material
|
|
450
|
+
[attach]="['material', index()]"
|
|
451
|
+
[map]="texture()"
|
|
452
|
+
[color]="hover() ? viewcubeInput.hoverColor() : viewcubeInput.color()"
|
|
453
|
+
[opacity]="viewcubeInput.opacity()"
|
|
454
|
+
[transparent]="true"
|
|
455
|
+
>
|
|
456
|
+
<ngt-value [rawValue]="gl().capabilities.getMaxAnisotropy() || 1" attach="map.anisotrophy" />
|
|
457
|
+
</ngt-mesh-lambert-material>
|
|
458
|
+
`,
|
|
459
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
460
|
+
}]
|
|
461
|
+
}], ctorParameters: function () { return []; }, propDecorators: { _index: [{
|
|
462
|
+
type: Input,
|
|
463
|
+
args: [{ required: true, alias: 'index' }]
|
|
464
|
+
}], _hover: [{
|
|
465
|
+
type: Input,
|
|
466
|
+
args: [{ required: true, alias: 'hover' }]
|
|
467
|
+
}] } });
|
|
468
|
+
class NgtsGizmoViewcubeFaceCube {
|
|
469
|
+
constructor() {
|
|
470
|
+
this.gizmoApi = injectNgtsGizmoHelperApi();
|
|
471
|
+
this.viewcubeInput = inject(NgtsGizmoViewcubeInput);
|
|
472
|
+
this.hover = signal(-1);
|
|
473
|
+
}
|
|
474
|
+
onPointerMove(event) {
|
|
475
|
+
event.stopPropagation();
|
|
476
|
+
this.hover.set(Math.floor(event.faceIndex / 2));
|
|
477
|
+
}
|
|
478
|
+
onPointerOut(event) {
|
|
479
|
+
event.stopPropagation();
|
|
480
|
+
this.hover.set(-1);
|
|
481
|
+
}
|
|
482
|
+
onClick(event) {
|
|
483
|
+
if (this.viewcubeInput.viewcubeClick.observed) {
|
|
484
|
+
this.viewcubeInput.viewcubeClick.emit(event);
|
|
485
|
+
}
|
|
486
|
+
else {
|
|
487
|
+
event.stopPropagation();
|
|
488
|
+
this.gizmoApi.tweenCamera(event.face.normal);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGizmoViewcubeFaceCube, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
492
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.3", type: NgtsGizmoViewcubeFaceCube, isStandalone: true, selector: "ngts-gizmo-viewcube-face-cube", ngImport: i0, template: `
|
|
493
|
+
<ngt-mesh
|
|
494
|
+
(pointermove)="onPointerMove($any($event))"
|
|
495
|
+
(pointerout)="onPointerOut($any($event))"
|
|
496
|
+
(click)="onClick($any($event))"
|
|
497
|
+
>
|
|
498
|
+
<ngt-box-geometry />
|
|
499
|
+
<ngts-gizmo-viewcube-face-material *ngFor="let i; repeat: 6" [hover]="hover() === i" [index]="i" />
|
|
500
|
+
</ngt-mesh>
|
|
501
|
+
`, isInline: true, dependencies: [{ kind: "component", type: NgtsGizmoViewcubeFaceMaterial, selector: "ngts-gizmo-viewcube-face-material", inputs: ["index", "hover"] }, { kind: "directive", type: Repeat, selector: "[ngFor][ngForRepeat]", inputs: ["ngForRepeat"] }] }); }
|
|
502
|
+
}
|
|
503
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGizmoViewcubeFaceCube, decorators: [{
|
|
504
|
+
type: Component,
|
|
505
|
+
args: [{
|
|
506
|
+
selector: 'ngts-gizmo-viewcube-face-cube',
|
|
507
|
+
standalone: true,
|
|
508
|
+
template: `
|
|
509
|
+
<ngt-mesh
|
|
510
|
+
(pointermove)="onPointerMove($any($event))"
|
|
511
|
+
(pointerout)="onPointerOut($any($event))"
|
|
512
|
+
(click)="onClick($any($event))"
|
|
513
|
+
>
|
|
514
|
+
<ngt-box-geometry />
|
|
515
|
+
<ngts-gizmo-viewcube-face-material *ngFor="let i; repeat: 6" [hover]="hover() === i" [index]="i" />
|
|
516
|
+
</ngt-mesh>
|
|
517
|
+
`,
|
|
518
|
+
imports: [NgtsGizmoViewcubeFaceMaterial, Repeat],
|
|
519
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
520
|
+
}]
|
|
521
|
+
}] });
|
|
522
|
+
|
|
523
|
+
extend({ Group, AmbientLight, PointLight });
|
|
524
|
+
class NgtsGizmoViewcube extends NgtsGizmoViewcubeInput {
|
|
525
|
+
constructor() {
|
|
526
|
+
super(...arguments);
|
|
527
|
+
this.edges = edges;
|
|
528
|
+
this.edgeDimensions = edgeDimensions;
|
|
529
|
+
this.corners = corners;
|
|
530
|
+
this.cornerDimensions = cornerDimensions;
|
|
531
|
+
}
|
|
532
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGizmoViewcube, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
533
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.3", type: NgtsGizmoViewcube, isStandalone: true, selector: "ngts-gizmo-viewcube", providers: [{ provide: NgtsGizmoViewcubeInput, useExisting: NgtsGizmoViewcube }], usesInheritance: true, ngImport: i0, template: `
|
|
534
|
+
<ngt-group [scale]="60">
|
|
535
|
+
<ngts-gizmo-viewcube-face-cube />
|
|
536
|
+
|
|
537
|
+
<ngts-gizmo-viewcube-edge-cube
|
|
538
|
+
*ngFor="let edge of edges; let i = index"
|
|
539
|
+
[position]="edge"
|
|
540
|
+
[dimensions]="edgeDimensions[i]"
|
|
541
|
+
/>
|
|
542
|
+
|
|
543
|
+
<ngts-gizmo-viewcube-edge-cube
|
|
544
|
+
*ngFor="let corner of corners"
|
|
545
|
+
[position]="corner"
|
|
546
|
+
[dimensions]="cornerDimensions"
|
|
547
|
+
/>
|
|
548
|
+
|
|
549
|
+
<ngt-ambient-light [intensity]="0.5" />
|
|
550
|
+
<ngt-point-light [position]="10" [intensity]="0.5" />
|
|
551
|
+
</ngt-group>
|
|
552
|
+
`, isInline: true, dependencies: [{ kind: "component", type: NgtsGizmoViewcubeEdgeCube, selector: "ngts-gizmo-viewcube-edge-cube", inputs: ["dimensions", "position"] }, { kind: "component", type: NgtsGizmoViewcubeFaceCube, selector: "ngts-gizmo-viewcube-face-cube" }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] }); }
|
|
553
|
+
}
|
|
554
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGizmoViewcube, decorators: [{
|
|
555
|
+
type: Component,
|
|
556
|
+
args: [{
|
|
557
|
+
selector: 'ngts-gizmo-viewcube',
|
|
558
|
+
standalone: true,
|
|
559
|
+
template: `
|
|
560
|
+
<ngt-group [scale]="60">
|
|
561
|
+
<ngts-gizmo-viewcube-face-cube />
|
|
562
|
+
|
|
563
|
+
<ngts-gizmo-viewcube-edge-cube
|
|
564
|
+
*ngFor="let edge of edges; let i = index"
|
|
565
|
+
[position]="edge"
|
|
566
|
+
[dimensions]="edgeDimensions[i]"
|
|
567
|
+
/>
|
|
568
|
+
|
|
569
|
+
<ngts-gizmo-viewcube-edge-cube
|
|
570
|
+
*ngFor="let corner of corners"
|
|
571
|
+
[position]="corner"
|
|
572
|
+
[dimensions]="cornerDimensions"
|
|
573
|
+
/>
|
|
574
|
+
|
|
575
|
+
<ngt-ambient-light [intensity]="0.5" />
|
|
576
|
+
<ngt-point-light [position]="10" [intensity]="0.5" />
|
|
577
|
+
</ngt-group>
|
|
578
|
+
`,
|
|
579
|
+
imports: [NgtsGizmoViewcubeEdgeCube, NgtsGizmoViewcubeFaceCube, NgFor],
|
|
580
|
+
providers: [{ provide: NgtsGizmoViewcubeInput, useExisting: NgtsGizmoViewcube }],
|
|
581
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
582
|
+
}]
|
|
583
|
+
}] });
|
|
584
|
+
|
|
585
|
+
extend({ Group, Mesh, BoxGeometry, MeshBasicMaterial, Sprite, SpriteMaterial });
|
|
586
|
+
class NgtsGizmoViewportAxis {
|
|
587
|
+
constructor() {
|
|
588
|
+
this.inputs = signalStore({ scale: [0.8, 0.05, 0.05] });
|
|
589
|
+
this.rotation = this.inputs.select('rotation');
|
|
590
|
+
this.color = this.inputs.select('color');
|
|
591
|
+
this.scale = this.inputs.select('scale');
|
|
592
|
+
}
|
|
593
|
+
set _color(color) {
|
|
594
|
+
this.inputs.set({ color });
|
|
595
|
+
}
|
|
596
|
+
set _rotation(rotation) {
|
|
597
|
+
this.inputs.set({ rotation });
|
|
598
|
+
}
|
|
599
|
+
set _scale(scale) {
|
|
600
|
+
this.inputs.set({ scale });
|
|
601
|
+
}
|
|
602
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGizmoViewportAxis, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
603
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.3", type: NgtsGizmoViewportAxis, isStandalone: true, selector: "ngts-gizmo-viewport-axis", inputs: { _color: ["color", "_color"], _rotation: ["rotation", "_rotation"], _scale: ["scale", "_scale"] }, ngImport: i0, template: `
|
|
604
|
+
<ngt-group [rotation]="rotation()">
|
|
605
|
+
<ngt-mesh [position]="[0.4, 0, 0]">
|
|
606
|
+
<ngt-box-geometry *args="scale()" />
|
|
607
|
+
<ngt-mesh-basic-material [color]="color()" [toneMapped]="false" />
|
|
608
|
+
</ngt-mesh>
|
|
609
|
+
</ngt-group>
|
|
610
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }] }); }
|
|
611
|
+
}
|
|
612
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGizmoViewportAxis, decorators: [{
|
|
613
|
+
type: Component,
|
|
614
|
+
args: [{
|
|
615
|
+
selector: 'ngts-gizmo-viewport-axis',
|
|
616
|
+
standalone: true,
|
|
617
|
+
template: `
|
|
618
|
+
<ngt-group [rotation]="rotation()">
|
|
619
|
+
<ngt-mesh [position]="[0.4, 0, 0]">
|
|
620
|
+
<ngt-box-geometry *args="scale()" />
|
|
621
|
+
<ngt-mesh-basic-material [color]="color()" [toneMapped]="false" />
|
|
622
|
+
</ngt-mesh>
|
|
623
|
+
</ngt-group>
|
|
624
|
+
`,
|
|
625
|
+
imports: [NgtArgs],
|
|
626
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
627
|
+
}]
|
|
628
|
+
}], propDecorators: { _color: [{
|
|
629
|
+
type: Input,
|
|
630
|
+
args: [{ required: true, alias: 'color' }]
|
|
631
|
+
}], _rotation: [{
|
|
632
|
+
type: Input,
|
|
633
|
+
args: [{ required: true, alias: 'rotation' }]
|
|
634
|
+
}], _scale: [{
|
|
635
|
+
type: Input,
|
|
636
|
+
args: [{ alias: 'scale' }]
|
|
637
|
+
}] } });
|
|
638
|
+
class NgtsGizmoViewportAxisHead {
|
|
639
|
+
constructor() {
|
|
640
|
+
this.inputs = signalStore({ axisHeadScale: 1 });
|
|
641
|
+
this.document = inject(DOCUMENT);
|
|
642
|
+
this.store = injectNgtStore();
|
|
643
|
+
this.capabilities = this.store.select('gl', 'capabilities');
|
|
644
|
+
this.active = signal(false);
|
|
645
|
+
this.arcStyle = this.inputs.select('arcStyle');
|
|
646
|
+
this.labelColor = this.inputs.select('labelColor');
|
|
647
|
+
this.font = this.inputs.select('font');
|
|
648
|
+
this.axisHeadScale = this.inputs.select('axisHeadScale');
|
|
649
|
+
this.label = this.inputs.select('label');
|
|
650
|
+
this.texture = computed(() => {
|
|
651
|
+
const [arcStyle, labelColor, font, label] = [this.arcStyle(), this.labelColor(), this.font(), this.label()];
|
|
652
|
+
const canvas = this.document.createElement('canvas');
|
|
653
|
+
canvas.width = 64;
|
|
654
|
+
canvas.height = 64;
|
|
655
|
+
const context = canvas.getContext('2d');
|
|
656
|
+
context.beginPath();
|
|
657
|
+
context.arc(32, 32, 16, 0, 2 * Math.PI);
|
|
658
|
+
context.closePath();
|
|
659
|
+
context.fillStyle = arcStyle;
|
|
660
|
+
context.fill();
|
|
661
|
+
if (label) {
|
|
662
|
+
context.font = font;
|
|
663
|
+
context.textAlign = 'center';
|
|
664
|
+
context.fillStyle = labelColor;
|
|
665
|
+
context.fillText(label, 32, 41);
|
|
666
|
+
}
|
|
667
|
+
return new CanvasTexture(canvas);
|
|
668
|
+
});
|
|
669
|
+
this.scale = computed(() => {
|
|
670
|
+
const [active, axisHeadScale, label] = [this.active(), this.axisHeadScale(), this.label()];
|
|
671
|
+
return (label ? 1 : 0.75) * (active ? 1.2 : 1) * axisHeadScale;
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
set _arcStyle(arcStyle) {
|
|
675
|
+
this.inputs.set({ arcStyle });
|
|
676
|
+
}
|
|
677
|
+
set _label(label) {
|
|
678
|
+
this.inputs.set({ label });
|
|
679
|
+
}
|
|
680
|
+
set _labelColor(labelColor) {
|
|
681
|
+
this.inputs.set({ labelColor });
|
|
682
|
+
}
|
|
683
|
+
set _axisHeadScale(axisHeadScale) {
|
|
684
|
+
this.inputs.set({ axisHeadScale });
|
|
685
|
+
}
|
|
686
|
+
set _disabled(disabled) {
|
|
687
|
+
this.inputs.set({ disabled });
|
|
688
|
+
}
|
|
689
|
+
set _font(font) {
|
|
690
|
+
this.inputs.set({ font });
|
|
691
|
+
}
|
|
692
|
+
onPointerOver(event) {
|
|
693
|
+
if (!this.inputs.get('disabled')) {
|
|
694
|
+
event.stopPropagation();
|
|
695
|
+
this.active.set(true);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
onPointerOut(event) {
|
|
699
|
+
if (!this.inputs.get('disabled')) {
|
|
700
|
+
if (this.viewportClickEmitter?.observed) {
|
|
701
|
+
this.viewportClickEmitter.emit(event);
|
|
702
|
+
}
|
|
703
|
+
else {
|
|
704
|
+
event.stopPropagation();
|
|
705
|
+
this.active.set(false);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGizmoViewportAxisHead, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
710
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.3", type: NgtsGizmoViewportAxisHead, isStandalone: true, selector: "ngts-gizmo-viewport-axis-head", inputs: { _arcStyle: ["arcStyle", "_arcStyle"], _label: ["label", "_label"], _labelColor: ["labelColor", "_labelColor"], _axisHeadScale: ["axisHeadScale", "_axisHeadScale"], _disabled: ["disabled", "_disabled"], _font: ["font", "_font"], viewportClickEmitter: "viewportClickEmitter" }, ngImport: i0, template: `
|
|
711
|
+
<ngt-sprite
|
|
712
|
+
ngtCompound
|
|
713
|
+
[scale]="scale()"
|
|
714
|
+
(pointerover)="onPointerOver($event)"
|
|
715
|
+
(pointerout)="onPointerOut($event)"
|
|
716
|
+
>
|
|
717
|
+
<ngt-sprite-material
|
|
718
|
+
[map]="texture()"
|
|
719
|
+
[opacity]="label() ? 1 : 0.75"
|
|
720
|
+
[alphaTest]="0.3"
|
|
721
|
+
[toneMapped]="false"
|
|
722
|
+
>
|
|
723
|
+
<ngt-value [rawValue]="capabilities().getMaxAnisotropy() || 1" attach="map.anisotropy" />
|
|
724
|
+
</ngt-sprite-material>
|
|
725
|
+
</ngt-sprite>
|
|
726
|
+
`, isInline: true }); }
|
|
727
|
+
}
|
|
728
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGizmoViewportAxisHead, decorators: [{
|
|
729
|
+
type: Component,
|
|
730
|
+
args: [{
|
|
731
|
+
selector: 'ngts-gizmo-viewport-axis-head',
|
|
732
|
+
standalone: true,
|
|
733
|
+
template: `
|
|
734
|
+
<ngt-sprite
|
|
735
|
+
ngtCompound
|
|
736
|
+
[scale]="scale()"
|
|
737
|
+
(pointerover)="onPointerOver($event)"
|
|
738
|
+
(pointerout)="onPointerOut($event)"
|
|
739
|
+
>
|
|
740
|
+
<ngt-sprite-material
|
|
741
|
+
[map]="texture()"
|
|
742
|
+
[opacity]="label() ? 1 : 0.75"
|
|
743
|
+
[alphaTest]="0.3"
|
|
744
|
+
[toneMapped]="false"
|
|
745
|
+
>
|
|
746
|
+
<ngt-value [rawValue]="capabilities().getMaxAnisotropy() || 1" attach="map.anisotropy" />
|
|
747
|
+
</ngt-sprite-material>
|
|
748
|
+
</ngt-sprite>
|
|
749
|
+
`,
|
|
750
|
+
imports: [NgtArgs],
|
|
751
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
752
|
+
}]
|
|
753
|
+
}], propDecorators: { _arcStyle: [{
|
|
754
|
+
type: Input,
|
|
755
|
+
args: [{ alias: 'arcStyle' }]
|
|
756
|
+
}], _label: [{
|
|
757
|
+
type: Input,
|
|
758
|
+
args: [{ alias: 'label' }]
|
|
759
|
+
}], _labelColor: [{
|
|
760
|
+
type: Input,
|
|
761
|
+
args: [{ alias: 'labelColor' }]
|
|
762
|
+
}], _axisHeadScale: [{
|
|
763
|
+
type: Input,
|
|
764
|
+
args: [{ alias: 'axisHeadScale' }]
|
|
765
|
+
}], _disabled: [{
|
|
766
|
+
type: Input,
|
|
767
|
+
args: [{ alias: 'disabled' }]
|
|
768
|
+
}], _font: [{
|
|
769
|
+
type: Input,
|
|
770
|
+
args: [{ alias: 'font' }]
|
|
771
|
+
}], viewportClickEmitter: [{
|
|
772
|
+
type: Input
|
|
773
|
+
}] } });
|
|
774
|
+
|
|
775
|
+
extend({ Group, AmbientLight, PointLight });
|
|
776
|
+
class NgtsGizmoViewport {
|
|
777
|
+
constructor() {
|
|
778
|
+
this.inputs = signalStore({
|
|
779
|
+
font: '18px Inter var, Arial, sans-serif',
|
|
780
|
+
axisColors: ['#ff2060', '#20df80', '#2080ff'],
|
|
781
|
+
axisHeadScale: 1,
|
|
782
|
+
labels: ['X', 'Y', 'Z'],
|
|
783
|
+
labelColor: '#000',
|
|
784
|
+
});
|
|
785
|
+
this.gizmoApi = injectNgtsGizmoHelperApi();
|
|
786
|
+
this.Math = Math;
|
|
787
|
+
this.viewportClick = new EventEmitter();
|
|
788
|
+
this.axisColors = this.inputs.select('axisColors');
|
|
789
|
+
this.axisScale = this.inputs.select('axisScale');
|
|
790
|
+
this.labels = this.inputs.select('labels');
|
|
791
|
+
this.axisHeadScale = this.inputs.select('axisHeadScale');
|
|
792
|
+
this.labelColor = this.inputs.select('labelColor');
|
|
793
|
+
this.hideNegativeAxes = this.inputs.select('hideNegativeAxes');
|
|
794
|
+
this.hideAxisHeads = this.inputs.select('hideAxisHeads');
|
|
795
|
+
this.disabled = this.inputs.select('disabled');
|
|
796
|
+
this.font = this.inputs.select('font');
|
|
797
|
+
}
|
|
798
|
+
set _axisColors(axisColors) {
|
|
799
|
+
this.inputs.set({ axisColors });
|
|
800
|
+
}
|
|
801
|
+
set _axisScale(axisScale) {
|
|
802
|
+
this.inputs.set({ axisScale });
|
|
803
|
+
}
|
|
804
|
+
set _labels(labels) {
|
|
805
|
+
this.inputs.set({ labels });
|
|
806
|
+
}
|
|
807
|
+
set _axisHeadScale(axisHeadScale) {
|
|
808
|
+
this.inputs.set({ axisHeadScale });
|
|
809
|
+
}
|
|
810
|
+
set _labelColor(labelColor) {
|
|
811
|
+
this.inputs.set({ labelColor });
|
|
812
|
+
}
|
|
813
|
+
set _hideNegativeAxes(hideNegativeAxes) {
|
|
814
|
+
this.inputs.set({ hideNegativeAxes });
|
|
815
|
+
}
|
|
816
|
+
set _hideAxisHeads(hideAxisHeads) {
|
|
817
|
+
this.inputs.set({ hideAxisHeads });
|
|
818
|
+
}
|
|
819
|
+
set _disabled(disabled) {
|
|
820
|
+
this.inputs.set({ disabled });
|
|
821
|
+
}
|
|
822
|
+
set _font(font) {
|
|
823
|
+
this.inputs.set({ font });
|
|
824
|
+
}
|
|
825
|
+
onPointerDown(event) {
|
|
826
|
+
if (!this.inputs.get('disabled')) {
|
|
827
|
+
event.stopPropagation();
|
|
828
|
+
this.gizmoApi.tweenCamera(event.object.position);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGizmoViewport, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
832
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.3", type: NgtsGizmoViewport, isStandalone: true, selector: "ngts-gizmo-viewport", inputs: { _axisColors: ["axisColors", "_axisColors"], _axisScale: ["axisScale", "_axisScale"], _labels: ["labels", "_labels"], _axisHeadScale: ["axisHeadScale", "_axisHeadScale"], _labelColor: ["labelColor", "_labelColor"], _hideNegativeAxes: ["hideNegativeAxes", "_hideNegativeAxes"], _hideAxisHeads: ["hideAxisHeads", "_hideAxisHeads"], _disabled: ["disabled", "_disabled"], _font: ["font", "_font"] }, outputs: { viewportClick: "viewportClick" }, ngImport: i0, template: `
|
|
833
|
+
<ngt-group ngtCompound [scale]="40">
|
|
834
|
+
<ngts-gizmo-viewport-axis [color]="axisColors()[0]" [rotation]="[0, 0, 0]" [scale]="axisScale()" />
|
|
835
|
+
<ngts-gizmo-viewport-axis
|
|
836
|
+
[color]="axisColors()[1]"
|
|
837
|
+
[rotation]="[0, 0, Math.PI / 2]"
|
|
838
|
+
[scale]="axisScale()"
|
|
839
|
+
/>
|
|
840
|
+
<ngts-gizmo-viewport-axis
|
|
841
|
+
[color]="axisColors()[2]"
|
|
842
|
+
[rotation]="[0, -Math.PI / 2, 0]"
|
|
843
|
+
[scale]="axisScale()"
|
|
844
|
+
/>
|
|
845
|
+
<ng-container *ngIf="!hideAxisHeads()">
|
|
846
|
+
<ngts-gizmo-viewport-axis-head
|
|
847
|
+
[arcStyle]="axisColors()[0]"
|
|
848
|
+
[position]="[1, 0, 0]"
|
|
849
|
+
[label]="labels()[0]"
|
|
850
|
+
[font]="font()"
|
|
851
|
+
[disabled]="disabled()"
|
|
852
|
+
[labelColor]="labelColor()"
|
|
853
|
+
[viewportClickEmitter]="viewportClick"
|
|
854
|
+
[axisHeadScale]="axisHeadScale()"
|
|
855
|
+
(pointerdown)="onPointerDown($any($event))"
|
|
856
|
+
/>
|
|
857
|
+
<ngts-gizmo-viewport-axis-head
|
|
858
|
+
[arcStyle]="axisColors()[1]"
|
|
859
|
+
[position]="[0, 1, 0]"
|
|
860
|
+
[label]="labels()[1]"
|
|
861
|
+
[font]="font()"
|
|
862
|
+
[disabled]="disabled()"
|
|
863
|
+
[labelColor]="labelColor()"
|
|
864
|
+
[viewportClickEmitter]="viewportClick"
|
|
865
|
+
[axisHeadScale]="axisHeadScale()"
|
|
866
|
+
(pointerdown)="onPointerDown($any($event))"
|
|
867
|
+
/>
|
|
868
|
+
<ngts-gizmo-viewport-axis-head
|
|
869
|
+
[arcStyle]="axisColors()[2]"
|
|
870
|
+
[position]="[0, 0, 1]"
|
|
871
|
+
[label]="labels()[2]"
|
|
872
|
+
[font]="font()"
|
|
873
|
+
[disabled]="disabled()"
|
|
874
|
+
[labelColor]="labelColor()"
|
|
875
|
+
[viewportClickEmitter]="viewportClick"
|
|
876
|
+
[axisHeadScale]="axisHeadScale()"
|
|
877
|
+
(pointerdown)="onPointerDown($any($event))"
|
|
878
|
+
/>
|
|
879
|
+
<ng-container *ngIf="!hideNegativeAxes()">
|
|
880
|
+
<ngts-gizmo-viewport-axis-head
|
|
881
|
+
[arcStyle]="axisColors()[0]"
|
|
882
|
+
[position]="[-1, 0, 0]"
|
|
883
|
+
[font]="font()"
|
|
884
|
+
[disabled]="disabled()"
|
|
885
|
+
[labelColor]="labelColor()"
|
|
886
|
+
[viewportClickEmitter]="viewportClick"
|
|
887
|
+
[axisHeadScale]="axisHeadScale()"
|
|
888
|
+
(pointerdown)="onPointerDown($any($event))"
|
|
889
|
+
/>
|
|
890
|
+
<ngts-gizmo-viewport-axis-head
|
|
891
|
+
[arcStyle]="axisColors()[1]"
|
|
892
|
+
[position]="[0, -1, 0]"
|
|
893
|
+
[font]="font()"
|
|
894
|
+
[disabled]="disabled()"
|
|
895
|
+
[labelColor]="labelColor()"
|
|
896
|
+
[viewportClickEmitter]="viewportClick"
|
|
897
|
+
[axisHeadScale]="axisHeadScale()"
|
|
898
|
+
(pointerdown)="onPointerDown($any($event))"
|
|
899
|
+
/>
|
|
900
|
+
<ngts-gizmo-viewport-axis-head
|
|
901
|
+
[arcStyle]="axisColors()[2]"
|
|
902
|
+
[position]="[0, 0, -1]"
|
|
903
|
+
[font]="font()"
|
|
904
|
+
[disabled]="disabled()"
|
|
905
|
+
[labelColor]="labelColor()"
|
|
906
|
+
[viewportClickEmitter]="viewportClick"
|
|
907
|
+
[axisHeadScale]="axisHeadScale()"
|
|
908
|
+
(pointerdown)="onPointerDown($any($event))"
|
|
909
|
+
/>
|
|
910
|
+
</ng-container>
|
|
911
|
+
</ng-container>
|
|
912
|
+
<ngt-ambient-light [intensity]="0.5"></ngt-ambient-light>
|
|
913
|
+
<ngt-point-light [position]="10" [intensity]="0.5"></ngt-point-light>
|
|
914
|
+
</ngt-group>
|
|
915
|
+
`, isInline: true, dependencies: [{ kind: "component", type: NgtsGizmoViewportAxis, selector: "ngts-gizmo-viewport-axis", inputs: ["color", "rotation", "scale"] }, { kind: "component", type: NgtsGizmoViewportAxisHead, selector: "ngts-gizmo-viewport-axis-head", inputs: ["arcStyle", "label", "labelColor", "axisHeadScale", "disabled", "font", "viewportClickEmitter"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
916
|
+
}
|
|
917
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGizmoViewport, decorators: [{
|
|
918
|
+
type: Component,
|
|
919
|
+
args: [{
|
|
920
|
+
selector: 'ngts-gizmo-viewport',
|
|
921
|
+
standalone: true,
|
|
922
|
+
template: `
|
|
923
|
+
<ngt-group ngtCompound [scale]="40">
|
|
924
|
+
<ngts-gizmo-viewport-axis [color]="axisColors()[0]" [rotation]="[0, 0, 0]" [scale]="axisScale()" />
|
|
925
|
+
<ngts-gizmo-viewport-axis
|
|
926
|
+
[color]="axisColors()[1]"
|
|
927
|
+
[rotation]="[0, 0, Math.PI / 2]"
|
|
928
|
+
[scale]="axisScale()"
|
|
929
|
+
/>
|
|
930
|
+
<ngts-gizmo-viewport-axis
|
|
931
|
+
[color]="axisColors()[2]"
|
|
932
|
+
[rotation]="[0, -Math.PI / 2, 0]"
|
|
933
|
+
[scale]="axisScale()"
|
|
934
|
+
/>
|
|
935
|
+
<ng-container *ngIf="!hideAxisHeads()">
|
|
936
|
+
<ngts-gizmo-viewport-axis-head
|
|
937
|
+
[arcStyle]="axisColors()[0]"
|
|
938
|
+
[position]="[1, 0, 0]"
|
|
939
|
+
[label]="labels()[0]"
|
|
940
|
+
[font]="font()"
|
|
941
|
+
[disabled]="disabled()"
|
|
942
|
+
[labelColor]="labelColor()"
|
|
943
|
+
[viewportClickEmitter]="viewportClick"
|
|
944
|
+
[axisHeadScale]="axisHeadScale()"
|
|
945
|
+
(pointerdown)="onPointerDown($any($event))"
|
|
946
|
+
/>
|
|
947
|
+
<ngts-gizmo-viewport-axis-head
|
|
948
|
+
[arcStyle]="axisColors()[1]"
|
|
949
|
+
[position]="[0, 1, 0]"
|
|
950
|
+
[label]="labels()[1]"
|
|
951
|
+
[font]="font()"
|
|
952
|
+
[disabled]="disabled()"
|
|
953
|
+
[labelColor]="labelColor()"
|
|
954
|
+
[viewportClickEmitter]="viewportClick"
|
|
955
|
+
[axisHeadScale]="axisHeadScale()"
|
|
956
|
+
(pointerdown)="onPointerDown($any($event))"
|
|
957
|
+
/>
|
|
958
|
+
<ngts-gizmo-viewport-axis-head
|
|
959
|
+
[arcStyle]="axisColors()[2]"
|
|
960
|
+
[position]="[0, 0, 1]"
|
|
961
|
+
[label]="labels()[2]"
|
|
962
|
+
[font]="font()"
|
|
963
|
+
[disabled]="disabled()"
|
|
964
|
+
[labelColor]="labelColor()"
|
|
965
|
+
[viewportClickEmitter]="viewportClick"
|
|
966
|
+
[axisHeadScale]="axisHeadScale()"
|
|
967
|
+
(pointerdown)="onPointerDown($any($event))"
|
|
968
|
+
/>
|
|
969
|
+
<ng-container *ngIf="!hideNegativeAxes()">
|
|
970
|
+
<ngts-gizmo-viewport-axis-head
|
|
971
|
+
[arcStyle]="axisColors()[0]"
|
|
972
|
+
[position]="[-1, 0, 0]"
|
|
973
|
+
[font]="font()"
|
|
974
|
+
[disabled]="disabled()"
|
|
975
|
+
[labelColor]="labelColor()"
|
|
976
|
+
[viewportClickEmitter]="viewportClick"
|
|
977
|
+
[axisHeadScale]="axisHeadScale()"
|
|
978
|
+
(pointerdown)="onPointerDown($any($event))"
|
|
979
|
+
/>
|
|
980
|
+
<ngts-gizmo-viewport-axis-head
|
|
981
|
+
[arcStyle]="axisColors()[1]"
|
|
982
|
+
[position]="[0, -1, 0]"
|
|
983
|
+
[font]="font()"
|
|
984
|
+
[disabled]="disabled()"
|
|
985
|
+
[labelColor]="labelColor()"
|
|
986
|
+
[viewportClickEmitter]="viewportClick"
|
|
987
|
+
[axisHeadScale]="axisHeadScale()"
|
|
988
|
+
(pointerdown)="onPointerDown($any($event))"
|
|
989
|
+
/>
|
|
990
|
+
<ngts-gizmo-viewport-axis-head
|
|
991
|
+
[arcStyle]="axisColors()[2]"
|
|
992
|
+
[position]="[0, 0, -1]"
|
|
993
|
+
[font]="font()"
|
|
994
|
+
[disabled]="disabled()"
|
|
995
|
+
[labelColor]="labelColor()"
|
|
996
|
+
[viewportClickEmitter]="viewportClick"
|
|
997
|
+
[axisHeadScale]="axisHeadScale()"
|
|
998
|
+
(pointerdown)="onPointerDown($any($event))"
|
|
999
|
+
/>
|
|
1000
|
+
</ng-container>
|
|
1001
|
+
</ng-container>
|
|
1002
|
+
<ngt-ambient-light [intensity]="0.5"></ngt-ambient-light>
|
|
1003
|
+
<ngt-point-light [position]="10" [intensity]="0.5"></ngt-point-light>
|
|
1004
|
+
</ngt-group>
|
|
1005
|
+
`,
|
|
1006
|
+
imports: [NgtsGizmoViewportAxis, NgtsGizmoViewportAxisHead, NgIf],
|
|
1007
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
1008
|
+
}]
|
|
1009
|
+
}], propDecorators: { _axisColors: [{
|
|
1010
|
+
type: Input,
|
|
1011
|
+
args: [{ alias: 'axisColors' }]
|
|
1012
|
+
}], _axisScale: [{
|
|
1013
|
+
type: Input,
|
|
1014
|
+
args: [{ alias: 'axisScale' }]
|
|
1015
|
+
}], _labels: [{
|
|
1016
|
+
type: Input,
|
|
1017
|
+
args: [{ alias: 'labels' }]
|
|
1018
|
+
}], _axisHeadScale: [{
|
|
1019
|
+
type: Input,
|
|
1020
|
+
args: [{ alias: 'axisHeadScale' }]
|
|
1021
|
+
}], _labelColor: [{
|
|
1022
|
+
type: Input,
|
|
1023
|
+
args: [{ alias: 'labelColor' }]
|
|
1024
|
+
}], _hideNegativeAxes: [{
|
|
1025
|
+
type: Input,
|
|
1026
|
+
args: [{ alias: 'hideNegativeAxes' }]
|
|
1027
|
+
}], _hideAxisHeads: [{
|
|
1028
|
+
type: Input,
|
|
1029
|
+
args: [{ alias: 'hideAxisHeads' }]
|
|
1030
|
+
}], _disabled: [{
|
|
1031
|
+
type: Input,
|
|
1032
|
+
args: [{ alias: 'disabled' }]
|
|
1033
|
+
}], _font: [{
|
|
1034
|
+
type: Input,
|
|
1035
|
+
args: [{ alias: 'font' }]
|
|
1036
|
+
}], viewportClick: [{
|
|
1037
|
+
type: Output
|
|
1038
|
+
}] } });
|
|
1039
|
+
|
|
1040
|
+
/**
|
|
1041
|
+
* Generated bundle index. Do not edit.
|
|
1042
|
+
*/
|
|
1043
|
+
|
|
1044
|
+
export { NgtsGizmoHelper, NgtsGizmoViewcube, NgtsGizmoViewport, injectNgtsGizmoHelperApi, provideNgtsGizmoHelperApi };
|
|
1045
|
+
//# sourceMappingURL=angular-three-soba-gizmos.mjs.map
|