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.
Files changed (323) hide show
  1. package/abstractions/billboard/billboard.d.ts +12 -8
  2. package/abstractions/detailed/detailed.d.ts +26 -0
  3. package/abstractions/edges/edges.d.ts +24 -12
  4. package/abstractions/grid/grid.d.ts +42 -51
  5. package/abstractions/index.d.ts +1 -7
  6. package/abstractions/text/text.d.ts +10 -4
  7. package/abstractions/text-3d/text-3d.d.ts +51 -41
  8. package/cameras/camera/camera-content.d.ts +1 -1
  9. package/cameras/camera/camera.d.ts +16 -13
  10. package/cameras/cube-camera/cube-camera.d.ts +49 -23
  11. package/cameras/index.d.ts +0 -1
  12. package/cameras/orthographic-camera/orthographic-camera.d.ts +29 -18
  13. package/cameras/perspective-camera/perspective-camera.d.ts +10 -1
  14. package/controls/orbit-controls/orbit-controls.d.ts +34 -15
  15. package/esm2022/abstractions/billboard/billboard.mjs +36 -33
  16. package/esm2022/abstractions/detailed/detailed.mjs +64 -0
  17. package/esm2022/abstractions/edges/edges.mjs +58 -63
  18. package/esm2022/abstractions/grid/grid.mjs +140 -110
  19. package/esm2022/abstractions/index.mjs +2 -8
  20. package/esm2022/abstractions/text/text.mjs +123 -122
  21. package/esm2022/abstractions/text-3d/text-3d.mjs +120 -115
  22. package/esm2022/cameras/camera/camera-content.mjs +6 -6
  23. package/esm2022/cameras/camera/camera.mjs +48 -42
  24. package/esm2022/cameras/cube-camera/cube-camera.mjs +120 -100
  25. package/esm2022/cameras/index.mjs +1 -2
  26. package/esm2022/cameras/orthographic-camera/orthographic-camera.mjs +78 -75
  27. package/esm2022/cameras/perspective-camera/perspective-camera.mjs +25 -26
  28. package/esm2022/controls/orbit-controls/orbit-controls.mjs +109 -85
  29. package/esm2022/gizmos/angular-three-soba-gizmos.mjs +5 -0
  30. package/esm2022/gizmos/gizmo-helper/gizmo-helper.mjs +198 -0
  31. package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/constants.mjs +31 -0
  32. package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.mjs +93 -0
  33. package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.mjs +151 -0
  34. package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-input.mjs +66 -0
  35. package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube.mjs +71 -0
  36. package/esm2022/gizmos/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.mjs +195 -0
  37. package/esm2022/gizmos/gizmo-helper/gizmo-viewport/gizmo-viewport.mjs +272 -0
  38. package/esm2022/gizmos/index.mjs +4 -0
  39. package/esm2022/loaders/gltf-loader/gltf-loader.mjs +14 -9
  40. package/esm2022/loaders/loader/loader.mjs +92 -87
  41. package/esm2022/loaders/progress/progress.mjs +31 -30
  42. package/esm2022/loaders/texture-loader/texture-loader.mjs +20 -15
  43. package/esm2022/materials/index.mjs +2 -1
  44. package/esm2022/materials/mesh-distort-material/mesh-distort-material.mjs +60 -51
  45. package/esm2022/materials/mesh-reflector-material/mesh-reflector-material.mjs +239 -255
  46. package/esm2022/materials/mesh-refraction-material/mesh-refraction-material.mjs +99 -97
  47. package/esm2022/materials/mesh-transmission-material/mesh-transmission-material.mjs +164 -144
  48. package/esm2022/materials/mesh-wobble-material/mesh-wobble-material.mjs +44 -42
  49. package/esm2022/materials/point-material/point-material.mjs +50 -0
  50. package/esm2022/misc/animations/animations.mjs +28 -23
  51. package/esm2022/misc/bake-shadows/bake-shadows.mjs +13 -13
  52. package/esm2022/misc/caustics/caustics.mjs +387 -0
  53. package/esm2022/misc/decal/decal.mjs +187 -0
  54. package/esm2022/misc/depth-buffer/depth-buffer.mjs +41 -37
  55. package/esm2022/misc/example/example.mjs +161 -0
  56. package/esm2022/misc/fbo/fbo.mjs +42 -36
  57. package/esm2022/misc/html/html-wrapper.mjs +478 -0
  58. package/esm2022/misc/html/html.mjs +305 -0
  59. package/esm2022/misc/index.mjs +10 -1
  60. package/esm2022/misc/sampler/sampler.mjs +132 -0
  61. package/esm2022/misc/shadow/shadow.mjs +111 -0
  62. package/esm2022/misc/stats-gl/stats-gl.mjs +61 -0
  63. package/esm2022/misc/trail/trail.mjs +204 -0
  64. package/esm2022/misc/trail-texture/inject-trail-texture.mjs +17 -0
  65. package/esm2022/misc/trail-texture/trail-texture.mjs +106 -0
  66. package/esm2022/modifiers/angular-three-soba-modifiers.mjs +5 -0
  67. package/esm2022/modifiers/curve-modifier/curve-modifier.mjs +64 -0
  68. package/esm2022/modifiers/index.mjs +2 -0
  69. package/esm2022/performances/adaptive-dpr/adaptive-dpr.mjs +44 -0
  70. package/esm2022/performances/adaptive-events/adaptive-events.mjs +27 -0
  71. package/esm2022/performances/angular-three-soba-performances.mjs +5 -0
  72. package/esm2022/performances/index.mjs +8 -0
  73. package/esm2022/performances/instances/instances.mjs +221 -0
  74. package/esm2022/performances/instances/position-mesh.mjs +52 -0
  75. package/esm2022/performances/points/points-input.mjs +64 -0
  76. package/esm2022/performances/points/points.mjs +327 -0
  77. package/esm2022/performances/points/position-point.mjs +54 -0
  78. package/esm2022/performances/segments/segment-object.mjs +9 -0
  79. package/esm2022/performances/segments/segments.mjs +183 -0
  80. package/esm2022/shaders/blur-pass/blur-pass.mjs +2 -2
  81. package/esm2022/shaders/caustics/caustics-material.mjs +130 -0
  82. package/esm2022/shaders/caustics/caustics-projection-material.mjs +32 -0
  83. package/esm2022/shaders/convolution-material/convolution-material.mjs +3 -2
  84. package/esm2022/shaders/discard-material/discard-material.mjs +1 -1
  85. package/esm2022/shaders/grid-material/grid-material.mjs +30 -14
  86. package/esm2022/shaders/index.mjs +5 -3
  87. package/esm2022/shaders/mesh-distort-material/mesh-distort-material.mjs +42 -41
  88. package/esm2022/shaders/mesh-reflector-material/mesh-reflector-material.mjs +2 -2
  89. package/esm2022/shaders/mesh-refraction-material/mesh-refraction-material.mjs +3 -2
  90. package/esm2022/shaders/mesh-transmission-material/mesh-transmission-material.mjs +7 -4
  91. package/esm2022/shaders/mesh-wobble-material/mesh-wobble-material.mjs +1 -1
  92. package/esm2022/shaders/shader-material/shader-material.mjs +3 -5
  93. package/esm2022/shaders/soft-shadow-material/soft-shadow-material.mjs +18 -25
  94. package/esm2022/shaders/sparkles-material/sparkles-material.mjs +32 -46
  95. package/esm2022/shaders/spot-light-material/spot-light-material.mjs +8 -7
  96. package/esm2022/shaders/star-field-material/star-field-material.mjs +3 -2
  97. package/esm2022/shaders/wireframe-material/wireframe-material.mjs +247 -0
  98. package/esm2022/staging/accumulative-shadows/accumulative-shadows.mjs +161 -176
  99. package/esm2022/staging/accumulative-shadows/progressive-light-map.mjs +8 -8
  100. package/esm2022/staging/accumulative-shadows/randomized-lights.mjs +129 -129
  101. package/esm2022/staging/backdrop/backdrop.mjs +77 -0
  102. package/esm2022/staging/bb-anchor/bb-anchor.mjs +69 -0
  103. package/esm2022/staging/bounds/bounds.mjs +145 -143
  104. package/esm2022/staging/camera-shake/camera-shake.mjs +86 -80
  105. package/esm2022/staging/center/center.mjs +129 -112
  106. package/esm2022/staging/cloud/cloud.mjs +118 -124
  107. package/esm2022/staging/contact-shadows/contact-shadows.mjs +131 -136
  108. package/esm2022/staging/environment/assets.mjs +12 -12
  109. package/esm2022/staging/environment/environment-cube.mjs +28 -30
  110. package/esm2022/staging/environment/environment-ground.mjs +17 -19
  111. package/esm2022/staging/environment/environment-input.mjs +98 -85
  112. package/esm2022/staging/environment/environment-map.mjs +33 -33
  113. package/esm2022/staging/environment/environment-portal.mjs +75 -97
  114. package/esm2022/staging/environment/environment.mjs +34 -51
  115. package/esm2022/staging/environment/utils.mjs +40 -17
  116. package/esm2022/staging/float/float.mjs +70 -58
  117. package/esm2022/staging/index.mjs +7 -3
  118. package/esm2022/staging/matcap-texture/matcap-texture.mjs +64 -0
  119. package/esm2022/staging/normal-texture/normal-texture.mjs +53 -0
  120. package/esm2022/staging/sky/sky.mjs +85 -80
  121. package/esm2022/staging/sparkles/sparkles.mjs +108 -105
  122. package/esm2022/staging/spot-light/shadow-mesh-input.mjs +63 -0
  123. package/esm2022/staging/spot-light/shadow-mesh.mjs +267 -0
  124. package/esm2022/staging/spot-light/spot-light-input.mjs +67 -58
  125. package/esm2022/staging/spot-light/spot-light.mjs +51 -63
  126. package/esm2022/staging/spot-light/volumetric-mesh.mjs +67 -70
  127. package/esm2022/staging/stage/stage.mjs +305 -290
  128. package/esm2022/staging/stars/stars.mjs +101 -102
  129. package/esm2022/staging/wireframe/wireframe-input.mjs +191 -0
  130. package/esm2022/staging/wireframe/wireframe.mjs +228 -0
  131. package/esm2022/utils/angular-three-soba-utils.mjs +5 -0
  132. package/esm2022/utils/constants.mjs +3 -0
  133. package/esm2022/utils/content/content.mjs +15 -0
  134. package/esm2022/utils/index.mjs +3 -0
  135. package/fesm2022/angular-three-soba-abstractions.mjs +504 -2079
  136. package/fesm2022/angular-three-soba-abstractions.mjs.map +1 -1
  137. package/fesm2022/angular-three-soba-cameras.mjs +293 -260
  138. package/fesm2022/angular-three-soba-cameras.mjs.map +1 -1
  139. package/fesm2022/angular-three-soba-controls.mjs +108 -83
  140. package/fesm2022/angular-three-soba-controls.mjs.map +1 -1
  141. package/fesm2022/angular-three-soba-gizmos.mjs +1045 -0
  142. package/fesm2022/angular-three-soba-gizmos.mjs.map +1 -0
  143. package/fesm2022/angular-three-soba-loaders.mjs +148 -132
  144. package/fesm2022/angular-three-soba-loaders.mjs.map +1 -1
  145. package/fesm2022/angular-three-soba-materials.mjs +656 -588
  146. package/fesm2022/angular-three-soba-materials.mjs.map +1 -1
  147. package/fesm2022/angular-three-soba-misc.mjs +2202 -99
  148. package/fesm2022/angular-three-soba-misc.mjs.map +1 -1
  149. package/fesm2022/angular-three-soba-modifiers.mjs +71 -0
  150. package/fesm2022/angular-three-soba-modifiers.mjs.map +1 -0
  151. package/fesm2022/angular-three-soba-performances.mjs +957 -0
  152. package/fesm2022/angular-three-soba-performances.mjs.map +1 -0
  153. package/fesm2022/angular-three-soba-shaders.mjs +508 -269
  154. package/fesm2022/angular-three-soba-shaders.mjs.map +1 -1
  155. package/fesm2022/angular-three-soba-staging.mjs +2910 -2573
  156. package/fesm2022/angular-three-soba-staging.mjs.map +1 -1
  157. package/fesm2022/angular-three-soba-utils.mjs +25 -0
  158. package/fesm2022/angular-three-soba-utils.mjs.map +1 -0
  159. package/gizmos/README.md +3 -0
  160. package/gizmos/gizmo-helper/gizmo-helper.d.ts +73 -0
  161. package/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.d.ts +22 -0
  162. package/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.d.ts +29 -0
  163. package/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-input.d.ts +33 -0
  164. package/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube.d.ts +10 -0
  165. package/gizmos/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.d.ts +40 -0
  166. package/gizmos/gizmo-helper/gizmo-viewport/gizmo-viewport.d.ts +30 -0
  167. package/gizmos/index.d.ts +3 -0
  168. package/loaders/gltf-loader/gltf-loader.d.ts +15 -4
  169. package/loaders/loader/loader.d.ts +19 -17
  170. package/loaders/progress/progress.d.ts +1 -1
  171. package/loaders/texture-loader/texture-loader.d.ts +8 -3
  172. package/materials/index.d.ts +1 -0
  173. package/materials/mesh-distort-material/mesh-distort-material.d.ts +25 -15
  174. package/materials/mesh-reflector-material/mesh-reflector-material.d.ts +74 -56
  175. package/materials/mesh-refraction-material/mesh-refraction-material.d.ts +33 -21
  176. package/materials/mesh-transmission-material/mesh-transmission-material.d.ts +55 -39
  177. package/materials/mesh-wobble-material/mesh-wobble-material.d.ts +19 -10
  178. package/materials/point-material/point-material.d.ts +24 -0
  179. package/metadata.json +1 -0
  180. package/misc/animations/animations.d.ts +6 -4
  181. package/misc/caustics/caustics.d.ts +87 -0
  182. package/misc/decal/decal.d.ts +49 -0
  183. package/misc/depth-buffer/depth-buffer.d.ts +2 -2
  184. package/misc/example/example.d.ts +85 -0
  185. package/misc/fbo/fbo.d.ts +2 -2
  186. package/misc/html/html-wrapper.d.ts +559 -0
  187. package/misc/html/html.d.ts +218 -0
  188. package/misc/index.d.ts +9 -0
  189. package/misc/sampler/sampler.d.ts +67 -0
  190. package/misc/shadow/shadow.d.ts +37 -0
  191. package/misc/stats-gl/stats-gl.d.ts +24 -0
  192. package/misc/trail/trail.d.ts +57 -0
  193. package/misc/trail-texture/inject-trail-texture.d.ts +9 -0
  194. package/misc/trail-texture/trail-texture.d.ts +50 -0
  195. package/modifiers/README.md +3 -0
  196. package/modifiers/curve-modifier/curve-modifier.d.ts +23 -0
  197. package/modifiers/index.d.ts +1 -0
  198. package/package.json +42 -24
  199. package/performances/README.md +3 -0
  200. package/performances/adaptive-dpr/adaptive-dpr.d.ts +14 -0
  201. package/{performance/adaptive → performances/adaptive-events}/adaptive-events.d.ts +3 -0
  202. package/performances/index.d.ts +7 -0
  203. package/performances/instances/instances.d.ts +83 -0
  204. package/{performance → performances}/instances/position-mesh.d.ts +1 -1
  205. package/performances/points/points-input.d.ts +32 -0
  206. package/performances/points/points.d.ts +96 -0
  207. package/performances/points/position-point.d.ts +11 -0
  208. package/performances/segments/segment-object.d.ts +7 -0
  209. package/performances/segments/segments.d.ts +128 -0
  210. package/shaders/grid-material/grid-material.d.ts +33 -0
  211. package/shaders/index.d.ts +4 -2
  212. package/shaders/mesh-distort-material/mesh-distort-material.d.ts +173 -6
  213. package/shaders/mesh-transmission-material/mesh-transmission-material.d.ts +1 -1
  214. package/shaders/shader-material/shader-material.d.ts +2 -2
  215. package/shaders/soft-shadow-material/soft-shadow-material.d.ts +10 -1
  216. package/shaders/sparkles-material/sparkles-material.d.ts +13 -0
  217. package/shaders/spot-light-material/spot-light-material.d.ts +11 -2
  218. package/shaders/star-field-material/star-field-material.d.ts +9 -0
  219. package/shaders/wireframe-material/wireframe-material.d.ts +58 -0
  220. package/staging/accumulative-shadows/accumulative-shadows.d.ts +93 -39
  221. package/staging/accumulative-shadows/randomized-lights.d.ts +41 -28
  222. package/staging/backdrop/backdrop.d.ts +30 -0
  223. package/staging/bb-anchor/bb-anchor.d.ts +27 -0
  224. package/staging/bounds/bounds.d.ts +105 -25
  225. package/staging/camera-shake/camera-shake.d.ts +30 -19
  226. package/staging/center/center.d.ts +43 -35
  227. package/staging/cloud/cloud.d.ts +27 -24
  228. package/staging/contact-shadows/contact-shadows.d.ts +43 -30
  229. package/staging/environment/assets.d.ts +9 -9
  230. package/staging/environment/environment-cube.d.ts +9 -5
  231. package/staging/environment/environment-ground.d.ts +7 -7
  232. package/staging/environment/environment-input.d.ts +38 -38
  233. package/staging/environment/environment-map.d.ts +10 -5
  234. package/staging/environment/environment-portal.d.ts +10 -5
  235. package/staging/environment/environment.d.ts +0 -4
  236. package/staging/environment/utils.d.ts +2 -2
  237. package/staging/float/float.d.ts +15 -11
  238. package/staging/index.d.ts +6 -2
  239. package/staging/matcap-texture/matcap-texture.d.ts +13 -0
  240. package/staging/normal-texture/normal-texture.d.ts +16 -0
  241. package/staging/sky/sky.d.ts +28 -21
  242. package/staging/sparkles/sparkles.d.ts +36 -22
  243. package/staging/spot-light/shadow-mesh-input.d.ts +29 -0
  244. package/staging/spot-light/shadow-mesh.d.ts +37 -0
  245. package/staging/spot-light/spot-light-input.d.ts +25 -25
  246. package/staging/spot-light/spot-light.d.ts +35 -15
  247. package/staging/spot-light/volumetric-mesh.d.ts +15 -9
  248. package/staging/stage/stage.d.ts +89 -65
  249. package/staging/stars/stars.d.ts +28 -17
  250. package/staging/wireframe/wireframe-input.d.ts +65 -0
  251. package/staging/wireframe/wireframe.d.ts +28 -0
  252. package/utils/README.md +3 -0
  253. package/utils/constants.d.ts +1 -0
  254. package/utils/content/content.d.ts +8 -0
  255. package/utils/index.d.ts +2 -0
  256. package/web-types.json +1 -0
  257. package/abstractions/catmull-rom-line/catmull-rom-line.d.ts +0 -25
  258. package/abstractions/cubic-bezier-line/cubic-bezier-line.d.ts +0 -25
  259. package/abstractions/gizmo-helper/gizmo-helper.d.ts +0 -34
  260. package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.d.ts +0 -22
  261. package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.d.ts +0 -30
  262. package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.d.ts +0 -32
  263. package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube.d.ts +0 -14
  264. package/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.d.ts +0 -47
  265. package/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport.d.ts +0 -40
  266. package/abstractions/line/line-input.d.ts +0 -42
  267. package/abstractions/line/line.d.ts +0 -35
  268. package/abstractions/quadratic-bezier-line/quadratic-bezier-line.d.ts +0 -23
  269. package/esm2022/abstractions/catmull-rom-line/catmull-rom-line.mjs +0 -131
  270. package/esm2022/abstractions/cubic-bezier-line/cubic-bezier-line.mjs +0 -113
  271. package/esm2022/abstractions/gizmo-helper/gizmo-helper.mjs +0 -210
  272. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/constants.mjs +0 -31
  273. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.mjs +0 -95
  274. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.mjs +0 -155
  275. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.mjs +0 -62
  276. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube.mjs +0 -80
  277. package/esm2022/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.mjs +0 -206
  278. package/esm2022/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport.mjs +0 -273
  279. package/esm2022/abstractions/line/line-input.mjs +0 -113
  280. package/esm2022/abstractions/line/line.mjs +0 -165
  281. package/esm2022/abstractions/quadratic-bezier-line/quadratic-bezier-line.mjs +0 -128
  282. package/esm2022/performance/adaptive/adaptive-dpr.mjs +0 -46
  283. package/esm2022/performance/adaptive/adaptive-events.mjs +0 -31
  284. package/esm2022/performance/angular-three-soba-performance.mjs +0 -5
  285. package/esm2022/performance/detailed/detailed.mjs +0 -61
  286. package/esm2022/performance/index.mjs +0 -7
  287. package/esm2022/performance/instances/instance.mjs +0 -48
  288. package/esm2022/performance/instances/instances.mjs +0 -189
  289. package/esm2022/performance/instances/position-mesh.mjs +0 -52
  290. package/esm2022/performance/stats/stats.mjs +0 -79
  291. package/esm2022/shaders/caustics-material/caustics-material.mjs +0 -128
  292. package/esm2022/shaders/caustics-material/caustics-projection-material.mjs +0 -33
  293. package/esm2022/staging/caustics/caustisc.mjs +0 -384
  294. package/esm2022/staging/spot-light/spot-light-shadow-mesh-input.mjs +0 -57
  295. package/esm2022/staging/spot-light/spot-light-shadow-mesh.mjs +0 -256
  296. package/fesm2022/angular-three-soba-performance.mjs +0 -487
  297. package/fesm2022/angular-three-soba-performance.mjs.map +0 -1
  298. package/performance/README.md +0 -3
  299. package/performance/adaptive/adaptive-dpr.d.ts +0 -8
  300. package/performance/detailed/detailed.d.ts +0 -20
  301. package/performance/index.d.ts +0 -6
  302. package/performance/instances/instance.d.ts +0 -9
  303. package/performance/instances/instances.d.ts +0 -35
  304. package/performance/stats/stats.d.ts +0 -18
  305. package/plugin/generators.json +0 -19
  306. package/plugin/libs/plugin/README.md +0 -11
  307. package/plugin/package.json +0 -9
  308. package/plugin/src/generators/init/compat.d.ts +0 -2
  309. package/plugin/src/generators/init/compat.js +0 -6
  310. package/plugin/src/generators/init/compat.js.map +0 -1
  311. package/plugin/src/generators/init/init.d.ts +0 -7
  312. package/plugin/src/generators/init/init.js +0 -28
  313. package/plugin/src/generators/init/init.js.map +0 -1
  314. package/plugin/src/generators/init/schema.json +0 -6
  315. package/plugin/src/index.d.ts +0 -1
  316. package/plugin/src/index.js +0 -6
  317. package/plugin/src/index.js.map +0 -1
  318. package/staging/caustics/caustisc.d.ts +0 -70
  319. package/staging/spot-light/spot-light-shadow-mesh-input.d.ts +0 -29
  320. package/staging/spot-light/spot-light-shadow-mesh.d.ts +0 -38
  321. /package/{abstractions → gizmos}/gizmo-helper/gizmo-viewcube/constants.d.ts +0 -0
  322. /package/shaders/{caustics-material → caustics}/caustics-material.d.ts +0 -0
  323. /package/shaders/{caustics-material → caustics}/caustics-projection-material.d.ts +0 -0
