angular-three-soba 1.13.0 → 2.0.0-beta.2

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 (428) hide show
  1. package/README.md +2 -2
  2. package/abstractions/billboard/billboard.d.ts +24 -0
  3. package/abstractions/catmull-rom-line/catmull-rom-line.d.ts +25 -0
  4. package/abstractions/cubic-bezier-line/cubic-bezier-line.d.ts +25 -0
  5. package/abstractions/edges/edges.d.ts +22 -0
  6. package/abstractions/gizmo-helper/gizmo-helper.d.ts +34 -0
  7. package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.d.ts +22 -0
  8. package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.d.ts +30 -0
  9. package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.d.ts +32 -0
  10. package/abstractions/{lib/gizmo-helper → gizmo-helper}/gizmo-viewcube/gizmo-viewcube.d.ts +2 -3
  11. package/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.d.ts +47 -0
  12. package/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport.d.ts +40 -0
  13. package/abstractions/index.d.ts +11 -11
  14. package/abstractions/line/line-input.d.ts +42 -0
  15. package/abstractions/line/line.d.ts +35 -0
  16. package/abstractions/quadratic-bezier-line/quadratic-bezier-line.d.ts +23 -0
  17. package/abstractions/text/text.d.ts +77 -0
  18. package/abstractions/text-3d/text-3d.d.ts +74 -0
  19. package/cameras/{lib/camera → camera}/camera-content.d.ts +2 -2
  20. package/cameras/camera/camera.d.ts +23 -0
  21. package/cameras/cube-camera/cube-camera.d.ts +42 -0
  22. package/cameras/index.d.ts +5 -4
  23. package/cameras/orthographic-camera/orthographic-camera.d.ts +26 -0
  24. package/controls/index.d.ts +1 -1
  25. package/controls/orbit-controls/orbit-controls.d.ts +35 -0
  26. package/esm2022/abstractions/angular-three-soba-abstractions.mjs +5 -0
  27. package/esm2022/abstractions/billboard/billboard.mjs +71 -0
  28. package/esm2022/abstractions/catmull-rom-line/catmull-rom-line.mjs +131 -0
  29. package/esm2022/abstractions/cubic-bezier-line/cubic-bezier-line.mjs +113 -0
  30. package/esm2022/abstractions/edges/edges.mjs +93 -0
  31. package/esm2022/abstractions/gizmo-helper/gizmo-helper.mjs +210 -0
  32. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/constants.mjs +31 -0
  33. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.mjs +95 -0
  34. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.mjs +155 -0
  35. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.mjs +62 -0
  36. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube.mjs +80 -0
  37. package/esm2022/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.mjs +206 -0
  38. package/esm2022/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport.mjs +273 -0
  39. package/esm2022/abstractions/index.mjs +12 -0
  40. package/esm2022/abstractions/line/line-input.mjs +113 -0
  41. package/esm2022/abstractions/line/line.mjs +165 -0
  42. package/esm2022/abstractions/quadratic-bezier-line/quadratic-bezier-line.mjs +128 -0
  43. package/esm2022/abstractions/text/text.mjs +275 -0
  44. package/esm2022/abstractions/text-3d/text-3d.mjs +167 -0
  45. package/esm2022/angular-three-soba.mjs +5 -0
  46. package/esm2022/cameras/angular-three-soba-cameras.mjs +5 -0
  47. package/esm2022/cameras/camera/camera-content.mjs +21 -0
  48. package/esm2022/cameras/camera/camera.mjs +71 -0
  49. package/esm2022/cameras/cube-camera/cube-camera.mjs +131 -0
  50. package/esm2022/cameras/index.mjs +6 -0
  51. package/esm2022/cameras/orthographic-camera/orthographic-camera.mjs +99 -0
  52. package/esm2022/cameras/perspective-camera/perspective-camera.mjs +47 -0
  53. package/esm2022/controls/angular-three-soba-controls.mjs +5 -0
  54. package/esm2022/controls/index.mjs +2 -0
  55. package/esm2022/controls/orbit-controls/orbit-controls.mjs +165 -0
  56. package/esm2022/index.mjs +2 -0
  57. package/esm2022/loaders/angular-three-soba-loaders.mjs +5 -0
  58. package/esm2022/loaders/gltf-loader/gltf-loader.mjs +33 -0
  59. package/esm2022/loaders/index.mjs +5 -0
  60. package/esm2022/loaders/loader/loader.mjs +133 -0
  61. package/esm2022/loaders/progress/progress.mjs +52 -0
  62. package/esm2022/loaders/texture-loader/texture-loader.mjs +28 -0
  63. package/esm2022/materials/angular-three-soba-materials.mjs +5 -0
  64. package/esm2022/materials/index.mjs +6 -0
  65. package/esm2022/materials/mesh-distort-material/mesh-distort-material.mjs +73 -0
  66. package/esm2022/materials/mesh-reflector-material/mesh-reflector-material.mjs +383 -0
  67. package/esm2022/materials/mesh-refraction-material/mesh-refraction-material.mjs +168 -0
  68. package/esm2022/materials/mesh-transmission-material/mesh-transmission-material.mjs +257 -0
  69. package/esm2022/materials/mesh-wobble-material/mesh-wobble-material.mjs +66 -0
  70. package/esm2022/misc/angular-three-soba-misc.mjs +5 -0
  71. package/esm2022/misc/animations/animations.mjs +55 -0
  72. package/esm2022/misc/bake-shadows/bake-shadows.mjs +24 -0
  73. package/esm2022/misc/depth-buffer/depth-buffer.mjs +46 -0
  74. package/esm2022/misc/fbo/fbo.mjs +47 -0
  75. package/esm2022/misc/index.mjs +5 -0
  76. package/esm2022/performance/adaptive/adaptive-dpr.mjs +46 -0
  77. package/esm2022/performance/adaptive/adaptive-events.mjs +31 -0
  78. package/esm2022/performance/angular-three-soba-performance.mjs +5 -0
  79. package/esm2022/performance/detailed/detailed.mjs +61 -0
  80. package/esm2022/performance/index.mjs +7 -0
  81. package/esm2022/performance/instances/instance.mjs +48 -0
  82. package/esm2022/performance/instances/instances.mjs +189 -0
  83. package/esm2022/performance/instances/position-mesh.mjs +52 -0
  84. package/esm2022/performance/stats/stats.mjs +79 -0
  85. package/esm2022/shaders/angular-three-soba-shaders.mjs +5 -0
  86. package/esm2022/shaders/blur-pass/blur-pass.mjs +61 -0
  87. package/esm2022/shaders/caustics-material/caustics-material.mjs +128 -0
  88. package/esm2022/shaders/caustics-material/caustics-projection-material.mjs +33 -0
  89. package/esm2022/shaders/convolution-material/convolution-material.mjs +94 -0
  90. package/esm2022/shaders/discard-material/discard-material.mjs +3 -0
  91. package/esm2022/shaders/index.mjs +15 -0
  92. package/esm2022/shaders/mesh-distort-material/mesh-distort-material.mjs +55 -0
  93. package/esm2022/shaders/mesh-reflector-material/mesh-reflector-material.mjs +223 -0
  94. package/esm2022/shaders/mesh-refraction-material/mesh-refraction-material.mjs +170 -0
  95. package/esm2022/shaders/mesh-transmission-material/mesh-transmission-material.mjs +268 -0
  96. package/esm2022/shaders/mesh-wobble-material/mesh-wobble-material.mjs +37 -0
  97. package/esm2022/shaders/shader-material/shader-material.mjs +34 -0
  98. package/esm2022/shaders/soft-shadow-material/soft-shadow-material.mjs +33 -0
  99. package/esm2022/shaders/sparkles-material/sparkles-material.mjs +47 -0
  100. package/esm2022/shaders/spot-light-material/spot-light-material.mjs +86 -0
  101. package/esm2022/shaders/star-field-material/star-field-material.mjs +32 -0
  102. package/esm2022/staging/accumulative-shadows/accumulative-shadows.mjs +283 -0
  103. package/esm2022/staging/accumulative-shadows/progressive-light-map.mjs +108 -0
  104. package/esm2022/staging/accumulative-shadows/randomized-lights.mjs +208 -0
  105. package/esm2022/staging/angular-three-soba-staging.mjs +5 -0
  106. package/esm2022/staging/bounds/bounds.mjs +307 -0
  107. package/esm2022/staging/camera-shake/camera-shake.mjs +117 -0
  108. package/esm2022/staging/caustics/caustisc.mjs +384 -0
  109. package/esm2022/staging/center/center.mjs +148 -0
  110. package/esm2022/staging/cloud/cloud.mjs +164 -0
  111. package/esm2022/staging/contact-shadows/contact-shadows.mjs +249 -0
  112. package/esm2022/staging/environment/assets.mjs +13 -0
  113. package/esm2022/staging/environment/environment-cube.mjs +49 -0
  114. package/esm2022/staging/environment/environment-ground.mjs +43 -0
  115. package/esm2022/staging/environment/environment-input.mjs +106 -0
  116. package/esm2022/staging/environment/environment-map.mjs +53 -0
  117. package/esm2022/staging/environment/environment-portal.mjs +135 -0
  118. package/esm2022/staging/environment/environment.mjs +78 -0
  119. package/esm2022/staging/environment/utils.mjs +84 -0
  120. package/esm2022/staging/float/float.mjs +82 -0
  121. package/esm2022/staging/index.mjs +18 -0
  122. package/esm2022/staging/sky/sky.mjs +114 -0
  123. package/esm2022/staging/sparkles/sparkles.mjs +161 -0
  124. package/esm2022/staging/spot-light/spot-light-input.mjs +75 -0
  125. package/esm2022/staging/spot-light/spot-light-shadow-mesh-input.mjs +57 -0
  126. package/esm2022/staging/spot-light/spot-light-shadow-mesh.mjs +256 -0
  127. package/esm2022/staging/spot-light/spot-light.mjs +94 -0
  128. package/esm2022/staging/spot-light/volumetric-mesh.mjs +101 -0
  129. package/esm2022/staging/stage/stage.mjs +374 -0
  130. package/esm2022/staging/stars/stars.mjs +148 -0
  131. package/fesm2022/angular-three-soba-abstractions.mjs +2271 -0
  132. package/fesm2022/angular-three-soba-abstractions.mjs.map +1 -0
  133. package/{fesm2015 → fesm2022}/angular-three-soba-cameras.mjs +141 -137
  134. package/fesm2022/angular-three-soba-cameras.mjs.map +1 -0
  135. package/fesm2022/angular-three-soba-controls.mjs +171 -0
  136. package/fesm2022/angular-three-soba-controls.mjs.map +1 -0
  137. package/fesm2022/angular-three-soba-loaders.mjs +244 -0
  138. package/fesm2022/angular-three-soba-loaders.mjs.map +1 -0
  139. package/{fesm2020 → fesm2022}/angular-three-soba-materials.mjs +363 -281
  140. package/fesm2022/angular-three-soba-materials.mjs.map +1 -0
  141. package/fesm2022/angular-three-soba-misc.mjs +169 -0
  142. package/fesm2022/angular-three-soba-misc.mjs.map +1 -0
  143. package/fesm2022/angular-three-soba-performance.mjs +487 -0
  144. package/fesm2022/angular-three-soba-performance.mjs.map +1 -0
  145. package/{fesm2020 → fesm2022}/angular-three-soba-shaders.mjs +58 -10
  146. package/fesm2022/angular-three-soba-shaders.mjs.map +1 -0
  147. package/fesm2022/angular-three-soba-staging.mjs +3826 -0
  148. package/fesm2022/angular-three-soba-staging.mjs.map +1 -0
  149. package/fesm2022/angular-three-soba.mjs.map +1 -0
  150. package/loaders/gltf-loader/gltf-loader.d.ts +9 -0
  151. package/loaders/index.d.ts +4 -5
  152. package/loaders/loader/loader.d.ts +31 -0
  153. package/loaders/progress/progress.d.ts +9 -0
  154. package/loaders/texture-loader/texture-loader.d.ts +7 -0
  155. package/materials/index.d.ts +5 -5
  156. package/materials/mesh-distort-material/mesh-distort-material.d.ts +30 -0
  157. package/materials/mesh-reflector-material/mesh-reflector-material.d.ts +81 -0
  158. package/materials/mesh-refraction-material/mesh-refraction-material.d.ts +50 -0
  159. package/materials/mesh-transmission-material/mesh-transmission-material.d.ts +91 -0
  160. package/materials/mesh-wobble-material/mesh-wobble-material.d.ts +20 -0
  161. package/misc/animations/animations.d.ts +13 -0
  162. package/misc/{lib/bake-shadows → bake-shadows}/bake-shadows.d.ts +2 -5
  163. package/misc/depth-buffer/depth-buffer.d.ts +9 -0
  164. package/misc/{lib/fbo → fbo}/fbo.d.ts +4 -2
  165. package/misc/index.d.ts +4 -4
  166. package/package.json +45 -68
  167. package/performance/adaptive/adaptive-dpr.d.ts +8 -0
  168. package/performance/{lib/adaptive → adaptive}/adaptive-events.d.ts +2 -6
  169. package/performance/detailed/detailed.d.ts +20 -0
  170. package/performance/index.d.ts +6 -4
  171. package/performance/instances/instance.d.ts +9 -0
  172. package/performance/instances/instances.d.ts +35 -0
  173. package/performance/instances/position-mesh.d.ts +10 -0
  174. package/performance/stats/stats.d.ts +18 -0
  175. package/plugin/package.json +1 -1
  176. package/plugin/src/generators/init/compat.js +1 -1
  177. package/plugin/src/generators/init/compat.js.map +1 -1
  178. package/plugin/src/generators/init/init.d.ts +2 -2
  179. package/plugin/src/generators/init/init.js +2 -2
  180. package/plugin/src/generators/init/init.js.map +1 -1
  181. package/plugin/src/index.js.map +1 -1
  182. package/shaders/{lib/blur-pass → blur-pass}/blur-pass.d.ts +2 -2
  183. package/shaders/index.d.ts +14 -14
  184. package/shaders/{lib/mesh-distort-material → mesh-distort-material}/mesh-distort-material.d.ts +1 -1
  185. package/shaders/{lib/mesh-wobble-material → mesh-wobble-material}/mesh-wobble-material.d.ts +1 -0
  186. package/shaders/{lib/soft-shadow-material → soft-shadow-material}/soft-shadow-material.d.ts +2 -2
  187. package/shaders/sparkles-material/sparkles-material.d.ts +3 -0
  188. package/staging/accumulative-shadows/accumulative-shadows.d.ts +96 -0
  189. package/staging/{lib/accumulative-shadows → accumulative-shadows}/progressive-light-map.d.ts +2 -2
  190. package/staging/accumulative-shadows/randomized-lights.d.ts +77 -0
  191. package/staging/bounds/bounds.d.ts +58 -0
  192. package/staging/camera-shake/camera-shake.d.ts +32 -0
  193. package/staging/caustics/caustisc.d.ts +70 -0
  194. package/staging/center/center.d.ts +62 -0
  195. package/staging/cloud/cloud.d.ts +48 -0
  196. package/staging/contact-shadows/contact-shadows.d.ts +57 -0
  197. package/staging/environment/environment-cube.d.ts +11 -0
  198. package/staging/environment/environment-ground.d.ts +13 -0
  199. package/staging/environment/environment-input.d.ts +68 -0
  200. package/staging/environment/environment-map.d.ts +11 -0
  201. package/staging/{lib/environment → environment}/environment-portal.d.ts +5 -7
  202. package/staging/{lib/environment → environment}/environment.d.ts +2 -2
  203. package/staging/environment/utils.d.ts +7 -0
  204. package/staging/float/float.d.ts +27 -0
  205. package/staging/index.d.ts +17 -17
  206. package/staging/sky/sky.d.ts +41 -0
  207. package/staging/sparkles/sparkles.d.ts +49 -0
  208. package/staging/spot-light/spot-light-input.d.ts +38 -0
  209. package/staging/spot-light/spot-light-shadow-mesh-input.d.ts +29 -0
  210. package/staging/spot-light/spot-light-shadow-mesh.d.ts +38 -0
  211. package/staging/{lib/spot-light → spot-light}/spot-light.d.ts +12 -6
  212. package/staging/{lib/spot-light → spot-light}/volumetric-mesh.d.ts +7 -4
  213. package/staging/{lib/stage → stage}/stage.d.ts +35 -16
  214. package/staging/stars/stars.d.ts +34 -0
  215. package/abstractions/lib/billboard/billboard.d.ts +0 -14
  216. package/abstractions/lib/catmull-rom-line/catmull-rom-line.d.ts +0 -15
  217. package/abstractions/lib/cubic-bezier-line/cubic-bezier-line.d.ts +0 -15
  218. package/abstractions/lib/edges/edges.d.ts +0 -18
  219. package/abstractions/lib/gizmo-helper/gizmo-helper.d.ts +0 -41
  220. package/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.d.ts +0 -16
  221. package/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.d.ts +0 -24
  222. package/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.d.ts +0 -14
  223. package/abstractions/lib/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.d.ts +0 -28
  224. package/abstractions/lib/gizmo-helper/gizmo-viewport/gizmo-viewport.d.ts +0 -21
  225. package/abstractions/lib/line/line-input.d.ts +0 -19
  226. package/abstractions/lib/line/line.d.ts +0 -21
  227. package/abstractions/lib/quadratic-bezier-line/quadratic-bezier-line.d.ts +0 -19
  228. package/abstractions/lib/text/text.d.ts +0 -21
  229. package/abstractions/lib/text-3d/text-3d.d.ts +0 -39
  230. package/assets/default-spot-light-shadow.glsl +0 -10
  231. package/cameras/lib/camera/camera.d.ts +0 -19
  232. package/cameras/lib/cube-camera/cube-camera.d.ts +0 -27
  233. package/cameras/lib/orthographic-camera/orthographic-camera.d.ts +0 -17
  234. package/controls/lib/orbit-controls/orbit-controls.d.ts +0 -27
  235. package/esm2020/abstractions/angular-three-soba-abstractions.mjs +0 -5
  236. package/esm2020/abstractions/index.mjs +0 -12
  237. package/esm2020/abstractions/lib/billboard/billboard.mjs +0 -73
  238. package/esm2020/abstractions/lib/catmull-rom-line/catmull-rom-line.mjs +0 -119
  239. package/esm2020/abstractions/lib/cubic-bezier-line/cubic-bezier-line.mjs +0 -98
  240. package/esm2020/abstractions/lib/edges/edges.mjs +0 -95
  241. package/esm2020/abstractions/lib/gizmo-helper/gizmo-helper.mjs +0 -211
  242. package/esm2020/abstractions/lib/gizmo-helper/gizmo-viewcube/constants.mjs +0 -31
  243. package/esm2020/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.mjs +0 -91
  244. package/esm2020/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.mjs +0 -182
  245. package/esm2020/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.mjs +0 -45
  246. package/esm2020/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube.mjs +0 -133
  247. package/esm2020/abstractions/lib/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.mjs +0 -193
  248. package/esm2020/abstractions/lib/gizmo-helper/gizmo-viewport/gizmo-viewport.mjs +0 -266
  249. package/esm2020/abstractions/lib/line/line-input.mjs +0 -75
  250. package/esm2020/abstractions/lib/line/line.mjs +0 -132
  251. package/esm2020/abstractions/lib/quadratic-bezier-line/quadratic-bezier-line.mjs +0 -127
  252. package/esm2020/abstractions/lib/text/text.mjs +0 -114
  253. package/esm2020/abstractions/lib/text-3d/text-3d.mjs +0 -144
  254. package/esm2020/angular-three-soba.mjs +0 -5
  255. package/esm2020/cameras/angular-three-soba-cameras.mjs +0 -5
  256. package/esm2020/cameras/index.mjs +0 -5
  257. package/esm2020/cameras/lib/camera/camera-content.mjs +0 -20
  258. package/esm2020/cameras/lib/camera/camera.mjs +0 -74
  259. package/esm2020/cameras/lib/cube-camera/cube-camera.mjs +0 -130
  260. package/esm2020/cameras/lib/orthographic-camera/orthographic-camera.mjs +0 -92
  261. package/esm2020/cameras/lib/perspective-camera/perspective-camera.mjs +0 -46
  262. package/esm2020/controls/angular-three-soba-controls.mjs +0 -5
  263. package/esm2020/controls/index.mjs +0 -2
  264. package/esm2020/controls/lib/orbit-controls/orbit-controls.mjs +0 -146
  265. package/esm2020/index.mjs +0 -2
  266. package/esm2020/loaders/angular-three-soba-loaders.mjs +0 -5
  267. package/esm2020/loaders/index.mjs +0 -6
  268. package/esm2020/loaders/lib/cube-texture-loader/cube-texture-loader.mjs +0 -10
  269. package/esm2020/loaders/lib/gltf-loader/gltf-loader.mjs +0 -32
  270. package/esm2020/loaders/lib/loader/loader.mjs +0 -133
  271. package/esm2020/loaders/lib/progress/progress.mjs +0 -39
  272. package/esm2020/loaders/lib/texture-loader/texture-loader.mjs +0 -19
  273. package/esm2020/materials/angular-three-soba-materials.mjs +0 -5
  274. package/esm2020/materials/index.mjs +0 -6
  275. package/esm2020/materials/lib/mesh-distort-material/mesh-distort-material.mjs +0 -74
  276. package/esm2020/materials/lib/mesh-reflector-material/mesh-reflector-material.mjs +0 -327
  277. package/esm2020/materials/lib/mesh-refraction-material/mesh-refraction-material.mjs +0 -157
  278. package/esm2020/materials/lib/mesh-transmission-material/mesh-transmission-material.mjs +0 -237
  279. package/esm2020/materials/lib/mesh-wobble-material/mesh-wobble-material.mjs +0 -67
  280. package/esm2020/misc/angular-three-soba-misc.mjs +0 -5
  281. package/esm2020/misc/index.mjs +0 -5
  282. package/esm2020/misc/lib/animations/animations.mjs +0 -52
  283. package/esm2020/misc/lib/bake-shadows/bake-shadows.mjs +0 -25
  284. package/esm2020/misc/lib/depth-buffer/depth-buffer.mjs +0 -39
  285. package/esm2020/misc/lib/fbo/fbo.mjs +0 -39
  286. package/esm2020/performance/angular-three-soba-performance.mjs +0 -5
  287. package/esm2020/performance/index.mjs +0 -5
  288. package/esm2020/performance/lib/adaptive/adaptive-dpr.mjs +0 -46
  289. package/esm2020/performance/lib/adaptive/adaptive-events.mjs +0 -36
  290. package/esm2020/performance/lib/detailed/detailed.mjs +0 -53
  291. package/esm2020/performance/lib/stats/stats.mjs +0 -79
  292. package/esm2020/shaders/angular-three-soba-shaders.mjs +0 -5
  293. package/esm2020/shaders/index.mjs +0 -15
  294. package/esm2020/shaders/lib/blur-pass/blur-pass.mjs +0 -61
  295. package/esm2020/shaders/lib/caustics-material/caustics-material.mjs +0 -128
  296. package/esm2020/shaders/lib/caustics-projection-material/caustics-projection-material.mjs +0 -33
  297. package/esm2020/shaders/lib/convolution-material/convolution-material.mjs +0 -94
  298. package/esm2020/shaders/lib/discard-material/discard-material.mjs +0 -3
  299. package/esm2020/shaders/lib/mesh-distort-material/mesh-distort-material.mjs +0 -55
  300. package/esm2020/shaders/lib/mesh-reflector-material/mesh-reflector-material.mjs +0 -223
  301. package/esm2020/shaders/lib/mesh-refraction-material/mesh-refraction-material.mjs +0 -169
  302. package/esm2020/shaders/lib/mesh-transmission-material/mesh-transmission-material.mjs +0 -268
  303. package/esm2020/shaders/lib/mesh-wobble-material/mesh-wobble-material.mjs +0 -37
  304. package/esm2020/shaders/lib/shader-material/shader-material.mjs +0 -34
  305. package/esm2020/shaders/lib/soft-shadow-material/soft-shadow-material.mjs +0 -33
  306. package/esm2020/shaders/lib/spot-light-material/spot-light-material.mjs +0 -86
  307. package/esm2020/shaders/lib/star-field-material/star-field-material.mjs +0 -32
  308. package/esm2020/staging/angular-three-soba-staging.mjs +0 -5
  309. package/esm2020/staging/index.mjs +0 -18
  310. package/esm2020/staging/lib/accumulative-shadows/accumulative-shadows.mjs +0 -247
  311. package/esm2020/staging/lib/accumulative-shadows/progressive-light-map.mjs +0 -108
  312. package/esm2020/staging/lib/accumulative-shadows/randomized-lights.mjs +0 -199
  313. package/esm2020/staging/lib/bounds/bounds.mjs +0 -283
  314. package/esm2020/staging/lib/camera-shake/camera-shake.mjs +0 -121
  315. package/esm2020/staging/lib/caustics/caustics.mjs +0 -363
  316. package/esm2020/staging/lib/center/center.mjs +0 -142
  317. package/esm2020/staging/lib/cloud/cloud.mjs +0 -159
  318. package/esm2020/staging/lib/contact-shadows/contact-shadows.mjs +0 -227
  319. package/esm2020/staging/lib/environment/assets.mjs +0 -13
  320. package/esm2020/staging/lib/environment/environment-cube.mjs +0 -40
  321. package/esm2020/staging/lib/environment/environment-ground.mjs +0 -66
  322. package/esm2020/staging/lib/environment/environment-inputs.mjs +0 -86
  323. package/esm2020/staging/lib/environment/environment-map.mjs +0 -38
  324. package/esm2020/staging/lib/environment/environment-portal.mjs +0 -110
  325. package/esm2020/staging/lib/environment/environment.mjs +0 -163
  326. package/esm2020/staging/lib/environment/utils.mjs +0 -70
  327. package/esm2020/staging/lib/float/float.mjs +0 -76
  328. package/esm2020/staging/lib/sky/sky.mjs +0 -108
  329. package/esm2020/staging/lib/sparkles/sparkles.mjs +0 -209
  330. package/esm2020/staging/lib/spot-light/common.mjs +0 -42
  331. package/esm2020/staging/lib/spot-light/shadow-mesh-input.mjs +0 -50
  332. package/esm2020/staging/lib/spot-light/spot-light-input.mjs +0 -61
  333. package/esm2020/staging/lib/spot-light/spot-light-shadow-no-shader.mjs +0 -73
  334. package/esm2020/staging/lib/spot-light/spot-light-shadow-shader.mjs +0 -125
  335. package/esm2020/staging/lib/spot-light/spot-light-shadow.mjs +0 -62
  336. package/esm2020/staging/lib/spot-light/spot-light.mjs +0 -116
  337. package/esm2020/staging/lib/spot-light/volumetric-mesh.mjs +0 -85
  338. package/esm2020/staging/lib/stage/stage.mjs +0 -366
  339. package/esm2020/staging/lib/stars/stars.mjs +0 -139
  340. package/fesm2015/angular-three-soba-abstractions.mjs +0 -2048
  341. package/fesm2015/angular-three-soba-abstractions.mjs.map +0 -1
  342. package/fesm2015/angular-three-soba-cameras.mjs.map +0 -1
  343. package/fesm2015/angular-three-soba-controls.mjs +0 -153
  344. package/fesm2015/angular-three-soba-controls.mjs.map +0 -1
  345. package/fesm2015/angular-three-soba-loaders.mjs +0 -229
  346. package/fesm2015/angular-three-soba-loaders.mjs.map +0 -1
  347. package/fesm2015/angular-three-soba-materials.mjs +0 -851
  348. package/fesm2015/angular-three-soba-materials.mjs.map +0 -1
  349. package/fesm2015/angular-three-soba-misc.mjs +0 -148
  350. package/fesm2015/angular-three-soba-misc.mjs.map +0 -1
  351. package/fesm2015/angular-three-soba-performance.mjs +0 -210
  352. package/fesm2015/angular-three-soba-performance.mjs.map +0 -1
  353. package/fesm2015/angular-three-soba-shaders.mjs +0 -1239
  354. package/fesm2015/angular-three-soba-shaders.mjs.map +0 -1
  355. package/fesm2015/angular-three-soba-staging.mjs +0 -3772
  356. package/fesm2015/angular-three-soba-staging.mjs.map +0 -1
  357. package/fesm2015/angular-three-soba.mjs.map +0 -1
  358. package/fesm2020/angular-three-soba-abstractions.mjs +0 -2045
  359. package/fesm2020/angular-three-soba-abstractions.mjs.map +0 -1
  360. package/fesm2020/angular-three-soba-cameras.mjs +0 -347
  361. package/fesm2020/angular-three-soba-cameras.mjs.map +0 -1
  362. package/fesm2020/angular-three-soba-controls.mjs +0 -153
  363. package/fesm2020/angular-three-soba-controls.mjs.map +0 -1
  364. package/fesm2020/angular-three-soba-loaders.mjs +0 -228
  365. package/fesm2020/angular-three-soba-loaders.mjs.map +0 -1
  366. package/fesm2020/angular-three-soba-materials.mjs.map +0 -1
  367. package/fesm2020/angular-three-soba-misc.mjs +0 -152
  368. package/fesm2020/angular-three-soba-misc.mjs.map +0 -1
  369. package/fesm2020/angular-three-soba-performance.mjs +0 -210
  370. package/fesm2020/angular-three-soba-performance.mjs.map +0 -1
  371. package/fesm2020/angular-three-soba-shaders.mjs.map +0 -1
  372. package/fesm2020/angular-three-soba-staging.mjs +0 -3778
  373. package/fesm2020/angular-three-soba-staging.mjs.map +0 -1
  374. package/fesm2020/angular-three-soba.mjs +0 -6
  375. package/fesm2020/angular-three-soba.mjs.map +0 -1
  376. package/loaders/lib/cube-texture-loader/cube-texture-loader.d.ts +0 -3
  377. package/loaders/lib/gltf-loader/gltf-loader.d.ts +0 -8
  378. package/loaders/lib/loader/loader.d.ts +0 -26
  379. package/loaders/lib/progress/progress.d.ts +0 -16
  380. package/loaders/lib/texture-loader/texture-loader.d.ts +0 -5
  381. package/materials/lib/mesh-distort-material/mesh-distort-material.d.ts +0 -24
  382. package/materials/lib/mesh-reflector-material/mesh-reflector-material.d.ts +0 -41
  383. package/materials/lib/mesh-refraction-material/mesh-refraction-material.d.ts +0 -28
  384. package/materials/lib/mesh-transmission-material/mesh-transmission-material.d.ts +0 -46
  385. package/materials/lib/mesh-wobble-material/mesh-wobble-material.d.ts +0 -14
  386. package/misc/lib/animations/animations.d.ts +0 -13
  387. package/misc/lib/depth-buffer/depth-buffer.d.ts +0 -7
  388. package/performance/lib/adaptive/adaptive-dpr.d.ts +0 -11
  389. package/performance/lib/detailed/detailed.d.ts +0 -13
  390. package/performance/lib/stats/stats.d.ts +0 -15
  391. package/staging/lib/accumulative-shadows/accumulative-shadows.d.ts +0 -58
  392. package/staging/lib/accumulative-shadows/randomized-lights.d.ts +0 -42
  393. package/staging/lib/bounds/bounds.d.ts +0 -48
  394. package/staging/lib/camera-shake/camera-shake.d.ts +0 -28
  395. package/staging/lib/caustics/caustics.d.ts +0 -47
  396. package/staging/lib/center/center.d.ts +0 -40
  397. package/staging/lib/cloud/cloud.d.ts +0 -23
  398. package/staging/lib/contact-shadows/contact-shadows.d.ts +0 -29
  399. package/staging/lib/environment/environment-cube.d.ts +0 -11
  400. package/staging/lib/environment/environment-ground.d.ts +0 -9
  401. package/staging/lib/environment/environment-inputs.d.ts +0 -28
  402. package/staging/lib/environment/environment-map.d.ts +0 -10
  403. package/staging/lib/environment/utils.d.ts +0 -8
  404. package/staging/lib/float/float.d.ts +0 -16
  405. package/staging/lib/sky/sky.d.ts +0 -20
  406. package/staging/lib/sparkles/sparkles.d.ts +0 -29
  407. package/staging/lib/spot-light/common.d.ts +0 -3
  408. package/staging/lib/spot-light/shadow-mesh-input.d.ts +0 -14
  409. package/staging/lib/spot-light/spot-light-input.d.ts +0 -16
  410. package/staging/lib/spot-light/spot-light-shadow-no-shader.d.ts +0 -14
  411. package/staging/lib/spot-light/spot-light-shadow-shader.d.ts +0 -25
  412. package/staging/lib/spot-light/spot-light-shadow.d.ts +0 -6
  413. package/staging/lib/stars/stars.d.ts +0 -20
  414. /package/abstractions/{lib/gizmo-helper → gizmo-helper}/gizmo-viewcube/constants.d.ts +0 -0
  415. /package/cameras/{lib/perspective-camera → perspective-camera}/perspective-camera.d.ts +0 -0
  416. /package/{fesm2015 → fesm2022}/angular-three-soba.mjs +0 -0
  417. /package/plugin/{README.md → libs/plugin/README.md} +0 -0
  418. /package/shaders/{lib/caustics-material → caustics-material}/caustics-material.d.ts +0 -0
  419. /package/shaders/{lib/caustics-projection-material → caustics-material}/caustics-projection-material.d.ts +0 -0
  420. /package/shaders/{lib/convolution-material → convolution-material}/convolution-material.d.ts +0 -0
  421. /package/shaders/{lib/discard-material → discard-material}/discard-material.d.ts +0 -0
  422. /package/shaders/{lib/mesh-reflector-material → mesh-reflector-material}/mesh-reflector-material.d.ts +0 -0
  423. /package/shaders/{lib/mesh-refraction-material → mesh-refraction-material}/mesh-refraction-material.d.ts +0 -0
  424. /package/shaders/{lib/mesh-transmission-material → mesh-transmission-material}/mesh-transmission-material.d.ts +0 -0
  425. /package/shaders/{lib/shader-material → shader-material}/shader-material.d.ts +0 -0
  426. /package/shaders/{lib/spot-light-material → spot-light-material}/spot-light-material.d.ts +0 -0
  427. /package/shaders/{lib/star-field-material → star-field-material}/star-field-material.d.ts +0 -0
  428. /package/staging/{lib/environment → environment}/assets.d.ts +0 -0
