angular-three-soba 2.0.0-beta.7 → 2.0.0-beta.8

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 (296) hide show
  1. package/abstractions/billboard/billboard.d.ts +11 -7
  2. package/abstractions/detailed/detailed.d.ts +26 -0
  3. package/abstractions/edges/edges.d.ts +23 -11
  4. package/abstractions/grid/grid.d.ts +41 -50
  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 +47 -40
  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 +50 -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 +30 -13
  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 +119 -121
  22. package/esm2022/cameras/camera/camera-content.mjs +5 -6
  23. package/esm2022/cameras/camera/camera.mjs +48 -42
  24. package/esm2022/cameras/cube-camera/cube-camera.mjs +129 -99
  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 +94 -90
  29. package/esm2022/loaders/gltf-loader/gltf-loader.mjs +3 -6
  30. package/esm2022/loaders/loader/loader.mjs +92 -87
  31. package/esm2022/loaders/progress/progress.mjs +1 -1
  32. package/esm2022/loaders/texture-loader/texture-loader.mjs +4 -4
  33. package/esm2022/materials/index.mjs +2 -1
  34. package/esm2022/materials/mesh-distort-material/mesh-distort-material.mjs +60 -51
  35. package/esm2022/materials/mesh-reflector-material/mesh-reflector-material.mjs +239 -255
  36. package/esm2022/materials/mesh-refraction-material/mesh-refraction-material.mjs +99 -97
  37. package/esm2022/materials/mesh-transmission-material/mesh-transmission-material.mjs +167 -146
  38. package/esm2022/materials/mesh-wobble-material/mesh-wobble-material.mjs +44 -42
  39. package/esm2022/materials/point-material/point-material.mjs +46 -0
  40. package/esm2022/misc/animations/animations.mjs +20 -16
  41. package/esm2022/misc/bake-shadows/bake-shadows.mjs +13 -13
  42. package/esm2022/misc/caustics/caustics.mjs +387 -0
  43. package/esm2022/misc/decal/decal.mjs +187 -0
  44. package/esm2022/misc/depth-buffer/depth-buffer.mjs +33 -35
  45. package/esm2022/misc/example/example.mjs +160 -0
  46. package/esm2022/misc/fbo/fbo.mjs +35 -35
  47. package/esm2022/misc/html/html-wrapper.mjs +478 -0
  48. package/esm2022/misc/html/html.mjs +304 -0
  49. package/esm2022/misc/index.mjs +10 -1
  50. package/esm2022/misc/sampler/sampler.mjs +142 -0
  51. package/esm2022/misc/shadow/shadow.mjs +111 -0
  52. package/esm2022/misc/stats-gl/stats-gl.mjs +61 -0
  53. package/esm2022/misc/trail/trail.mjs +209 -0
  54. package/esm2022/misc/trail-texture/inject-trail-texture.mjs +17 -0
  55. package/esm2022/misc/trail-texture/trail-texture.mjs +106 -0
  56. package/esm2022/modifiers/angular-three-soba-modifiers.mjs +5 -0
  57. package/esm2022/modifiers/curve-modifier/curve-modifier.mjs +64 -0
  58. package/esm2022/modifiers/index.mjs +2 -0
  59. package/esm2022/performances/adaptive-dpr/adaptive-dpr.mjs +44 -0
  60. package/esm2022/performances/adaptive-events/adaptive-events.mjs +27 -0
  61. package/esm2022/performances/angular-three-soba-performances.mjs +5 -0
  62. package/esm2022/performances/index.mjs +6 -0
  63. package/esm2022/performances/points/points-input.mjs +64 -0
  64. package/esm2022/performances/points/points.mjs +329 -0
  65. package/esm2022/performances/points/position-point.mjs +54 -0
  66. package/esm2022/performances/segments/segment-object.mjs +9 -0
  67. package/esm2022/performances/segments/segments.mjs +182 -0
  68. package/esm2022/shaders/blur-pass/blur-pass.mjs +1 -1
  69. package/esm2022/shaders/caustics/caustics-material.mjs +130 -0
  70. package/esm2022/shaders/caustics/caustics-projection-material.mjs +31 -0
  71. package/esm2022/shaders/convolution-material/convolution-material.mjs +1 -1
  72. package/esm2022/shaders/discard-material/discard-material.mjs +1 -1
  73. package/esm2022/shaders/grid-material/grid-material.mjs +29 -14
  74. package/esm2022/shaders/index.mjs +5 -3
  75. package/esm2022/shaders/mesh-distort-material/mesh-distort-material.mjs +42 -41
  76. package/esm2022/shaders/mesh-reflector-material/mesh-reflector-material.mjs +1 -1
  77. package/esm2022/shaders/mesh-refraction-material/mesh-refraction-material.mjs +2 -2
  78. package/esm2022/shaders/mesh-transmission-material/mesh-transmission-material.mjs +4 -4
  79. package/esm2022/shaders/mesh-wobble-material/mesh-wobble-material.mjs +1 -1
  80. package/esm2022/shaders/shader-material/shader-material.mjs +1 -1
  81. package/esm2022/shaders/soft-shadow-material/soft-shadow-material.mjs +17 -25
  82. package/esm2022/shaders/sparkles-material/sparkles-material.mjs +32 -46
  83. package/esm2022/shaders/spot-light-material/spot-light-material.mjs +7 -7
  84. package/esm2022/shaders/star-field-material/star-field-material.mjs +3 -2
  85. package/esm2022/shaders/wireframe-material/wireframe-material.mjs +247 -0
  86. package/esm2022/staging/accumulative-shadows/accumulative-shadows.mjs +160 -176
  87. package/esm2022/staging/accumulative-shadows/progressive-light-map.mjs +1 -1
  88. package/esm2022/staging/accumulative-shadows/randomized-lights.mjs +126 -128
  89. package/esm2022/staging/backdrop/backdrop.mjs +77 -0
  90. package/esm2022/staging/bb-anchor/bb-anchor.mjs +70 -0
  91. package/esm2022/staging/bounds/bounds.mjs +144 -143
  92. package/esm2022/staging/camera-shake/camera-shake.mjs +86 -80
  93. package/esm2022/staging/center/center.mjs +106 -91
  94. package/esm2022/staging/cloud/cloud.mjs +118 -124
  95. package/esm2022/staging/contact-shadows/contact-shadows.mjs +131 -134
  96. package/esm2022/staging/environment/assets.mjs +12 -12
  97. package/esm2022/staging/environment/environment-cube.mjs +28 -30
  98. package/esm2022/staging/environment/environment-ground.mjs +18 -20
  99. package/esm2022/staging/environment/environment-input.mjs +97 -84
  100. package/esm2022/staging/environment/environment-map.mjs +33 -33
  101. package/esm2022/staging/environment/environment-portal.mjs +75 -97
  102. package/esm2022/staging/environment/environment.mjs +34 -51
  103. package/esm2022/staging/environment/utils.mjs +35 -14
  104. package/esm2022/staging/float/float.mjs +70 -58
  105. package/esm2022/staging/index.mjs +7 -3
  106. package/esm2022/staging/matcap-texture/matcap-texture.mjs +64 -0
  107. package/esm2022/staging/normal-texture/normal-texture.mjs +53 -0
  108. package/esm2022/staging/sky/sky.mjs +85 -80
  109. package/esm2022/staging/sparkles/sparkles.mjs +108 -105
  110. package/esm2022/staging/spot-light/shadow-mesh-input.mjs +63 -0
  111. package/esm2022/staging/spot-light/shadow-mesh.mjs +266 -0
  112. package/esm2022/staging/spot-light/spot-light-input.mjs +67 -58
  113. package/esm2022/staging/spot-light/spot-light.mjs +51 -64
  114. package/esm2022/staging/spot-light/volumetric-mesh.mjs +61 -78
  115. package/esm2022/staging/stage/stage.mjs +304 -290
  116. package/esm2022/staging/stars/stars.mjs +101 -102
  117. package/esm2022/staging/wireframe/wireframe-input.mjs +191 -0
  118. package/esm2022/staging/wireframe/wireframe.mjs +224 -0
  119. package/esm2022/utils/angular-three-soba-utils.mjs +5 -0
  120. package/esm2022/utils/content/content.mjs +15 -0
  121. package/esm2022/utils/index.mjs +2 -0
  122. package/fesm2022/angular-three-soba-abstractions.mjs +505 -2087
  123. package/fesm2022/angular-three-soba-abstractions.mjs.map +1 -1
  124. package/fesm2022/angular-three-soba-cameras.mjs +302 -259
  125. package/fesm2022/angular-three-soba-cameras.mjs.map +1 -1
  126. package/fesm2022/angular-three-soba-controls.mjs +93 -88
  127. package/fesm2022/angular-three-soba-controls.mjs.map +1 -1
  128. package/fesm2022/angular-three-soba-loaders.mjs +94 -90
  129. package/fesm2022/angular-three-soba-loaders.mjs.map +1 -1
  130. package/fesm2022/angular-three-soba-materials.mjs +655 -590
  131. package/fesm2022/angular-three-soba-materials.mjs.map +1 -1
  132. package/fesm2022/angular-three-soba-misc.mjs +2198 -89
  133. package/fesm2022/angular-three-soba-misc.mjs.map +1 -1
  134. package/fesm2022/angular-three-soba-modifiers.mjs +71 -0
  135. package/fesm2022/angular-three-soba-modifiers.mjs.map +1 -0
  136. package/fesm2022/angular-three-soba-performances.mjs +697 -0
  137. package/fesm2022/angular-three-soba-performances.mjs.map +1 -0
  138. package/fesm2022/angular-three-soba-shaders.mjs +501 -264
  139. package/fesm2022/angular-three-soba-shaders.mjs.map +1 -1
  140. package/fesm2022/angular-three-soba-staging.mjs +2870 -2555
  141. package/fesm2022/angular-three-soba-staging.mjs.map +1 -1
  142. package/fesm2022/angular-three-soba-utils.mjs +22 -0
  143. package/fesm2022/angular-three-soba-utils.mjs.map +1 -0
  144. package/loaders/gltf-loader/gltf-loader.d.ts +4 -3
  145. package/loaders/loader/loader.d.ts +19 -17
  146. package/loaders/progress/progress.d.ts +1 -1
  147. package/loaders/texture-loader/texture-loader.d.ts +2 -2
  148. package/materials/index.d.ts +1 -0
  149. package/materials/mesh-distort-material/mesh-distort-material.d.ts +25 -15
  150. package/materials/mesh-reflector-material/mesh-reflector-material.d.ts +74 -56
  151. package/materials/mesh-refraction-material/mesh-refraction-material.d.ts +33 -21
  152. package/materials/mesh-transmission-material/mesh-transmission-material.d.ts +55 -39
  153. package/materials/mesh-wobble-material/mesh-wobble-material.d.ts +19 -10
  154. package/materials/point-material/point-material.d.ts +24 -0
  155. package/metadata.json +1 -0
  156. package/misc/animations/animations.d.ts +6 -4
  157. package/misc/caustics/caustics.d.ts +87 -0
  158. package/misc/decal/decal.d.ts +49 -0
  159. package/misc/depth-buffer/depth-buffer.d.ts +2 -2
  160. package/misc/example/example.d.ts +81 -0
  161. package/misc/fbo/fbo.d.ts +2 -2
  162. package/misc/html/html-wrapper.d.ts +559 -0
  163. package/misc/html/html.d.ts +214 -0
  164. package/misc/index.d.ts +9 -0
  165. package/misc/sampler/sampler.d.ts +67 -0
  166. package/misc/shadow/shadow.d.ts +37 -0
  167. package/misc/stats-gl/stats-gl.d.ts +24 -0
  168. package/misc/trail/trail.d.ts +57 -0
  169. package/misc/trail-texture/inject-trail-texture.d.ts +9 -0
  170. package/misc/trail-texture/trail-texture.d.ts +50 -0
  171. package/modifiers/README.md +3 -0
  172. package/modifiers/curve-modifier/curve-modifier.d.ts +23 -0
  173. package/modifiers/index.d.ts +1 -0
  174. package/package.json +30 -22
  175. package/performances/README.md +3 -0
  176. package/performances/adaptive-dpr/adaptive-dpr.d.ts +14 -0
  177. package/{performance/adaptive → performances/adaptive-events}/adaptive-events.d.ts +3 -0
  178. package/performances/index.d.ts +5 -0
  179. package/performances/points/points-input.d.ts +32 -0
  180. package/performances/points/points.d.ts +92 -0
  181. package/{performance/instances/position-mesh.d.ts → performances/points/position-point.d.ts} +4 -3
  182. package/performances/segments/segment-object.d.ts +7 -0
  183. package/performances/segments/segments.d.ts +124 -0
  184. package/shaders/grid-material/grid-material.d.ts +33 -0
  185. package/shaders/index.d.ts +4 -2
  186. package/shaders/mesh-distort-material/mesh-distort-material.d.ts +146 -1
  187. package/shaders/mesh-transmission-material/mesh-transmission-material.d.ts +1 -1
  188. package/shaders/shader-material/shader-material.d.ts +2 -2
  189. package/shaders/soft-shadow-material/soft-shadow-material.d.ts +10 -1
  190. package/shaders/sparkles-material/sparkles-material.d.ts +15 -1
  191. package/shaders/spot-light-material/spot-light-material.d.ts +11 -2
  192. package/shaders/star-field-material/star-field-material.d.ts +11 -1
  193. package/shaders/wireframe-material/wireframe-material.d.ts +58 -0
  194. package/staging/accumulative-shadows/accumulative-shadows.d.ts +89 -39
  195. package/staging/accumulative-shadows/randomized-lights.d.ts +40 -27
  196. package/staging/backdrop/backdrop.d.ts +30 -0
  197. package/staging/bb-anchor/bb-anchor.d.ts +27 -0
  198. package/staging/bounds/bounds.d.ts +100 -24
  199. package/staging/camera-shake/camera-shake.d.ts +30 -19
  200. package/staging/center/center.d.ts +43 -35
  201. package/staging/cloud/cloud.d.ts +26 -23
  202. package/staging/contact-shadows/contact-shadows.d.ts +41 -28
  203. package/staging/environment/assets.d.ts +9 -9
  204. package/staging/environment/environment-cube.d.ts +9 -5
  205. package/staging/environment/environment-ground.d.ts +7 -7
  206. package/staging/environment/environment-input.d.ts +36 -36
  207. package/staging/environment/environment-map.d.ts +10 -5
  208. package/staging/environment/environment-portal.d.ts +10 -5
  209. package/staging/environment/environment.d.ts +0 -4
  210. package/staging/environment/utils.d.ts +2 -2
  211. package/staging/float/float.d.ts +14 -10
  212. package/staging/index.d.ts +6 -2
  213. package/staging/matcap-texture/matcap-texture.d.ts +13 -0
  214. package/staging/normal-texture/normal-texture.d.ts +16 -0
  215. package/staging/sky/sky.d.ts +28 -21
  216. package/staging/sparkles/sparkles.d.ts +35 -21
  217. package/staging/spot-light/shadow-mesh-input.d.ts +29 -0
  218. package/staging/spot-light/shadow-mesh.d.ts +37 -0
  219. package/staging/spot-light/spot-light-input.d.ts +25 -25
  220. package/staging/spot-light/spot-light.d.ts +31 -15
  221. package/staging/spot-light/volumetric-mesh.d.ts +15 -9
  222. package/staging/stage/stage.d.ts +88 -63
  223. package/staging/stars/stars.d.ts +27 -16
  224. package/staging/wireframe/wireframe-input.d.ts +65 -0
  225. package/staging/wireframe/wireframe.d.ts +28 -0
  226. package/utils/README.md +3 -0
  227. package/utils/content/content.d.ts +8 -0
  228. package/utils/index.d.ts +1 -0
  229. package/web-types.json +1 -0
  230. package/abstractions/catmull-rom-line/catmull-rom-line.d.ts +0 -25
  231. package/abstractions/cubic-bezier-line/cubic-bezier-line.d.ts +0 -25
  232. package/abstractions/gizmo-helper/gizmo-helper.d.ts +0 -34
  233. package/abstractions/gizmo-helper/gizmo-viewcube/constants.d.ts +0 -12
  234. package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.d.ts +0 -22
  235. package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.d.ts +0 -30
  236. package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.d.ts +0 -32
  237. package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube.d.ts +0 -14
  238. package/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.d.ts +0 -47
  239. package/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport.d.ts +0 -40
  240. package/abstractions/line/line-input.d.ts +0 -42
  241. package/abstractions/line/line.d.ts +0 -35
  242. package/abstractions/quadratic-bezier-line/quadratic-bezier-line.d.ts +0 -23
  243. package/esm2022/abstractions/catmull-rom-line/catmull-rom-line.mjs +0 -131
  244. package/esm2022/abstractions/cubic-bezier-line/cubic-bezier-line.mjs +0 -113
  245. package/esm2022/abstractions/gizmo-helper/gizmo-helper.mjs +0 -210
  246. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/constants.mjs +0 -31
  247. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.mjs +0 -95
  248. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.mjs +0 -155
  249. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.mjs +0 -62
  250. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube.mjs +0 -80
  251. package/esm2022/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.mjs +0 -206
  252. package/esm2022/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport.mjs +0 -273
  253. package/esm2022/abstractions/line/line-input.mjs +0 -113
  254. package/esm2022/abstractions/line/line.mjs +0 -165
  255. package/esm2022/abstractions/quadratic-bezier-line/quadratic-bezier-line.mjs +0 -128
  256. package/esm2022/performance/adaptive/adaptive-dpr.mjs +0 -46
  257. package/esm2022/performance/adaptive/adaptive-events.mjs +0 -31
  258. package/esm2022/performance/angular-three-soba-performance.mjs +0 -5
  259. package/esm2022/performance/detailed/detailed.mjs +0 -61
  260. package/esm2022/performance/index.mjs +0 -7
  261. package/esm2022/performance/instances/instance.mjs +0 -48
  262. package/esm2022/performance/instances/instances.mjs +0 -189
  263. package/esm2022/performance/instances/position-mesh.mjs +0 -52
  264. package/esm2022/performance/stats/stats.mjs +0 -79
  265. package/esm2022/shaders/caustics-material/caustics-material.mjs +0 -128
  266. package/esm2022/shaders/caustics-material/caustics-projection-material.mjs +0 -33
  267. package/esm2022/staging/caustics/caustisc.mjs +0 -384
  268. package/esm2022/staging/spot-light/spot-light-shadow-mesh-input.mjs +0 -57
  269. package/esm2022/staging/spot-light/spot-light-shadow-mesh.mjs +0 -258
  270. package/fesm2022/angular-three-soba-performance.mjs +0 -487
  271. package/fesm2022/angular-three-soba-performance.mjs.map +0 -1
  272. package/performance/README.md +0 -3
  273. package/performance/adaptive/adaptive-dpr.d.ts +0 -8
  274. package/performance/detailed/detailed.d.ts +0 -20
  275. package/performance/index.d.ts +0 -6
  276. package/performance/instances/instance.d.ts +0 -9
  277. package/performance/instances/instances.d.ts +0 -35
  278. package/performance/stats/stats.d.ts +0 -18
  279. package/plugin/generators.json +0 -19
  280. package/plugin/libs/plugin/README.md +0 -11
  281. package/plugin/package.json +0 -9
  282. package/plugin/src/generators/init/compat.d.ts +0 -2
  283. package/plugin/src/generators/init/compat.js +0 -6
  284. package/plugin/src/generators/init/compat.js.map +0 -1
  285. package/plugin/src/generators/init/init.d.ts +0 -7
  286. package/plugin/src/generators/init/init.js +0 -28
  287. package/plugin/src/generators/init/init.js.map +0 -1
  288. package/plugin/src/generators/init/schema.json +0 -6
  289. package/plugin/src/index.d.ts +0 -1
  290. package/plugin/src/index.js +0 -6
  291. package/plugin/src/index.js.map +0 -1
  292. package/staging/caustics/caustisc.d.ts +0 -70
  293. package/staging/spot-light/spot-light-shadow-mesh-input.d.ts +0 -29
  294. package/staging/spot-light/spot-light-shadow-mesh.d.ts +0 -38
  295. /package/shaders/{caustics-material → caustics}/caustics-material.d.ts +0 -0
  296. /package/shaders/{caustics-material → caustics}/caustics-projection-material.d.ts +0 -0
