angular-three-soba 1.14.1 → 2.0.0-beta.10

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