@@ -1,2045 +0,0 @@
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';
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';
11
- import { Text, preloadFont } from 'troika-three-text';
12
-
13
- extend({ Group });
14
- class NgtsBillboard extends NgtRxStore {
15
- constructor() {
16
- super(...arguments);
17
- this.billboardRef = injectNgtRef();
18
- }
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
- }
52
- NgtsBillboard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsBillboard, deps: null, target: i0.ɵɵFactoryTarget.Component });
53
- NgtsBillboard.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: NgtsBillboard, isStandalone: true, selector: "ngts-billboard", inputs: { billboardRef: "billboardRef", follow: "follow", lockX: "lockX", lockY: "lockY", lockZ: "lockZ" }, usesInheritance: true, ngImport: i0, template: `
54
- <ngt-group ngtCompound [ref]="billboardRef" (beforeRender)="onBeforeRender($any($event))">
55
- <ng-content />
56
- </ngt-group>
57
- `, isInline: true });
58
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsBillboard, decorators: [{
59
- type: Component,
60
- args: [{
61
- selector: 'ngts-billboard',
62
- standalone: true,
63
- template: `
64
- <ngt-group ngtCompound [ref]="billboardRef" (beforeRender)="onBeforeRender($any($event))">
65
- <ng-content />
66
- </ngt-group>
67
- `,
68
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
69
- }]
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
80
- }] } });
81
-
82
- class NgtsLineInput extends NgtRxStore {
83
- set vertexColors(vertexColors) {
84
- this.set({ vertexColors });
85
- }
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 });
94
- }
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
- }
124
- NgtsLineInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsLineInput, deps: null, target: i0.ɵɵFactoryTarget.Directive });
125
- NgtsLineInput.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", 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 });
126
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", 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
- 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;
192
- });
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
- });
210
- }
211
- }
212
- NgtsLine.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsLine, deps: null, target: i0.ɵɵFactoryTarget.Component });
213
- NgtsLine.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: NgtsLine, isStandalone: true, selector: "ngts-line[points]", inputs: { lineRef: "lineRef", points: "points", segments: "segments" }, usesInheritance: true, ngImport: i0, template: `
214
- <ngt-primitive *args="[line]" [ref]="lineRef" ngtCompound>
215
- <ngt-primitive
216
- *args="[get('lineGeometry')]"
217
- attach="geometry"
218
- (afterAttach)="onAfterAttach($any($event))"
219
- />
220
- <ngt-primitive
221
- *args="[lineMaterial]"
222
- attach="material"
223
- [color]="get('color')"
224
- [vertexColors]="Boolean(get('vertexColors'))"
225
- [resolution]="get('materialResolution')"
226
- [linewidth]="get('lineWidth')"
227
- [alphaToCoverage]="get('alphaToCoverage')"
228
- [dashed]="get('dashed')"
229
- [dashScale]="get('dashScale') ?? lineMaterial.dashScale"
230
- [dashSize]="get('dashSize') ?? lineMaterial.dashSize"
231
- [dashOffset]="get('dashOffset') ?? lineMaterial.dashOffset"
232
- [gapSize]="get('gapSize') ?? lineMaterial.gapSize"
233
- [wireframe]="get('wireframe') ?? lineMaterial.wireframe"
234
- [worldUnits]="get('worldUnits')"
235
- />
236
- </ngt-primitive>
237
- `, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "[args]", inputs: ["args"] }] });
238
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsLine, decorators: [{
239
- type: Component,
240
- args: [{
241
- selector: 'ngts-line[points]',
242
- standalone: true,
243
- 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],
269
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
270
- }]
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
- }
331
- NgtsCatmullRomLine.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsCatmullRomLine, deps: null, target: i0.ɵɵFactoryTarget.Component });
332
- NgtsCatmullRomLine.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", 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: `
333
- <ngts-line
334
- [lineRef]="lineRef"
335
- [points]="get('segmentedPoints')"
336
- [color]="get('color')"
337
- [vertexColors]="get('interpolatedVertexColors')"
338
- [resolution]="get('resolution')"
339
- [lineWidth]="get('lineWidth')"
340
- [alphaToCoverage]="get('alphaToCoverage')"
341
- [dashed]="get('dashed')"
342
- [dashScale]="get('dashScale')"
343
- [dashOffset]="get('dashOffset')"
344
- [dashSize]="get('dashSize')"
345
- [gapSize]="get('gapSize')"
346
- [wireframe]="get('wireframe')"
347
- [worldUnits]="get('worldUnits')"
348
- />
349
- `, isInline: true, dependencies: [{ kind: "component", type: NgtsLine, selector: "ngts-line[points]", inputs: ["lineRef", "points", "segments"] }] });
350
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", 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
- }
422
- NgtsCubicBezierLine.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsCubicBezierLine, deps: null, target: i0.ɵɵFactoryTarget.Component });
423
- NgtsCubicBezierLine.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", 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: `
424
- <ngts-line
425
- [lineRef]="lineRef"
426
- [points]="get('points')"
427
- [color]="get('color')"
428
- [vertexColors]="get('vertexColors')"
429
- [resolution]="get('resolution')"
430
- [lineWidth]="get('lineWidth')"
431
- [alphaToCoverage]="get('alphaToCoverage')"
432
- [dashed]="get('dashed')"
433
- [dashScale]="get('dashScale')"
434
- [dashSize]="get('dashSize')"
435
- [dashOffset]="get('dashOffset')"
436
- [gapSize]="get('gapSize')"
437
- [wireframe]="get('wireframe')"
438
- [worldUnits]="get('worldUnits')"
439
- />
440
- `, isInline: true, dependencies: [{ kind: "component", type: NgtsLine, selector: "ngts-line[points]", inputs: ["lineRef", "points", "segments"] }] });
441
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", 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
479
- }] } });
480
-
481
- 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 });
497
- }
498
- set userData(userData) {
499
- this.set({ userData });
500
- }
501
- initialize() {
502
- super.initialize();
503
- this.set({
504
- threshold: 15,
505
- color: 'black',
506
- userData: {},
507
- });
508
- }
509
- ngOnInit() {
510
- this.setupGeometry();
511
- }
512
- setupGeometry() {
513
- this.hold(this.edgesRef.$, (segments) => {
514
- const parent = segments.parent;
515
- 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);
522
- }
523
- }
524
- });
525
- }
526
- }
527
- NgtsEdges.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsEdges, deps: null, target: i0.ɵɵFactoryTarget.Component });
528
- NgtsEdges.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", 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: `
529
- <ngt-line-segments [ref]="edgesRef" [raycast]="noop" ngtCompound>
530
- <ng-container *ngIf="withChildren; else noChildren">
531
- <ng-content />
532
- </ng-container>
533
- <ng-template #noChildren>
534
- <ngt-line-basic-material [color]="color" />
535
- </ng-template>
536
- </ngt-line-segments>
537
- `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
538
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsEdges, decorators: [{
539
- type: Component,
540
- args: [{
541
- selector: 'ngts-edges',
542
- standalone: true,
543
- 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
- }
597
- NgtsGizmoHelperContent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsGizmoHelperContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
598
- NgtsGizmoHelperContent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: NgtsGizmoHelperContent, isStandalone: true, selector: "ng-template[ngtsGizmoHelperContent]", ngImport: i0 });
599
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", 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
- }
713
- NgtsGizmoHelper.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsGizmoHelper, deps: null, target: i0.ɵɵFactoryTarget.Component });
714
- NgtsGizmoHelper.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", 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: `
715
- <ngt-portal [renderPriority]="get('renderPriority')">
716
- <ng-template ngtPortalContent>
717
- <ngts-orthographic-camera
718
- [cameraRef]="virtualCameraRef"
719
- [makeDefault]="true"
720
- [position]="[0, 0, 200]"
721
- />
722
- <ngt-group
723
- [ref]="gizmoRef"
724
- [position]="get('gizmoPosition')"
725
- (beforeRender)="onBeforeRender($any($event).state.delta)"
726
- >
727
- <ng-container *ngTemplateOutlet="gizmoHelperContent" />
728
- </ngt-group>
729
- </ng-template>
730
- </ngt-portal>
731
- `, 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"] }] });
732
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", 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] }],
757
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
758
- }]
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: [{
770
- type: ContentChild,
771
- args: [NgtsGizmoHelperContent, { static: true, read: TemplateRef }]
772
- }] } });
773
-
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);
808
- }
809
- set opacity(opacity) {
810
- this.set({ opacity });
811
- }
812
- set hoverColor(hoverColor) {
813
- this.set({ hoverColor });
814
- }
815
- set textColor(textColor) {
816
- this.set({ textColor });
817
- }
818
- set strokeColor(strokeColor) {
819
- this.set({ strokeColor });
820
- }
821
- set faces(faces) {
822
- this.set({ faces });
823
- }
824
- set clickEmitter(clickEmitter) {
825
- this.set({ clickEmitter });
826
- }
827
- }
828
- NgtsGizmoViewcubeInputs.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsGizmoViewcubeInputs, deps: null, target: i0.ɵɵFactoryTarget.Directive });
829
- NgtsGizmoViewcubeInputs.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: NgtsGizmoViewcubeInputs, inputs: { opacity: "opacity", hoverColor: "hoverColor", textColor: "textColor", strokeColor: "strokeColor", faces: "faces", clickEmitter: "clickEmitter" }, usesInheritance: true, ngImport: i0 });
830
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", 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
- 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
- }
881
- NgtsGizmoViewcubeEdgeCube.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsGizmoViewcubeEdgeCube, deps: null, target: i0.ɵɵFactoryTarget.Component });
882
- NgtsGizmoViewcubeEdgeCube.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: NgtsGizmoViewcubeEdgeCube, isStandalone: true, selector: "ngts-gizmo-viewcube-edge-cube[dimensions][position]", inputs: { dimensions: "dimensions", position: "position" }, usesInheritance: true, ngImport: i0, template: `
883
- <ngt-mesh
884
- [scale]="1.01"
885
- [position]="get('position')"
886
- (pointermove)="onPointerMove($any($event))"
887
- (pointerout)="onPointerOut($any($event))"
888
- (click)="onClick($any($event))"
889
- >
890
- <ngt-box-geometry *args="get('dimensions')" />
891
- <ngt-mesh-basic-material
892
- [color]="hover ? get('hoverColor') : 'white'"
893
- [transparent]="true"
894
- [opacity]="0.6"
895
- [visible]="hover"
896
- />
897
- </ngt-mesh>
898
- `, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "[args]", inputs: ["args"] }] });
899
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsGizmoViewcubeEdgeCube, decorators: [{
900
- type: Component,
901
- args: [{
902
- selector: 'ngts-gizmo-viewcube-edge-cube[dimensions][position]',
903
- standalone: true,
904
- 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
- `,
921
- imports: [NgtArgs],
922
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
923
- }]
924
- }], propDecorators: { dimensions: [{
925
- type: Input
926
- }], position: [{
927
- type: Input
928
- }] } });
929
-
930
- extend({ MeshLambertMaterial, Mesh, BoxGeometry });
931
- class NgtsGizmoViewcubeFaceMaterial extends NgtsGizmoViewcubeInputs {
932
- constructor() {
933
- super(...arguments);
934
- this.document = inject(DOCUMENT);
935
- }
936
- set index(index) {
937
- this.set({ index });
938
- }
939
- set hover(hover) {
940
- this.set({ hover });
941
- }
942
- set font(font) {
943
- this.set({ font });
944
- }
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
- }
976
- NgtsGizmoViewcubeFaceMaterial.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsGizmoViewcubeFaceMaterial, deps: null, target: i0.ɵɵFactoryTarget.Component });
977
- NgtsGizmoViewcubeFaceMaterial.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", 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: `
978
- <ngt-mesh-lambert-material
979
- [attach]="['material', get('index')]"
980
- [map]="get('texture')"
981
- [color]="get('hover') ? get('hoverColor') : get('color')"
982
- [opacity]="get('opacity')"
983
- [transparent]="true"
984
- >
985
- <ngt-value [rawValue]="store.get('gl').outputEncoding" attach="map.encoding" />
986
- <ngt-value [rawValue]="store.get('gl').capabilities.getMaxAnisotropy() || 1" attach="map.anisotrophy" />
987
- </ngt-mesh-lambert-material>
988
- `, isInline: true });
989
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", 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;
1022
- }
1023
- set font(font) {
1024
- this.set({ font });
1025
- }
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
- }
1047
- NgtsGizmoViewcubeFaceCube.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsGizmoViewcubeFaceCube, deps: null, target: i0.ɵɵFactoryTarget.Component });
1048
- NgtsGizmoViewcubeFaceCube.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: NgtsGizmoViewcubeFaceCube, isStandalone: true, selector: "ngts-gizmo-viewcube-face-cube", inputs: { font: "font", color: "color" }, usesInheritance: true, ngImport: i0, template: `
1049
- <ngt-mesh
1050
- (pointermove)="onPointerMove($any($event))"
1051
- (pointerout)="onPointerOut($any($event))"
1052
- (click)="onClick($any($event))"
1053
- >
1054
- <ngt-box-geometry />
1055
- <ngts-gizmo-viewcube-face-material
1056
- *ngFor="let i; repeat: 6"
1057
- [hover]="hover === i"
1058
- [index]="i"
1059
- [font]="get('font')"
1060
- [color]="get('color')"
1061
- [opacity]="get('opacity')"
1062
- [hoverColor]="get('hoverColor')"
1063
- [textColor]="get('textColor')"
1064
- [strokeColor]="get('strokeColor')"
1065
- [faces]="get('faces')"
1066
- />
1067
- </ngt-mesh>
1068
- `, 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"] }] });
1069
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", 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();
1113
- }
1114
- set font(font) {
1115
- this.set({ font });
1116
- }
1117
- set color(color) {
1118
- this.set({ color });
1119
- }
1120
- }
1121
- NgtsGizmoViewcube.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsGizmoViewcube, deps: null, target: i0.ɵɵFactoryTarget.Component });
1122
- NgtsGizmoViewcube.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: NgtsGizmoViewcube, isStandalone: true, selector: "ngts-gizmo-viewcube", inputs: { font: "font", color: "color" }, outputs: { clicked: "clicked" }, usesInheritance: true, ngImport: i0, template: `
1123
- <ngt-group [scale]="60">
1124
- <ngts-gizmo-viewcube-face-cube
1125
- [font]="get('font')"
1126
- [color]="get('color')"
1127
- [opacity]="get('opacity')"
1128
- [hoverColor]="get('hoverColor')"
1129
- [textColor]="get('textColor')"
1130
- [strokeColor]="get('strokeColor')"
1131
- [faces]="get('faces')"
1132
- [clickEmitter]="clicked"
1133
- />
1134
-
1135
- <ngts-gizmo-viewcube-edge-cube
1136
- *ngFor="let edge of edges; let i = index"
1137
- [position]="edge"
1138
- [dimensions]="edgeDimensions[i]"
1139
- [font]="get('font')"
1140
- [color]="get('color')"
1141
- [opacity]="get('opacity')"
1142
- [hoverColor]="get('hoverColor')"
1143
- [textColor]="get('textColor')"
1144
- [strokeColor]="get('strokeColor')"
1145
- [faces]="get('faces')"
1146
- [clickEmitter]="clicked"
1147
- />
1148
-
1149
- <ngts-gizmo-viewcube-edge-cube
1150
- *ngFor="let corner of corners"
1151
- [position]="corner"
1152
- [dimensions]="cornerDimensions"
1153
- [font]="get('font')"
1154
- [color]="get('color')"
1155
- [opacity]="get('opacity')"
1156
- [hoverColor]="get('hoverColor')"
1157
- [textColor]="get('textColor')"
1158
- [strokeColor]="get('strokeColor')"
1159
- [faces]="get('faces')"
1160
- [clickEmitter]="clicked"
1161
- />
1162
-
1163
- <ngt-ambient-light [intensity]="0.5" />
1164
- <ngt-point-light [position]="10" [intensity]="0.5" />
1165
- </ngt-group>
1166
- `, 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"] }] });
1167
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", 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
- }
1244
- NgtsGizmoViewportAxis.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsGizmoViewportAxis, deps: null, target: i0.ɵɵFactoryTarget.Component });
1245
- NgtsGizmoViewportAxis.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: NgtsGizmoViewportAxis, isStandalone: true, selector: "ngts-gizmo-viewport-axis[color][rotation]", inputs: { color: "color", rotation: "rotation", scale: "scale" }, usesInheritance: true, ngImport: i0, template: `
1246
- <ngt-group [rotation]="get('rotation')">
1247
- <ngt-mesh [position]="[0.4, 0, 0]">
1248
- <ngt-box-geometry *args="get('scale')" />
1249
- <ngt-mesh-basic-material [color]="get('color')" [toneMapped]="false" />
1250
- </ngt-mesh>
1251
- </ngt-group>
1252
- `, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "[args]", inputs: ["args"] }] });
1253
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", 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');
1282
- }
1283
- set arcStyle(arcStyle) {
1284
- this.set({ arcStyle });
1285
- }
1286
- set label(label) {
1287
- this.set({ label });
1288
- }
1289
- set labelColor(labelColor) {
1290
- this.set({ labelColor });
1291
- }
1292
- set axisHeadScale(axisHeadScale) {
1293
- this.set({ axisHeadScale });
1294
- }
1295
- set disabled(disabled) {
1296
- this.set({ disabled });
1297
- }
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
- }
1354
- NgtsGizmoViewportAxisHead.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsGizmoViewportAxisHead, deps: null, target: i0.ɵɵFactoryTarget.Component });
1355
- NgtsGizmoViewportAxisHead.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", 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: `
1356
- <ngt-sprite
1357
- ngtCompound
1358
- [scale]="get('scale')"
1359
- (pointerover)="onPointerOver($any($event))"
1360
- (pointerout)="onPointerOut($any($event))"
1361
- >
1362
- <ngt-sprite-material
1363
- [map]="get('texture')"
1364
- [opacity]="get('label') ? 1 : 0.75"
1365
- [alphaTest]="0.3"
1366
- [toneMapped]="false"
1367
- >
1368
- <ngt-value [rawValue]="gl.outputEncoding" attach="map.encoding" />
1369
- <ngt-value [rawValue]="gl.capabilities.getMaxAnisotropy() || 1" attach="map.anisotropy" />
1370
- </ngt-sprite-material>
1371
- </ngt-sprite>
1372
- `, isInline: true });
1373
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsGizmoViewportAxisHead, decorators: [{
1374
- type: Component,
1375
- args: [{
1376
- selector: 'ngts-gizmo-viewport-axis-head',
1377
- standalone: true,
1378
- 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
- `,
1396
- imports: [NgtArgs],
1397
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
1398
- }]
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: [{
1412
- type: Input
1413
- }] } });
1414
-
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();
1422
- }
1423
- set axisColors(axisColors) {
1424
- this.set({ axisColors });
1425
- }
1426
- set axisScale(axisScale) {
1427
- this.set({ axisScale });
1428
- }
1429
- set labels(labels) {
1430
- this.set({ labels });
1431
- }
1432
- set axisHeadScale(axisHeadScale) {
1433
- this.set({ axisHeadScale });
1434
- }
1435
- set labelColor(labelColor) {
1436
- this.set({ labelColor });
1437
- }
1438
- set hideNegativeAxes(hideNegativeAxes) {
1439
- this.set({ hideNegativeAxes });
1440
- }
1441
- set hideAxisHeads(hideAxisHeads) {
1442
- this.set({ hideAxisHeads });
1443
- }
1444
- set disabled(disabled) {
1445
- this.set({ disabled });
1446
- }
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
- });
1459
- }
1460
- onPointerDown(event) {
1461
- if (!this.get('disabled')) {
1462
- event.stopPropagation();
1463
- this.gizmoHelperApi.tweenCamera(event.object.position);
1464
- }
1465
- }
1466
- }
1467
- NgtsGizmoViewport.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsGizmoViewport, deps: null, target: i0.ɵɵFactoryTarget.Component });
1468
- NgtsGizmoViewport.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", 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: `
1469
- <ngt-group ngtCompound [scale]="40">
1470
- <ngts-gizmo-viewport-axis
1471
- [color]="get('axisColors')[0]"
1472
- [rotation]="[0, 0, 0]"
1473
- [scale]="get('axisScale')"
1474
- ></ngts-gizmo-viewport-axis>
1475
- <ngts-gizmo-viewport-axis
1476
- [color]="get('axisColors')[1]"
1477
- [rotation]="[0, 0, Math.PI / 2]"
1478
- [scale]="get('axisScale')"
1479
- ></ngts-gizmo-viewport-axis>
1480
- <ngts-gizmo-viewport-axis
1481
- [color]="get('axisColors')[2]"
1482
- [rotation]="[0, -Math.PI / 2, 0]"
1483
- [scale]="get('axisScale')"
1484
- ></ngts-gizmo-viewport-axis>
1485
- <ng-container *ngIf="!get('hideAxisHeads')">
1486
- <ngts-gizmo-viewport-axis-head
1487
- [arcStyle]="get('axisColors')[0]"
1488
- [position]="[1, 0, 0]"
1489
- [label]="get('labels')[0]"
1490
- [font]="get('font')"
1491
- [disabled]="get('disabled')"
1492
- [labelColor]="get('labelColor')"
1493
- [clickEmitter]="clicked"
1494
- [axisHeadScale]="get('axisHeadScale')"
1495
- (pointerdown)="onPointerDown($any($event))"
1496
- ></ngts-gizmo-viewport-axis-head>
1497
- <ngts-gizmo-viewport-axis-head
1498
- [arcStyle]="get('axisColors')[1]"
1499
- [position]="[0, 1, 0]"
1500
- [label]="get('labels')[1]"
1501
- [font]="get('font')"
1502
- [disabled]="get('disabled')"
1503
- [labelColor]="get('labelColor')"
1504
- [clickEmitter]="clicked"
1505
- [axisHeadScale]="get('axisHeadScale')"
1506
- (pointerdown)="onPointerDown($any($event))"
1507
- ></ngts-gizmo-viewport-axis-head>
1508
- <ngts-gizmo-viewport-axis-head
1509
- [arcStyle]="get('axisColors')[2]"
1510
- [position]="[0, 0, 1]"
1511
- [label]="get('labels')[2]"
1512
- [font]="get('font')"
1513
- [disabled]="get('disabled')"
1514
- [labelColor]="get('labelColor')"
1515
- [clickEmitter]="clicked"
1516
- [axisHeadScale]="get('axisHeadScale')"
1517
- (pointerdown)="onPointerDown($any($event))"
1518
- ></ngts-gizmo-viewport-axis-head>
1519
- <ng-container *ngIf="!get('hideNegativeAxes')">
1520
- <ngts-gizmo-viewport-axis-head
1521
- [arcStyle]="get('axisColors')[0]"
1522
- [position]="[-1, 0, 0]"
1523
- [font]="get('font')"
1524
- [disabled]="get('disabled')"
1525
- [labelColor]="get('labelColor')"
1526
- [clickEmitter]="clicked"
1527
- [axisHeadScale]="get('axisHeadScale')"
1528
- (pointerdown)="onPointerDown($any($event))"
1529
- ></ngts-gizmo-viewport-axis-head>
1530
- <ngts-gizmo-viewport-axis-head
1531
- [arcStyle]="get('axisColors')[1]"
1532
- [position]="[0, -1, 0]"
1533
- [font]="get('font')"
1534
- [disabled]="get('disabled')"
1535
- [labelColor]="get('labelColor')"
1536
- [clickEmitter]="clicked"
1537
- [axisHeadScale]="get('axisHeadScale')"
1538
- (pointerdown)="onPointerDown($any($event))"
1539
- ></ngts-gizmo-viewport-axis-head>
1540
- <ngts-gizmo-viewport-axis-head
1541
- [arcStyle]="get('axisColors')[2]"
1542
- [position]="[0, 0, -1]"
1543
- [font]="get('font')"
1544
- [disabled]="get('disabled')"
1545
- [labelColor]="get('labelColor')"
1546
- [clickEmitter]="clicked"
1547
- [axisHeadScale]="get('axisHeadScale')"
1548
- (pointerdown)="onPointerDown($any($event))"
1549
- ></ngts-gizmo-viewport-axis-head>
1550
- </ng-container>
1551
- </ng-container>
1552
- <ngt-ambient-light intensity="0.5"></ngt-ambient-light>
1553
- <ngt-point-light position="10" intensity="0.5"></ngt-point-light>
1554
- </ngt-group>
1555
- `, 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"] }] });
1556
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", 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
- });
1715
- }
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
- }
1737
- NgtsQuadraticBezierLine.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsQuadraticBezierLine, deps: null, target: i0.ɵɵFactoryTarget.Component });
1738
- NgtsQuadraticBezierLine.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", 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: `
1739
- <ngts-line
1740
- [lineRef]="lineRef"
1741
- [points]="get('points')"
1742
- [color]="get('color')"
1743
- [vertexColors]="get('vertexColors')"
1744
- [resolution]="get('resolution')"
1745
- [lineWidth]="get('lineWidth')"
1746
- [alphaToCoverage]="get('alphaToCoverage')"
1747
- [dashed]="get('dashed')"
1748
- [dashScale]="get('dashScale')"
1749
- [dashSize]="get('dashSize')"
1750
- [dashOffset]="get('dashOffset')"
1751
- [gapSize]="get('gapSize')"
1752
- [wireframe]="get('wireframe')"
1753
- [worldUnits]="get('worldUnits')"
1754
- />
1755
- `, isInline: true, dependencies: [{ kind: "component", type: NgtsLine, selector: "ngts-line[points]", inputs: ["lineRef", "points", "segments"] }] });
1756
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", 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
- ]));
1832
- }
1833
- set font(font) {
1834
- this.set({ font });
1835
- }
1836
- set text(text) {
1837
- this.set({ text });
1838
- }
1839
- set bevelEnabled(bevelEnabled) {
1840
- this.set({ bevelEnabled });
1841
- }
1842
- set bevelOffset(bevelOffset) {
1843
- this.set({ bevelOffset });
1844
- }
1845
- set bevelSize(bevelSize) {
1846
- this.set({ bevelSize });
1847
- }
1848
- set bevelThickness(bevelThickness) {
1849
- this.set({ bevelThickness });
1850
- }
1851
- set curveSegments(curveSegments) {
1852
- this.set({ curveSegments });
1853
- }
1854
- set bevelSegments(bevelSegments) {
1855
- this.set({ bevelSegments });
1856
- }
1857
- set height(height) {
1858
- this.set({ height });
1859
- }
1860
- set size(size) {
1861
- this.set({ size });
1862
- }
1863
- set lineHeight(lineHeight) {
1864
- this.set({ lineHeight });
1865
- }
1866
- set letterSpacing(letterSpacing) {
1867
- this.set({ letterSpacing });
1868
- }
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
- });
1883
- }
1884
- }
1885
- NgtsText3D.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsText3D, deps: null, target: i0.ɵɵFactoryTarget.Component });
1886
- NgtsText3D.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", 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: `
1887
- <ngt-mesh ngtCompound>
1888
- <ngt-text-geometry *args="geometryArgs$ | ngtPush : null" />
1889
- <ng-content />
1890
- </ngt-mesh>
1891
- `, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "[args]", inputs: ["args"] }, { kind: "pipe", type: NgtPush, name: "ngtPush" }] });
1892
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", 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
- constructor() {
1934
- super(...arguments);
1935
- this.textRef = injectNgtRef();
1936
- this.sync = new EventEmitter();
1937
- this.store = inject(NgtStore);
1938
- 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() {
1960
- this.preloadFont();
1961
- this.syncText();
1962
- }
1963
- ngOnDestroy() {
1964
- this.troikaText.dispose();
1965
- super.ngOnDestroy();
1966
- }
1967
- preloadFont() {
1968
- const { font, characters } = this.get();
1969
- if (font && characters) {
1970
- preloadFont({ font, characters });
1971
- }
1972
- }
1973
- syncText() {
1974
- this.hold(this.select(), () => {
1975
- const invalidate = this.store.get('invalidate');
1976
- this.troikaText.sync(() => {
1977
- invalidate();
1978
- if (this.sync.observed)
1979
- this.sync.next(this.troikaText);
1980
- });
1981
- });
1982
- }
1983
- }
1984
- NgtsText.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsText, deps: null, target: i0.ɵɵFactoryTarget.Component });
1985
- NgtsText.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", 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: `
1986
- <ng-container>
1987
- <ngt-primitive
1988
- ngtCompound
1989
- *args="[troikaText]"
1990
- [ref]="textRef"
1991
- [text]="get('text')"
1992
- [anchorX]="get('anchorX')"
1993
- [anchorY]="get('anchorY')"
1994
- [font]="get('font')"
1995
- >
1996
- <ng-content />
1997
- </ngt-primitive>
1998
- </ng-container>
1999
- `, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "[args]", inputs: ["args"] }] });
2000
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtsText, decorators: [{
2001
- type: Component,
2002
- args: [{
2003
- selector: 'ngts-text[text]',
2004
- standalone: true,
2005
- 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
- `,
2020
- imports: [NgtArgs],
2021
- providers: [RxActionFactory],
2022
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
2023
- }]
2024
- }], propDecorators: { textRef: [{
2025
- type: Input
2026
- }], text: [{
2027
- type: Input
2028
- }], characters: [{
2029
- type: Input
2030
- }], font: [{
2031
- type: Input
2032
- }], anchorX: [{
2033
- type: Input
2034
- }], anchorY: [{
2035
- type: Input
2036
- }], sync: [{
2037
- type: Output
2038
- }] } });
2039
-
2040
- /**
2041
- * Generated bundle index. Do not edit.
2042
- */
2043
-
2044
- export { NGTS_GIZMO_HELPER_API, NgtsBillboard, NgtsCatmullRomLine, NgtsCubicBezierLine, NgtsEdges, NgtsGizmoHelper, NgtsGizmoHelperContent, NgtsGizmoViewcube, NgtsGizmoViewport, NgtsLine, NgtsQuadraticBezierLine, NgtsText, NgtsText3D };
2045
- //# sourceMappingURL=angular-three-soba-abstractions.mjs.map