@@ -1,36 +1,36 @@
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, requestAnimationFrameInInjectionContext, NgtArgs, NgtPortal, NgtPortalContent, NgtRepeat } from 'angular-three';
2
+ import { Component, CUSTOM_ELEMENTS_SCHEMA, Input, effect, TemplateRef, ContentChild, computed, EventEmitter, inject, 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
9
  import { toSignal, toObservable } from '@angular/core/rxjs-interop';
11
10
  import { switchMap, of, map } from 'rxjs';
11
+ import { TextGeometry, FontLoader } from 'three-stdlib';
12
12
  import { Text, preloadFont } from 'troika-three-text';
13
13
 
14
14
  extend({ Group });
15
- class NgtsBillboard extends NgtSignalStore {
16
- set follow(follow) {
17
- this.set({ follow });
15
+ class NgtsBillboard {
16
+ set _follow(follow) {
17
+ this.inputs.set({ follow });
18
18
  }
19
- set lockX(lockX) {
20
- this.set({ lockX });
19
+ set _lockX(lockX) {
20
+ this.inputs.set({ lockX });
21
21
  }
22
- set lockY(lockY) {
23
- this.set({ lockY });
22
+ set _lockY(lockY) {
23
+ this.inputs.set({ lockY });
24
24
  }
25
- set lockZ(lockZ) {
26
- this.set({ lockZ });
25
+ set _lockZ(lockZ) {
26
+ this.inputs.set({ lockZ });
27
27
  }
28
28
  constructor() {
29
- super({ follow: true, lockX: false, lockY: false, lockZ: false });
29
+ this.inputs = signalStore({ follow: true, lockX: false, lockY: false, lockZ: false });
30
30
  this.billboardRef = injectNgtRef();
31
31
  injectBeforeRender(({ camera }) => {
32
32
  const ref = this.billboardRef.untracked;
33
- const { follow, lockX, lockY, lockZ } = this.get();
33
+ const { follow, lockX, lockY, lockZ } = this.inputs.get();
34
34
  if (!ref || !follow)
35
35
  return;
36
36
  // save previous rotation in case we're locking an axis
@@ -46,1982 +46,360 @@ class NgtsBillboard extends NgtSignalStore {
46
46
  ref.rotation.z = prevRotation.z;
47
47
  });
48
48
  }
49
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.3", ngImport: i0, type: NgtsBillboard, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
50
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.3", 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 }); }
49
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsBillboard, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
50
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", 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: `
51
+ <ngt-group ngtCompound [ref]="billboardRef">
52
+ <ng-content />
53
+ </ngt-group>
54
+ `, isInline: true }); }
55
55
  }
56
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.3", ngImport: i0, type: NgtsBillboard, decorators: [{
56
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsBillboard, decorators: [{
57
57
  type: Component,
58
58
  args: [{
59
59
  selector: 'ngts-billboard',
60
60
  standalone: true,
61
61
  template: `
62
- <ngt-group ngtCompound [ref]="billboardRef">
63
- <ng-content />
64
- </ngt-group>
65
- `,
62
+ <ngt-group ngtCompound [ref]="billboardRef">
63
+ <ng-content />
64
+ </ngt-group>
65
+ `,
66
66
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
67
67
  }]
68
68
  }], ctorParameters: function () { return []; }, propDecorators: { billboardRef: [{
69
69
  type: Input
70
- }], follow: [{
71
- type: Input
72
- }], lockX: [{
73
- type: Input
74
- }], lockY: [{
75
- type: Input
76
- }], lockZ: [{
77
- type: Input
70
+ }], _follow: [{
71
+ type: Input,
72
+ args: [{ alias: 'follow' }]
73
+ }], _lockX: [{
74
+ type: Input,
75
+ args: [{ alias: 'lockX' }]
76
+ }], _lockY: [{
77
+ type: Input,
78
+ args: [{ alias: 'lockY' }]
79
+ }], _lockZ: [{
80
+ type: Input,
81
+ args: [{ alias: 'lockZ' }]
78
82
  }] } });
79
83
 
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 });
95
- }
96
- set dashScale(dashScale) {
97
- this.set({ dashScale });
84
+ extend({ LOD });
85
+ class NgtsDetailed {
86
+ set _distances(distances) {
87
+ this.inputs.set({ distances });
98
88
  }
99
- set dashSize(dashSize) {
100
- this.set({ dashSize });
89
+ set _hysteresis(hysteresis) {
90
+ this.inputs.set({ hysteresis });
101
91
  }
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
- 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.3", ngImport: i0, type: NgtsLineInputs, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
159
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.3", 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.3", 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
92
  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
- requestAnimationFrameInInjectionContext(() => {
261
- this.#disposeGeometry();
262
- this.#computeLineDistances();
263
- });
93
+ this.inputs = signalStore({ hysteresis: 0 });
94
+ this.lodRef = injectNgtRef();
95
+ this.updateChildren();
264
96
  }
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
- });
97
+ onBeforeRender({ object, state }) {
98
+ object.update(state.camera);
99
+ }
100
+ updateChildren() {
101
+ const lodChildren = this.lodRef.children();
102
+ const _distances = this.inputs.select('distances');
103
+ const _hysteresis = this.inputs.select('hysteresis');
273
104
  effect(() => {
274
- const { line } = trigger();
275
- if (!line)
105
+ const lod = this.lodRef.nativeElement;
106
+ if (!lod)
276
107
  return;
277
- line.computeLineDistances();
278
- });
279
- }
280
- #disposeGeometry() {
281
- effect((onCleanup) => {
282
- const lineGeometry = this.lineGeometry();
283
- onCleanup(() => lineGeometry.dispose());
108
+ const [distances, hysteresis, children] = [_distances(), _hysteresis(), lodChildren()];
109
+ lod.levels.length = 0;
110
+ children.forEach((child, index) => {
111
+ lod.addLevel(child, distances[index], hysteresis);
112
+ });
284
113
  });