@@ -1,36 +1,34 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, CUSTOM_ELEMENTS_SCHEMA, Input, computed, Directive, inject, effect, InjectionToken, EventEmitter, TemplateRef, Output, ContentChild, signal, DestroyRef } from '@angular/core';
3
- import { extend, NgtSignalStore, injectNgtRef, injectBeforeRender, NgtStore, requestAnimationInInjectionContext, NgtArgs, NgtPortal, NgtPortalContent, NgtRepeat } from 'angular-three';
2
+ import { Component, CUSTOM_ELEMENTS_SCHEMA, Input, effect, TemplateRef, ContentChild, inject, ChangeDetectorRef, signal, computed, EventEmitter, DestroyRef, Output } from '@angular/core';
3
+ import { extend, signalStore, injectNgtRef, injectBeforeRender, NgtArgs, injectNgtStore } from 'angular-three';
4
4
  import * as THREE from 'three';
5
- import { Group, CatmullRomCurve3, LineSegments, LineBasicMaterial, Vector3, Quaternion, Object3D, Matrix4, Mesh, BoxGeometry, MeshBasicMaterial, MeshLambertMaterial, CanvasTexture, AmbientLight, PointLight, Sprite, SpriteMaterial, PlaneGeometry } from 'three';
6
- import { LineSegmentsGeometry, LineGeometry, LineMaterial, LineSegments2, Line2, TextGeometry, FontLoader } from 'three-stdlib';
7
- import { NgIf, NgTemplateOutlet, DOCUMENT, NgFor } from '@angular/common';
8
- import { NgtsOrthographicCamera } from 'angular-three-soba/cameras';
5
+ import { Group, LOD, LineSegments, LineBasicMaterial, Mesh, PlaneGeometry } from 'three';
6
+ import { NgIf, NgTemplateOutlet } from '@angular/common';
7
+ import { NgtsSobaContent } from 'angular-three-soba/utils';
9
8
  import { GridMaterial } from 'angular-three-soba/shaders';
10
- import { toSignal, toObservable } from '@angular/core/rxjs-interop';
11
- import { switchMap, of, map } from 'rxjs';
9
+ import { TextGeometry, FontLoader } from 'three-stdlib';
12
10
  import { Text, preloadFont } from 'troika-three-text';
13
11
 
14
12
  extend({ Group });
15
- class NgtsBillboard extends NgtSignalStore {
16
- set follow(follow) {
17
- this.set({ follow });
13
+ class NgtsBillboard {
14
+ set _follow(follow) {
15
+ this.inputs.set({ follow });
18
16
  }
19
- set lockX(lockX) {
20
- this.set({ lockX });
17
+ set _lockX(lockX) {
18
+ this.inputs.set({ lockX });
21
19
  }
22
- set lockY(lockY) {
23
- this.set({ lockY });
20
+ set _lockY(lockY) {
21
+ this.inputs.set({ lockY });
24
22
  }
25
- set lockZ(lockZ) {
26
- this.set({ lockZ });
23
+ set _lockZ(lockZ) {
24
+ this.inputs.set({ lockZ });
27
25
  }
28
26
  constructor() {
29
- super({ follow: true, lockX: false, lockY: false, lockZ: false });
27
+ this.inputs = signalStore({ follow: true, lockX: false, lockY: false, lockZ: false });
30
28
  this.billboardRef = injectNgtRef();
31
29
  injectBeforeRender(({ camera }) => {
32
30
  const ref = this.billboardRef.untracked;
33
- const { follow, lockX, lockY, lockZ } = this.get();
31
+ const { follow, lockX, lockY, lockZ } = this.inputs.get();
34
32
  if (!ref || !follow)
35
33
  return;
36
34
  // save previous rotation in case we're locking an axis
@@ -46,1982 +44,399 @@ class NgtsBillboard extends NgtSignalStore {
46
44
  ref.rotation.z = prevRotation.z;
47
45
  });
48
46
  }
49
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsBillboard, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
50
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsBillboard, isStandalone: true, selector: "ngts-billboard", inputs: { billboardRef: "billboardRef", follow: "follow", lockX: "lockX", lockY: "lockY", lockZ: "lockZ" }, usesInheritance: true, ngImport: i0, template: `
51
- <ngt-group ngtCompound [ref]="billboardRef">
52
- <ng-content />
53
- </ngt-group>
54
- `, isInline: true }); }
47
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsBillboard, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
48
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.3", type: NgtsBillboard, isStandalone: true, selector: "ngts-billboard", inputs: { billboardRef: "billboardRef", _follow: ["follow", "_follow"], _lockX: ["lockX", "_lockX"], _lockY: ["lockY", "_lockY"], _lockZ: ["lockZ", "_lockZ"] }, ngImport: i0, template: `
49
+ <ngt-group ngtCompound [ref]="billboardRef">
50
+ <ng-content />
51
+ </ngt-group>
52
+ `, isInline: true }); }
55
53
  }
56
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsBillboard, decorators: [{
54
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsBillboard, decorators: [{
57
55
  type: Component,
58
56
  args: [{
59
57
  selector: 'ngts-billboard',
60
58
  standalone: true,
61
59
  template: `
62
- <ngt-group ngtCompound [ref]="billboardRef">
63
- <ng-content />
64
- </ngt-group>
65
- `,
60
+ <ngt-group ngtCompound [ref]="billboardRef">
61
+ <ng-content />
62
+ </ngt-group>
63
+ `,
66
64
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
67
65
  }]
68
66
  }], ctorParameters: function () { return []; }, propDecorators: { billboardRef: [{
69
67
  type: Input
70
- }], follow: [{
71
- type: Input
72
- }], lockX: [{
73
- type: Input
74
- }], lockY: [{
75
- type: Input
76
- }], lockZ: [{
77
- 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' }]
78
80
  }] } });
79
81
 
80
- class NgtsLineInputs extends NgtSignalStore {
81
- set vertexColors(vertexColors) {
82
- this.set({ vertexColors });
83
- }
84
- set lineWidth(lineWidth) {
85
- this.set({ lineWidth });
86
- }
87
- set alphaToCoverage(alphaToCoverage) {
88
- this.set({ alphaToCoverage });
89
- }
90
- set color(color) {
91
- this.set({ color });
92
- }
93
- set dashed(dashed) {
94
- this.set({ dashed });
82
+ extend({ LOD });
83
+ class NgtsDetailed {
84
+ set _distances(distances) {
85
+ this.inputs.set({ distances });
95
86
  }
96
- set dashScale(dashScale) {
97
- this.set({ dashScale });
87
+ set _hysteresis(hysteresis) {
88
+ this.inputs.set({ hysteresis });
98
89
  }
99
- set dashSize(dashSize) {
100
- this.set({ dashSize });
101
- }
102
- set dashOffset(dashOffset) {
103
- this.set({ dashOffset });
104
- }
105
- set gapSize(gapSize) {
106
- this.set({ gapSize });
107
- }
108
- set resolution(resolution) {
109
- this.set({ resolution });
110
- }
111
- set wireframe(wireframe) {
112
- this.set({ wireframe });
113
- }
114
- set worldUnits(worldUnits) {
115
- this.set({ worldUnits });
116
- }
117
- #color;
118
- #vertexColors;
119
- #resolution;
120
- #linewidth;
121
- #alphaToCoverage;
122
- #dashed;
123
- #dashScale;
124
- #dashSize;
125
- #dashOffset;
126
- #gapSize;
127
- #wireframe;
128
- #worldUnits;
129
90
  constructor() {
130
- super({ color: 'black' });
131
- this.#color = this.select('color');
132
- this.#vertexColors = this.select('vertexColors');
133
- this.#resolution = this.select('resolution');
134
- this.#linewidth = this.select('lineWidth');
135
- this.#alphaToCoverage = this.select('alphaToCoverage');
136
- this.#dashed = this.select('dashed');
137
- this.#dashScale = this.select('dashScale');
138
- this.#dashSize = this.select('dashSize');
139
- this.#dashOffset = this.select('dashOffset');
140
- this.#gapSize = this.select('gapSize');
141
- this.#wireframe = this.select('wireframe');
142
- this.#worldUnits = this.select('worldUnits');
143
- this.lineParameters = computed(() => ({
144
- color: this.#color(),
145
- vertexColors: this.#vertexColors(),
146
- resolution: this.#resolution(),
147
- linewidth: this.#linewidth(),
148
- alphaToCoverage: this.#alphaToCoverage(),
149
- dashed: this.#dashed(),
150
- dashScale: this.#dashScale(),
151
- dashSize: this.#dashSize(),
152
- dashOffset: this.#dashOffset(),
153
- gapSize: this.#gapSize(),
154
- wireframe: this.#wireframe(),
155
- worldUnits: this.#worldUnits(),
156
- }));
157
- }
158
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsLineInputs, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
159
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: NgtsLineInputs, inputs: { vertexColors: "vertexColors", lineWidth: "lineWidth", alphaToCoverage: "alphaToCoverage", color: "color", dashed: "dashed", dashScale: "dashScale", dashSize: "dashSize", dashOffset: "dashOffset", gapSize: "gapSize", resolution: "resolution", wireframe: "wireframe", worldUnits: "worldUnits" }, usesInheritance: true, ngImport: i0 }); }
160
- }
161
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsLineInputs, decorators: [{
162
- type: Directive
163
- }], ctorParameters: function () { return []; }, propDecorators: { vertexColors: [{
164
- type: Input
165
- }], lineWidth: [{
166
- type: Input
167
- }], alphaToCoverage: [{
168
- type: Input
169
- }], color: [{
170
- type: Input
171
- }], dashed: [{
172
- type: Input
173
- }], dashScale: [{
174
- type: Input
175
- }], dashSize: [{
176
- type: Input
177
- }], dashOffset: [{
178
- type: Input
179
- }], gapSize: [{
180
- type: Input
181
- }], resolution: [{
182
- type: Input
183
- }], wireframe: [{
184
- type: Input
185
- }], worldUnits: [{
186
- type: Input
187
- }] } });
188
-
189
- class NgtsLine extends NgtsLineInputs {
190
- set points(points) {
191
- this.set({ points });
192
- }
193
- set segments(segments) {
194
- this.set({ segments });
195
- }
196
- #store;
197
- #size;
198
- #lineResolution;
199
- #resolution;
200
- #points;
201
- #pointValues;
202
- #vertexColors;
203
- #vertexColorValues;
204
- #segments;
205
- constructor() {
206
- super();
207
- this.lineRef = injectNgtRef();
208
- this.#store = inject(NgtStore);
209
- this.#size = this.#store.select('size');
210
- this.#lineResolution = this.select('resolution');
211
- this.#resolution = computed(() => this.#lineResolution() ? this.#lineResolution() : [this.#size().width, this.#size().height]);
212
- this.#points = this.select('points');
213
- this.#pointValues = computed(() => this.#points().map((p) => {
214
- const isArray = Array.isArray(p);
215
- return p instanceof THREE.Vector3
216
- ? [p.x, p.y, p.z]
217
- : p instanceof THREE.Vector2
218
- ? [p.x, p.y, 0]
219
- : isArray && p.length === 3
220
- ? [p[0], p[1], p[2]]
221
- : isArray && p.length === 2
222
- ? [p[0], p[1], 0]
223
- : p;
224
- }));
225
- this.#vertexColors = this.select('vertexColors');
226
- this.#vertexColorValues = computed(() => (this.#vertexColors() || []).map((c) => (c instanceof THREE.Color ? c.toArray() : c)));
227
- this.#segments = this.select('segments');
228
- this.lineGeometry = computed(() => {
229
- const pointValues = this.#pointValues();
230
- const vertexColors = this.#vertexColorValues();
231
- const geometry = this.#segments() ? new LineSegmentsGeometry() : new LineGeometry();
232
- geometry.setPositions(pointValues.flat());
233
- if (vertexColors.length) {
234
- geometry.setColors(vertexColors.flat());
235
- }
236
- return geometry;
237
- });
238
- this.lineMaterial = new LineMaterial();
239
- this.line = computed(() => (this.#segments() ? new LineSegments2() : new Line2()));
240
- this.lineMaterialParameters = computed(() => {
241
- const parameters = this.lineParameters();
242
- const resolution = this.#resolution();
243
- const vertexColors = Boolean(parameters.vertexColors);
244
- if (vertexColors) {
245
- parameters.color = undefined;
246
- }
247
- return {
248
- ...parameters,
249
- vertexColors,
250
- resolution,
251
- dashScale: parameters.dashScale ?? this.lineMaterial.dashScale,
252
- dashSize: parameters.dashSize ?? this.lineMaterial.dashSize,
253
- dashOffset: parameters.dashOffset ?? this.lineMaterial.dashOffset,
254
- gapSize: parameters.gapSize ?? this.lineMaterial.gapSize,
255
- wireframe: parameters.wireframe ?? this.lineMaterial.wireframe,
256
- worldUnits: parameters.worldUnits ?? this.lineMaterial.worldUnits,
257
- };
258
- });
259
- this.set({ segments: false });
260
- requestAnimationInInjectionContext(() => {
261
- this.#disposeGeometry();
262
- this.#computeLineDistances();
263
- });
91
+ this.inputs = signalStore({ hysteresis: 0 });
92
+ this.lodRef = injectNgtRef();
93
+ this.updateChildren();
264
94
  }
265
- #computeLineDistances() {
266
- const points = this.select('points');
267
- const trigger = computed(() => {
268
- const lineGeometry = this.lineGeometry();
269
- const line = this.lineRef.nativeElement;
270
- const children = this.lineRef.children('nonObjects');
271
- return { points: points(), lineGeometry, line, children: children() };
272
- });
95
+ onBeforeRender({ object, state }) {
96
+ object.update(state.camera);
97
+ }
98
+ updateChildren() {
99
+ const lodChildren = this.lodRef.children();
100
+ const _distances = this.inputs.select('distances');
101
+ const _hysteresis = this.inputs.select('hysteresis');
273
102
  effect(() => {
274
- const { line } = trigger();
275
- if (!line)
103
+ const lod = this.lodRef.nativeElement;
104
+ if (!lod)
276
105
  return;
277
- line.computeLineDistances();
278
- });
279
- }
280
- #disposeGeometry() {
281
- effect((onCleanup) => {
282
- const lineGeometry = this.lineGeometry();
283
- onCleanup(() => lineGeometry.dispose());
106
+ const [distances, hysteresis, children] = [_distances(), _hysteresis(), lodChildren()];
107
+ lod.levels.length = 0;
108
+ children.forEach((child, index) => {
109
+ lod.addLevel(child, distances[index], hysteresis);
110
+ });
284
111
  });
285
112
  }
