angular-three-soba 2.0.0-beta.3 → 2.0.0-beta.30

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