285
114
  }
286
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.3", ngImport: i0, type: NgtsLine, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
287
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.3", 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"] }] }); }
115
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsDetailed, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
116
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: NgtsDetailed, isStandalone: true, selector: "ngts-detailed", inputs: { lodRef: "lodRef", _distances: ["distances", "_distances"], _hysteresis: ["hysteresis", "_hysteresis"] }, ngImport: i0, template: `
117
+ <ngt-lOD ngtCompound [ref]="lodRef" (beforeRender)="onBeforeRender($event)">
118
+ <ng-content />
119
+ </ngt-lOD>
120
+ `, isInline: true }); }
308
121
  }
309
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.3", ngImport: i0, type: NgtsLine, decorators: [{
122
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsDetailed, decorators: [{
310
123
  type: Component,
311
124
  args: [{
312
- selector: 'ngts-line',
125
+ selector: 'ngts-detailed',
313
126
  standalone: true,
314
127
  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],
128
+ <ngt-lOD ngtCompound [ref]="lodRef" (beforeRender)="onBeforeRender($event)">
129
+ <ng-content />
130
+ </ngt-lOD>
131
+ `,
336
132
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
337
133
  }]
338
- }], ctorParameters: function () { return []; }, propDecorators: { lineRef: [{
134
+ }], ctorParameters: function () { return []; }, propDecorators: { lodRef: [{
339
135
  type: Input
340
- }], points: [{
136
+ }], _distances: [{
341
137
  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.3", ngImport: i0, type: NgtsCatmullRomLine, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
410
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.3", 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.3", 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: [{
138
+ args: [{ required: true, alias: 'distances' }]
139
+ }], _hysteresis: [{
458
140
  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.3", ngImport: i0, type: NgtsCubicBezierLine, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
514
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.3", 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.3", 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: [{
567
- type: Input,
568
- args: [{ required: true }]
569
- }], midB: [{
570
- type: Input,
571
- args: [{ required: true }]
572
- }], segments: [{
573
- type: Input
141
+ args: [{ alias: 'hysteresis' }]
574
142
  }] } });
575
143
 
576
144
  extend({ LineSegments, LineBasicMaterial });
577
- class NgtsEdges extends NgtSignalStore {
578
- set threshold(threshold) {
579
- this.set({ threshold });
145
+ class NgtsEdges {
146
+ set _threshold(threshold) {
147
+ this.inputs.set({ threshold });
580
148
  }
581
- set color(color) {
582
- this.set({ color });
149
+ set _color(color) {
150
+ this.inputs.set({ color });
583
151
  }
584
- set geometry(geometry) {
585
- this.set({ geometry });
152
+ set _geometry(geometry) {
153
+ this.inputs.set({ geometry });
586
154
  }
587
- set userData(userData) {
588
- this.set({ userData });
155
+ set _userData(userData) {
156
+ this.inputs.set({ userData });
589
157
  }
590
158
  constructor() {
591
- super({
592
- threshold: 15,
593
- color: 'black',
594
- userData: {},
595
- });
159
+ this.nullRaycast = () => null;
160
+ this.inputs = signalStore({ threshold: 15, color: 'black' });
596
161
  this.edgesRef = injectNgtRef();
597
- this.withChildren = false;
598
- this.noop = () => null;
599
- this.#setupGeometry();
600
- }
601
- #setupGeometry() {
162
+ this.geometry = this.inputs.select('geometry');
163
+ this.threshold = this.inputs.select('threshold');
164
+ this.color = this.inputs.select('color');
602
165
  effect(() => {
603
166
  const edges = this.edgesRef.nativeElement;
604
167
  if (!edges)
605
168
  return;
606
- const parent = edges.parent;
169
+ const parent = this.edgesRef.nativeElement.parent;
607
170
  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;
171
+ const [geometry, threshold] = [this.geometry() || parent.geometry, this.threshold()];
172
+ if (geometry !== edges.userData['currentGeom'] || threshold !== edges.userData['currentThreshold']) {
173
+ edges.userData['currentGeom'] = geometry;
612
174
  edges.userData['currentThreshold'] = threshold;
613
- edges.geometry = new THREE.EdgesGeometry(geom, threshold);
175
+ edges.geometry = new THREE.EdgesGeometry(geometry, threshold);
614
176
  }
615
177
  }
616
178
  });
617
179
  }
618
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.3", ngImport: i0, type: NgtsEdges, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
619
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.3", 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"] }] }); }
180
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsEdges, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
181
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", 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: `
182
+ <ngt-line-segments [ref]="edgesRef" [raycast]="nullRaycast" ngtCompound>
183
+ <ng-container *ngIf="content; else defaultMaterial" [ngTemplateOutlet]="content" />
184
+ <ng-template #defaultMaterial>
185
+ <ngt-line-basic-material [color]="color()" />
186
+ </ng-template>
187
+ </ngt-line-segments>
188
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
629
189
  }
630
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.3", ngImport: i0, type: NgtsEdges, decorators: [{
190
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsEdges, decorators: [{
631
191
  type: Component,
632
192
  args: [{
633
193
  selector: 'ngts-edges',
634
194
  standalone: true,
635
195
  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],
196
+ <ngt-line-segments [ref]="edgesRef" [raycast]="nullRaycast" ngtCompound>
197
+ <ng-container *ngIf="content; else defaultMaterial" [ngTemplateOutlet]="content" />
198
+ <ng-template #defaultMaterial>
199
+ <ngt-line-basic-material [color]="color()" />
200
+ </ng-template>
201
+ </ngt-line-segments>
202
+ `,
203
+ imports: [NgIf, NgTemplateOutlet],
646
204
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
647
205
  }]
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.3", ngImport: i0, type: NgtsGizmoHelperContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
667
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.3", type: NgtsGizmoHelperContent, isStandalone: true, selector: "ng-template[ngtsGizmoHelperContent]", ngImport: i0 }); }
668
- }
669
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.3", 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.3", ngImport: i0, type: NgtsGizmoHelper, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
807
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.3", 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.3", 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
- ],
847
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
848
- }]
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: [{
206
+ }], ctorParameters: function () { return []; }, propDecorators: { content: [{
860
207
  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.3", ngImport: i0, type: NgtsGizmoViewcubeInputs, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
930
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.3", 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.3", 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: [{
943
- type: Input
944
- }], font: [{
208
+ args: [NgtsSobaContent, { read: TemplateRef }]
209
+ }], edgesRef: [{
945
210
  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.3", ngImport: i0, type: NgtsGizmoViewcubeEdgeCube, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
988
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.3", 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.3", 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: [{
211
+ }], _threshold: [{
1032
212
  type: Input,
1033
- args: [{ required: true }]
1034
- }], position: [{
213
+ args: [{ alias: 'threshold' }]
214
+ }], _color: [{
1035
215
  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.3", ngImport: i0, type: NgtsGizmoViewcubeFaceMaterial, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1089
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.3", 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.3", 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.3", ngImport: i0, type: NgtsGizmoViewcubeFaceCube, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1153
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.3", 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.3", 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
- requestAnimationFrameInInjectionContext(() => {
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.3", ngImport: i0, type: NgtsGizmoViewcube, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1200
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.3", 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.3", 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.3", ngImport: i0, type: NgtsGizmoViewportAxis, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1272
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.3", 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.3", 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: [{
216
+ args: [{ alias: 'color' }]
217
+ }], _geometry: [{
1298
218
  type: Input,
1299
- args: [{ required: true }]
1300
- }], rotation: [{
219
+ args: [{ alias: 'geometry' }]
220
+ }], _userData: [{
1301
221
  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.3", ngImport: i0, type: NgtsGizmoViewportAxisHead, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1392
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.3", 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.3", 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
222
+ args: [{ alias: 'userData' }]
1451
223
  }] } });
1452
224
 
1453
- extend({ Group, AmbientLight, PointLight });
1454
- class NgtsGizmoViewport extends NgtSignalStore {
1455
- #gizmoHelperApi;
1456
- set axisColors(axisColors) {
1457
- this.set({ axisColors });
225
+ extend({ GridMaterial, Mesh, PlaneGeometry });
226
+ class NgtsGrid {
227
+ set _cellSize(cellSize) {
228
+ this.inputs.set({ cellSize });
1458
229
  }
1459
- set axisScale(axisScale) {
1460
- this.set({ axisScale });
230
+ set _cellThickness(cellThickness) {
231
+ this.inputs.set({ cellThickness });
1461
232
  }
1462
- set labels(labels) {
1463
- this.set({ labels });
233
+ set _cellColor(cellColor) {
234
+ this.inputs.set({ cellColor });
1464
235
  }
1465
- set axisHeadScale(axisHeadScale) {
1466
- this.set({ axisHeadScale });
236
+ set _sectionSize(sectionSize) {
237
+ this.inputs.set({ sectionSize });
1467
238
  }
1468
- set labelColor(labelColor) {
1469
- this.set({ labelColor });
239
+ set _sectionThickness(sectionThickness) {
240
+ this.inputs.set({ sectionThickness });
1470
241
  }
1471
- set hideNegativeAxes(hideNegativeAxes) {
1472
- this.set({ hideNegativeAxes });
242
+ set _sectionColor(sectionColor) {
243
+ this.inputs.set({ sectionColor });
1473
244
  }
1474
- set hideAxisHeads(hideAxisHeads) {
1475
- this.set({ hideAxisHeads });
245
+ set _followCamera(followCamera) {
246
+ this.inputs.set({ followCamera });
1476
247
  }
1477
- set disabled(disabled) {
1478
- this.set({ disabled });
248
+ set _infiniteGrid(infiniteGrid) {
249
+ this.inputs.set({ infiniteGrid });
1479
250
  }
1480
- set font(font) {
1481
- this.set({ font });
251
+ set _fadeDistance(fadeDistance) {
252
+ this.inputs.set({ fadeDistance });
1482
253
  }
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.3", ngImport: i0, type: NgtsGizmoViewport, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1511
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.3", 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.3", 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 });
1722
- }
1723
- set cellThickness(cellThickness) {
1724
- this.set({ cellThickness });
1725
- }
1726
- set cellColor(cellColor) {
1727
- this.set({ cellColor });
1728
- }
1729
- set sectionSize(sectionSize) {
1730
- this.set({ sectionSize });
1731
- }
1732
- set sectionThickness(sectionThickness) {
1733
- this.set({ sectionThickness });
1734
- }
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 });
254
+ set _fadeStrength(fadeStrength) {
255
+ this.inputs.set({ fadeStrength });
1746
256
  }
1747
- set fadeStrength(fadeStrength) {
1748
- this.set({ fadeStrength });
257
+ set _side(side) {
258
+ this.inputs.set({ side });
1749
259
  }
1750
- set side(side) {
1751
- this.set({ side });
1752
- }
1753
- set args(args) {
1754
- this.set({ args });
260
+ set _args(args) {
261
+ this.inputs.set({ args });
1755
262
  }
1756
263
  constructor() {
1757
- super({
264
+ this.inputs = signalStore({
265
+ cellColor: '#000000',
266
+ sectionColor: '#2080ff',
1758
267
  cellSize: 0.5,
1759
268
  sectionSize: 1,
269
+ followCamera: false,
270
+ infiniteGrid: false,
1760
271
  fadeDistance: 100,
1761
272
  fadeStrength: 1,
1762
273
  cellThickness: 0.5,
1763
274
  sectionThickness: 1,
1764
- infiniteGrid: false,
1765
- followCamera: false,
1766
- cellColor: '#000000',
1767
- sectionColor: '#2080ff',
1768
275
  side: THREE.BackSide,
1769
- args: [1, 1, 1],
276
+ args: [1, 1, 1, 1],
1770
277
  });
1771
278
  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.3", ngImport: i0, type: NgtsGrid, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1786
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.3", 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"] }] }); }
279
+ this.cellSize = this.inputs.select('cellSize');
280
+ this.sectionSize = this.inputs.select('sectionSize');
281
+ this.fadeDistance = this.inputs.select('fadeDistance');
282
+ this.fadeStrength = this.inputs.select('fadeStrength');
283
+ this.cellThickness = this.inputs.select('cellThickness');
284
+ this.sectionThickness = this.inputs.select('sectionThickness');
285
+ this.infiniteGrid = this.inputs.select('infiniteGrid');
286
+ this.followCamera = this.inputs.select('followCamera');
287
+ this.cellColor = this.inputs.select('cellColor');
288
+ this.sectionColor = this.inputs.select('sectionColor');
289
+ this.side = this.inputs.select('side');
290
+ this.args = this.inputs.select('args');
291
+ this.plane = new THREE.Plane();
292
+ this.upVector = new THREE.Vector3(0, 1, 0);
293
+ this.zeroVector = new THREE.Vector3(0, 0, 0);
294
+ injectBeforeRender(({ camera }) => {
295
+ this.plane
296
+ .setFromNormalAndCoplanarPoint(this.upVector, this.zeroVector)
297
+ .applyMatrix4(this.gridRef.nativeElement.matrixWorld);
298
+ const gridMaterial = this.gridRef.nativeElement.material;
299
+ const worldCamProjPosition = gridMaterial.uniforms['worldCamProjPosition'];
300
+ const worldPlanePosition = gridMaterial.uniforms['worldPlanePosition'];
301
+ this.plane.projectPoint(camera.position, worldCamProjPosition.value);
302
+ worldPlanePosition.value.set(0, 0, 0).applyMatrix4(this.gridRef.nativeElement.matrixWorld);
303
+ });
304
+ }
305
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsGrid, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
306
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", 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: `
307
+ <ngt-mesh ngtCompound [ref]="gridRef" [frustumCulled]="false">
308
+ <ngt-plane-geometry *args="args()" />
309
+ <ngt-grid-material
310
+ [transparent]="true"
311
+ [side]="side()"
312
+ [cellSize]="cellSize()"
313
+ [cellColor]="cellColor()"
314
+ [cellThickness]="cellThickness()"
315
+ [sectionSize]="sectionSize()"
316
+ [sectionColor]="sectionColor()"
317
+ [sectionThickness]="sectionThickness()"
318
+ [fadeDistance]="fadeDistance()"
319
+ [fadeStrength]="fadeStrength()"
320
+ [infiniteGrid]="infiniteGrid()"
321
+ [followCamera]="followCamera()"
322
+ >
323
+ <ngt-value attach="extensions.derivatives" [rawValue]="false" />
324
+ </ngt-grid-material>
325
+ <ng-content />
326
+ </ngt-mesh>
327
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }] }); }
1805
328
  }