286
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsLine, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
287
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsLine, isStandalone: true, selector: "ngts-line", inputs: { lineRef: "lineRef", points: "points", segments: "segments" }, usesInheritance: true, ngImport: i0, template: `
288
- <ngt-primitive *args="[line()]" [ref]="lineRef" ngtCompound>
289
- <ngt-primitive *args="[lineGeometry()]" attach="geometry" />
290
- <ngt-primitive
291
- *args="[lineMaterial]"
292
- attach="material"
293
- [resolution]="lineMaterialParameters().resolution"
294
- [color]="lineMaterialParameters().color"
295
- [vertexColors]="lineMaterialParameters().vertexColors"
296
- [linewidth]="lineMaterialParameters().linewidth"
297
- [alphaToCoverage]="lineMaterialParameters().alphaToCoverage"
298
- [dashed]="lineMaterialParameters().dashed"
299
- [dashScale]="lineMaterialParameters().dashScale"
300
- [dashSize]="lineMaterialParameters().dashSize"
301
- [dashOffset]="lineMaterialParameters().dashOffset"
302
- [gapSize]="lineMaterialParameters().gapSize"
303
- [wireframe]="lineMaterialParameters().wireframe"
304
- [worldUnits]="lineMaterialParameters().worldUnits"
305
- />
306
- </ngt-primitive>
307
- `, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "[args]", inputs: ["args"] }] }); }
113
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsDetailed, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
114
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.3", type: NgtsDetailed, isStandalone: true, selector: "ngts-detailed", inputs: { lodRef: "lodRef", _distances: ["distances", "_distances"], _hysteresis: ["hysteresis", "_hysteresis"] }, ngImport: i0, template: `
115
+ <ngt-lOD ngtCompound [ref]="lodRef" (beforeRender)="onBeforeRender($event)">
116
+ <ng-content />
117
+ </ngt-lOD>
118
+ `, isInline: true }); }
308
119
  }
309
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsLine, decorators: [{
120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsDetailed, decorators: [{
310
121
  type: Component,
311
122
  args: [{
312
- selector: 'ngts-line',
123
+ selector: 'ngts-detailed',
313
124
  standalone: true,
314
125
  template: `
315
- <ngt-primitive *args="[line()]" [ref]="lineRef" ngtCompound>
316
- <ngt-primitive *args="[lineGeometry()]" attach="geometry" />
317
- <ngt-primitive
318
- *args="[lineMaterial]"
319
- attach="material"
320
- [resolution]="lineMaterialParameters().resolution"
321
- [color]="lineMaterialParameters().color"
322
- [vertexColors]="lineMaterialParameters().vertexColors"
323
- [linewidth]="lineMaterialParameters().linewidth"
324
- [alphaToCoverage]="lineMaterialParameters().alphaToCoverage"
325
- [dashed]="lineMaterialParameters().dashed"
326
- [dashScale]="lineMaterialParameters().dashScale"
327
- [dashSize]="lineMaterialParameters().dashSize"
328
- [dashOffset]="lineMaterialParameters().dashOffset"
329
- [gapSize]="lineMaterialParameters().gapSize"
330
- [wireframe]="lineMaterialParameters().wireframe"
331
- [worldUnits]="lineMaterialParameters().worldUnits"
332
- />
333
- </ngt-primitive>
334
- `,
335
- imports: [NgtArgs],
126
+ <ngt-lOD ngtCompound [ref]="lodRef" (beforeRender)="onBeforeRender($event)">
127
+ <ng-content />
128
+ </ngt-lOD>
129
+ `,
336
130
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
337
131
  }]
338
- }], ctorParameters: function () { return []; }, propDecorators: { lineRef: [{
132
+ }], ctorParameters: function () { return []; }, propDecorators: { lodRef: [{
339
133
  type: Input
340
- }], points: [{
134
+ }], _distances: [{
341
135
  type: Input,
342
- args: [{ required: true }]
343
- }], segments: [{
344
- type: Input
345
- }] } });
346
-
347
- class NgtsCatmullRomLine extends NgtsLineInputs {
348
- set points(points) {
349
- this.set({ points });
350
- }
351
- set closed(closed) {
352
- this.set({ closed });
353
- }
354
- set curveType(curveType) {
355
- this.set({ curveType });
356
- }
357
- set tension(tension) {
358
- this.set({ tension });
359
- }
360
- set segments(segments) {
361
- this.set({ segments });
362
- }
363
- #points;
364
- #closed;
365
- #curveType;
366
- #tension;
367
- #vertexColors;
368
- #curve;
369
- #segments;
370
- constructor() {
371
- super();
372
- this.lineRef = injectNgtRef();
373
- this.#points = this.select('points');
374
- this.#closed = this.select('closed');
375
- this.#curveType = this.select('curveType');
376
- this.#tension = this.select('tension');
377
- this.#vertexColors = this.select('vertexColors');
378
- this.#curve = computed(() => {
379
- const mappedPoints = this.#points().map((p) => p instanceof THREE.Vector3 ? p : new THREE.Vector3(...p));
380
- return new CatmullRomCurve3(mappedPoints, this.#closed(), this.#curveType(), this.#tension());
381
- });
382
- this.#segments = this.select('segments');
383
- this.segmentedPoints = computed(() => {
384
- const curve = this.#curve();
385
- return curve.getPoints(this.#segments());
386
- });
387
- this.interpolatedVertexColors = computed(() => {
388
- const vertexColors = this.#vertexColors();
389
- const segments = this.#segments();
390
- if (!vertexColors || vertexColors.length < 2)
391
- return undefined;
392
- if (vertexColors.length === segments + 1)
393
- return vertexColors;
394
- const mappedColors = vertexColors.map((color) => color instanceof THREE.Color ? color : new THREE.Color(...color));
395
- if (this.get('closed'))
396
- mappedColors.push(mappedColors[0].clone());
397
- const iColors = [mappedColors[0]];
398
- const divisions = segments / (mappedColors.length - 1);
399
- for (let i = 0; i < segments; i++) {
400
- const alpha = (i % divisions) / divisions;
401
- const colorIndex = Math.floor(i / divisions);
402
- iColors.push(mappedColors[colorIndex].clone().lerp(mappedColors[colorIndex + 1], alpha));
403
- }
404
- iColors.push(mappedColors[mappedColors.length - 1]);
405
- return iColors;
406
- });
407
- this.set({ closed: false, curveType: 'centripetal', tension: 0.5, segments: 64 });
408
- }
409
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsCatmullRomLine, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
410
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsCatmullRomLine, isStandalone: true, selector: "ngts-catmull-rom-line", inputs: { lineRef: "lineRef", points: "points", closed: "closed", curveType: "curveType", tension: "tension", segments: "segments" }, usesInheritance: true, ngImport: i0, template: `
411
- <ngts-line
412
- [lineRef]="lineRef"
413
- [points]="segmentedPoints()"
414
- [vertexColors]="interpolatedVertexColors()"
415
- [color]="lineParameters().color"
416
- [resolution]="lineParameters().resolution"
417
- [lineWidth]="lineParameters().linewidth"
418
- [alphaToCoverage]="lineParameters().alphaToCoverage"
419
- [dashed]="lineParameters().dashed"
420
- [dashScale]="lineParameters().dashScale"
421
- [dashSize]="lineParameters().dashSize"
422
- [dashOffset]="lineParameters().dashOffset"
423
- [gapSize]="lineParameters().gapSize"
424
- [wireframe]="lineParameters().wireframe"
425
- [worldUnits]="lineParameters().worldUnits"
426
- />
427
- `, isInline: true, dependencies: [{ kind: "component", type: NgtsLine, selector: "ngts-line", inputs: ["lineRef", "points", "segments"] }] }); }
428
- }
429
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsCatmullRomLine, decorators: [{
430
- type: Component,
431
- args: [{
432
- selector: 'ngts-catmull-rom-line',
433
- standalone: true,
434
- template: `
435
- <ngts-line
436
- [lineRef]="lineRef"
437
- [points]="segmentedPoints()"
438
- [vertexColors]="interpolatedVertexColors()"
439
- [color]="lineParameters().color"
440
- [resolution]="lineParameters().resolution"
441
- [lineWidth]="lineParameters().linewidth"
442
- [alphaToCoverage]="lineParameters().alphaToCoverage"
443
- [dashed]="lineParameters().dashed"
444
- [dashScale]="lineParameters().dashScale"
445
- [dashSize]="lineParameters().dashSize"
446
- [dashOffset]="lineParameters().dashOffset"
447
- [gapSize]="lineParameters().gapSize"
448
- [wireframe]="lineParameters().wireframe"
449
- [worldUnits]="lineParameters().worldUnits"
450
- />
451
- `,
452
- imports: [NgtsLine],
453
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
454
- }]
455
- }], ctorParameters: function () { return []; }, propDecorators: { lineRef: [{
456
- type: Input
457
- }], points: [{
458
- type: Input,
459
- args: [{ required: true }]
460
- }], closed: [{
461
- type: Input
462
- }], curveType: [{
463
- type: Input
464
- }], tension: [{
465
- type: Input
466
- }], segments: [{
467
- type: Input
468
- }] } });
469
-
470
- class NgtsCubicBezierLine extends NgtsLineInputs {
471
- set start(start) {
472
- this.set({ start });
473
- }
474
- set end(end) {
475
- this.set({ end });
476
- }
477
- set midA(midA) {
478
- this.set({ midA });
479
- }
480
- set midB(midB) {
481
- this.set({ midB });
482
- }
483
- set segments(segments) {
484
- this.set({ segments });
485
- }
486
- #start;
487
- #end;
488
- #midA;
489
- #midB;
490
- #segments;
491
- constructor() {
492
- super();
493
- this.lineRef = injectNgtRef();
494
- this.#start = this.select('start');
495
- this.#end = this.select('end');
496
- this.#midA = this.select('midA');
497
- this.#midB = this.select('midB');
498
- this.#segments = this.select('segments');
499
- this.points = computed(() => {
500
- const start = this.#start();
501
- const end = this.#end();
502
- const midA = this.#midA();
503
- const midB = this.#midB();
504
- const segments = this.#segments();
505
- const startV = start instanceof THREE.Vector3 ? start : new THREE.Vector3(...start);
506
- const endV = end instanceof THREE.Vector3 ? end : new THREE.Vector3(...end);
507
- const midAV = midA instanceof THREE.Vector3 ? midA : new THREE.Vector3(...midA);
508
- const midBV = midB instanceof THREE.Vector3 ? midB : new THREE.Vector3(...midB);
509
- return new THREE.CubicBezierCurve3(startV, midAV, midBV, endV).getPoints(segments);
510
- });
511
- this.set({ segments: 10 });
512
- }
513
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsCubicBezierLine, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
514
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsCubicBezierLine, isStandalone: true, selector: "ngts-cubic-bezier-line", inputs: { lineRef: "lineRef", start: "start", end: "end", midA: "midA", midB: "midB", segments: "segments" }, usesInheritance: true, ngImport: i0, template: `
515
- <ngts-line
516
- [lineRef]="lineRef"
517
- [points]="points()"
518
- [color]="lineParameters().color"
519
- [vertexColors]="lineParameters().vertexColors"
520
- [resolution]="lineParameters().resolution"
521
- [lineWidth]="lineParameters().linewidth"
522
- [alphaToCoverage]="lineParameters().alphaToCoverage"
523
- [dashed]="lineParameters().dashed"
524
- [dashScale]="lineParameters().dashScale"
525
- [dashSize]="lineParameters().dashSize"
526
- [dashOffset]="lineParameters().dashOffset"
527
- [gapSize]="lineParameters().gapSize"
528
- [wireframe]="lineParameters().wireframe"
529
- [worldUnits]="lineParameters().worldUnits"
530
- />
531
- `, isInline: true, dependencies: [{ kind: "component", type: NgtsLine, selector: "ngts-line", inputs: ["lineRef", "points", "segments"] }] }); }
532
- }
533
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsCubicBezierLine, decorators: [{
534
- type: Component,
535
- args: [{
536
- selector: 'ngts-cubic-bezier-line',
537
- standalone: true,
538
- template: `
539
- <ngts-line
540
- [lineRef]="lineRef"
541
- [points]="points()"
542
- [color]="lineParameters().color"
543
- [vertexColors]="lineParameters().vertexColors"
544
- [resolution]="lineParameters().resolution"
545
- [lineWidth]="lineParameters().linewidth"
546
- [alphaToCoverage]="lineParameters().alphaToCoverage"
547
- [dashed]="lineParameters().dashed"
548
- [dashScale]="lineParameters().dashScale"
549
- [dashSize]="lineParameters().dashSize"
550
- [dashOffset]="lineParameters().dashOffset"
551
- [gapSize]="lineParameters().gapSize"
552
- [wireframe]="lineParameters().wireframe"
553
- [worldUnits]="lineParameters().worldUnits"
554
- />
555
- `,
556
- imports: [NgtsLine],
557
- }]
558
- }], ctorParameters: function () { return []; }, propDecorators: { lineRef: [{
559
- type: Input
560
- }], start: [{
561
- type: Input,
562
- args: [{ required: true }]
563
- }], end: [{
564
- type: Input,
565
- args: [{ required: true }]
566
- }], midA: [{
136
+ args: [{ required: true, alias: 'distances' }]
137
+ }], _hysteresis: [{
567
138
  type: Input,
568
- args: [{ required: true }]
569
- }], midB: [{
570
- type: Input,
571
- args: [{ required: true }]
572
- }], segments: [{
573
- type: Input
139
+ args: [{ alias: 'hysteresis' }]
574
140
  }] } });
575
141
 
576
142
  extend({ LineSegments, LineBasicMaterial });