1806
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.3", ngImport: i0, type: NgtsGrid, decorators: [{
329
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsGrid, decorators: [{
1807
330
  type: Component,
1808
331
  args: [{
1809
332
  selector: 'ngts-grid',
1810
333
  standalone: true,
1811
334
  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
- `,
335
+ <ngt-mesh ngtCompound [ref]="gridRef" [frustumCulled]="false">
336
+ <ngt-plane-geometry *args="args()" />
337
+ <ngt-grid-material
338
+ [transparent]="true"
339
+ [side]="side()"
340
+ [cellSize]="cellSize()"
341
+ [cellColor]="cellColor()"
342
+ [cellThickness]="cellThickness()"
343
+ [sectionSize]="sectionSize()"
344
+ [sectionColor]="sectionColor()"
345
+ [sectionThickness]="sectionThickness()"
346
+ [fadeDistance]="fadeDistance()"
347
+ [fadeStrength]="fadeStrength()"
348
+ [infiniteGrid]="infiniteGrid()"
349
+ [followCamera]="followCamera()"
350
+ >
351
+ <ngt-value attach="extensions.derivatives" [rawValue]="false" />
352
+ </ngt-grid-material>
353
+ <ng-content />
354
+ </ngt-mesh>
355
+ `,
1830
356
  imports: [NgtArgs],
1831
357
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
1832
358
  }]
1833
359
  }], ctorParameters: function () { return []; }, propDecorators: { gridRef: [{
1834
360
  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.3", ngImport: i0, type: NgtsQuadraticBezierLine, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1926
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.3", 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.3", 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
361
+ }], _cellSize: [{
362
+ type: Input,
363
+ args: [{ alias: 'cellSize' }]
364
+ }], _cellThickness: [{
365
+ type: Input,
366
+ args: [{ alias: 'cellThickness' }]
367
+ }], _cellColor: [{
368
+ type: Input,
369
+ args: [{ alias: 'cellColor' }]
370
+ }], _sectionSize: [{
371
+ type: Input,
372
+ args: [{ alias: 'sectionSize' }]
373
+ }], _sectionThickness: [{
374
+ type: Input,
375
+ args: [{ alias: 'sectionThickness' }]
376
+ }], _sectionColor: [{
377
+ type: Input,
378
+ args: [{ alias: 'sectionColor' }]
379
+ }], _followCamera: [{
380
+ type: Input,
381
+ args: [{ alias: 'followCamera' }]
382
+ }], _infiniteGrid: [{
383
+ type: Input,
384
+ args: [{ alias: 'infiniteGrid' }]
385
+ }], _fadeDistance: [{
386
+ type: Input,
387
+ args: [{ alias: 'fadeDistance' }]
388
+ }], _fadeStrength: [{
389
+ type: Input,
390
+ args: [{ alias: 'fadeStrength' }]
391
+ }], _side: [{
392
+ type: Input,
393
+ args: [{ alias: 'side' }]
394
+ }], _args: [{
395
+ type: Input,
396
+ args: [{ alias: 'args' }]
1980
397
  }] } });
1981
398
 
1982
399
  extend({ Mesh, TextGeometry });
1983
- class NgtsText3D extends NgtSignalStore {
1984
- set font(font) {
1985
- this.set({ font });
1986
- }
1987
- set text(text) {
1988
- this.set({ text });
1989
- }
1990
- set bevelEnabled(bevelEnabled) {
1991
- this.set({ bevelEnabled });
1992
- }
1993
- set bevelOffset(bevelOffset) {
1994
- this.set({ bevelOffset });
1995
- }
1996
- set bevelSize(bevelSize) {
1997
- this.set({ bevelSize });
1998
- }
1999
- set bevelThickness(bevelThickness) {
2000
- this.set({ bevelThickness });
2001
- }
2002
- set curveSegments(curveSegments) {
2003
- this.set({ curveSegments });
2004
- }
2005
- set bevelSegments(bevelSegments) {
2006
- this.set({ bevelSegments });
2007
- }
2008
- set height(height) {
2009
- this.set({ height });
2010
- }
2011
- set size(size) {
2012
- this.set({ size });
2013
- }
2014
- set lineHeight(lineHeight) {
2015
- this.set({ lineHeight });
2016
- }
2017
- set letterSpacing(letterSpacing) {
2018
- this.set({ letterSpacing });
2019
- }
2020
- set smooth(smooth) {
2021
- this.set({ smooth });
2022
- }
400
+ class NgtsText3D {
2023
401
  constructor() {
2024
- super({
402
+ this.inputs = signalStore({
2025
403
  lineHeight: 1,
2026
404
  letterSpacing: 0,
2027
405
  size: 1,
@@ -2034,222 +412,262 @@ class NgtsText3D extends NgtSignalStore {
2034
412
  curveSegments: 8,
2035
413
  });
2036
414
  this.textRef = injectNgtRef();
2037
- this.#fontData = toSignal(toObservable(this.select('font')).pipe(switchMap((font) => {
415
+ this.fontData = toSignal(toObservable(this.inputs.select('font')).pipe(switchMap((font) => {
2038
416
  if (typeof font === 'string')
2039
417
  return fetch(font).then((res) => res.json());
2040
418
  return of(font);
2041
419
  }), 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');
420
+ this.text = this.inputs.select('text');
421
+ this.size = this.inputs.select('size');
422
+ this.height = this.inputs.select('height');
423
+ this.bevelThickness = this.inputs.select('bevelThickness');
424
+ this.bevelSize = this.inputs.select('bevelSize');
425
+ this.bevelEnabled = this.inputs.select('bevelEnabled');
426
+ this.bevelSegments = this.inputs.select('bevelSegments');
427
+ this.bevelOffset = this.inputs.select('bevelOffset');
428
+ this.curveSegments = this.inputs.select('curveSegments');
429
+ this.letterSpacing = this.inputs.select('letterSpacing');
430
+ this.lineHeight = this.inputs.select('lineHeight');
2053
431
  this.geometryArgs = computed(() => {
2054
- const fontData = this.#fontData();
2055
- if (!fontData)
432
+ const fontData = this.fontData();
433
+ if (!fontData || !fontData.data)
2056
434
  return null;
2057
435
  return [
2058
- this.#text(),
436
+ this.text(),
2059
437
  {
2060
438
  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(),
439
+ size: this.size(),
440
+ height: this.height(),
441
+ bevelThickness: this.bevelThickness(),
442
+ bevelSize: this.bevelSize(),
443
+ bevelSegments: this.bevelSegments(),
444
+ bevelEnabled: this.bevelEnabled(),
445
+ bevelOffset: this.bevelOffset(),
446
+ curveSegments: this.curveSegments(),
447
+ letterSpacing: this.letterSpacing(),
448
+ lineHeight: this.lineHeight(),
2071
449
  },
2072
450
  ];
2073
451
  });
2074
452
  }
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.3", ngImport: i0, type: NgtsText3D, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2088
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.3", 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"] }] }); }
453
+ set _font(font) {
454
+ this.inputs.set({ font });
455
+ }
456
+ set _text(text) {
457
+ this.inputs.set({ text });
458
+ }
459
+ set _bevelEnabled(bevelEnabled) {
460
+ this.inputs.set({ bevelEnabled });
461
+ }
462
+ set _bevelOffset(bevelOffset) {
463
+ this.inputs.set({ bevelOffset });
464
+ }
465
+ set _bevelSize(bevelSize) {
466
+ this.inputs.set({ bevelSize });
467
+ }
468
+ set _bevelThickness(bevelThickness) {
469
+ this.inputs.set({ bevelThickness });
470
+ }
471
+ set _curveSegments(curveSegments) {
472
+ this.inputs.set({ curveSegments });
473
+ }
474
+ set _bevelSegments(bevelSegments) {
475
+ this.inputs.set({ bevelSegments });
476
+ }
477
+ set _height(height) {
478
+ this.inputs.set({ height });
479
+ }
480
+ set _size(size) {
481
+ this.inputs.set({ size });
482
+ }
483
+ set _lineHeight(lineHeight) {
484
+ this.inputs.set({ lineHeight });
485
+ }
486
+ set _letterSpacing(letterSpacing) {
487
+ this.inputs.set({ letterSpacing });
488
+ }
489
+ set _smooth(smooth) {
490
+ this.inputs.set({ smooth });
491
+ }
492
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsText3D, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
493
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", 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: `
494
+ <ngt-mesh ngtCompound [ref]="textRef">
495
+ <ngt-text-geometry *args="geometryArgs()" />
496
+ <ng-content />
497
+ </ngt-mesh>
498
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }] }); }
2094
499
  }