577
- class NgtsEdges extends NgtSignalStore {
578
- set threshold(threshold) {
579
- this.set({ threshold });
143
+ class NgtsEdges {
144
+ set _threshold(threshold) {
145
+ this.inputs.set({ threshold });
580
146
  }
581
- set color(color) {
582
- this.set({ color });
147
+ set _color(color) {
148
+ this.inputs.set({ color });
583
149
  }
584
- set geometry(geometry) {
585
- this.set({ geometry });
150
+ set _geometry(geometry) {
151
+ this.inputs.set({ geometry });
586
152
  }
587
- set userData(userData) {
588
- this.set({ userData });
153
+ set _userData(userData) {
154
+ this.inputs.set({ userData });
589
155
  }
590
156
  constructor() {
591
- super({
592
- threshold: 15,
593
- color: 'black',
594
- userData: {},
595
- });
157
+ this.nullRaycast = () => null;
158
+ this.inputs = signalStore({ threshold: 15, color: 'black' });
596
159
  this.edgesRef = injectNgtRef();
597
- this.withChildren = false;
598
- this.noop = () => null;
599
- this.#setupGeometry();
600
- }
601
- #setupGeometry() {
160
+ this.geometry = this.inputs.select('geometry');
161
+ this.threshold = this.inputs.select('threshold');
162
+ this.color = this.inputs.select('color');
602
163
  effect(() => {
603
164
  const edges = this.edgesRef.nativeElement;
604
165
  if (!edges)
605
166
  return;
606
- const parent = edges.parent;
167
+ const parent = this.edgesRef.nativeElement.parent;
607
168
  if (parent) {
608
- const geom = this.get('geometry') || parent.geometry;
609
- const threshold = this.get('threshold');
610
- if (geom !== edges.userData['currentGeom'] || threshold !== edges.userData['currentThreshold']) {
611
- edges.userData['currentGeom'] = geom;
169
+ const [geometry, threshold] = [this.geometry() || parent.geometry, this.threshold()];
170
+ if (geometry !== edges.userData['currentGeom'] || threshold !== edges.userData['currentThreshold']) {
171
+ edges.userData['currentGeom'] = geometry;
612
172
  edges.userData['currentThreshold'] = threshold;
613
- edges.geometry = new THREE.EdgesGeometry(geom, threshold);
173
+ edges.geometry = new THREE.EdgesGeometry(geometry, threshold);
614
174
  }
615
175
  }
616
176
  });
617
177
  }
618
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsEdges, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
619
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsEdges, isStandalone: true, selector: "ngts-edges", inputs: { edgesRef: "edgesRef", threshold: "threshold", color: "color", geometry: "geometry", userData: "userData", withChildren: "withChildren" }, usesInheritance: true, ngImport: i0, template: `
620
- <ngt-line-segments [ref]="edgesRef" [raycast]="noop" ngtCompound>
621
- <ng-container *ngIf="withChildren; else noChildren">
622
- <ng-content />
623
- </ng-container>
624
- <ng-template #noChildren>
625
- <ngt-line-basic-material [color]="color" />
626
- </ng-template>
627
- </ngt-line-segments>
628
- `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
178
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsEdges, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
179
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.3", type: NgtsEdges, isStandalone: true, selector: "ngts-edges", inputs: { edgesRef: "edgesRef", _threshold: ["threshold", "_threshold"], _color: ["color", "_color"], _geometry: ["geometry", "_geometry"], _userData: ["userData", "_userData"] }, queries: [{ propertyName: "content", first: true, predicate: NgtsSobaContent, descendants: true, read: TemplateRef }], ngImport: i0, template: `
180
+ <ngt-line-segments [ref]="edgesRef" [raycast]="nullRaycast" ngtCompound>
181
+ <ng-container *ngIf="content; else defaultMaterial" [ngTemplateOutlet]="content" />
182
+ <ng-template #defaultMaterial>
183
+ <ngt-line-basic-material [color]="color()" />
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"] }] }); }
629
187
  }
630
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsEdges, decorators: [{
188
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsEdges, decorators: [{
631
189
  type: Component,
632
190
  args: [{
633
191
  selector: 'ngts-edges',
634
192
  standalone: true,
635
193
  template: `
636
- <ngt-line-segments [ref]="edgesRef" [raycast]="noop" ngtCompound>
637
- <ng-container *ngIf="withChildren; else noChildren">
638
- <ng-content />
639
- </ng-container>
640
- <ng-template #noChildren>
641
- <ngt-line-basic-material [color]="color" />
642
- </ng-template>
643
- </ngt-line-segments>
644
- `,
645
- imports: [NgIf],
646
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
647
- }]
648
- }], ctorParameters: function () { return []; }, propDecorators: { edgesRef: [{
649
- type: Input
650
- }], threshold: [{
651
- type: Input
652
- }], color: [{
653
- type: Input
654
- }], geometry: [{
655
- type: Input
656
- }], userData: [{
657
- type: Input
658
- }], withChildren: [{
659
- type: Input
660
- }] } });
661
-
662
- const isOrbitControls = (controls) => 'minPolarAngle' in controls;
663
- const NGTS_GIZMO_HELPER_API = new InjectionToken('NgtsGizmoHelper API');
664
- extend({ Group });
665
- class NgtsGizmoHelperContent {
666
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoHelperContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
667
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: NgtsGizmoHelperContent, isStandalone: true, selector: "ng-template[ngtsGizmoHelperContent]", ngImport: i0 }); }
668
- }
669
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoHelperContent, decorators: [{
670
- type: Directive,
671
- args: [{ selector: 'ng-template[ngtsGizmoHelperContent]', standalone: true }]
672
- }] });
673
- class NgtsGizmoHelper extends NgtSignalStore {
674
- set alignment(alignment) {
675
- this.set({ alignment });
676
- }
677
- set margin(margin) {
678
- this.set({ margin });
679
- }
680
- set renderPriority(renderPriority) {
681
- this.set({ renderPriority });
682
- }
683
- set autoClear(autoClear) {
684
- this.set({ autoClear });
685
- }
686
- #store;
687
- #camera;
688
- #size;
689
- #alignment;
690
- #margin;
691
- #animating;
692
- #radius;
693
- #focusPoint;
694
- #q1;
695
- #q2;
696
- #target;
697
- #targetPosition;
698
- #dummy;
699
- #defaultUp;
700
- #turnRate; // turn rate in angles per sec
701
- #matrix;
702
- constructor() {
703
- super({ alignment: 'bottom-right', margin: [80, 80], renderPriority: 1 });
704
- this.gizmoRef = injectNgtRef();
705
- this.virtualCameraRef = injectNgtRef();
706
- this.updated = new EventEmitter();
707
- this.#store = inject(NgtStore);
708
- this.#camera = this.#store.select('camera');
709
- this.#size = this.#store.select('size');
710
- this.#alignment = this.select('alignment');
711
- this.#margin = this.select('margin');
712
- this.#animating = false;
713
- this.#radius = 0;
714
- this.#focusPoint = new Vector3(0, 0, 0);
715
- this.#q1 = new Quaternion();
716
- this.#q2 = new Quaternion();
717
- this.#target = new Vector3();
718
- this.#targetPosition = new Vector3();
719
- this.#dummy = new Object3D();
720
- this.#defaultUp = new Vector3(0, 0, 0);
721
- this.#turnRate = 2 * Math.PI; // turn rate in angles per sec
722
- this.#matrix = new Matrix4();
723
- this.priority = this.select('renderPriority');
724
- this.position = computed(() => {
725
- const size = this.#size();
726
- const alignment = this.#alignment();
727
- const margin = this.#margin();
728
- const [marginX, marginY] = margin;
729
- const x = alignment.endsWith('-center')
730
- ? 0
731
- : alignment.endsWith('-left')
732
- ? -size.width / 2 + marginX
733
- : size.width / 2 - marginX;
734
- const y = alignment.startsWith('center-')
735
- ? 0
736
- : alignment.startsWith('top-')
737
- ? size.height / 2 - marginY
738
- : -size.height / 2 + marginY;
739
- return [x, y, 0];
740
- });
741
- this.api = computed(() => (direction) => {
742
- const { controls, camera, invalidate } = this.#store.get();
743
- const defaultControls = controls;
744
- this.#animating = true;
745
- if (defaultControls)
746
- this.#focusPoint = defaultControls.target;
747
- this.#radius = camera.position.distanceTo(this.#target);
748
- // rotate from current camera orientation
749
- this.#q1.copy(camera.quaternion);
750
- // to new current camera orientation
751
- this.#targetPosition.copy(direction).multiplyScalar(this.#radius).add(this.#target);
752
- this.#dummy.lookAt(this.#targetPosition);
753
- this.#q2.copy(this.#dummy.quaternion);
754
- invalidate();
755
- });
756
- this.#updateDefaultUp();
757
- }
758
- onBeforeRender(delta) {
759
- if (this.virtualCameraRef.nativeElement && this.gizmoRef.nativeElement) {
760
- const { controls, camera: mainCamera, invalidate } = this.#store.get();
761
- const defaultControls = controls;
762
- // Animate step
763
- if (this.#animating) {
764
- if (this.#q1.angleTo(this.#q2) < 0.01) {
765
- this.#animating = false;
766
- // Orbit controls uses UP vector as the orbit axes,
767
- // so we need to reset it after the animation is done
768
- // moving it around for the controls to work correctly
769
- if (isOrbitControls(defaultControls)) {
770
- mainCamera.up.copy(this.#defaultUp);
771
- }
772
- }
773
- else {
774
- const step = delta * this.#turnRate;
775
- // animate position by doing a slerp and then scaling the position on the unit sphere
776
- this.#q1.rotateTowards(this.#q2, step);
777
- // animate orientation
778
- mainCamera.position
779
- .set(0, 0, 1)
780
- .applyQuaternion(this.#q1)
781
- .multiplyScalar(this.#radius)
782
- .add(this.#focusPoint);
783
- mainCamera.up.set(0, 1, 0).applyQuaternion(this.#q1).normalize();
784
- mainCamera.quaternion.copy(this.#q1);
785
- if (this.updated.observed)
786
- this.updated.emit();
787
- else if (defaultControls) {
788
- defaultControls.update();
789
- }
790
- invalidate();
791
- }
792
- }
793
- // Sync Gizmo with main camera orientation
794
- this.#matrix.copy(mainCamera.matrix).invert();
795
- this.gizmoRef.nativeElement.quaternion.setFromRotationMatrix(this.#matrix);
796
- }
797
- }
798
- #updateDefaultUp() {
799
- effect(() => {
800
- const camera = this.#camera();
801
- if (!camera)
802
- return;
803
- this.#defaultUp.copy(camera.up);
804
- });
805
- }
806
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoHelper, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
807
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsGizmoHelper, isStandalone: true, selector: "ngts-gizmo-helper", inputs: { alignment: "alignment", margin: "margin", renderPriority: "renderPriority", autoClear: "autoClear" }, outputs: { updated: "updated" }, providers: [
808
- { provide: NGTS_GIZMO_HELPER_API, useFactory: (gizmo) => gizmo.api, deps: [NgtsGizmoHelper] },
809
- ], queries: [{ propertyName: "gizmoHelperContent", first: true, predicate: NgtsGizmoHelperContent, descendants: true, read: TemplateRef, static: true }], usesInheritance: true, ngImport: i0, template: `
810
- <ngt-portal [renderPriority]="priority()">
811
- <ng-template ngtPortalContent>
812
- <ngts-orthographic-camera
813
- [cameraRef]="virtualCameraRef"
814
- [makeDefault]="true"
815
- [position]="[0, 0, 200]"
816
- />
817
- <ngt-group [ref]="gizmoRef" [position]="position()" (beforeRender)="onBeforeRender($event.state.delta)">
818
- <ng-container *ngTemplateOutlet="gizmoHelperContent" />
819
- </ngt-group>
820
- </ng-template>
821
- </ngt-portal>
822
- `, isInline: true, dependencies: [{ kind: "component", type: NgtPortal, selector: "ngt-portal", inputs: ["container", "portalState", "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"] }] }); }
823
- }
824
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoHelper, decorators: [{
825
- type: Component,
826
- args: [{
827
- selector: 'ngts-gizmo-helper',
828
- standalone: true,
829
- template: `
830
- <ngt-portal [renderPriority]="priority()">
831
- <ng-template ngtPortalContent>
832
- <ngts-orthographic-camera
833
- [cameraRef]="virtualCameraRef"
834
- [makeDefault]="true"
835
- [position]="[0, 0, 200]"
836
- />
837
- <ngt-group [ref]="gizmoRef" [position]="position()" (beforeRender)="onBeforeRender($event.state.delta)">
838
- <ng-container *ngTemplateOutlet="gizmoHelperContent" />
839
- </ngt-group>
840
- </ng-template>
841
- </ngt-portal>
842
- `,
843
- imports: [NgtPortal, NgtPortalContent, NgtsOrthographicCamera, NgTemplateOutlet],
844
- providers: [
845
- { provide: NGTS_GIZMO_HELPER_API, useFactory: (gizmo) => gizmo.api, deps: [NgtsGizmoHelper] },
846
- ],
194
+ <ngt-line-segments [ref]="edgesRef" [raycast]="nullRaycast" ngtCompound>
195
+ <ng-container *ngIf="content; else defaultMaterial" [ngTemplateOutlet]="content" />
196
+ <ng-template #defaultMaterial>
197
+ <ngt-line-basic-material [color]="color()" />
198
+ </ng-template>
199
+ </ngt-line-segments>
200
+ `,
201
+ imports: [NgIf, NgTemplateOutlet],
847
202
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
848
203
  }]
849
- }], ctorParameters: function () { return []; }, propDecorators: { alignment: [{
850
- type: Input
851
- }], margin: [{
852
- type: Input
853
- }], renderPriority: [{
854
- type: Input
855
- }], autoClear: [{
856
- type: Input
857
- }], updated: [{
858
- type: Output
859
- }], gizmoHelperContent: [{
204
+ }], ctorParameters: function () { return []; }, propDecorators: { content: [{
860
205
  type: ContentChild,
861
- args: [NgtsGizmoHelperContent, { static: true, read: TemplateRef }]
862
- }] } });
863
-
864
- const colors = { bg: '#f0f0f0', hover: '#999', text: 'black', stroke: 'black' };
865
- const defaultFaces = ['Right', 'Left', 'Top', 'Bottom', 'Front', 'Back'];
866
- const makePositionVector = (xyz) => new THREE.Vector3(...xyz).multiplyScalar(0.38);
867
- const corners = [
868
- [1, 1, 1],
869
- [1, 1, -1],
870
- [1, -1, 1],
871
- [1, -1, -1],
872
- [-1, 1, 1],
873
- [-1, 1, -1],
874
- [-1, -1, 1],
875
- [-1, -1, -1],
876
- ].map(makePositionVector);
877
- const cornerDimensions = [0.25, 0.25, 0.25];
878
- const edges = [
879
- [1, 1, 0],
880
- [1, 0, 1],
881
- [1, 0, -1],
882
- [1, -1, 0],
883
- [0, 1, 1],
884
- [0, 1, -1],
885
- [0, -1, 1],
886
- [0, -1, -1],
887
- [-1, 1, 0],
888
- [-1, 0, 1],
889
- [-1, 0, -1],
890
- [-1, -1, 0],
891
- ].map(makePositionVector);
892
- const edgeDimensions = edges.map((edge) => edge.toArray().map((axis) => (axis == 0 ? 0.5 : 0.25)));
893
-
894
- class NgtsGizmoViewcubeInputs extends NgtSignalStore {
895
- constructor() {
896
- super(...arguments);
897
- this.viewcubeHoverColor = this.select('hoverColor');
898
- this.viewcubeOpacity = this.select('opacity');
899
- this.viewcubeTextColor = this.select('textColor');
900
- this.viewcubeStrokeColor = this.select('strokeColor');
901
- this.viewcubeFaces = this.select('faces');
902
- this.viewcubeFont = this.select('font');
903
- this.viewcubeColor = this.select('color');
904
- }
905
- set opacity(opacity) {
906
- this.set({ opacity });
907
- }
908
- set hoverColor(hoverColor) {
909
- this.set({ hoverColor });
910
- }
911
- set textColor(textColor) {
912
- this.set({ textColor });
913
- }
914
- set strokeColor(strokeColor) {
915
- this.set({ strokeColor });
916
- }
917
- set faces(faces) {
918
- this.set({ faces });
919
- }
920
- set font(font) {
921
- this.set({ font });
922
- }
923
- set color(color) {
924
- this.set({ color });
925
- }
926
- set clickEmitter(clickEmitter) {
927
- this.set({ clickEmitter });
928
- }
929
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoViewcubeInputs, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
930
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: NgtsGizmoViewcubeInputs, inputs: { opacity: "opacity", hoverColor: "hoverColor", textColor: "textColor", strokeColor: "strokeColor", faces: "faces", font: "font", color: "color", clickEmitter: "clickEmitter" }, usesInheritance: true, ngImport: i0 }); }
931
- }
932
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoViewcubeInputs, decorators: [{
933
- type: Directive
934
- }], propDecorators: { opacity: [{
935
- type: Input
936
- }], hoverColor: [{
937
- type: Input
938
- }], textColor: [{
939
- type: Input
940
- }], strokeColor: [{
941
- type: Input
942
- }], faces: [{
206
+ args: [NgtsSobaContent, { read: TemplateRef }]
207
+ }], edgesRef: [{
943
208
  type: Input
944
- }], font: [{
945
- type: Input
946
- }], color: [{
947
- type: Input
948
- }], clickEmitter: [{
949
- type: Input
950
- }] } });
951
-
952
- extend({ Mesh, BoxGeometry, MeshBasicMaterial });
953
- class NgtsGizmoViewcubeEdgeCube extends NgtSignalStore {
954
- #gizmoHelperApi;
955
- set dimensions(dimensions) {
956
- this.set({ dimensions });
957
- }
958
- set position(position) {
959
- this.set({ position });
960
- }
961
- constructor() {
962
- super();
963
- this.#gizmoHelperApi = inject(NGTS_GIZMO_HELPER_API);
964
- this.viewcubeInputs = inject(NgtsGizmoViewcubeInputs);
965
- this.hover = signal(false);
966
- this.edgePosition = this.select('position');
967
- this.edgeDimensions = this.select('dimensions');
968
- this.viewcubeInputs.patch({ hoverColor: colors.hover });
969
- }
970
- onPointerMove(event) {
971
- event.stopPropagation();
972
- this.hover.set(true);
973
- }
974
- onPointerOut(event) {
975
- event.stopPropagation();
976
- this.hover.set(false);
977
- }
978
- onClick(event) {
979
- if (this.viewcubeInputs.get('clickEmitter')?.observed) {
980
- this.viewcubeInputs.get('clickEmitter').emit(event);
981
- }
982
- else {
983
- event.stopPropagation();
984
- this.#gizmoHelperApi()(this.get('position'));
985
- }
986
- }
987
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoViewcubeEdgeCube, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
988
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsGizmoViewcubeEdgeCube, isStandalone: true, selector: "ngts-gizmo-viewcube-edge-cube", inputs: { dimensions: "dimensions", position: "position" }, usesInheritance: true, ngImport: i0, template: `
989
- <ngt-mesh
990
- [scale]="1.01"
991
- [position]="edgePosition()"
992
- (pointermove)="onPointerMove($event)"
993
- (pointerout)="onPointerOut($event)"
994
- (click)="onClick($event)"
995
- >
996
- <ngt-box-geometry *args="edgeDimensions()" />
997
- <ngt-mesh-basic-material
998
- [color]="hover() ? viewcubeInputs.viewcubeHoverColor() : 'white'"
999
- [transparent]="true"
1000
- [opacity]="0.6"
1001
- [visible]="hover()"
1002
- />
1003
- </ngt-mesh>
1004
- `, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "[args]", inputs: ["args"] }] }); }
1005
- }
1006
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoViewcubeEdgeCube, decorators: [{
1007
- type: Component,
1008
- args: [{
1009
- selector: 'ngts-gizmo-viewcube-edge-cube',
1010
- standalone: true,
1011
- template: `
1012
- <ngt-mesh
1013
- [scale]="1.01"
1014
- [position]="edgePosition()"
1015
- (pointermove)="onPointerMove($event)"
1016
- (pointerout)="onPointerOut($event)"
1017
- (click)="onClick($event)"
1018
- >
1019
- <ngt-box-geometry *args="edgeDimensions()" />
1020
- <ngt-mesh-basic-material
1021
- [color]="hover() ? viewcubeInputs.viewcubeHoverColor() : 'white'"
1022
- [transparent]="true"
1023
- [opacity]="0.6"
1024
- [visible]="hover()"
1025
- />
1026
- </ngt-mesh>
1027
- `,
1028
- imports: [NgtArgs],
1029
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
1030
- }]
1031
- }], ctorParameters: function () { return []; }, propDecorators: { dimensions: [{
209
+ }], _threshold: [{
1032
210
  type: Input,
1033
- args: [{ required: true }]
1034
- }], position: [{
211
+ args: [{ alias: 'threshold' }]
212
+ }], _color: [{
1035
213
  type: Input,
1036
- args: [{ required: true }]
1037
- }] } });
1038
-
1039
- extend({ MeshLambertMaterial, Mesh, BoxGeometry });
1040
- class NgtsGizmoViewcubeFaceMaterial extends NgtSignalStore {
1041
- #document;
1042
- #store;
1043
- set index(index) {
1044
- this.set({ index });
1045
- }
1046
- set hover(hover) {
1047
- this.set({ hover });
1048
- }
1049
- constructor() {
1050
- super();
1051
- this.#document = inject(DOCUMENT);
1052
- this.#store = inject(NgtStore);
1053
- this.gl = this.#store.select('gl');
1054
- this.viewcubeInputs = inject(NgtsGizmoViewcubeInputs);
1055
- this.faceIndex = this.select('index');
1056
- this.faceHover = this.select('hover');
1057
- this.texture = computed(() => {
1058
- const index = this.faceIndex();
1059
- const color = this.viewcubeInputs.viewcubeColor();
1060
- const font = this.viewcubeInputs.viewcubeFont();
1061
- const faces = this.viewcubeInputs.viewcubeFaces();
1062
- const textColor = this.viewcubeInputs.viewcubeTextColor();
1063
- const strokeColor = this.viewcubeInputs.viewcubeStrokeColor();
1064
- const canvas = this.#document.createElement('canvas');
1065
- canvas.width = 128;
1066
- canvas.height = 128;
1067
- const context = canvas.getContext('2d');
1068
- context.fillStyle = color;
1069
- context.fillRect(0, 0, canvas.width, canvas.height);
1070
- context.strokeStyle = strokeColor;
1071
- context.strokeRect(0, 0, canvas.width, canvas.height);
1072
- context.font = font;
1073
- context.textAlign = 'center';
1074
- context.fillStyle = textColor;
1075
- context.fillText(faces[index].toUpperCase(), 64, 76);
1076
- return new CanvasTexture(canvas);
1077
- });
1078
- this.viewcubeInputs.patch({
1079
- color: colors.bg,
1080
- font: '20px Inter var, Arial, sans-serif',
1081
- faces: defaultFaces,
1082
- hoverColor: colors.hover,
1083
- textColor: colors.text,
1084
- strokeColor: colors.stroke,
1085
- opacity: 1,
1086
- });
1087
- }
1088
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoViewcubeFaceMaterial, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1089
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsGizmoViewcubeFaceMaterial, isStandalone: true, selector: "ngts-gizmo-viewcube-face-material", inputs: { index: "index", hover: "hover" }, usesInheritance: true, ngImport: i0, template: `
1090
- <ngt-mesh-lambert-material
1091
- [attach]="['material', faceIndex()]"
1092
- [map]="texture()"
1093
- [color]="faceHover() ? viewcubeInputs.viewcubeHoverColor() : viewcubeInputs.viewcubeColor()"
1094
- [opacity]="viewcubeInputs.viewcubeOpacity()"
1095
- [transparent]="true"
1096
- >
1097
- <ngt-value [rawValue]="gl().outputEncoding" attach="map.encoding" />
1098
- <ngt-value [rawValue]="gl().capabilities.getMaxAnisotropy() || 1" attach="map.anisotrophy" />
1099
- </ngt-mesh-lambert-material>
1100
- `, isInline: true }); }
1101
- }
1102
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoViewcubeFaceMaterial, decorators: [{
1103
- type: Component,
1104
- args: [{
1105
- selector: 'ngts-gizmo-viewcube-face-material',
1106
- standalone: true,
1107
- template: `
1108
- <ngt-mesh-lambert-material
1109
- [attach]="['material', faceIndex()]"
1110
- [map]="texture()"
1111
- [color]="faceHover() ? viewcubeInputs.viewcubeHoverColor() : viewcubeInputs.viewcubeColor()"
1112
- [opacity]="viewcubeInputs.viewcubeOpacity()"
1113
- [transparent]="true"
1114
- >
1115
- <ngt-value [rawValue]="gl().outputEncoding" attach="map.encoding" />
1116
- <ngt-value [rawValue]="gl().capabilities.getMaxAnisotropy() || 1" attach="map.anisotrophy" />
1117
- </ngt-mesh-lambert-material>
1118
- `,
1119
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
1120
- }]
1121
- }], ctorParameters: function () { return []; }, propDecorators: { index: [{
1122
- type: Input,
1123
- args: [{ required: true }]
1124
- }], hover: [{
1125
- type: Input,
1126
- args: [{ required: true }]
1127
- }] } });
1128
- class NgtsGizmoViewcubeFaceCube {
1129
- constructor() {
1130
- this.#gizmoHelperApi = inject(NGTS_GIZMO_HELPER_API);
1131
- this.viewcubeInputs = inject(NgtsGizmoViewcubeInputs);
1132
- this.hover = signal(-1);
1133
- }
1134
- #gizmoHelperApi;
1135
- onPointerMove(event) {
1136
- event.stopPropagation();
1137
- this.hover.set(Math.floor(event.faceIndex / 2));
1138
- }
1139
- onPointerOut(event) {
1140
- event.stopPropagation();
1141
- this.hover.set(-1);
1142
- }
1143
- onClick(event) {
1144
- if (this.viewcubeInputs.get('clickEmitter')?.observed) {
1145
- this.viewcubeInputs.get('clickEmitter').emit(event);
1146
- }
1147
- else {
1148
- event.stopPropagation();
1149
- this.#gizmoHelperApi()(event.face.normal);
1150
- }
1151
- }
1152
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoViewcubeFaceCube, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1153
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsGizmoViewcubeFaceCube, isStandalone: true, selector: "ngts-gizmo-viewcube-face-cube", ngImport: i0, template: `
1154
- <ngt-mesh
1155
- (pointermove)="onPointerMove($any($event))"
1156
- (pointerout)="onPointerOut($any($event))"
1157
- (click)="onClick($any($event))"
1158
- >
1159
- <ngt-box-geometry />
1160
- <ngts-gizmo-viewcube-face-material *ngFor="let i; repeat: 6" [hover]="hover() === i" [index]="i" />
1161
- </ngt-mesh>
1162
- `, isInline: true, dependencies: [{ kind: "component", type: NgtsGizmoViewcubeFaceMaterial, selector: "ngts-gizmo-viewcube-face-material", inputs: ["index", "hover"] }, { kind: "directive", type: NgtRepeat, selector: "[ngFor][ngForRepeat]", inputs: ["ngForRepeat"] }] }); }
1163
- }
1164
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoViewcubeFaceCube, decorators: [{
1165
- type: Component,
1166
- args: [{
1167
- selector: 'ngts-gizmo-viewcube-face-cube',
1168
- standalone: true,
1169
- template: `
1170
- <ngt-mesh
1171
- (pointermove)="onPointerMove($any($event))"
1172
- (pointerout)="onPointerOut($any($event))"
1173
- (click)="onClick($any($event))"
1174
- >
1175
- <ngt-box-geometry />
1176
- <ngts-gizmo-viewcube-face-material *ngFor="let i; repeat: 6" [hover]="hover() === i" [index]="i" />
1177
- </ngt-mesh>
1178
- `,
1179
- imports: [NgtsGizmoViewcubeFaceMaterial, NgtRepeat],
1180
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
1181
- }]
1182
- }] });
1183
-
1184
- extend({ Group, AmbientLight, PointLight });
1185
- class NgtsGizmoViewcube extends NgtsGizmoViewcubeInputs {
1186
- constructor() {
1187
- super();
1188
- this.edges = edges;
1189
- this.edgeDimensions = edgeDimensions;
1190
- this.corners = corners;
1191
- this.cornerDimensions = cornerDimensions;
1192
- this.clicked = new EventEmitter();
1193
- requestAnimationInInjectionContext(() => {
1194
- if (this.clicked.observed) {
1195
- this.set({ clickEmitter: this.clicked });
1196
- }
1197
- });
1198
- }
1199
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoViewcube, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1200
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsGizmoViewcube, isStandalone: true, selector: "ngts-gizmo-viewcube", outputs: { clicked: "clicked" }, providers: [{ provide: NgtsGizmoViewcubeInputs, useExisting: NgtsGizmoViewcube }], usesInheritance: true, ngImport: i0, template: `
1201
- <ngt-group [scale]="60">
1202
- <ngts-gizmo-viewcube-face-cube />
1203
-
1204
- <ngts-gizmo-viewcube-edge-cube
1205
- *ngFor="let edge of edges; let i = index"
1206
- [position]="edge"
1207
- [dimensions]="edgeDimensions[i]"
1208
- />
1209
-
1210
- <ngts-gizmo-viewcube-edge-cube
1211
- *ngFor="let corner of corners"
1212
- [position]="corner"
1213
- [dimensions]="cornerDimensions"
1214
- />
1215
-
1216
- <ngt-ambient-light [intensity]="0.5" />
1217
- <ngt-point-light [position]="10" [intensity]="0.5" />
1218
- </ngt-group>
1219
- `, 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"] }] }); }
1220
- }
1221
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoViewcube, decorators: [{
1222
- type: Component,
1223
- args: [{
1224
- selector: 'ngts-gizmo-viewcube',
1225
- standalone: true,
1226
- template: `
1227
- <ngt-group [scale]="60">
1228
- <ngts-gizmo-viewcube-face-cube />
1229
-
1230
- <ngts-gizmo-viewcube-edge-cube
1231
- *ngFor="let edge of edges; let i = index"
1232
- [position]="edge"
1233
- [dimensions]="edgeDimensions[i]"
1234
- />
1235
-
1236
- <ngts-gizmo-viewcube-edge-cube
1237
- *ngFor="let corner of corners"
1238
- [position]="corner"
1239
- [dimensions]="cornerDimensions"
1240
- />
1241
-
1242
- <ngt-ambient-light [intensity]="0.5" />
1243
- <ngt-point-light [position]="10" [intensity]="0.5" />
1244
- </ngt-group>
1245
- `,
1246
- imports: [NgtsGizmoViewcubeEdgeCube, NgtsGizmoViewcubeFaceCube, NgFor],
1247
- providers: [{ provide: NgtsGizmoViewcubeInputs, useExisting: NgtsGizmoViewcube }],
1248
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
1249
- }]
1250
- }], ctorParameters: function () { return []; }, propDecorators: { clicked: [{
1251
- type: Output
1252
- }] } });
1253
-
1254
- extend({ Group, Mesh, BoxGeometry, MeshBasicMaterial, Sprite, SpriteMaterial });
1255
- class NgtsGizmoViewportAxis extends NgtSignalStore {
1256
- set color(color) {
1257
- this.set({ color });
1258
- }
1259
- set rotation(rotation) {
1260
- this.set({ rotation });
1261
- }
1262
- set scale(scale) {
1263
- this.set({ scale });
1264
- }
1265
- constructor() {
1266
- super({ scale: [0.8, 0.05, 0.05] });
1267
- this.axisRotation = this.select('rotation');
1268
- this.axisColor = this.select('color');
1269
- this.axisScale = this.select('scale');
1270
- }
1271
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoViewportAxis, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1272
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsGizmoViewportAxis, isStandalone: true, selector: "ngts-gizmo-viewport-axis", inputs: { color: "color", rotation: "rotation", scale: "scale" }, usesInheritance: true, ngImport: i0, template: `
1273
- <ngt-group [rotation]="axisRotation()">
1274
- <ngt-mesh [position]="[0.4, 0, 0]">
1275
- <ngt-box-geometry *args="axisScale()" />
1276
- <ngt-mesh-basic-material [color]="axisColor()" [toneMapped]="false" />
1277
- </ngt-mesh>
1278
- </ngt-group>
1279
- `, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "[args]", inputs: ["args"] }] }); }
1280
- }
1281
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoViewportAxis, decorators: [{
1282
- type: Component,
1283
- args: [{
1284
- selector: 'ngts-gizmo-viewport-axis',
1285
- standalone: true,
1286
- template: `
1287
- <ngt-group [rotation]="axisRotation()">
1288
- <ngt-mesh [position]="[0.4, 0, 0]">
1289
- <ngt-box-geometry *args="axisScale()" />
1290
- <ngt-mesh-basic-material [color]="axisColor()" [toneMapped]="false" />
1291
- </ngt-mesh>
1292
- </ngt-group>
1293
- `,
1294
- imports: [NgtArgs],
1295
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
1296
- }]
1297
- }], ctorParameters: function () { return []; }, propDecorators: { color: [{
214
+ args: [{ alias: 'color' }]
215
+ }], _geometry: [{
1298
216
  type: Input,
1299
- args: [{ required: true }]
1300
- }], rotation: [{
217
+ args: [{ alias: 'geometry' }]
218
+ }], _userData: [{
1301
219
  type: Input,
1302
- args: [{ required: true }]
1303
- }], scale: [{
1304
- type: Input
1305
- }] } });
1306
- class NgtsGizmoViewportAxisHead extends NgtSignalStore {
1307
- #document;
1308
- #store;
1309
- set arcStyle(arcStyle) {
1310
- this.set({ arcStyle });
1311
- }
1312
- set label(label) {
1313
- this.set({ label });
1314
- }
1315
- set labelColor(labelColor) {
1316
- this.set({ labelColor });
1317
- }
1318
- set axisHeadScale(axisHeadScale) {
1319
- this.set({ axisHeadScale });
1320
- }
1321
- set disabled(disabled) {
1322
- this.set({ disabled });
1323
- }
1324
- set font(font) {
1325
- this.set({ font });
1326
- }
1327
- set clickEmitter(clickEmitter) {
1328
- this.set({ clickEmitter });
1329
- }
1330
- #arcStyle;
1331
- #labelColor;
1332
- #font;
1333
- #axisHeadScale;
1334
- constructor() {
1335
- super({ axisHeadScale: 1 });
1336
- this.#document = inject(DOCUMENT);
1337
- this.#store = inject(NgtStore);
1338
- this.gl = this.#store.select('gl');
1339
- this.active = signal(false);
1340
- this.#arcStyle = this.select('arcStyle');
1341
- this.#labelColor = this.select('labelColor');
1342
- this.#font = this.select('font');
1343
- this.#axisHeadScale = this.select('axisHeadScale');
1344
- this.axisLabel = this.select('label');
1345
- this.texture = computed(() => {
1346
- const arcStyle = this.#arcStyle();
1347
- const labelColor = this.#labelColor();
1348
- const font = this.#font();
1349
- const label = this.axisLabel();
1350
- const canvas = this.#document.createElement('canvas');
1351
- canvas.width = 64;
1352
- canvas.height = 64;
1353
- const context = canvas.getContext('2d');
1354
- context.beginPath();
1355
- context.arc(32, 32, 16, 0, 2 * Math.PI);
1356
- context.closePath();
1357
- context.fillStyle = arcStyle;
1358
- context.fill();
1359
- if (label) {
1360
- context.font = font;
1361
- context.textAlign = 'center';
1362
- context.fillStyle = labelColor;
1363
- context.fillText(label, 32, 41);
1364
- }
1365
- return new CanvasTexture(canvas);
1366
- });
1367
- this.scale = computed(() => {
1368
- const active = this.active();
1369
- const axisHeadScale = this.#axisHeadScale();
1370
- const label = this.axisLabel();
1371
- return (label ? 1 : 0.75) * (active ? 1.2 : 1) * axisHeadScale;
1372
- });
1373
- }
1374
- onPointerOver(event) {
1375
- if (!this.get('disabled')) {
1376
- event.stopPropagation();
1377
- this.active.set(true);
1378
- }
1379
- }
1380
- onPointerOut(event) {
1381
- if (!this.get('disabled')) {
1382
- if (this.get('clickEmitter')?.observed) {
1383
- this.get('clickEmitter').emit(event);
1384
- }
1385
- else {
1386
- event.stopPropagation();
1387
- this.active.set(false);
1388
- }
1389
- }
1390
- }
1391
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoViewportAxisHead, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1392
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsGizmoViewportAxisHead, isStandalone: true, selector: "ngts-gizmo-viewport-axis-head", inputs: { arcStyle: "arcStyle", label: "label", labelColor: "labelColor", axisHeadScale: "axisHeadScale", disabled: "disabled", font: "font", clickEmitter: "clickEmitter" }, usesInheritance: true, ngImport: i0, template: `
1393
- <ngt-sprite
1394
- ngtCompound
1395
- [scale]="scale()"
1396
- (pointerover)="onPointerOver($event)"
1397
- (pointerout)="onPointerOut($event)"
1398
- >
1399
- <ngt-sprite-material
1400
- [map]="texture()"
1401
- [opacity]="axisLabel() ? 1 : 0.75"
1402
- [alphaTest]="0.3"
1403
- [toneMapped]="false"
1404
- >
1405
- <ngt-value [rawValue]="gl().outputEncoding" attach="map.encoding" />
1406
- <ngt-value [rawValue]="gl().capabilities.getMaxAnisotropy() || 1" attach="map.anisotropy" />
1407
- </ngt-sprite-material>
1408
- </ngt-sprite>
1409
- `, isInline: true }); }
1410
- }
1411
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoViewportAxisHead, decorators: [{
1412
- type: Component,
1413
- args: [{
1414
- selector: 'ngts-gizmo-viewport-axis-head',
1415
- standalone: true,
1416
- template: `
1417
- <ngt-sprite
1418
- ngtCompound
1419
- [scale]="scale()"
1420
- (pointerover)="onPointerOver($event)"
1421
- (pointerout)="onPointerOut($event)"
1422
- >
1423
- <ngt-sprite-material
1424
- [map]="texture()"
1425
- [opacity]="axisLabel() ? 1 : 0.75"
1426
- [alphaTest]="0.3"
1427
- [toneMapped]="false"
1428
- >
1429
- <ngt-value [rawValue]="gl().outputEncoding" attach="map.encoding" />
1430
- <ngt-value [rawValue]="gl().capabilities.getMaxAnisotropy() || 1" attach="map.anisotropy" />
1431
- </ngt-sprite-material>
1432
- </ngt-sprite>
1433
- `,
1434
- imports: [NgtArgs],
1435
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
1436
- }]
1437
- }], ctorParameters: function () { return []; }, propDecorators: { arcStyle: [{
1438
- type: Input
1439
- }], label: [{
1440
- type: Input
1441
- }], labelColor: [{
1442
- type: Input
1443
- }], axisHeadScale: [{
1444
- type: Input
1445
- }], disabled: [{
1446
- type: Input
1447
- }], font: [{
1448
- type: Input
1449
- }], clickEmitter: [{
1450
- type: Input
220
+ args: [{ alias: 'userData' }]
1451
221
  }] } });
1452
222
 
1453
- extend({ Group, AmbientLight, PointLight });
1454
- class NgtsGizmoViewport extends NgtSignalStore {
1455
- #gizmoHelperApi;
1456
- set axisColors(axisColors) {
1457
- this.set({ axisColors });
1458
- }
1459
- set axisScale(axisScale) {
1460
- this.set({ axisScale });
223
+ extend({ GridMaterial, Mesh, PlaneGeometry });
224
+ class NgtsGrid {
225
+ set _cellSize(cellSize) {
226
+ this.inputs.set({ cellSize });
1461
227
  }
1462
- set labels(labels) {
1463
- this.set({ labels });
228
+ set _cellThickness(cellThickness) {
229
+ this.inputs.set({ cellThickness });
1464
230
  }
1465
- set axisHeadScale(axisHeadScale) {
1466
- this.set({ axisHeadScale });
231
+ set _cellColor(cellColor) {
232
+ this.inputs.set({ cellColor });
1467
233
  }
1468
- set labelColor(labelColor) {
1469
- this.set({ labelColor });
234
+ set _sectionSize(sectionSize) {
235
+ this.inputs.set({ sectionSize });
1470
236
  }
1471
- set hideNegativeAxes(hideNegativeAxes) {
1472
- this.set({ hideNegativeAxes });
237
+ set _sectionThickness(sectionThickness) {
238
+ this.inputs.set({ sectionThickness });
1473
239
  }
1474
- set hideAxisHeads(hideAxisHeads) {
1475
- this.set({ hideAxisHeads });
240
+ set _sectionColor(sectionColor) {
241
+ this.inputs.set({ sectionColor });
1476
242
  }
1477
- set disabled(disabled) {
1478
- this.set({ disabled });
1479
- }
1480
- set font(font) {
1481
- this.set({ font });
1482
- }
1483
- constructor() {
1484
- super({
1485
- font: '18px Inter var, Arial, sans-serif',
1486
- axisColors: ['#ff2060', '#20df80', '#2080ff'],
1487
- axisHeadScale: 1,
1488
- labels: ['X', 'Y', 'Z'],
1489
- labelColor: '#000',
1490
- });
1491
- this.#gizmoHelperApi = inject(NGTS_GIZMO_HELPER_API);
1492
- this.Math = Math;
1493
- this.clicked = new EventEmitter();
1494
- this.viewportAxisColors = this.select('axisColors');
1495
- this.viewportAxisScale = this.select('axisScale');
1496
- this.viewportLabels = this.select('labels');
1497
- this.viewportAxisHeadScale = this.select('axisHeadScale');
1498
- this.viewportLabelColor = this.select('labelColor');
1499
- this.viewportHideNegativeAxes = this.select('hideNegativeAxes');
1500
- this.viewportHideAxisHeads = this.select('hideAxisHeads');
1501
- this.viewportDisabled = this.select('disabled');
1502
- this.viewportFont = this.select('font');
1503
- }
1504
- onPointerDown(event) {
1505
- if (!this.get('disabled')) {
1506
- event.stopPropagation();
1507
- this.#gizmoHelperApi()(event.object.position);
1508
- }
1509
- }
1510
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoViewport, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1511
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsGizmoViewport, isStandalone: true, selector: "ngts-gizmo-viewport", inputs: { axisColors: "axisColors", axisScale: "axisScale", labels: "labels", axisHeadScale: "axisHeadScale", labelColor: "labelColor", hideNegativeAxes: "hideNegativeAxes", hideAxisHeads: "hideAxisHeads", disabled: "disabled", font: "font" }, outputs: { clicked: "clicked" }, usesInheritance: true, ngImport: i0, template: `
1512
- <ngt-group ngtCompound [scale]="40">
1513
- <ngts-gizmo-viewport-axis
1514
- [color]="viewportAxisColors()[0]"
1515
- [rotation]="[0, 0, 0]"
1516
- [scale]="viewportAxisScale()"
1517
- ></ngts-gizmo-viewport-axis>
1518
- <ngts-gizmo-viewport-axis
1519
- [color]="viewportAxisColors()[1]"
1520
- [rotation]="[0, 0, Math.PI / 2]"
1521
- [scale]="viewportAxisScale()"
1522
- ></ngts-gizmo-viewport-axis>
1523
- <ngts-gizmo-viewport-axis
1524
- [color]="viewportAxisColors()[2]"
1525
- [rotation]="[0, -Math.PI / 2, 0]"
1526
- [scale]="viewportAxisScale()"
1527
- ></ngts-gizmo-viewport-axis>
1528
- <ng-container *ngIf="!viewportHideAxisHeads()">
1529
- <ngts-gizmo-viewport-axis-head
1530
- [arcStyle]="viewportAxisColors()[0]"
1531
- [position]="[1, 0, 0]"
1532
- [label]="viewportLabels()[0]"
1533
- [font]="viewportFont()"
1534
- [disabled]="viewportDisabled()"
1535
- [labelColor]="viewportLabelColor()"
1536
- [clickEmitter]="clicked"
1537
- [axisHeadScale]="viewportAxisHeadScale()"
1538
- (pointerdown)="onPointerDown($any($event))"
1539
- ></ngts-gizmo-viewport-axis-head>
1540
- <ngts-gizmo-viewport-axis-head
1541
- [arcStyle]="viewportAxisColors()[1]"
1542
- [position]="[0, 1, 0]"
1543
- [label]="viewportLabels()[1]"
1544
- [font]="viewportFont()"
1545
- [disabled]="viewportDisabled()"
1546
- [labelColor]="viewportLabelColor()"
1547
- [clickEmitter]="clicked"
1548
- [axisHeadScale]="viewportAxisHeadScale()"
1549
- (pointerdown)="onPointerDown($any($event))"
1550
- ></ngts-gizmo-viewport-axis-head>
1551
- <ngts-gizmo-viewport-axis-head
1552
- [arcStyle]="viewportAxisColors()[2]"
1553
- [position]="[0, 0, 1]"
1554
- [label]="viewportLabels()[2]"
1555
- [font]="viewportFont()"
1556
- [disabled]="viewportDisabled()"
1557
- [labelColor]="viewportLabelColor()"
1558
- [clickEmitter]="clicked"
1559
- [axisHeadScale]="viewportAxisHeadScale()"
1560
- (pointerdown)="onPointerDown($any($event))"
1561
- ></ngts-gizmo-viewport-axis-head>
1562
- <ng-container *ngIf="!viewportHideNegativeAxes()">
1563
- <ngts-gizmo-viewport-axis-head
1564
- [arcStyle]="viewportAxisColors()[0]"
1565
- [position]="[-1, 0, 0]"
1566
- [font]="viewportFont()"
1567
- [disabled]="viewportDisabled()"
1568
- [labelColor]="viewportLabelColor()"
1569
- [clickEmitter]="clicked"
1570
- [axisHeadScale]="viewportAxisHeadScale()"
1571
- (pointerdown)="onPointerDown($any($event))"
1572
- ></ngts-gizmo-viewport-axis-head>
1573
- <ngts-gizmo-viewport-axis-head
1574
- [arcStyle]="viewportAxisColors()[1]"
1575
- [position]="[0, -1, 0]"
1576
- [font]="viewportFont()"
1577
- [disabled]="viewportDisabled()"
1578
- [labelColor]="viewportLabelColor()"
1579
- [clickEmitter]="clicked"
1580
- [axisHeadScale]="viewportAxisHeadScale()"
1581
- (pointerdown)="onPointerDown($any($event))"
1582
- ></ngts-gizmo-viewport-axis-head>
1583
- <ngts-gizmo-viewport-axis-head
1584
- [arcStyle]="viewportAxisColors()[2]"
1585
- [position]="[0, 0, -1]"
1586
- [font]="viewportFont()"
1587
- [disabled]="viewportDisabled()"
1588
- [labelColor]="viewportLabelColor()"
1589
- [clickEmitter]="clicked"
1590
- [axisHeadScale]="viewportAxisHeadScale()"
1591
- (pointerdown)="onPointerDown($any($event))"
1592
- ></ngts-gizmo-viewport-axis-head>
1593
- </ng-container>
1594
- </ng-container>
1595
- <ngt-ambient-light intensity="0.5"></ngt-ambient-light>
1596
- <ngt-point-light position="10" intensity="0.5"></ngt-point-light>
1597
- </ngt-group>
1598
- `, 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", "clickEmitter"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
1599
- }
1600
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGizmoViewport, decorators: [{
1601
- type: Component,
1602
- args: [{
1603
- selector: 'ngts-gizmo-viewport',
1604
- standalone: true,
1605
- template: `
1606
- <ngt-group ngtCompound [scale]="40">
1607
- <ngts-gizmo-viewport-axis
1608
- [color]="viewportAxisColors()[0]"
1609
- [rotation]="[0, 0, 0]"
1610
- [scale]="viewportAxisScale()"
1611
- ></ngts-gizmo-viewport-axis>
1612
- <ngts-gizmo-viewport-axis
1613
- [color]="viewportAxisColors()[1]"
1614
- [rotation]="[0, 0, Math.PI / 2]"
1615
- [scale]="viewportAxisScale()"
1616
- ></ngts-gizmo-viewport-axis>
1617
- <ngts-gizmo-viewport-axis
1618
- [color]="viewportAxisColors()[2]"
1619
- [rotation]="[0, -Math.PI / 2, 0]"
1620
- [scale]="viewportAxisScale()"
1621
- ></ngts-gizmo-viewport-axis>
1622
- <ng-container *ngIf="!viewportHideAxisHeads()">
1623
- <ngts-gizmo-viewport-axis-head
1624
- [arcStyle]="viewportAxisColors()[0]"
1625
- [position]="[1, 0, 0]"
1626
- [label]="viewportLabels()[0]"
1627
- [font]="viewportFont()"
1628
- [disabled]="viewportDisabled()"
1629
- [labelColor]="viewportLabelColor()"
1630
- [clickEmitter]="clicked"
1631
- [axisHeadScale]="viewportAxisHeadScale()"
1632
- (pointerdown)="onPointerDown($any($event))"
1633
- ></ngts-gizmo-viewport-axis-head>
1634
- <ngts-gizmo-viewport-axis-head
1635
- [arcStyle]="viewportAxisColors()[1]"
1636
- [position]="[0, 1, 0]"
1637
- [label]="viewportLabels()[1]"
1638
- [font]="viewportFont()"
1639
- [disabled]="viewportDisabled()"
1640
- [labelColor]="viewportLabelColor()"
1641
- [clickEmitter]="clicked"
1642
- [axisHeadScale]="viewportAxisHeadScale()"
1643
- (pointerdown)="onPointerDown($any($event))"
1644
- ></ngts-gizmo-viewport-axis-head>
1645
- <ngts-gizmo-viewport-axis-head
1646
- [arcStyle]="viewportAxisColors()[2]"
1647
- [position]="[0, 0, 1]"
1648
- [label]="viewportLabels()[2]"
1649
- [font]="viewportFont()"
1650
- [disabled]="viewportDisabled()"
1651
- [labelColor]="viewportLabelColor()"
1652
- [clickEmitter]="clicked"
1653
- [axisHeadScale]="viewportAxisHeadScale()"
1654
- (pointerdown)="onPointerDown($any($event))"
1655
- ></ngts-gizmo-viewport-axis-head>
1656
- <ng-container *ngIf="!viewportHideNegativeAxes()">
1657
- <ngts-gizmo-viewport-axis-head
1658
- [arcStyle]="viewportAxisColors()[0]"
1659
- [position]="[-1, 0, 0]"
1660
- [font]="viewportFont()"
1661
- [disabled]="viewportDisabled()"
1662
- [labelColor]="viewportLabelColor()"
1663
- [clickEmitter]="clicked"
1664
- [axisHeadScale]="viewportAxisHeadScale()"
1665
- (pointerdown)="onPointerDown($any($event))"
1666
- ></ngts-gizmo-viewport-axis-head>
1667
- <ngts-gizmo-viewport-axis-head
1668
- [arcStyle]="viewportAxisColors()[1]"
1669
- [position]="[0, -1, 0]"
1670
- [font]="viewportFont()"
1671
- [disabled]="viewportDisabled()"
1672
- [labelColor]="viewportLabelColor()"
1673
- [clickEmitter]="clicked"
1674
- [axisHeadScale]="viewportAxisHeadScale()"
1675
- (pointerdown)="onPointerDown($any($event))"
1676
- ></ngts-gizmo-viewport-axis-head>
1677
- <ngts-gizmo-viewport-axis-head
1678
- [arcStyle]="viewportAxisColors()[2]"
1679
- [position]="[0, 0, -1]"
1680
- [font]="viewportFont()"
1681
- [disabled]="viewportDisabled()"
1682
- [labelColor]="viewportLabelColor()"
1683
- [clickEmitter]="clicked"
1684
- [axisHeadScale]="viewportAxisHeadScale()"
1685
- (pointerdown)="onPointerDown($any($event))"
1686
- ></ngts-gizmo-viewport-axis-head>
1687
- </ng-container>
1688
- </ng-container>
1689
- <ngt-ambient-light intensity="0.5"></ngt-ambient-light>
1690
- <ngt-point-light position="10" intensity="0.5"></ngt-point-light>
1691
- </ngt-group>
1692
- `,
1693
- imports: [NgtsGizmoViewportAxis, NgtsGizmoViewportAxisHead, NgIf],
1694
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
1695
- }]
1696
- }], ctorParameters: function () { return []; }, propDecorators: { axisColors: [{
1697
- type: Input
1698
- }], axisScale: [{
1699
- type: Input
1700
- }], labels: [{
1701
- type: Input
1702
- }], axisHeadScale: [{
1703
- type: Input
1704
- }], labelColor: [{
1705
- type: Input
1706
- }], hideNegativeAxes: [{
1707
- type: Input
1708
- }], hideAxisHeads: [{
1709
- type: Input
1710
- }], disabled: [{
1711
- type: Input
1712
- }], font: [{
1713
- type: Input
1714
- }], clicked: [{
1715
- type: Output
1716
- }] } });
1717
-
1718
- extend({ Mesh, GridMaterial, PlaneGeometry });
1719
- class NgtsGrid extends NgtSignalStore {
1720
- set cellSize(cellSize) {
1721
- this.set({ cellSize });
243
+ set _followCamera(followCamera) {
244
+ this.inputs.set({ followCamera });
1722
245
  }
1723
- set cellThickness(cellThickness) {
1724
- this.set({ cellThickness });
246
+ set _infiniteGrid(infiniteGrid) {
247
+ this.inputs.set({ infiniteGrid });
1725
248
  }
1726
- set cellColor(cellColor) {
1727
- this.set({ cellColor });
249
+ set _fadeDistance(fadeDistance) {
250
+ this.inputs.set({ fadeDistance });
1728
251
  }
1729
- set sectionSize(sectionSize) {
1730
- this.set({ sectionSize });
252
+ set _fadeStrength(fadeStrength) {
253
+ this.inputs.set({ fadeStrength });
1731
254
  }
1732
- set sectionThickness(sectionThickness) {
1733
- this.set({ sectionThickness });
255
+ set _side(side) {
256
+ this.inputs.set({ side });
1734
257
  }
1735
- set sectionColor(sectionColor) {
1736
- this.set({ sectionColor });
1737
- }
1738
- set followCamera(followCamera) {
1739
- this.set({ followCamera });
1740
- }
1741
- set infiniteGrid(infiniteGrid) {
1742
- this.set({ infiniteGrid });
1743
- }
1744
- set fadeDistance(fadeDistance) {
1745
- this.set({ fadeDistance });
1746
- }
1747
- set fadeStrength(fadeStrength) {
1748
- this.set({ fadeStrength });
1749
- }
1750
- set side(side) {
1751
- this.set({ side });
1752
- }
1753
- set args(args) {
1754
- this.set({ args });
258
+ set _args(args) {
259
+ this.inputs.set({ args });
1755
260
  }
1756
261
  constructor() {
1757
- super({
262
+ this.inputs = signalStore({
263
+ cellColor: '#000000',
264
+ sectionColor: '#2080ff',
1758
265
  cellSize: 0.5,
1759
266
  sectionSize: 1,
267
+ followCamera: false,
268
+ infiniteGrid: false,
1760
269
  fadeDistance: 100,
1761
270
  fadeStrength: 1,
1762
271
  cellThickness: 0.5,
1763
272
  sectionThickness: 1,
1764
- infiniteGrid: false,
1765
- followCamera: false,
1766
- cellColor: '#000000',
1767
- sectionColor: '#2080ff',
1768
273
  side: THREE.BackSide,
1769
- args: [1, 1, 1],
274
+ args: [1, 1, 1, 1],
1770
275
  });
1771
276
  this.gridRef = injectNgtRef();
1772
- this.gridCellSize = this.select('cellSize');
1773
- this.gridSectionSize = this.select('sectionSize');
1774
- this.gridFadeDistance = this.select('fadeDistance');
1775
- this.gridFadeStrength = this.select('fadeStrength');
1776
- this.gridCellThickness = this.select('cellThickness');
1777
- this.gridSectionThickness = this.select('sectionThickness');
1778
- this.gridInfiniteGrid = this.select('infiniteGrid');
1779
- this.gridFollowCamera = this.select('followCamera');
1780
- this.gridCellColor = this.select('cellColor');
1781
- this.gridSectionColor = this.select('sectionColor');
1782
- this.gridSide = this.select('side');
1783
- this.gridArgs = this.select('args');
1784
- }
1785
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGrid, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1786
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsGrid, isStandalone: true, selector: "ngts-grid", inputs: { gridRef: "gridRef", cellSize: "cellSize", cellThickness: "cellThickness", cellColor: "cellColor", sectionSize: "sectionSize", sectionThickness: "sectionThickness", sectionColor: "sectionColor", followCamera: "followCamera", infiniteGrid: "infiniteGrid", fadeDistance: "fadeDistance", fadeStrength: "fadeStrength", side: "side", args: "args" }, usesInheritance: true, ngImport: i0, template: `
1787
- <ngt-mesh ngtCompound [ref]="gridRef" [frustumCulled]="false">
1788
- <ngt-grid-material
1789
- [transparent]="true"
1790
- [side]="gridSide()"
1791
- [cellSize]="gridCellSize()"
1792
- [sectionSize]="gridSectionSize()"
1793
- [cellColor]="gridCellColor()"
1794
- [sectionColor]="gridSectionColor()"
1795
- [cellThickness]="gridCellThickness()"
1796
- [sectionThickness]="gridSectionThickness()"
1797
- [fadeDistance]="gridFadeDistance()"
1798
- [fadeStrength]="gridFadeStrength()"
1799
- [infiniteGrid]="gridInfiniteGrid()"
1800
- [followCamera]="gridFollowCamera()"
1801
- />
1802
- <ngt-plane-geometry *args="gridArgs()" />
1803
- </ngt-mesh>
1804
- `, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "[args]", inputs: ["args"] }] }); }
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);
292
+ injectBeforeRender(({ camera }) => {
293
+ this.plane
294
+ .setFromNormalAndCoplanarPoint(this.upVector, this.zeroVector)
295
+ .applyMatrix4(this.gridRef.nativeElement.matrixWorld);
296
+ const gridMaterial = this.gridRef.nativeElement.material;
297
+ const worldCamProjPosition = gridMaterial.uniforms['worldCamProjPosition'];
298
+ const worldPlanePosition = gridMaterial.uniforms['worldPlanePosition'];
299
+ this.plane.projectPoint(camera.position, worldCamProjPosition.value);
300
+ worldPlanePosition.value.set(0, 0, 0).applyMatrix4(this.gridRef.nativeElement.matrixWorld);
301
+ });
302
+ }
303
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGrid, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
304
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.3", type: NgtsGrid, isStandalone: true, selector: "ngts-grid", inputs: { gridRef: "gridRef", _cellSize: ["cellSize", "_cellSize"], _cellThickness: ["cellThickness", "_cellThickness"], _cellColor: ["cellColor", "_cellColor"], _sectionSize: ["sectionSize", "_sectionSize"], _sectionThickness: ["sectionThickness", "_sectionThickness"], _sectionColor: ["sectionColor", "_sectionColor"], _followCamera: ["followCamera", "_followCamera"], _infiniteGrid: ["infiniteGrid", "_infiniteGrid"], _fadeDistance: ["fadeDistance", "_fadeDistance"], _fadeStrength: ["fadeStrength", "_fadeStrength"], _side: ["side", "_side"], _args: ["args", "_args"] }, ngImport: i0, template: `
305
+ <ngt-mesh ngtCompound [ref]="gridRef" [frustumCulled]="false">
306
+ <ngt-plane-geometry *args="args()" />
307
+ <ngt-grid-material
308
+ [transparent]="true"
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" />
322
+ </ngt-grid-material>
323
+ <ng-content />
324
+ </ngt-mesh>
325
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }] }); }
1805
326
  }
1806
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsGrid, decorators: [{
327
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsGrid, decorators: [{
1807
328
  type: Component,
1808
329
  args: [{
1809
330
  selector: 'ngts-grid',
1810
331
  standalone: true,
1811
332
  template: `
1812
- <ngt-mesh ngtCompound [ref]="gridRef" [frustumCulled]="false">
1813
- <ngt-grid-material
1814
- [transparent]="true"
1815
- [side]="gridSide()"
1816
- [cellSize]="gridCellSize()"
1817
- [sectionSize]="gridSectionSize()"
1818
- [cellColor]="gridCellColor()"
1819
- [sectionColor]="gridSectionColor()"
1820
- [cellThickness]="gridCellThickness()"
1821
- [sectionThickness]="gridSectionThickness()"
1822
- [fadeDistance]="gridFadeDistance()"
1823
- [fadeStrength]="gridFadeStrength()"
1824
- [infiniteGrid]="gridInfiniteGrid()"
1825
- [followCamera]="gridFollowCamera()"
1826
- />
1827
- <ngt-plane-geometry *args="gridArgs()" />
1828
- </ngt-mesh>
1829
- `,
333
+ <ngt-mesh ngtCompound [ref]="gridRef" [frustumCulled]="false">
334
+ <ngt-plane-geometry *args="args()" />
335
+ <ngt-grid-material
336
+ [transparent]="true"
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" />
350
+ </ngt-grid-material>
351
+ <ng-content />
352
+ </ngt-mesh>
353
+ `,
1830
354
  imports: [NgtArgs],
1831
355
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
1832
356
  }]
1833
357
  }], ctorParameters: function () { return []; }, propDecorators: { gridRef: [{
1834
358
  type: Input
1835
- }], cellSize: [{
1836
- type: Input
1837
- }], cellThickness: [{
1838
- type: Input
1839
- }], cellColor: [{
1840
- type: Input
1841
- }], sectionSize: [{
1842
- type: Input
1843
- }], sectionThickness: [{
1844
- type: Input
1845
- }], sectionColor: [{
1846
- type: Input
1847
- }], followCamera: [{
1848
- type: Input
1849
- }], infiniteGrid: [{
1850
- type: Input
1851
- }], fadeDistance: [{
1852
- type: Input
1853
- }], fadeStrength: [{
1854
- type: Input
1855
- }], side: [{
1856
- type: Input
1857
- }], args: [{
1858
- type: Input
1859
- }] } });
1860
-
1861
- const v = new THREE.Vector3();
1862
- class NgtsQuadraticBezierLine extends NgtsLineInputs {
1863
- set start(start) {
1864
- this.set({ start });
1865
- }
1866
- set end(end) {
1867
- this.set({ end });
1868
- }
1869
- set mid(mid) {
1870
- this.set({ mid });
1871
- }
1872
- set segments(segments) {
1873
- this.set({ segments });
1874
- }
1875
- #curve;
1876
- #start;
1877
- #end;
1878
- #mid;
1879
- #segments;
1880
- constructor() {
1881
- super();
1882
- this.lineRef = injectNgtRef();
1883
- this.#curve = new THREE.QuadraticBezierCurve3(undefined, undefined, undefined);
1884
- this.#start = this.select('start');
1885
- this.#end = this.select('end');
1886
- this.#mid = this.select('mid');
1887
- this.#segments = this.select('segments');
1888
- this.points = computed(() => this.#getPoints(this.#start(), this.#end(), this.#mid(), this.#segments()));
1889
- this.set({ start: [0, 0, 0], end: [0, 0, 0], segments: 20 });
1890
- this.#replaceSetPoints();
1891
- }
1892
- #replaceSetPoints() {
1893
- effect(() => {
1894
- const line = this.lineRef.nativeElement;
1895
- if (!line)
1896
- return;
1897
- line.setPoints = (start, end, mid) => {
1898
- const points = this.#getPoints(start, end, mid);
1899
- if (line.geometry) {
1900
- line.geometry.setPositions(points.map((p) => p.toArray()).flat());
1901
- }
1902
- };
1903
- });
1904
- }
1905
- #getPoints(start, end, mid, segments = 20) {
1906
- if (start instanceof THREE.Vector3)
1907
- this.#curve.v0.copy(start);
1908
- else
1909
- this.#curve.v0.set(...start);
1910
- if (end instanceof THREE.Vector3)
1911
- this.#curve.v2.copy(end);
1912
- else
1913
- this.#curve.v2.set(...end);
1914
- if (mid instanceof THREE.Vector3) {
1915
- this.#curve.v1.copy(mid);
1916
- }
1917
- else {
1918
- this.#curve.v1.copy(this.#curve.v0
1919
- .clone()
1920
- .add(this.#curve.v2.clone().sub(this.#curve.v0))
1921
- .add(v.set(0, this.#curve.v0.y - this.#curve.v2.y, 0)));
1922
- }
1923
- return this.#curve.getPoints(segments);
1924
- }
1925
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsQuadraticBezierLine, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1926
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsQuadraticBezierLine, isStandalone: true, selector: "ngts-quadratic-bezier-line", inputs: { lineRef: "lineRef", start: "start", end: "end", mid: "mid", segments: "segments" }, usesInheritance: true, ngImport: i0, template: `
1927
- <ngts-line
1928
- [lineRef]="lineRef"
1929
- [points]="points()"
1930
- [color]="lineParameters().color"
1931
- [vertexColors]="lineParameters().vertexColors"
1932
- [resolution]="lineParameters().resolution"
1933
- [lineWidth]="lineParameters().linewidth"
1934
- [alphaToCoverage]="lineParameters().alphaToCoverage"
1935
- [dashed]="lineParameters().dashed"
1936
- [dashScale]="lineParameters().dashScale"
1937
- [dashSize]="lineParameters().dashSize"
1938
- [dashOffset]="lineParameters().dashOffset"
1939
- [gapSize]="lineParameters().gapSize"
1940
- [wireframe]="lineParameters().wireframe"
1941
- [worldUnits]="lineParameters().worldUnits"
1942
- />
1943
- `, isInline: true, dependencies: [{ kind: "component", type: NgtsLine, selector: "ngts-line", inputs: ["lineRef", "points", "segments"] }] }); }
1944
- }
1945
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsQuadraticBezierLine, decorators: [{
1946
- type: Component,
1947
- args: [{
1948
- selector: 'ngts-quadratic-bezier-line',
1949
- standalone: true,
1950
- template: `
1951
- <ngts-line
1952
- [lineRef]="lineRef"
1953
- [points]="points()"
1954
- [color]="lineParameters().color"
1955
- [vertexColors]="lineParameters().vertexColors"
1956
- [resolution]="lineParameters().resolution"
1957
- [lineWidth]="lineParameters().linewidth"
1958
- [alphaToCoverage]="lineParameters().alphaToCoverage"
1959
- [dashed]="lineParameters().dashed"
1960
- [dashScale]="lineParameters().dashScale"
1961
- [dashSize]="lineParameters().dashSize"
1962
- [dashOffset]="lineParameters().dashOffset"
1963
- [gapSize]="lineParameters().gapSize"
1964
- [wireframe]="lineParameters().wireframe"
1965
- [worldUnits]="lineParameters().worldUnits"
1966
- />
1967
- `,
1968
- imports: [NgtsLine],
1969
- }]
1970
- }], ctorParameters: function () { return []; }, propDecorators: { lineRef: [{
1971
- type: Input
1972
- }], start: [{
1973
- type: Input
1974
- }], end: [{
1975
- type: Input
1976
- }], mid: [{
1977
- type: Input
1978
- }], segments: [{
1979
- 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' }]
1980
395
  }] } });
1981
396
 
1982
397
  extend({ Mesh, TextGeometry });
1983
- class NgtsText3D extends NgtSignalStore {
1984
- set font(font) {
1985
- this.set({ font });
398
+ class NgtsText3D {
399
+ set _font(font) {
400
+ this.inputs.set({ font });
1986
401
  }
1987
- set text(text) {
1988
- this.set({ text });
402
+ set _text(text) {
403
+ this.inputs.set({ text });
1989
404
  }
1990
- set bevelEnabled(bevelEnabled) {
1991
- this.set({ bevelEnabled });
405
+ set _bevelEnabled(bevelEnabled) {
406
+ this.inputs.set({ bevelEnabled });
1992
407
  }
1993
- set bevelOffset(bevelOffset) {
1994
- this.set({ bevelOffset });
408
+ set _bevelOffset(bevelOffset) {
409
+ this.inputs.set({ bevelOffset });
1995
410
  }
1996
- set bevelSize(bevelSize) {
1997
- this.set({ bevelSize });
411
+ set _bevelSize(bevelSize) {
412
+ this.inputs.set({ bevelSize });
1998
413
  }
1999
- set bevelThickness(bevelThickness) {
2000
- this.set({ bevelThickness });
414
+ set _bevelThickness(bevelThickness) {
415
+ this.inputs.set({ bevelThickness });
2001
416
  }
2002
- set curveSegments(curveSegments) {
2003
- this.set({ curveSegments });
417
+ set _curveSegments(curveSegments) {
418
+ this.inputs.set({ curveSegments });
2004
419
  }
2005
- set bevelSegments(bevelSegments) {
2006
- this.set({ bevelSegments });
420
+ set _bevelSegments(bevelSegments) {
421
+ this.inputs.set({ bevelSegments });
2007
422
  }
2008
- set height(height) {
2009
- this.set({ height });
423
+ set _height(height) {
424
+ this.inputs.set({ height });
2010
425
  }
2011
- set size(size) {
2012
- this.set({ size });
426
+ set _size(size) {
427
+ this.inputs.set({ size });
2013
428
  }
2014
- set lineHeight(lineHeight) {
2015
- this.set({ lineHeight });
429
+ set _lineHeight(lineHeight) {
430
+ this.inputs.set({ lineHeight });
2016
431
  }
2017
- set letterSpacing(letterSpacing) {
2018
- this.set({ letterSpacing });
432
+ set _letterSpacing(letterSpacing) {
433
+ this.inputs.set({ letterSpacing });
2019
434
  }
2020
- set smooth(smooth) {
2021
- this.set({ smooth });
435
+ set _smooth(smooth) {
436
+ this.inputs.set({ smooth });
2022
437
  }
2023
438
  constructor() {
2024
- super({
439
+ this.inputs = signalStore({
2025
440
  lineHeight: 1,
2026
441
  letterSpacing: 0,
2027
442
  size: 1,
@@ -2034,222 +449,232 @@ class NgtsText3D extends NgtSignalStore {
2034
449
  curveSegments: 8,
2035
450
  });
2036
451
  this.textRef = injectNgtRef();
2037
- this.#fontData = toSignal(toObservable(this.select('font')).pipe(switchMap((font) => {
2038
- if (typeof font === 'string')
2039
- return fetch(font).then((res) => res.json());
2040
- return of(font);
2041
- }), map((fontData) => new FontLoader().parse(fontData))));
2042
- this.#text = this.select('text');
2043
- this.#size = this.select('size');
2044
- this.#height = this.select('height');
2045
- this.#bevelThickness = this.select('bevelThickness');
2046
- this.#bevelSize = this.select('bevelSize');
2047
- this.#bevelEnabled = this.select('bevelEnabled');
2048
- this.#bevelSegments = this.select('bevelSegments');
2049
- this.#bevelOffset = this.select('bevelOffset');
2050
- this.#curveSegments = this.select('curveSegments');
2051
- this.#letterSpacing = this.select('letterSpacing');
2052
- this.#lineHeight = this.select('lineHeight');
452
+ this.cdr = inject(ChangeDetectorRef);
453
+ this.fontData = signal(null);
454
+ this.font = this.inputs.select('font');
455
+ this.text = this.inputs.select('text');
456
+ this.size = this.inputs.select('size');
457
+ this.height = this.inputs.select('height');
458
+ this.bevelThickness = this.inputs.select('bevelThickness');
459
+ this.bevelSize = this.inputs.select('bevelSize');
460
+ this.bevelEnabled = this.inputs.select('bevelEnabled');
461
+ this.bevelSegments = this.inputs.select('bevelSegments');
462
+ this.bevelOffset = this.inputs.select('bevelOffset');
463
+ this.curveSegments = this.inputs.select('curveSegments');
464
+ this.letterSpacing = this.inputs.select('letterSpacing');
465
+ this.lineHeight = this.inputs.select('lineHeight');
2053
466
  this.geometryArgs = computed(() => {
2054
- const fontData = this.#fontData();
2055
- if (!fontData)
467
+ const fontData = this.fontData() || this.font();
468
+ if (!fontData || !fontData.data)
2056
469
  return null;
2057
470
  return [
2058
- this.#text(),
471
+ this.text(),
2059
472
  {
2060
473
  font: fontData,
2061
- size: this.#size(),
2062
- height: this.#height(),
2063
- bevelThickness: this.#bevelThickness(),
2064
- bevelSize: this.#bevelSize(),
2065
- bevelSegments: this.#bevelSegments(),
2066
- bevelEnabled: this.#bevelEnabled(),
2067
- bevelOffset: this.#bevelOffset(),
2068
- curveSegments: this.#curveSegments(),
2069
- letterSpacing: this.#letterSpacing(),
2070
- lineHeight: this.#lineHeight(),
474
+ size: this.size(),
475
+ height: this.height(),
476
+ bevelThickness: this.bevelThickness(),
477
+ bevelSize: this.bevelSize(),
478
+ bevelSegments: this.bevelSegments(),
479
+ bevelEnabled: this.bevelEnabled(),
480
+ bevelOffset: this.bevelOffset(),
481
+ curveSegments: this.curveSegments(),
482
+ letterSpacing: this.letterSpacing(),
483
+ lineHeight: this.lineHeight(),
2071
484
  },
2072
485
  ];
2073
486
  });
487
+ effect(() => {
488
+ const font = this.font();
489
+ if (typeof font === 'string') {
490
+ fetch(font)
491
+ .then((res) => res.json())
492
+ .then((fontData) => {
493
+ this.fontData.set(new FontLoader().parse(fontData));
494
+ this.cdr.detectChanges();
495
+ });
496
+ }
497
+ });
2074
498
  }
2075
- #fontData;
2076
- #text;
2077
- #size;
2078
- #height;
2079
- #bevelThickness;
2080
- #bevelSize;
2081
- #bevelEnabled;
2082
- #bevelSegments;
2083
- #bevelOffset;
2084
- #curveSegments;
2085
- #letterSpacing;
2086
- #lineHeight;
2087
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsText3D, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2088
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsText3D, isStandalone: true, selector: "ngts-text-3d", inputs: { textRef: "textRef", font: "font", text: "text", bevelEnabled: "bevelEnabled", bevelOffset: "bevelOffset", bevelSize: "bevelSize", bevelThickness: "bevelThickness", curveSegments: "curveSegments", bevelSegments: "bevelSegments", height: "height", size: "size", lineHeight: "lineHeight", letterSpacing: "letterSpacing", smooth: "smooth" }, usesInheritance: true, ngImport: i0, template: `
2089
- <ngt-mesh ngtCompound [ref]="textRef">
2090
- <ngt-text-geometry *args="geometryArgs()" />
2091
- <ng-content />
2092
- </ngt-mesh>
2093
- `, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "[args]", inputs: ["args"] }] }); }
499
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsText3D, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
500
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.3", type: NgtsText3D, isStandalone: true, selector: "ngts-text-3d", inputs: { textRef: "textRef", _font: ["font", "_font"], _text: ["text", "_text"], _bevelEnabled: ["bevelEnabled", "_bevelEnabled"], _bevelOffset: ["bevelOffset", "_bevelOffset"], _bevelSize: ["bevelSize", "_bevelSize"], _bevelThickness: ["bevelThickness", "_bevelThickness"], _curveSegments: ["curveSegments", "_curveSegments"], _bevelSegments: ["bevelSegments", "_bevelSegments"], _height: ["height", "_height"], _size: ["size", "_size"], _lineHeight: ["lineHeight", "_lineHeight"], _letterSpacing: ["letterSpacing", "_letterSpacing"], _smooth: ["smooth", "_smooth"] }, ngImport: i0, template: `
501
+ <ngt-mesh ngtCompound [ref]="textRef">
502
+ <ngt-text-geometry *args="geometryArgs()" />
503
+ <ng-content />
504
+ </ngt-mesh>
505
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }] }); }
2094
506
  }
2095
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsText3D, decorators: [{
507
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsText3D, decorators: [{
2096
508
  type: Component,
2097
509
  args: [{
2098
510
  selector: 'ngts-text-3d',
2099
511
  standalone: true,
2100
512
  template: `
2101
- <ngt-mesh ngtCompound [ref]="textRef">
2102
- <ngt-text-geometry *args="geometryArgs()" />
2103
- <ng-content />
2104
- </ngt-mesh>
2105
- `,
513
+ <ngt-mesh ngtCompound [ref]="textRef">
514
+ <ngt-text-geometry *args="geometryArgs()" />
515
+ <ng-content />
516
+ </ngt-mesh>
517
+ `,
2106
518
  imports: [NgtArgs],
2107
519
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
2108
520
  }]
2109
521
  }], ctorParameters: function () { return []; }, propDecorators: { textRef: [{
2110
522
  type: Input
2111
- }], font: [{
523
+ }], _font: [{
2112
524
  type: Input,
2113
- args: [{ required: true }]
2114
- }], text: [{
525
+ args: [{ required: true, alias: 'font' }]
526
+ }], _text: [{
2115
527
  type: Input,
2116
- args: [{ required: true }]
2117
- }], bevelEnabled: [{
2118
- type: Input
2119
- }], bevelOffset: [{
2120
- type: Input
2121
- }], bevelSize: [{
2122
- type: Input
2123
- }], bevelThickness: [{
2124
- type: Input
2125
- }], curveSegments: [{
2126
- type: Input
2127
- }], bevelSegments: [{
2128
- type: Input
2129
- }], height: [{
2130
- type: Input
2131
- }], size: [{
2132
- type: Input
2133
- }], lineHeight: [{
2134
- type: Input
2135
- }], letterSpacing: [{
2136
- type: Input
2137
- }], smooth: [{
2138
- 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' }]
2139
562
  }] } });
2140
563
 
2141
- class NgtsText extends NgtSignalStore {
564
+ class NgtsText {
2142
565
  set text(text) {
2143
- this.set({ text });
566
+ this.inputs.set({ text });
2144
567
  }
2145
568
  set font(font) {
2146
- this.set({ font });
569
+ this.inputs.set({ font });
2147
570
  }
2148
571
  set fontSize(fontSize) {
2149
- this.set({ fontSize });
572
+ this.inputs.set({ fontSize });
2150
573
  }
2151
574
  set anchorX(anchorX) {
2152
- this.set({ anchorX });
575
+ this.inputs.set({ anchorX });
2153
576
  }
2154
577
  set anchorY(anchorY) {
2155
- this.set({ anchorY });
578
+ this.inputs.set({ anchorY });
2156
579
  }
2157
580
  set sdfGlyphSize(sdfGlyphSize) {
2158
- this.set({ sdfGlyphSize });
581
+ this.inputs.set({ sdfGlyphSize });
2159
582
  }
2160
583
  set characters(characters) {
2161
- this.set({ characters });
584
+ this.inputs.set({ characters });
2162
585
  }
2163
586
  set color(color) {
2164
- this.set({ color });
587
+ this.inputs.set({ color });
2165
588
  }
2166
589
  set maxWidth(maxWidth) {
2167
- this.set({ maxWidth });
590
+ this.inputs.set({ maxWidth });
2168
591
  }
2169
592
  set lineHeight(lineHeight) {
2170
- this.set({ lineHeight });
593
+ this.inputs.set({ lineHeight });
2171
594
  }
2172
595
  set letterSpacing(letterSpacing) {
2173
- this.set({ letterSpacing });
596
+ this.inputs.set({ letterSpacing });
2174
597
  }
2175
598
  set textAlign(textAlign) {
2176
- this.set({ textAlign });
599
+ this.inputs.set({ textAlign });
2177
600
  }
2178
601
  set clipRect(clipRect) {
2179
- this.set({ clipRect });
602
+ this.inputs.set({ clipRect });
2180
603
  }
2181
604
  set depthOffset(depthOffset) {
2182
- this.set({ depthOffset });
605
+ this.inputs.set({ depthOffset });
2183
606
  }
2184
607
  set direction(direction) {
2185
- this.set({ direction });
608
+ this.inputs.set({ direction });
2186
609
  }
2187
610
  set overflowWrap(overflowWrap) {
2188
- this.set({ overflowWrap });
611
+ this.inputs.set({ overflowWrap });
2189
612
  }
2190
613
  set whiteSpace(whiteSpace) {
2191
- this.set({ whiteSpace });
614
+ this.inputs.set({ whiteSpace });
2192
615
  }
2193
616
  set outlineWidth(outlineWidth) {
2194
- this.set({ outlineWidth });
617
+ this.inputs.set({ outlineWidth });
2195
618
  }
2196
619
  set outlineOffsetX(outlineOffsetX) {
2197
- this.set({ outlineOffsetX });
620
+ this.inputs.set({ outlineOffsetX });
2198
621
  }
2199
622
  set outlineOffsetY(outlineOffsetY) {
2200
- this.set({ outlineOffsetY });
623
+ this.inputs.set({ outlineOffsetY });
2201
624
  }
2202
625
  set outlineBlur(outlineBlur) {
2203
- this.set({ outlineBlur });
626
+ this.inputs.set({ outlineBlur });
2204
627
  }
2205
628
  set outlineColor(outlineColor) {
2206
- this.set({ outlineColor });
629
+ this.inputs.set({ outlineColor });
2207
630
  }
2208
631
  set outlineOpacity(outlineOpacity) {
2209
- this.set({ outlineOpacity });
632
+ this.inputs.set({ outlineOpacity });
2210
633
  }
2211
634
  set strokeWidth(strokeWidth) {
2212
- this.set({ strokeWidth });
635
+ this.inputs.set({ strokeWidth });
2213
636
  }
2214
637
  set strokeColor(strokeColor) {
2215
- this.set({ strokeColor });
638
+ this.inputs.set({ strokeColor });
2216
639
  }
2217
640
  set strokeOpacity(strokeOpacity) {
2218
- this.set({ strokeOpacity });
641
+ this.inputs.set({ strokeOpacity });
2219
642
  }
2220
643
  set fillOpacity(fillOpacity) {
2221
- this.set({ fillOpacity });
644
+ this.inputs.set({ fillOpacity });
2222
645
  }
2223
646
  set debugSDF(debugSDF) {
2224
- this.set({ debugSDF });
647
+ this.inputs.set({ debugSDF });
2225
648
  }
2226
- #store;
2227
649
  constructor() {
2228
- super({ fontSize: 1, sdfGlyphSize: 64, anchorX: 'center', anchorY: 'middle' });
650
+ this.inputs = signalStore({
651
+ fontSize: 1,
652
+ sdfGlyphSize: 64,
653
+ anchorX: 'center',
654
+ anchorY: 'middle',
655
+ });
2229
656
  this.textRef = injectNgtRef();
2230
657
  this.sync = new EventEmitter();
2231
658
  this.troikaText = new Text();
2232
- this.#store = inject(NgtStore);
659
+ this.store = injectNgtStore();
2233
660
  inject(DestroyRef).onDestroy(() => {
2234
661
  this.troikaText.dispose();
2235
662
  });
2236
- this.#preloadFont();
2237
- this.#syncText();
663
+ this.preloadFont();
664
+ this.syncText();
2238
665
  }
2239
- #preloadFont() {
2240
- const font = this.select('font');
2241
- const characters = this.select('characters');
2242
- const trigger = computed(() => ({ font: font(), characters: characters() }));
666
+ preloadFont() {
667
+ const _font = this.inputs.select('font');
668
+ const _characters = this.inputs.select('characters');
2243
669
  effect(() => {
2244
- const { font, characters } = trigger();
2245
- const invalidate = this.#store.get('invalidate');
670
+ const [font, characters] = [_font(), _characters()];
671
+ const invalidate = this.store.get('invalidate');
2246
672
  preloadFont({ font, characters }, () => invalidate());
2247
673
  });
2248
674
  }
2249
- #syncText() {
675
+ syncText() {
2250
676
  effect(() => {
2251
- this.state();
2252
- const invalidate = this.#store.get('invalidate');
677
+ const [invalidate] = [this.store.get('invalidate'), this.inputs.state()];
2253
678
  this.troikaText.sync(() => {
2254
679
  invalidate();
2255
680
  if (this.sync.observed) {
@@ -2258,87 +683,87 @@ class NgtsText extends NgtSignalStore {
2258
683
  });
2259
684
  });
2260
685
  }
2261
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsText, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2262
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsText, isStandalone: true, selector: "ngts-text", inputs: { textRef: "textRef", text: "text", font: "font", fontSize: "fontSize", anchorX: "anchorX", anchorY: "anchorY", sdfGlyphSize: "sdfGlyphSize", characters: "characters", color: "color", maxWidth: "maxWidth", lineHeight: "lineHeight", letterSpacing: "letterSpacing", textAlign: "textAlign", clipRect: "clipRect", depthOffset: "depthOffset", direction: "direction", overflowWrap: "overflowWrap", whiteSpace: "whiteSpace", outlineWidth: "outlineWidth", outlineOffsetX: "outlineOffsetX", outlineOffsetY: "outlineOffsetY", outlineBlur: "outlineBlur", outlineColor: "outlineColor", outlineOpacity: "outlineOpacity", strokeWidth: "strokeWidth", strokeColor: "strokeColor", strokeOpacity: "strokeOpacity", fillOpacity: "fillOpacity", debugSDF: "debugSDF" }, outputs: { sync: "sync" }, usesInheritance: true, ngImport: i0, template: `
2263
- <ngt-primitive
2264
- ngtCompound
2265
- *args="[troikaText]"
2266
- [ref]="textRef"
2267
- [text]="state().text"
2268
- [anchorX]="state().anchorX"
2269
- [anchorY]="state().anchorY"
2270
- [font]="state().font"
2271
- [fontSize]="state().fontSize"
2272
- [sdfGlyphSize]="state().sdfGlyphSize"
2273
- [characters]="state().characters"
2274
- [color]="state().color"
2275
- [maxWidth]="state().maxWidth"
2276
- [lineHeight]="state().lineHeight"
2277
- [letterSpacing]="state().letterSpacing"
2278
- [textAlign]="state().textAlign"
2279
- [clipRect]="state().clipRect"
2280
- [depthOffset]="state().depthOffset"
2281
- [direction]="state().direction"
2282
- [overflowWrap]="state().overflowWrap"
2283
- [whiteSpace]="state().whiteSpace"
2284
- [outlineWidth]="state().outlineWidth"
2285
- [outlineOffsetX]="state().outlineOffsetX"
2286
- [outlineOffsetY]="state().outlineOffsetY"
2287
- [outlineBlur]="state().outlineBlur"
2288
- [outlineColor]="state().outlineColor"
2289
- [outlineOpacity]="state().outlineOpacity"
2290
- [strokeWidth]="state().strokeWidth"
2291
- [strokeColor]="state().strokeColor"
2292
- [strokeOpacity]="state().strokeOpacity"
2293
- [fillOpacity]="state().fillOpacity"
2294
- [debugSDF]="state().debugSDF"
2295
- >
2296
- <ng-content />
2297
- </ngt-primitive>
2298
- `, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "[args]", inputs: ["args"] }] }); }
686
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsText, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
687
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.3", type: NgtsText, isStandalone: true, selector: "ngts-text", inputs: { textRef: "textRef", text: "text", font: "font", fontSize: "fontSize", anchorX: "anchorX", anchorY: "anchorY", sdfGlyphSize: "sdfGlyphSize", characters: "characters", color: "color", maxWidth: "maxWidth", lineHeight: "lineHeight", letterSpacing: "letterSpacing", textAlign: "textAlign", clipRect: "clipRect", depthOffset: "depthOffset", direction: "direction", overflowWrap: "overflowWrap", whiteSpace: "whiteSpace", outlineWidth: "outlineWidth", outlineOffsetX: "outlineOffsetX", outlineOffsetY: "outlineOffsetY", outlineBlur: "outlineBlur", outlineColor: "outlineColor", outlineOpacity: "outlineOpacity", strokeWidth: "strokeWidth", strokeColor: "strokeColor", strokeOpacity: "strokeOpacity", fillOpacity: "fillOpacity", debugSDF: "debugSDF" }, outputs: { sync: "sync" }, ngImport: i0, template: `
688
+ <ngt-primitive
689
+ ngtCompound
690
+ *args="[troikaText]"
691
+ [ref]="textRef"
692
+ [text]="inputs.state().text"
693
+ [anchorX]="inputs.state().anchorX"
694
+ [anchorY]="inputs.state().anchorY"
695
+ [font]="inputs.state().font"
696
+ [fontSize]="inputs.state().fontSize"
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"
720
+ >
721
+ <ng-content />
722
+ </ngt-primitive>
723
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }] }); }
2299
724
  }
2300
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsText, decorators: [{
725
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.3", ngImport: i0, type: NgtsText, decorators: [{
2301
726
  type: Component,
2302
727
  args: [{
2303
728
  selector: 'ngts-text',
2304
729
  standalone: true,
2305
730
  template: `
2306
- <ngt-primitive
2307
- ngtCompound
2308
- *args="[troikaText]"
2309
- [ref]="textRef"
2310
- [text]="state().text"
2311
- [anchorX]="state().anchorX"
2312
- [anchorY]="state().anchorY"
2313
- [font]="state().font"
2314
- [fontSize]="state().fontSize"
2315
- [sdfGlyphSize]="state().sdfGlyphSize"
2316
- [characters]="state().characters"
2317
- [color]="state().color"
2318
- [maxWidth]="state().maxWidth"
2319
- [lineHeight]="state().lineHeight"
2320
- [letterSpacing]="state().letterSpacing"
2321
- [textAlign]="state().textAlign"
2322
- [clipRect]="state().clipRect"
2323
- [depthOffset]="state().depthOffset"
2324
- [direction]="state().direction"
2325
- [overflowWrap]="state().overflowWrap"
2326
- [whiteSpace]="state().whiteSpace"
2327
- [outlineWidth]="state().outlineWidth"
2328
- [outlineOffsetX]="state().outlineOffsetX"
2329
- [outlineOffsetY]="state().outlineOffsetY"
2330
- [outlineBlur]="state().outlineBlur"
2331
- [outlineColor]="state().outlineColor"
2332
- [outlineOpacity]="state().outlineOpacity"
2333
- [strokeWidth]="state().strokeWidth"
2334
- [strokeColor]="state().strokeColor"
2335
- [strokeOpacity]="state().strokeOpacity"
2336
- [fillOpacity]="state().fillOpacity"
2337
- [debugSDF]="state().debugSDF"
2338
- >
2339
- <ng-content />
2340
- </ngt-primitive>
2341
- `,
731
+ <ngt-primitive
732
+ ngtCompound
733
+ *args="[troikaText]"
734
+ [ref]="textRef"
735
+ [text]="inputs.state().text"
736
+ [anchorX]="inputs.state().anchorX"
737
+ [anchorY]="inputs.state().anchorY"
738
+ [font]="inputs.state().font"
739
+ [fontSize]="inputs.state().fontSize"
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"
763
+ >
764
+ <ng-content />
765
+ </ngt-primitive>
766
+ `,
2342
767
  imports: [NgtArgs],
2343
768
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
2344
769
  }]
@@ -2409,5 +834,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
2409
834
  * Generated bundle index. Do not edit.
2410
835
  */
2411
836
 
2412
- export { NGTS_GIZMO_HELPER_API, NgtsBillboard, NgtsCatmullRomLine, NgtsCubicBezierLine, NgtsEdges, NgtsGizmoHelper, NgtsGizmoHelperContent, NgtsGizmoViewcube, NgtsGizmoViewport, NgtsGrid, NgtsLine, NgtsQuadraticBezierLine, NgtsText, NgtsText3D };
837
+ export { NgtsBillboard, NgtsDetailed, NgtsEdges, NgtsGrid, NgtsText, NgtsText3D };
2413
838
  //# sourceMappingURL=angular-three-soba-abstractions.mjs.map