2095
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.3", ngImport: i0, type: NgtsText3D, decorators: [{
500
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsText3D, decorators: [{
2096
501
  type: Component,
2097
502
  args: [{
2098
503
  selector: 'ngts-text-3d',
2099
504
  standalone: true,
2100
505
  template: `
2101
- <ngt-mesh ngtCompound [ref]="textRef">
2102
- <ngt-text-geometry *args="geometryArgs()" />
2103
- <ng-content />
2104
- </ngt-mesh>
2105
- `,
506
+ <ngt-mesh ngtCompound [ref]="textRef">
507
+ <ngt-text-geometry *args="geometryArgs()" />
508
+ <ng-content />
509
+ </ngt-mesh>
510
+ `,
2106
511
  imports: [NgtArgs],
2107
512
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
2108
513
  }]
2109
- }], ctorParameters: function () { return []; }, propDecorators: { textRef: [{
514
+ }], propDecorators: { textRef: [{
2110
515
  type: Input
2111
- }], font: [{
516
+ }], _font: [{
2112
517
  type: Input,
2113
- args: [{ required: true }]
2114
- }], text: [{
518
+ args: [{ required: true, alias: 'font' }]
519
+ }], _text: [{
2115
520
  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
521
+ args: [{ required: true, alias: 'text' }]
522
+ }], _bevelEnabled: [{
523
+ type: Input,
524
+ args: [{ alias: 'bevelEnabled' }]
525
+ }], _bevelOffset: [{
526
+ type: Input,
527
+ args: [{ alias: 'bevelOffset' }]
528
+ }], _bevelSize: [{
529
+ type: Input,
530
+ args: [{ alias: 'bevelSize' }]
531
+ }], _bevelThickness: [{
532
+ type: Input,
533
+ args: [{ alias: 'bevelThickness' }]
534
+ }], _curveSegments: [{
535
+ type: Input,
536
+ args: [{ alias: 'curveSegments' }]
537
+ }], _bevelSegments: [{
538
+ type: Input,
539
+ args: [{ alias: 'bevelSegments' }]
540
+ }], _height: [{
541
+ type: Input,
542
+ args: [{ alias: 'height' }]
543
+ }], _size: [{
544
+ type: Input,
545
+ args: [{ alias: 'size' }]
546
+ }], _lineHeight: [{
547
+ type: Input,
548
+ args: [{ alias: 'lineHeight' }]
549
+ }], _letterSpacing: [{
550
+ type: Input,
551
+ args: [{ alias: 'letterSpacing' }]
552
+ }], _smooth: [{
553
+ type: Input,
554
+ args: [{ alias: 'smooth' }]
2139
555
  }] } });
2140
556
 
2141
- class NgtsText extends NgtSignalStore {
557
+ class NgtsText {
2142
558
  set text(text) {
2143
- this.set({ text });
559
+ this.inputs.set({ text });
2144
560
  }
2145
561
  set font(font) {
2146
- this.set({ font });
562
+ this.inputs.set({ font });
2147
563
  }
2148
564
  set fontSize(fontSize) {
2149
- this.set({ fontSize });
565
+ this.inputs.set({ fontSize });
2150
566
  }
2151
567
  set anchorX(anchorX) {
2152
- this.set({ anchorX });
568
+ this.inputs.set({ anchorX });
2153
569
  }
2154
570
  set anchorY(anchorY) {
2155
- this.set({ anchorY });
571
+ this.inputs.set({ anchorY });
2156
572
  }
2157
573
  set sdfGlyphSize(sdfGlyphSize) {
2158
- this.set({ sdfGlyphSize });
574
+ this.inputs.set({ sdfGlyphSize });
2159
575
  }
2160
576
  set characters(characters) {
2161
- this.set({ characters });
577
+ this.inputs.set({ characters });
2162
578
  }
2163
579
  set color(color) {
2164
- this.set({ color });
580
+ this.inputs.set({ color });
2165
581
  }
2166
582
  set maxWidth(maxWidth) {
2167
- this.set({ maxWidth });
583
+ this.inputs.set({ maxWidth });
2168
584
  }
2169
585
  set lineHeight(lineHeight) {
2170
- this.set({ lineHeight });
586
+ this.inputs.set({ lineHeight });
2171
587
  }
2172
588
  set letterSpacing(letterSpacing) {
2173
- this.set({ letterSpacing });
589
+ this.inputs.set({ letterSpacing });
2174
590
  }
2175
591
  set textAlign(textAlign) {
2176
- this.set({ textAlign });
592
+ this.inputs.set({ textAlign });
2177
593
  }
2178
594
  set clipRect(clipRect) {
2179
- this.set({ clipRect });
595
+ this.inputs.set({ clipRect });
2180
596
  }
2181
597
  set depthOffset(depthOffset) {
2182
- this.set({ depthOffset });
598
+ this.inputs.set({ depthOffset });
2183
599
  }
2184
600
  set direction(direction) {
2185
- this.set({ direction });
601
+ this.inputs.set({ direction });
2186
602
  }
2187
603
  set overflowWrap(overflowWrap) {
2188
- this.set({ overflowWrap });
604
+ this.inputs.set({ overflowWrap });
2189
605
  }
2190
606
  set whiteSpace(whiteSpace) {
2191
- this.set({ whiteSpace });
607
+ this.inputs.set({ whiteSpace });
2192
608
  }
2193
609
  set outlineWidth(outlineWidth) {
2194
- this.set({ outlineWidth });
610
+ this.inputs.set({ outlineWidth });
2195
611
  }
2196
612
  set outlineOffsetX(outlineOffsetX) {
2197
- this.set({ outlineOffsetX });
613
+ this.inputs.set({ outlineOffsetX });
2198
614
  }
2199
615
  set outlineOffsetY(outlineOffsetY) {
2200
- this.set({ outlineOffsetY });
616
+ this.inputs.set({ outlineOffsetY });
2201
617
  }
2202
618
  set outlineBlur(outlineBlur) {
2203
- this.set({ outlineBlur });
619
+ this.inputs.set({ outlineBlur });
2204
620
  }
2205
621
  set outlineColor(outlineColor) {
2206
- this.set({ outlineColor });
622
+ this.inputs.set({ outlineColor });
2207
623
  }
2208
624
  set outlineOpacity(outlineOpacity) {
2209
- this.set({ outlineOpacity });
625
+ this.inputs.set({ outlineOpacity });
2210
626
  }
2211
627
  set strokeWidth(strokeWidth) {
2212
- this.set({ strokeWidth });
628
+ this.inputs.set({ strokeWidth });
2213
629
  }
2214
630
  set strokeColor(strokeColor) {
2215
- this.set({ strokeColor });
631
+ this.inputs.set({ strokeColor });
2216
632
  }
2217
633
  set strokeOpacity(strokeOpacity) {
2218
- this.set({ strokeOpacity });
634
+ this.inputs.set({ strokeOpacity });
2219
635
  }
2220
636
  set fillOpacity(fillOpacity) {
2221
- this.set({ fillOpacity });
637
+ this.inputs.set({ fillOpacity });
2222
638
  }
2223
639
  set debugSDF(debugSDF) {
2224
- this.set({ debugSDF });
640
+ this.inputs.set({ debugSDF });
2225
641
  }
2226
- #store;
2227
642
  constructor() {
2228
- super({ fontSize: 1, sdfGlyphSize: 64, anchorX: 'center', anchorY: 'middle' });
643
+ this.inputs = signalStore({
644
+ fontSize: 1,
645
+ sdfGlyphSize: 64,
646
+ anchorX: 'center',
647
+ anchorY: 'middle',
648
+ });
2229
649
  this.textRef = injectNgtRef();
2230
650
  this.sync = new EventEmitter();
2231
651
  this.troikaText = new Text();
2232
- this.#store = inject(NgtStore);
652
+ this.store = injectNgtStore();
2233
653
  inject(DestroyRef).onDestroy(() => {
2234
654
  this.troikaText.dispose();
2235
655
  });
2236
- this.#preloadFont();
2237
- this.#syncText();
656
+ this.preloadFont();
657
+ this.syncText();
2238
658
  }
2239
- #preloadFont() {
2240
- const font = this.select('font');
2241
- const characters = this.select('characters');
2242
- const trigger = computed(() => ({ font: font(), characters: characters() }));
659
+ preloadFont() {
660
+ const _font = this.inputs.select('font');
661
+ const _characters = this.inputs.select('characters');
2243
662
  effect(() => {
2244
- const { font, characters } = trigger();
2245
- const invalidate = this.#store.get('invalidate');
663
+ const [font, characters] = [_font(), _characters()];
664
+ const invalidate = this.store.get('invalidate');
2246
665
  preloadFont({ font, characters }, () => invalidate());
2247
666
  });
2248
667
  }
2249
- #syncText() {
668
+ syncText() {
2250
669
  effect(() => {
2251
- this.state();
2252
- const invalidate = this.#store.get('invalidate');
670
+ const [invalidate] = [this.store.get('invalidate'), this.inputs.state()];
2253
671
  this.troikaText.sync(() => {
2254
672
  invalidate();
2255
673
  if (this.sync.observed) {
@@ -2258,87 +676,87 @@ class NgtsText extends NgtSignalStore {
2258
676
  });
2259
677
  });
2260
678
  }
2261
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.3", ngImport: i0, type: NgtsText, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2262
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.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" }, 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"] }] }); }
679
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsText, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
680
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", 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: `
681
+ <ngt-primitive
682
+ ngtCompound
683
+ *args="[troikaText]"
684
+ [ref]="textRef"
685
+ [text]="inputs.state().text"
686
+ [anchorX]="inputs.state().anchorX"
687
+ [anchorY]="inputs.state().anchorY"
688
+ [font]="inputs.state().font"
689
+ [fontSize]="inputs.state().fontSize"
690
+ [sdfGlyphSize]="inputs.state().sdfGlyphSize"
691
+ [characters]="inputs.state().characters"
692
+ [color]="inputs.state().color"
693
+ [maxWidth]="inputs.state().maxWidth"
694
+ [lineHeight]="inputs.state().lineHeight"
695
+ [letterSpacing]="inputs.state().letterSpacing"
696
+ [textAlign]="inputs.state().textAlign"
697
+ [clipRect]="inputs.state().clipRect"
698
+ [depthOffset]="inputs.state().depthOffset"
699
+ [direction]="inputs.state().direction"
700
+ [overflowWrap]="inputs.state().overflowWrap"
701
+ [whiteSpace]="inputs.state().whiteSpace"
702
+ [outlineWidth]="inputs.state().outlineWidth"
703
+ [outlineOffsetX]="inputs.state().outlineOffsetX"
704
+ [outlineOffsetY]="inputs.state().outlineOffsetY"
705
+ [outlineBlur]="inputs.state().outlineBlur"
706
+ [outlineColor]="inputs.state().outlineColor"
707
+ [outlineOpacity]="inputs.state().outlineOpacity"
708
+ [strokeWidth]="inputs.state().strokeWidth"
709
+ [strokeColor]="inputs.state().strokeColor"
710
+ [strokeOpacity]="inputs.state().strokeOpacity"
711
+ [fillOpacity]="inputs.state().fillOpacity"
712
+ [debugSDF]="inputs.state().debugSDF"
713
+ >
714
+ <ng-content />
715
+ </ngt-primitive>
716
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }] }); }
2299
717
  }
2300
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.3", ngImport: i0, type: NgtsText, decorators: [{
718
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: NgtsText, decorators: [{
2301
719
  type: Component,
2302
720
  args: [{
2303
721
  selector: 'ngts-text',
2304
722
  standalone: true,
2305
723
  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
- `,
724
+ <ngt-primitive
725
+ ngtCompound
726
+ *args="[troikaText]"
727
+ [ref]="textRef"
728
+ [text]="inputs.state().text"
729
+ [anchorX]="inputs.state().anchorX"
730
+ [anchorY]="inputs.state().anchorY"
731
+ [font]="inputs.state().font"
732
+ [fontSize]="inputs.state().fontSize"
733
+ [sdfGlyphSize]="inputs.state().sdfGlyphSize"
734
+ [characters]="inputs.state().characters"
735
+ [color]="inputs.state().color"
736
+ [maxWidth]="inputs.state().maxWidth"
737
+ [lineHeight]="inputs.state().lineHeight"
738
+ [letterSpacing]="inputs.state().letterSpacing"
739
+ [textAlign]="inputs.state().textAlign"
740
+ [clipRect]="inputs.state().clipRect"
741
+ [depthOffset]="inputs.state().depthOffset"
742
+ [direction]="inputs.state().direction"
743
+ [overflowWrap]="inputs.state().overflowWrap"
744
+ [whiteSpace]="inputs.state().whiteSpace"
745
+ [outlineWidth]="inputs.state().outlineWidth"
746
+ [outlineOffsetX]="inputs.state().outlineOffsetX"
747
+ [outlineOffsetY]="inputs.state().outlineOffsetY"
748
+ [outlineBlur]="inputs.state().outlineBlur"
749
+ [outlineColor]="inputs.state().outlineColor"
750
+ [outlineOpacity]="inputs.state().outlineOpacity"
751
+ [strokeWidth]="inputs.state().strokeWidth"
752
+ [strokeColor]="inputs.state().strokeColor"
753
+ [strokeOpacity]="inputs.state().strokeOpacity"
754
+ [fillOpacity]="inputs.state().fillOpacity"
755
+ [debugSDF]="inputs.state().debugSDF"
756
+ >
757
+ <ng-content />
758
+ </ngt-primitive>
759
+ `,
2342
760
  imports: [NgtArgs],
2343
761
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
2344
762
  }]
@@ -2409,5 +827,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.3", ngImpor
2409
827
  * Generated bundle index. Do not edit.
2410
828
  */
2411
829
 
2412
- export { NGTS_GIZMO_HELPER_API, NgtsBillboard, NgtsCatmullRomLine, NgtsCubicBezierLine, NgtsEdges, NgtsGizmoHelper, NgtsGizmoHelperContent, NgtsGizmoViewcube, NgtsGizmoViewport, NgtsGrid, NgtsLine, NgtsQuadraticBezierLine, NgtsText, NgtsText3D };
830
+ export { NgtsBillboard, NgtsDetailed, NgtsEdges, NgtsGrid, NgtsText, NgtsText3D };
2413
831
  //# sourceMappingURL=angular-three-soba-abstractions.mjs.map