@hology/core 0.0.90 → 0.0.92

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 (412) hide show
  1. package/LICENSE.md +14 -14
  2. package/README.md +2 -2
  3. package/dist/config/project-config.d.ts +1 -0
  4. package/dist/config/project-config.d.ts.map +1 -0
  5. package/dist/config/project-config.js +1 -2
  6. package/dist/controllers/base-game-controller.d.ts +1 -0
  7. package/dist/controllers/base-game-controller.d.ts.map +1 -0
  8. package/dist/controllers/base-game-controller.js +1 -2
  9. package/dist/csm.d.ts +1 -0
  10. package/dist/csm.d.ts.map +1 -0
  11. package/dist/csm.js +1 -2
  12. package/dist/effects/particles/examples.d.ts +1 -0
  13. package/dist/effects/particles/examples.d.ts.map +1 -0
  14. package/dist/effects/particles/examples.js +1 -2
  15. package/dist/effects/particles/particle-system-config.d.ts +1 -0
  16. package/dist/effects/particles/particle-system-config.d.ts.map +1 -0
  17. package/dist/effects/particles/particle-system-config.js +1 -2
  18. package/dist/effects/vfx/behaviours.d.ts +3 -1
  19. package/dist/effects/vfx/behaviours.d.ts.map +1 -0
  20. package/dist/effects/vfx/behaviours.js +1 -2
  21. package/dist/effects/vfx/index.d.ts +1 -0
  22. package/dist/effects/vfx/index.d.ts.map +1 -0
  23. package/dist/effects/vfx/index.js +1 -2
  24. package/dist/effects/vfx/initializsers.d.ts +20 -39
  25. package/dist/effects/vfx/initializsers.d.ts.map +1 -0
  26. package/dist/effects/vfx/initializsers.js +1 -2
  27. package/dist/effects/vfx/rates.d.ts +5 -4
  28. package/dist/effects/vfx/rates.d.ts.map +1 -0
  29. package/dist/effects/vfx/rates.js +1 -2
  30. package/dist/effects/vfx/stretched-sprite.d.ts +1 -0
  31. package/dist/effects/vfx/stretched-sprite.d.ts.map +1 -0
  32. package/dist/effects/vfx/stretched-sprite.js +1 -2
  33. package/dist/effects/vfx/trail-renderer.d.ts +1 -0
  34. package/dist/effects/vfx/trail-renderer.d.ts.map +1 -0
  35. package/dist/effects/vfx/trail-renderer.js +1 -2
  36. package/dist/effects/vfx/vfx-actor.d.ts +2 -1
  37. package/dist/effects/vfx/vfx-actor.d.ts.map +1 -0
  38. package/dist/effects/vfx/vfx-actor.js +1 -2
  39. package/dist/effects/vfx/vfx-asset.d.ts +11 -0
  40. package/dist/effects/vfx/vfx-asset.d.ts.map +1 -0
  41. package/dist/effects/vfx/vfx-asset.js +1 -2
  42. package/dist/effects/vfx/vfx-defs.d.ts +11 -7
  43. package/dist/effects/vfx/vfx-defs.d.ts.map +1 -0
  44. package/dist/effects/vfx/vfx-defs.js +1 -2
  45. package/dist/effects/vfx/vfx-materializer.d.ts +9 -1
  46. package/dist/effects/vfx/vfx-materializer.d.ts.map +1 -0
  47. package/dist/effects/vfx/vfx-materializer.js +1 -2
  48. package/dist/effects/vfx/vfx-old-materializer.d.ts +2 -11
  49. package/dist/effects/vfx/vfx-old-materializer.d.ts.map +1 -0
  50. package/dist/effects/vfx/vfx-old-materializer.js +1 -2
  51. package/dist/effects/vfx/vfx-param.d.ts +1 -0
  52. package/dist/effects/vfx/vfx-param.d.ts.map +1 -0
  53. package/dist/effects/vfx/vfx-param.js +1 -2
  54. package/dist/effects/vfx/vfx-renderers.d.ts +2 -1
  55. package/dist/effects/vfx/vfx-renderers.d.ts.map +1 -0
  56. package/dist/effects/vfx/vfx-renderers.js +1 -2
  57. package/dist/effects/vfx/vfx-service.d.ts +1 -0
  58. package/dist/effects/vfx/vfx-service.d.ts.map +1 -0
  59. package/dist/effects/vfx/vfx-service.js +1 -2
  60. package/dist/effects/vfx/zones.d.ts +2 -1
  61. package/dist/effects/vfx/zones.d.ts.map +1 -0
  62. package/dist/effects/vfx/zones.js +1 -2
  63. package/dist/game-component/component-decorators.d.ts +1 -0
  64. package/dist/game-component/component-decorators.d.ts.map +1 -0
  65. package/dist/game-component/component-decorators.js +1 -2
  66. package/dist/game-component/game-component.d.ts +1 -0
  67. package/dist/game-component/game-component.d.ts.map +1 -0
  68. package/dist/game-component/game-component.js +1 -2
  69. package/dist/gameplay/actors/actor.d.ts +1 -0
  70. package/dist/gameplay/actors/actor.d.ts.map +1 -0
  71. package/dist/gameplay/actors/actor.js +1 -2
  72. package/dist/gameplay/actors/builtin/camera-actor.d.ts +1 -0
  73. package/dist/gameplay/actors/builtin/camera-actor.d.ts.map +1 -0
  74. package/dist/gameplay/actors/builtin/camera-actor.js +1 -2
  75. package/dist/gameplay/actors/builtin/components/character/character-animation.d.ts +1 -0
  76. package/dist/gameplay/actors/builtin/components/character/character-animation.d.ts.map +1 -0
  77. package/dist/gameplay/actors/builtin/components/character/character-animation.js +1 -2
  78. package/dist/gameplay/actors/builtin/components/character/character-movement copy.d.ts +1 -0
  79. package/dist/gameplay/actors/builtin/components/character/character-movement copy.d.ts.map +1 -0
  80. package/dist/gameplay/actors/builtin/components/character/character-movement copy.js +1 -2
  81. package/dist/gameplay/actors/builtin/components/character/character-movement.d.ts +1 -0
  82. package/dist/gameplay/actors/builtin/components/character/character-movement.d.ts.map +1 -0
  83. package/dist/gameplay/actors/builtin/components/character/character-movement.js +1 -2
  84. package/dist/gameplay/actors/builtin/components/character/modes.d.ts +1 -0
  85. package/dist/gameplay/actors/builtin/components/character/modes.d.ts.map +1 -0
  86. package/dist/gameplay/actors/builtin/components/character/modes.js +1 -2
  87. package/dist/gameplay/actors/builtin/components/mesh-component.d.ts +1 -0
  88. package/dist/gameplay/actors/builtin/components/mesh-component.d.ts.map +1 -0
  89. package/dist/gameplay/actors/builtin/components/mesh-component.js +1 -2
  90. package/dist/gameplay/actors/builtin/components/scene-component.d.ts +1 -0
  91. package/dist/gameplay/actors/builtin/components/scene-component.d.ts.map +1 -0
  92. package/dist/gameplay/actors/builtin/components/scene-component.js +1 -2
  93. package/dist/gameplay/actors/builtin/index.d.ts +1 -0
  94. package/dist/gameplay/actors/builtin/index.d.ts.map +1 -0
  95. package/dist/gameplay/actors/builtin/index.js +1 -2
  96. package/dist/gameplay/actors/builtin/navmesh-actor.d.ts +1 -0
  97. package/dist/gameplay/actors/builtin/navmesh-actor.d.ts.map +1 -0
  98. package/dist/gameplay/actors/builtin/navmesh-actor.js +1 -2
  99. package/dist/gameplay/actors/builtin/positional-audio-actor.d.ts +1 -0
  100. package/dist/gameplay/actors/builtin/positional-audio-actor.d.ts.map +1 -0
  101. package/dist/gameplay/actors/builtin/positional-audio-actor.js +1 -2
  102. package/dist/gameplay/actors/builtin/spawn-point.d.ts +1 -0
  103. package/dist/gameplay/actors/builtin/spawn-point.d.ts.map +1 -0
  104. package/dist/gameplay/actors/builtin/spawn-point.js +1 -2
  105. package/dist/gameplay/actors/builtin/trigger-volume.d.ts +1 -0
  106. package/dist/gameplay/actors/builtin/trigger-volume.d.ts.map +1 -0
  107. package/dist/gameplay/actors/builtin/trigger-volume.js +1 -2
  108. package/dist/gameplay/actors/camera/camera-component.d.ts +1 -0
  109. package/dist/gameplay/actors/camera/camera-component.d.ts.map +1 -0
  110. package/dist/gameplay/actors/camera/camera-component.js +1 -2
  111. package/dist/gameplay/actors/camera/third-person-camera-component.d.ts +1 -0
  112. package/dist/gameplay/actors/camera/third-person-camera-component.d.ts.map +1 -0
  113. package/dist/gameplay/actors/camera/third-person-camera-component.js +1 -2
  114. package/dist/gameplay/actors/component.d.ts +1 -0
  115. package/dist/gameplay/actors/component.d.ts.map +1 -0
  116. package/dist/gameplay/actors/component.js +1 -2
  117. package/dist/gameplay/actors/factory.d.ts +1 -0
  118. package/dist/gameplay/actors/factory.d.ts.map +1 -0
  119. package/dist/gameplay/actors/factory.js +1 -2
  120. package/dist/gameplay/actors/index.d.ts +1 -0
  121. package/dist/gameplay/actors/index.d.ts.map +1 -0
  122. package/dist/gameplay/actors/index.js +1 -2
  123. package/dist/gameplay/actors/internal/component-init.d.ts +1 -0
  124. package/dist/gameplay/actors/internal/component-init.d.ts.map +1 -0
  125. package/dist/gameplay/actors/internal/component-init.js +1 -2
  126. package/dist/gameplay/actors/internal/container-map.d.ts +1 -0
  127. package/dist/gameplay/actors/internal/container-map.d.ts.map +1 -0
  128. package/dist/gameplay/actors/internal/container-map.js +1 -2
  129. package/dist/gameplay/ai/behavior-tree/bt.d.ts +1 -0
  130. package/dist/gameplay/ai/behavior-tree/bt.d.ts.map +1 -0
  131. package/dist/gameplay/ai/behavior-tree/bt.js +1 -2
  132. package/dist/gameplay/ai/behavior-tree/move.d.ts +1 -0
  133. package/dist/gameplay/ai/behavior-tree/move.d.ts.map +1 -0
  134. package/dist/gameplay/ai/behavior-tree/move.js +1 -2
  135. package/dist/gameplay/ai/build-tile.d.ts +1 -0
  136. package/dist/gameplay/ai/build-tile.d.ts.map +1 -0
  137. package/dist/gameplay/ai/build-tile.js +1 -2
  138. package/dist/gameplay/ai/dynamic-tiled-navmesh.d.ts +1 -0
  139. package/dist/gameplay/ai/dynamic-tiled-navmesh.d.ts.map +1 -0
  140. package/dist/gameplay/ai/dynamic-tiled-navmesh.js +1 -2
  141. package/dist/gameplay/ai/dynamic-tiled-navmesh.worker.d.ts +1 -0
  142. package/dist/gameplay/ai/dynamic-tiled-navmesh.worker.d.ts.map +1 -0
  143. package/dist/gameplay/ai/dynamic-tiled-navmesh.worker.js +1 -2
  144. package/dist/gameplay/ai/index.d.ts +1 -0
  145. package/dist/gameplay/ai/index.d.ts.map +1 -0
  146. package/dist/gameplay/ai/index.js +1 -2
  147. package/dist/gameplay/ai/navigation.d.ts +1 -0
  148. package/dist/gameplay/ai/navigation.d.ts.map +1 -0
  149. package/dist/gameplay/ai/navigation.js +1 -2
  150. package/dist/gameplay/animation/anim-sm.d.ts +1 -0
  151. package/dist/gameplay/animation/anim-sm.d.ts.map +1 -0
  152. package/dist/gameplay/animation/anim-sm.js +1 -2
  153. package/dist/gameplay/animation/root-motion.d.ts +1 -0
  154. package/dist/gameplay/animation/root-motion.d.ts.map +1 -0
  155. package/dist/gameplay/animation/root-motion.js +1 -2
  156. package/dist/gameplay/env.d.ts +1 -0
  157. package/dist/gameplay/env.d.ts.map +1 -0
  158. package/dist/gameplay/env.js +1 -2
  159. package/dist/gameplay/index.d.ts +1 -0
  160. package/dist/gameplay/index.d.ts.map +1 -0
  161. package/dist/gameplay/index.js +1 -2
  162. package/dist/gameplay/initiate.d.ts +1 -0
  163. package/dist/gameplay/initiate.d.ts.map +1 -0
  164. package/dist/gameplay/initiate.js +1 -2
  165. package/dist/gameplay/inject.d.ts +1 -0
  166. package/dist/gameplay/inject.d.ts.map +1 -0
  167. package/dist/gameplay/inject.js +1 -2
  168. package/dist/gameplay/input/index.d.ts +1 -0
  169. package/dist/gameplay/input/index.d.ts.map +1 -0
  170. package/dist/gameplay/input/index.js +1 -2
  171. package/dist/gameplay/input/input-service.d.ts +1 -0
  172. package/dist/gameplay/input/input-service.d.ts.map +1 -0
  173. package/dist/gameplay/input/input-service.js +1 -2
  174. package/dist/gameplay/input/input.d.ts +1 -0
  175. package/dist/gameplay/input/input.d.ts.map +1 -0
  176. package/dist/gameplay/input/input.js +1 -2
  177. package/dist/gameplay/input/keybind.d.ts +1 -0
  178. package/dist/gameplay/input/keybind.d.ts.map +1 -0
  179. package/dist/gameplay/input/keybind.js +1 -2
  180. package/dist/gameplay/polyfill.d.ts +1 -0
  181. package/dist/gameplay/polyfill.d.ts.map +1 -0
  182. package/dist/gameplay/polyfill.js +1 -2
  183. package/dist/gameplay/services/asset-loader.d.ts +1 -0
  184. package/dist/gameplay/services/asset-loader.d.ts.map +1 -0
  185. package/dist/gameplay/services/asset-loader.js +1 -2
  186. package/dist/gameplay/services/physics/abstract-physics-system.d.ts +202 -0
  187. package/dist/gameplay/services/physics/abstract-physics-system.d.ts.map +1 -0
  188. package/dist/gameplay/services/physics/abstract-physics-system.js +4 -0
  189. package/dist/gameplay/services/physics/collision-contact.d.ts +1 -0
  190. package/dist/gameplay/services/physics/collision-contact.d.ts.map +1 -0
  191. package/dist/gameplay/services/physics/collision-contact.js +1 -2
  192. package/dist/gameplay/services/physics/physics-system.d.ts +283 -24
  193. package/dist/gameplay/services/physics/physics-system.d.ts.map +1 -0
  194. package/dist/gameplay/services/physics/physics-system.js +1 -2
  195. package/dist/gameplay/services/pointer-events.d.ts +1 -0
  196. package/dist/gameplay/services/pointer-events.d.ts.map +1 -0
  197. package/dist/gameplay/services/pointer-events.js +1 -2
  198. package/dist/gameplay/services/render.d.ts +1 -0
  199. package/dist/gameplay/services/render.d.ts.map +1 -0
  200. package/dist/gameplay/services/render.js +1 -2
  201. package/dist/gameplay/services/world.d.ts +1 -0
  202. package/dist/gameplay/services/world.d.ts.map +1 -0
  203. package/dist/gameplay/services/world.js +1 -2
  204. package/dist/index.d.ts +1 -0
  205. package/dist/index.d.ts.map +1 -0
  206. package/dist/index.js +1 -2
  207. package/dist/rendering/shader-override.d.ts +1 -0
  208. package/dist/rendering/shader-override.d.ts.map +1 -0
  209. package/dist/rendering/shader-override.js +1 -2
  210. package/dist/rendering.d.ts +1 -0
  211. package/dist/rendering.d.ts.map +1 -0
  212. package/dist/rendering.js +1 -2
  213. package/dist/scene/asset-resource-loader.d.ts +1 -0
  214. package/dist/scene/asset-resource-loader.d.ts.map +1 -0
  215. package/dist/scene/asset-resource-loader.js +1 -2
  216. package/dist/scene/assets-provider.d.ts +1 -0
  217. package/dist/scene/assets-provider.d.ts.map +1 -0
  218. package/dist/scene/assets-provider.js +1 -2
  219. package/dist/scene/bootstrap.d.ts +1 -0
  220. package/dist/scene/bootstrap.d.ts.map +1 -0
  221. package/dist/scene/bootstrap.js +1 -2
  222. package/dist/scene/collision/collision-shape-import.d.ts +1 -0
  223. package/dist/scene/collision/collision-shape-import.d.ts.map +1 -0
  224. package/dist/scene/collision/collision-shape-import.js +1 -2
  225. package/dist/scene/collision/collision-shape.d.ts +1 -0
  226. package/dist/scene/collision/collision-shape.d.ts.map +1 -0
  227. package/dist/scene/collision/collision-shape.js +1 -2
  228. package/dist/scene/landscape/landscape-manager.d.ts +1 -0
  229. package/dist/scene/landscape/landscape-manager.d.ts.map +1 -0
  230. package/dist/scene/landscape/landscape-manager.js +1 -2
  231. package/dist/scene/landscape/landscape.d.ts +1 -0
  232. package/dist/scene/landscape/landscape.d.ts.map +1 -0
  233. package/dist/scene/landscape/landscape.js +1 -2
  234. package/dist/scene/landscape/utils.d.ts +1 -0
  235. package/dist/scene/landscape/utils.d.ts.map +1 -0
  236. package/dist/scene/landscape/utils.js +1 -2
  237. package/dist/scene/materializer.d.ts +1 -0
  238. package/dist/scene/materializer.d.ts.map +1 -0
  239. package/dist/scene/materializer.js +1 -2
  240. package/dist/scene/materials/grass-foliage.d.ts +1 -0
  241. package/dist/scene/materials/grass-foliage.d.ts.map +1 -0
  242. package/dist/scene/materials/grass-foliage.js +1 -2
  243. package/dist/scene/materials/grass.d.ts +1 -0
  244. package/dist/scene/materials/grass.d.ts.map +1 -0
  245. package/dist/scene/materials/grass.js +1 -2
  246. package/dist/scene/materials/utils/material-painting.d.ts +1 -0
  247. package/dist/scene/materials/utils/material-painting.d.ts.map +1 -0
  248. package/dist/scene/materials/utils/material-painting.js +1 -2
  249. package/dist/scene/materials/utils/noise.glsl.d.ts +1 -0
  250. package/dist/scene/materials/utils/noise.glsl.d.ts.map +1 -0
  251. package/dist/scene/materials/utils/noise.glsl.js +1 -2
  252. package/dist/scene/materials/water.d.ts +1 -0
  253. package/dist/scene/materials/water.d.ts.map +1 -0
  254. package/dist/scene/materials/water.js +1 -2
  255. package/dist/scene/model.d.ts +1 -0
  256. package/dist/scene/model.d.ts.map +1 -0
  257. package/dist/scene/model.js +1 -2
  258. package/dist/scene/objects/ramp-geometry.d.ts +1 -0
  259. package/dist/scene/objects/ramp-geometry.d.ts.map +1 -0
  260. package/dist/scene/objects/ramp-geometry.js +1 -2
  261. package/dist/scene/objects/shapes.d.ts +2 -2
  262. package/dist/scene/objects/shapes.d.ts.map +1 -0
  263. package/dist/scene/objects/shapes.js +1 -2
  264. package/dist/scene/objects/stairs-geometry.d.ts +1 -0
  265. package/dist/scene/objects/stairs-geometry.d.ts.map +1 -0
  266. package/dist/scene/objects/stairs-geometry.js +1 -2
  267. package/dist/scene/runtime-asset-service.d.ts +1 -0
  268. package/dist/scene/runtime-asset-service.d.ts.map +1 -0
  269. package/dist/scene/runtime-asset-service.js +1 -2
  270. package/dist/scene/runtime-backend-service.d.ts +1 -0
  271. package/dist/scene/runtime-backend-service.d.ts.map +1 -0
  272. package/dist/scene/runtime-backend-service.js +1 -2
  273. package/dist/scene/runtime-bundled-backend-service.d.ts +1 -0
  274. package/dist/scene/runtime-bundled-backend-service.d.ts.map +1 -0
  275. package/dist/scene/runtime-bundled-backend-service.js +1 -2
  276. package/dist/scene/scene-data-service.d.ts +1 -0
  277. package/dist/scene/scene-data-service.d.ts.map +1 -0
  278. package/dist/scene/scene-data-service.js +1 -2
  279. package/dist/scene/sky.d.ts +1 -0
  280. package/dist/scene/sky.d.ts.map +1 -0
  281. package/dist/scene/sky.js +1 -2
  282. package/dist/scene/storage/storage.d.ts +1 -0
  283. package/dist/scene/storage/storage.d.ts.map +1 -0
  284. package/dist/scene/storage/storage.js +1 -2
  285. package/dist/shader/builtin/index.d.ts +1 -0
  286. package/dist/shader/builtin/index.d.ts.map +1 -0
  287. package/dist/shader/builtin/index.js +1 -2
  288. package/dist/shader/builtin/lambert-shader.d.ts +1 -0
  289. package/dist/shader/builtin/lambert-shader.d.ts.map +1 -0
  290. package/dist/shader/builtin/lambert-shader.js +1 -2
  291. package/dist/shader/builtin/landscape-composite-shader.d.ts +1 -0
  292. package/dist/shader/builtin/landscape-composite-shader.d.ts.map +1 -0
  293. package/dist/shader/builtin/landscape-composite-shader.js +1 -2
  294. package/dist/shader/builtin/landscape-shader.d.ts +1 -0
  295. package/dist/shader/builtin/landscape-shader.d.ts.map +1 -0
  296. package/dist/shader/builtin/landscape-shader.js +1 -2
  297. package/dist/shader/builtin/standard-shader.d.ts +1 -0
  298. package/dist/shader/builtin/standard-shader.d.ts.map +1 -0
  299. package/dist/shader/builtin/standard-shader.js +1 -2
  300. package/dist/shader/builtin/unlit-shader.d.ts +1 -0
  301. package/dist/shader/builtin/unlit-shader.d.ts.map +1 -0
  302. package/dist/shader/builtin/unlit-shader.js +1 -2
  303. package/dist/shader/index.d.ts +1 -0
  304. package/dist/shader/index.d.ts.map +1 -0
  305. package/dist/shader/index.js +1 -2
  306. package/dist/shader/parameter.d.ts +1 -0
  307. package/dist/shader/parameter.d.ts.map +1 -0
  308. package/dist/shader/parameter.js +1 -2
  309. package/dist/shader/shader.d.ts +1 -0
  310. package/dist/shader/shader.d.ts.map +1 -0
  311. package/dist/shader/shader.js +1 -2
  312. package/dist/shader-nodes/bulge.d.ts +1 -0
  313. package/dist/shader-nodes/bulge.d.ts.map +1 -0
  314. package/dist/shader-nodes/bulge.js +1 -2
  315. package/dist/shader-nodes/depth.d.ts +1 -0
  316. package/dist/shader-nodes/depth.d.ts.map +1 -0
  317. package/dist/shader-nodes/depth.js +1 -2
  318. package/dist/shader-nodes/effects.d.ts +1 -0
  319. package/dist/shader-nodes/effects.d.ts.map +1 -0
  320. package/dist/shader-nodes/effects.js +1 -2
  321. package/dist/shader-nodes/glsl-node.d.ts +2 -1
  322. package/dist/shader-nodes/glsl-node.d.ts.map +1 -0
  323. package/dist/shader-nodes/glsl-node.js +1 -2
  324. package/dist/shader-nodes/index.d.ts +2 -0
  325. package/dist/shader-nodes/index.d.ts.map +1 -0
  326. package/dist/shader-nodes/index.js +1 -2
  327. package/dist/shader-nodes/landscape.d.ts +1 -0
  328. package/dist/shader-nodes/landscape.d.ts.map +1 -0
  329. package/dist/shader-nodes/landscape.js +1 -2
  330. package/dist/shader-nodes/layers.d.ts +1 -0
  331. package/dist/shader-nodes/layers.d.ts.map +1 -0
  332. package/dist/shader-nodes/layers.js +1 -2
  333. package/dist/shader-nodes/math.d.ts +1 -0
  334. package/dist/shader-nodes/math.d.ts.map +1 -0
  335. package/dist/shader-nodes/math.js +1 -2
  336. package/dist/shader-nodes/particle.d.ts +3 -0
  337. package/dist/shader-nodes/particle.d.ts.map +1 -0
  338. package/dist/shader-nodes/particle.js +1 -2
  339. package/dist/shader-nodes/shapes.d.ts +1 -0
  340. package/dist/shader-nodes/shapes.d.ts.map +1 -0
  341. package/dist/shader-nodes/shapes.js +1 -2
  342. package/dist/shader-nodes/texture-sequence.d.ts +2 -1
  343. package/dist/shader-nodes/texture-sequence.d.ts.map +1 -0
  344. package/dist/shader-nodes/texture-sequence.js +1 -2
  345. package/dist/shader-nodes/time.d.ts +1 -0
  346. package/dist/shader-nodes/time.d.ts.map +1 -0
  347. package/dist/shader-nodes/time.js +1 -2
  348. package/dist/shader-nodes/voronoi.d.ts +1 -0
  349. package/dist/shader-nodes/voronoi.d.ts.map +1 -0
  350. package/dist/shader-nodes/voronoi.js +1 -2
  351. package/dist/test/injection.test.d.ts +1 -0
  352. package/dist/test/injection.test.d.ts.map +1 -0
  353. package/dist/test/injection.test.js +1 -2
  354. package/dist/utils/async.d.ts +1 -0
  355. package/dist/utils/async.d.ts.map +1 -0
  356. package/dist/utils/async.js +1 -2
  357. package/dist/utils/buffer.d.ts +1 -0
  358. package/dist/utils/buffer.d.ts.map +1 -0
  359. package/dist/utils/buffer.js +1 -2
  360. package/dist/utils/collections.d.ts +1 -0
  361. package/dist/utils/collections.d.ts.map +1 -0
  362. package/dist/utils/collections.js +1 -2
  363. package/dist/utils/files.d.ts +1 -0
  364. package/dist/utils/files.d.ts.map +1 -0
  365. package/dist/utils/files.js +1 -2
  366. package/dist/utils/materials.d.ts +1 -0
  367. package/dist/utils/materials.d.ts.map +1 -0
  368. package/dist/utils/materials.js +1 -2
  369. package/dist/utils/math.d.ts +1 -0
  370. package/dist/utils/math.d.ts.map +1 -0
  371. package/dist/utils/math.js +1 -2
  372. package/dist/utils/mesh.d.ts +1 -0
  373. package/dist/utils/mesh.d.ts.map +1 -0
  374. package/dist/utils/mesh.js +1 -2
  375. package/dist/utils/polyfill.d.ts +1 -0
  376. package/dist/utils/polyfill.d.ts.map +1 -0
  377. package/dist/utils/polyfill.js +1 -2
  378. package/dist/utils/three/depth-pass.d.ts +1 -0
  379. package/dist/utils/three/depth-pass.d.ts.map +1 -0
  380. package/dist/utils/three/depth-pass.js +1 -2
  381. package/dist/utils/three/gpu-stats-panel.d.ts +1 -0
  382. package/dist/utils/three/gpu-stats-panel.d.ts.map +1 -0
  383. package/dist/utils/three/gpu-stats-panel.js +1 -2
  384. package/dist/utils/three/line-sphere.d.ts +1 -0
  385. package/dist/utils/three/line-sphere.d.ts.map +1 -0
  386. package/dist/utils/three/line-sphere.js +1 -2
  387. package/dist/utils/three/outline-pass.d.ts +1 -0
  388. package/dist/utils/three/outline-pass.d.ts.map +1 -0
  389. package/dist/utils/three/outline-pass.js +1 -2
  390. package/dist/utils/three/positional-audio-helper.d.ts +1 -0
  391. package/dist/utils/three/positional-audio-helper.d.ts.map +1 -0
  392. package/dist/utils/three/positional-audio-helper.js +1 -2
  393. package/dist/utils/three/stats.d.ts +1 -0
  394. package/dist/utils/three/stats.d.ts.map +1 -0
  395. package/dist/utils/three/stats.js +1 -2
  396. package/dist/utils/three/transform-controls.d.ts +1 -0
  397. package/dist/utils/three/transform-controls.d.ts.map +1 -0
  398. package/dist/utils/three/transform-controls.js +1 -2
  399. package/dist/utils/three/traverse.d.ts +1 -0
  400. package/dist/utils/three/traverse.d.ts.map +1 -0
  401. package/dist/utils/three/traverse.js +1 -2
  402. package/dist/utils/type.d.ts +1 -0
  403. package/dist/utils/type.d.ts.map +1 -0
  404. package/dist/utils/type.js +1 -2
  405. package/dist/utils/uuid.d.ts +1 -0
  406. package/dist/utils/uuid.d.ts.map +1 -0
  407. package/dist/utils/uuid.js +1 -2
  408. package/dist/worker/index.d.ts +1 -0
  409. package/dist/worker/index.d.ts.map +1 -0
  410. package/dist/worker/index.js +1 -2
  411. package/package.json +122 -122
  412. package/tsconfig.tsbuildinfo +1 -1
@@ -3,3 +3,4 @@ export declare function voronoi(uv: Vec2Node, angleOffset: FloatNode, cellDensit
3
3
  noise: FloatNode;
4
4
  cells: FloatNode;
5
5
  };
6
+ //# sourceMappingURL=voronoi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voronoi.d.ts","sourceRoot":"","sources":["../../src/shader-nodes/voronoi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwD,SAAS,EAAE,QAAQ,EAA4C,MAAM,oBAAoB,CAAC;AAWzJ,wBAAgB,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,GAAG;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAgB5H"}
@@ -1,5 +1,4 @@
1
- import{select as t,length as a,ComponentsVec2Node as r,ConstantMat2Node as l,fract as d,sin as n,cos as e,vec2 as o,vec3 as u,floor as c}from"three-shader-graph";export function voronoi(i,p,m){const y=i.multiplyScalar(m),s=c(y),x=d(y),f=[-1,0,1],h=f.flatMap((t=>f.map((a=>[t,a])))).reduce(((c,[i,m])=>{const y=o(i,m),f=function(t,a){const o=new l(15.27,47.63,99.41,89.98);return t=d(n(t.multiplyMat(o)).multiplyScalar(46839.32)),new r(n(t.y.add(a)).multiply(.5).add(.5),e(t.x.add(a)).multiply(.5).add(.5))}(y.add(s),p),h=a(y.add(f).subtract(x));return t(h.lt(c.x),u(h,f.x,f.y),c)}),u(8,0,0));return{noise:h.x,cells:h.y}}
2
- /*
1
+ import{select as t,length as a,ComponentsVec2Node as r,ConstantMat2Node as l,fract as d,sin as n,cos as e,vec2 as o,vec3 as u,floor as c}from"three-shader-graph";export function voronoi(i,p,m){const y=i.multiplyScalar(m),s=c(y),x=d(y),f=[-1,0,1],h=f.flatMap((t=>f.map((a=>[t,a])))).reduce(((c,[i,m])=>{const y=o(i,m),f=function(t,a){const o=new l(15.27,47.63,99.41,89.98);return t=d(n(t.multiplyMat(o)).multiplyScalar(46839.32)),new r(n(t.y.add(a)).multiply(.5).add(.5),e(t.x.add(a)).multiply(.5).add(.5))}(y.add(s),p),h=a(y.add(f).subtract(x));return t(h.lt(c.x),u(h,f.x,f.y),c)}),u(8,0,0));return{noise:h.x,cells:h.y}}/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -1 +1,2 @@
1
1
  import "reflect-metadata";
2
+ //# sourceMappingURL=injection.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"injection.test.d.ts","sourceRoot":"","sources":["../../src/test/injection.test.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA"}
@@ -1,5 +1,4 @@
1
- import{__decorate as t}from"tslib";import"reflect-metadata";import{expect as e,test as a}from"vitest";import{Actor as s,ActorComponent as o,ActorFactory as n,BaseActor as c,Component as i,inject as r}from"../gameplay/index.js";import{Container as l,Service as m}from"typedi";a("injecting without a service decorator",(()=>{class t{}const e=l.of("test");e.set({id:t,type:t});e.get(t)})),a("creating actors with non default container instance",(async()=>{const t=new n(l.of("custom"),{inEditor:!1});l.set(n,t);const a=await t.create(v);e(a.componentA.a.value).toBe(a.a.value),e(l.of("another").get(p).value).toBeGreaterThan(a.a.value)})),a("injection with dynamically attached component using same container",(async()=>{const t=new n(l.of("custom2"),{inEditor:!1});l.set(n,t);const a=await t.create(w);e(a.componentA.a.value).toBe(a.a.value)}));let u=class{};u=t([m()],u);let h=0,p=class{constructor(){this.name="a",this.value=h++,this.b=r(d)}};p=t([m()],p);let d=class{constructor(){this.name="b",this.value=h++}};d=t([m()],d);let f=class extends o{constructor(){super(...arguments),this.a=r(p)}};f=t([i()],f);let v=class extends c{constructor(){super(...arguments),this.a=r(p),this.componentA=this.attach(f)}};v=t([s()],v);let w=class extends c{constructor(){super(...arguments),this.a=r(p)}onInit(){this.componentA=this.attach(f)}};w=t([s()],w);
2
- /*
1
+ import{__decorate as t}from"tslib";import"reflect-metadata";import{expect as e,test as a}from"vitest";import{Actor as s,ActorComponent as o,ActorFactory as n,BaseActor as c,Component as i,inject as r}from"../gameplay/index.js";import{Container as l,Service as m}from"typedi";a("injecting without a service decorator",(()=>{class t{}const e=l.of("test");e.set({id:t,type:t});e.get(t)})),a("creating actors with non default container instance",(async()=>{const t=new n(l.of("custom"),{inEditor:!1});l.set(n,t);const a=await t.create(v);e(a.componentA.a.value).toBe(a.a.value),e(l.of("another").get(p).value).toBeGreaterThan(a.a.value)})),a("injection with dynamically attached component using same container",(async()=>{const t=new n(l.of("custom2"),{inEditor:!1});l.set(n,t);const a=await t.create(w);e(a.componentA.a.value).toBe(a.a.value)}));let u=class{};u=t([m()],u);let h=0,p=class{constructor(){this.name="a",this.value=h++,this.b=r(d)}};p=t([m()],p);let d=class{constructor(){this.name="b",this.value=h++}};d=t([m()],d);let f=class extends o{constructor(){super(...arguments),this.a=r(p)}};f=t([i()],f);let v=class extends c{constructor(){super(...arguments),this.a=r(p),this.componentA=this.attach(f)}};v=t([s()],v);let w=class extends c{constructor(){super(...arguments),this.a=r(p)}onInit(){this.componentA=this.attach(f)}};w=t([s()],w);/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -3,3 +3,4 @@ export declare function sleepDelay(ms: any): Promise<unknown>;
3
3
  * Executes a function whenever there is CPU available
4
4
  */
5
5
  export declare function whenIdle<T>(fn: () => T): Promise<T>;
6
+ //# sourceMappingURL=async.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../src/utils/async.ts"],"names":[],"mappings":"AACA,wBAAgB,UAAU,CAAC,EAAE,KAAA,oBAE5B;AAGD;;GAEG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAMnD"}
@@ -1,5 +1,4 @@
1
- export function sleepDelay(e){return new Promise((t=>setTimeout(t,e)))}export function whenIdle(e){return new Promise(((t,n)=>{window.requestIdleCallback((()=>{t(e())}),{timeout:500})}))}
2
- /*
1
+ export function sleepDelay(e){return new Promise((t=>setTimeout(t,e)))}export function whenIdle(e){return new Promise(((t,n)=>{window.requestIdleCallback((()=>{t(e())}),{timeout:500})}))}/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -1,3 +1,4 @@
1
1
  export declare const hasSharedArrayBufferSupport: boolean;
2
2
  export declare function toSharedFloat32Array(arr: Float32Array): Float32Array;
3
3
  export declare function toSharedUint32Array(arr: Uint32Array): Uint32Array;
4
+ //# sourceMappingURL=buffer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buffer.d.ts","sourceRoot":"","sources":["../../src/utils/buffer.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,2BAA2B,SAAgF,CAAA;AAExH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CAKpE;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,CAKjE"}
@@ -1,5 +1,4 @@
1
- export const hasSharedArrayBufferSupport=window.crossOriginIsolated&&void 0!==window.SharedArrayBuffer;export function toSharedFloat32Array(r){const e=new SharedArrayBuffer(r.buffer.byteLength),t=new Float32Array(e);return t.set(r),t}export function toSharedUint32Array(r){const e=new SharedArrayBuffer(r.buffer.byteLength),t=new Uint32Array(e);return t.set(r),t}
2
- /*
1
+ export const hasSharedArrayBufferSupport=window.crossOriginIsolated&&void 0!==window.SharedArrayBuffer;export function toSharedFloat32Array(r){const e=new SharedArrayBuffer(r.buffer.byteLength),t=new Float32Array(e);return t.set(r),t}export function toSharedUint32Array(r){const e=new SharedArrayBuffer(r.buffer.byteLength),t=new Uint32Array(e);return t.set(r),t}/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -24,3 +24,4 @@ export declare class ArrayMap<K, V> extends DefaultMap<K, V[]> {
24
24
  }
25
25
  export declare function partition<T>(objects: T[], predicate: (o: T) => boolean): T[][];
26
26
  export declare function removeObjectUndefined<T>(o: Record<string, T>): Record<string, T>;
27
+ //# sourceMappingURL=collections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/utils/collections.ts"],"names":[],"mappings":"AACA,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAUnE;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAMjE;AAED,qBAAa,UAAU,CAAC,CAAC,EAAE,CAAC,CAAE,YAAW,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;IAEpC,OAAO,CAAC,YAAY;IADhC,OAAO,CAAC,GAAG,CAAkB;gBACT,YAAY,EAAE,CAAC,GAAC,CAAC,MAAM,CAAC,CAAC;IAC7C,KAAK,IAAI,IAAI;IAGb,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IAGvB,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI;IAGpF,OAAO,CAAC,UAAU;IAMlB,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC;IAMd,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IAGpB,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAI3B,IAAI,IAAI,WAEP;IACD,OAAO,IAAI,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAGnC,IAAI,IAAI,gBAAgB,CAAC,CAAC,CAAC;IAG3B,MAAM,IAAI,gBAAgB,CAAC,CAAC,CAAC;IAG7B,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAG7C,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,qBAAa,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;;IAEpD,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;CAGtB;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,GAAG,CAAC,EAAE,EAAE,CAO9E;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,qBAO5D"}
@@ -1,5 +1,4 @@
1
- export function groupBy(t,e){const r=new Map;for(const s of t??[]){const t=e(s);r.has(t)||r.set(t,[]),r.get(t).push(s)}return r}export function indexBy(t,e){const r=new Map;for(const s of t??[])r.set(e(s),s);return r}export class DefaultMap{static{Symbol.toStringTag}constructor(t){this.defaultValue=t,this.map=new Map}clear(){this.map.clear()}delete(t){return this.map.delete(t)}forEach(t,e){this.map.forEach(t)}getDefault(){return"function"==typeof this.defaultValue?this.defaultValue():JSON.parse(JSON.stringify(this.defaultValue))}get(t){return this.map.has(t)||this.map.set(t,this.getDefault()),this.map.get(t)}has(t){return!0}set(t,e){return this.map.set(t,e),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}[Symbol.iterator](){return this.map[Symbol.iterator]()}}export class ArrayMap extends DefaultMap{constructor(){super((()=>[]))}push(t,e){this.get(t).push(e)}}export function partition(t,e){let r=[],s=[];for(const a of t)(e(a)?r:s).push(a);return[r,s]}export function removeObjectUndefined(t){for(const e of Object.keys(t))null==t[e]&&delete t[e];return t}
2
- /*
1
+ export function groupBy(t,e){const r=new Map;for(const s of t??[]){const t=e(s);r.has(t)||r.set(t,[]),r.get(t).push(s)}return r}export function indexBy(t,e){const r=new Map;for(const s of t??[])r.set(e(s),s);return r}export class DefaultMap{constructor(t){this.defaultValue=t,this.map=new Map}clear(){this.map.clear()}delete(t){return this.map.delete(t)}forEach(t,e){this.map.forEach(t)}getDefault(){return"function"==typeof this.defaultValue?this.defaultValue():JSON.parse(JSON.stringify(this.defaultValue))}get(t){return this.map.has(t)||this.map.set(t,this.getDefault()),this.map.get(t)}has(t){return!0}set(t,e){return this.map.set(t,e),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}[Symbol.iterator](){return this.map[Symbol.iterator]()}}Symbol.toStringTag;export class ArrayMap extends DefaultMap{constructor(){super((()=>[]))}push(t,e){this.get(t).push(e)}}export function partition(t,e){let r=[],s=[];for(const a of t)(e(a)?r:s).push(a);return[r,s]}export function removeObjectUndefined(t){for(const e of Object.keys(t))null==t[e]&&delete t[e];return t}/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -1 +1,2 @@
1
1
  export declare function pathJoin(...args: String[]): string;
2
+ //# sourceMappingURL=files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/utils/files.ts"],"names":[],"mappings":"AACA,wBAAgB,QAAQ,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,UAQzC"}
@@ -1,5 +1,4 @@
1
- export function pathJoin(...e){return e.map(((e,r)=>0===r?e.trim().replace(/[\/]*$/g,""):e.trim().replace(/(^[\/]*|[\/]*$)/g,""))).filter((e=>e.length)).join("/")}
2
- /*
1
+ export function pathJoin(...e){return e.map(((e,r)=>0===r?e.trim().replace(/[\/]*$/g,""):e.trim().replace(/(^[\/]*|[\/]*$)/g,""))).filter((e=>e.length)).join("/")}/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -1,2 +1,3 @@
1
1
  import * as THREE from 'three';
2
2
  export declare function iterateMaterials(material: THREE.Material | THREE.Material[]): Generator<THREE.Material, void, unknown>;
3
+ //# sourceMappingURL=materials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"materials.d.ts","sourceRoot":"","sources":["../../src/utils/materials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,wBAAiB,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAC,KAAK,CAAC,QAAQ,EAAE,4CAQ1E"}
@@ -1,5 +1,4 @@
1
- export function*iterateMaterials(e){if(e instanceof Array)for(const i of e)yield i;else yield e}
2
- /*
1
+ export function*iterateMaterials(e){if(e instanceof Array)for(const i of e)yield i;else yield e}/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -22,3 +22,4 @@ export declare function meanVectors3withWeight(vectors: Vector3[], weights: numb
22
22
  export declare function randomString(length?: number): string;
23
23
  export declare function toDegrees(radians: any): number;
24
24
  export declare function boundingRadius(...objects: THREE.Object3D[]): number;
25
+ //# sourceMappingURL=math.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/utils/math.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAErE;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,MAAM,KAAA,EAAE,CAAC,KAAA,QAEjC;AAED,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAO9C;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,iBAO9C;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,iBAYpD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,KAAK,OAAO,iBAQ/F;AAGD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,iBAgB5F;AAED,wBAAgB,YAAY,CAAC,MAAM,SAAI,UAEtC;AAED,wBAAgB,SAAS,CAAC,OAAO,KAAA,UAEhC;AAKD,wBAAgB,cAAc,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE,UAsB1D"}
@@ -1,5 +1,4 @@
1
- import*as t from"three";import{Vector3 as e}from"three";export function clamp(t,e,n){return Math.max(Math.min(n,t),e)}export function byChance(t,e){Math.random()<t&&e()}export function mean(t){let e=0,n=t.length;for(;--n>=0;)e+=t[n];return t.length>0?e/t.length:0}export function meanVectors3(t){const e=n.set(0,0,0);for(const n of t)e.add(n);return e.divideScalar(t.length),e}export function meanBottomVectors3(t){const e=n.set(0,0,0);let o=null;for(const n of t)e.add(n),(null==o||n.y<o)&&(o=n.y);return e.divideScalar(t.length),e.y=o,e}export function meanVectors3Mapped(t,n){const o=new e,r=new e;for(const e of t)r.add(n(e,o));return r.divideScalar(t.length),r}const n=new e;export function meanVectors3withWeight(t,e,o){let r=0;for(const t of e)r+=t;n.set(0,0,0);let a=0;for(const o of t){const t=e[a]/r;n.x+=o.x*t,n.y+=o.y*t,n.z+=o.z*t,a++}return o.copy(n),o}export function randomString(t=9){return Math.random().toString(36).substr(2,t)}export function toDegrees(t){return t*(180/Math.PI)}var o=new t.Sphere,r=new t.Sphere;export function boundingRadius(...e){o.makeEmpty(),r.makeEmpty();for(var n=0;n<e.length;n++)e[n].traverse((e=>{if(e instanceof t.Mesh){const t=e.geometry;t.computeBoundingSphere(),r.copy(t.boundingSphere),r.applyMatrix4(e.matrixWorld),o.makeEmpty().union(r)}}));return o.radius}
2
- /*
1
+ import*as t from"three";import{Vector3 as e}from"three";export function clamp(t,e,n){return Math.max(Math.min(n,t),e)}export function byChance(t,e){Math.random()<t&&e()}export function mean(t){let e=0,n=t.length;for(;--n>=0;)e+=t[n];return t.length>0?e/t.length:0}export function meanVectors3(t){const e=n.set(0,0,0);for(const n of t)e.add(n);return e.divideScalar(t.length),e}export function meanBottomVectors3(t){const e=n.set(0,0,0);let o=null;for(const n of t)e.add(n),(null==o||n.y<o)&&(o=n.y);return e.divideScalar(t.length),e.y=o,e}export function meanVectors3Mapped(t,n){const o=new e,r=new e;for(const e of t)r.add(n(e,o));return r.divideScalar(t.length),r}const n=new e;export function meanVectors3withWeight(t,e,o){let r=0;for(const t of e)r+=t;n.set(0,0,0);let a=0;for(const o of t){const t=e[a]/r;n.x+=o.x*t,n.y+=o.y*t,n.z+=o.z*t,a++}return o.copy(n),o}export function randomString(t=9){return Math.random().toString(36).substr(2,t)}export function toDegrees(t){return t*(180/Math.PI)}var o=new t.Sphere,r=new t.Sphere;export function boundingRadius(...e){o.makeEmpty(),r.makeEmpty();for(var n=0;n<e.length;n++)e[n].traverse((e=>{if(e instanceof t.Mesh){const t=e.geometry;t.computeBoundingSphere(),r.copy(t.boundingSphere),r.applyMatrix4(e.matrixWorld),o.makeEmpty().union(r)}}));return o.radius}/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -4,3 +4,4 @@ export declare class NoRaycastMesh extends THREE.Mesh {
4
4
  raycast(...args: any[]): void;
5
5
  }
6
6
  export declare function cloneMesh<T extends Object3D>(o: T): T;
7
+ //# sourceMappingURL=mesh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mesh.d.ts","sourceRoot":"","sources":["../../src/utils/mesh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,qBAAa,aAAc,SAAQ,KAAK,CAAC,IAAI;IAC3C,OAAO,CAAC,GAAG,IAAI,OAAA;CAGhB;AAED,wBAAgB,SAAS,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAGrD"}
@@ -1,5 +1,4 @@
1
- import*as e from"three";import{SkeletonUtils as t}from"three-stdlib";export class NoRaycastMesh extends e.Mesh{raycast(...e){}}export function cloneMesh(e){return t.clone(e)}
2
- /*
1
+ import*as e from"three";import{SkeletonUtils as t}from"three-stdlib";export class NoRaycastMesh extends e.Mesh{raycast(...e){}}export function cloneMesh(e){return t.clone(e)}/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -1 +1,2 @@
1
1
  export declare function polyfill(): void;
2
+ //# sourceMappingURL=polyfill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polyfill.d.ts","sourceRoot":"","sources":["../../src/utils/polyfill.ts"],"names":[],"mappings":"AAKA,wBAAgB,QAAQ,SAIvB"}
@@ -1,5 +1,4 @@
1
- import*as e from"three";import{computeBoundsTree as o,disposeBoundsTree as r,acceleratedRaycast as t}from"three-mesh-bvh";export function polyfill(){e.BufferGeometry.prototype.computeBoundsTree=o,e.BufferGeometry.prototype.disposeBoundsTree=r,e.Mesh.prototype.raycast=t}
2
- /*
1
+ import*as e from"three";import{computeBoundsTree as o,disposeBoundsTree as r,acceleratedRaycast as t}from"three-mesh-bvh";export function polyfill(){e.BufferGeometry.prototype.computeBoundsTree=o,e.BufferGeometry.prototype.disposeBoundsTree=r,e.Mesh.prototype.raycast=t}/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -11,3 +11,4 @@ declare class DepthPass extends Pass {
11
11
  render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget, deltaTime: number, maskActive?: unknown): void;
12
12
  }
13
13
  export { DepthPass };
14
+ //# sourceMappingURL=depth-pass.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"depth-pass.d.ts","sourceRoot":"","sources":["../../../src/utils/three/depth-pass.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,MAAM,EAON,iBAAiB,EAIjB,KAAK,EAKL,iBAAiB,EACjB,aAAa,EACd,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,IAAI,EAAkB,MAAM,cAAc,CAAA;AAGnD,cAAM,SAAU,SAAQ,IAAI;IAExB,OAAO,CAAC,KAAK;IACN,MAAM,EAAE,MAAM;IACd,aAAa,EAAE,iBAAiB;IAChC,iBAAiB,EAAE,iBAAiB;gBAHnC,KAAK,EAAE,KAAK,EACb,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,iBAAiB,EAChC,iBAAiB,EAAE,iBAAiB;IAM7C,OAAO;IAEP,OAAO,CAAC,KAAK,KAAA,EAAE,MAAM,KAAA;IAErB,MAAM,CACJ,QAAQ,EAAE,aAAa,EACvB,WAAW,EAAE,iBAAiB,EAC9B,UAAU,EAAE,iBAAiB,EAC7B,SAAS,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,OAAO;CAmDvB;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -1,5 +1,4 @@
1
- import{depthUniformName as e}from"../../shader-nodes/depth.js";import{Mesh as r}from"three";import{Pass as t}from"three-stdlib";class s extends t{constructor(e,r,t,s){super(),this.scene=e,this.camera=r,this.depthMaterial=t,this.depthRenderTarget=s,this.needsSwap=!0}dispose(){}setSize(e,r){}render(t,s,i,a,n){if(this.renderToScreen)t.setRenderTarget(null),t.render(this.scene,this.camera);else{const i=[];this.scene.traverse((t=>{t instanceof r&&t.visible&&(t.material?.userData?.water||t.material?.uniforms&&null!=t.material?.uniforms[e])&&(t.visible=!1,i.push(t))})),this.scene.overrideMaterial=this.depthMaterial,t.setRenderTarget(this.depthRenderTarget),t.render(this.scene,this.camera),this.scene.overrideMaterial=null,i.forEach((e=>e.visible=!0)),t.setRenderTarget(s),t.clear(),t.render(this.scene,this.camera)}}}export{s as DepthPass};
2
- /*
1
+ import{depthUniformName as e}from"../../shader-nodes/depth.js";import{Mesh as r}from"three";import{Pass as t}from"three-stdlib";class s extends t{constructor(e,r,t,s){super(),this.scene=e,this.camera=r,this.depthMaterial=t,this.depthRenderTarget=s,this.needsSwap=!0}dispose(){}setSize(e,r){}render(t,s,i,a,n){if(this.renderToScreen)t.setRenderTarget(null),t.render(this.scene,this.camera);else{const i=[];this.scene.traverse((t=>{t instanceof r&&t.visible&&(t.material?.userData?.water||t.material?.uniforms&&null!=t.material?.uniforms[e])&&(t.visible=!1,i.push(t))})),this.scene.overrideMaterial=this.depthMaterial,t.setRenderTarget(this.depthRenderTarget),t.render(this.scene,this.camera),this.scene.overrideMaterial=null,i.forEach((e=>e.visible=!0)),t.setRenderTarget(s),t.clear(),t.render(this.scene,this.camera)}}}export{s as DepthPass};/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -8,3 +8,4 @@ export class GPUStatsPanel extends Stats.Panel {
8
8
  endQuery: () => void;
9
9
  }
10
10
  import Stats from 'three/examples/jsm/libs/stats.module.js';
11
+ //# sourceMappingURL=gpu-stats-panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpu-stats-panel.d.ts","sourceRoot":"","sources":["../../../src/utils/three/gpu-stats-panel.js"],"names":[],"mappings":"AAIA;IAEC,yCA8HC;IA3GA,aAAsB;IACtB,eAA0B;IAC1B,gBAAiB;IACjB,sBAAsB;IAEtB,uBA4EC;IAED,qBAsBC;CAIF;kBAtIiB,yCAAyC"}
@@ -1,5 +1,4 @@
1
- import e from"three/examples/jsm/libs/stats.module.js";class t extends e.Panel{constructor(e,t="GPU MS"){super(t,"#f90","#210");let i=!0,s=e.getExtension("EXT_disjoint_timer_query_webgl2");null===s&&(i=!1,s=e.getExtension("EXT_disjoint_timer_query"),null===s&&console.warn("GPUStatsPanel: disjoint_time_query extension not available.")),this.context=e,this.extension=s,this.maxTime=30,this.activeQueries=0,this.startQuery=function(){if(this.activeQueries>2)return;const e=this.context,t=this.extension;if(null===t)return;let s;i?(s=e.createQuery(),e.beginQuery(t.TIME_ELAPSED_EXT,s)):(s=t.createQueryEXT(),t.beginQueryEXT(t.TIME_ELAPSED_EXT,s)),this.activeQueries++;const n=()=>{let r,E,u;i?(r=e.getQueryParameter(s,e.QUERY_RESULT_AVAILABLE),E=e.getParameter(t.GPU_DISJOINT_EXT),u=e.getQueryParameter(s,e.QUERY_RESULT)):(r=t.getQueryObjectEXT(s,t.QUERY_RESULT_AVAILABLE_EXT),E=e.getParameter(t.GPU_DISJOINT_EXT),u=t.getQueryObjectEXT(s,t.QUERY_RESULT_EXT));const a=1e-6*u;r?(E||this.update(a,this.maxTime),this.activeQueries--):requestAnimationFrame(n)};n()},this.endQuery=function(){const e=this.extension,t=this.context;null!==e&&(i?t.endQuery(e.TIME_ELAPSED_EXT):e.endQueryEXT(e.TIME_ELAPSED_EXT))}}}export{t as GPUStatsPanel};
2
- /*
1
+ import e from"three/examples/jsm/libs/stats.module.js";class t extends e.Panel{constructor(e,t="GPU MS"){super(t,"#f90","#210");let i=!0,s=e.getExtension("EXT_disjoint_timer_query_webgl2");null===s&&(i=!1,s=e.getExtension("EXT_disjoint_timer_query"),null===s&&console.warn("GPUStatsPanel: disjoint_time_query extension not available.")),this.context=e,this.extension=s,this.maxTime=30,this.activeQueries=0,this.startQuery=function(){if(this.activeQueries>2)return;const e=this.context,t=this.extension;if(null===t)return;let s;i?(s=e.createQuery(),e.beginQuery(t.TIME_ELAPSED_EXT,s)):(s=t.createQueryEXT(),t.beginQueryEXT(t.TIME_ELAPSED_EXT,s)),this.activeQueries++;const n=()=>{let r,E,u;i?(r=e.getQueryParameter(s,e.QUERY_RESULT_AVAILABLE),E=e.getParameter(t.GPU_DISJOINT_EXT),u=e.getQueryParameter(s,e.QUERY_RESULT)):(r=t.getQueryObjectEXT(s,t.QUERY_RESULT_AVAILABLE_EXT),E=e.getParameter(t.GPU_DISJOINT_EXT),u=t.getQueryObjectEXT(s,t.QUERY_RESULT_EXT));const a=1e-6*u;r?(E||this.update(a,this.maxTime),this.activeQueries--):requestAnimationFrame(n)};n()},this.endQuery=function(){const e=this.extension,t=this.context;null!==e&&(i?t.endQuery(e.TIME_ELAPSED_EXT):e.endQueryEXT(e.TIME_ELAPSED_EXT))}}}export{t as GPUStatsPanel};/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -1,2 +1,3 @@
1
1
  import * as THREE from "three";
2
2
  export declare function createLineSphere(radius: number): THREE.Object3D;
3
+ //# sourceMappingURL=line-sphere.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-sphere.d.ts","sourceRoot":"","sources":["../../../src/utils/three/line-sphere.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAyB9B,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,QAAQ,CAS/D"}
@@ -1,5 +1,4 @@
1
- import*as e from"three";const t=new e.EllipseCurve(0,0,1,1,0,2*Math.PI,!1,0).getPoints(50),r=(new e.BufferGeometry).setFromPoints(t),o=new e.LineBasicMaterial({color:16777215,side:e.DoubleSide});function n(t){const n=new e.Line(r,o);return n.scale.multiplyScalar(t),n}export function createLineSphere(t){const r=n(t),o=n(t);o.rotateY(Math.PI/2),o.updateMatrixWorld();const a=n(t);return a.rotateX(Math.PI/2),a.updateMatrixWorld(),(new e.Group).add(r,o,a)}
2
- /*
1
+ import*as e from"three";const t=new e.EllipseCurve(0,0,1,1,0,2*Math.PI,!1,0).getPoints(50),r=(new e.BufferGeometry).setFromPoints(t),o=new e.LineBasicMaterial({color:16777215,side:e.DoubleSide});function n(t){const n=new e.Line(r,o);return n.scale.multiplyScalar(t),n}export function createLineSphere(t){const r=n(t),o=n(t);o.rotateY(Math.PI/2),o.updateMatrixWorld();const a=n(t);return a.rotateX(Math.PI/2),a.updateMatrixWorld(),(new e.Group).add(r,o,a)}/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -58,3 +58,4 @@ import { MeshDepthMaterial } from 'three';
58
58
  import { ShaderMaterial } from 'three';
59
59
  import { FullScreenQuad } from 'three-stdlib';
60
60
  import { Matrix4 } from 'three';
61
+ //# sourceMappingURL=outline-pass.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outline-pass.d.ts","sourceRoot":"","sources":["../../../src/utils/three/outline-pass.js"],"names":[],"mappings":"AAoBA;IAEE,4EAmHC;IA/GO,iBAAwB;IACxB,kBAA0B;IAC1B,qBAA2E;IAC3E,wBAA4C;IAC5C,uBAAmD;IACnD,iBAAmB;IACnB,2BAA8B;IAC9B,sBAAwB;IACxB,qBAAuB;IACvB,wBAAwB;IACxB,oBAAoB;IAEpB,gCAAiC;IAGjC,oBAAoH;IAOpH,sCAAsE;IAEtE,mEAAiG;IAIjG,iCAA4C;IAK5C,oCAAwD;IAIxD,oEAAkG;IAIlG,6EAAiF;IAIjF,oEAAwE;IAGxE,oEAA4G;IAI5G,sCAA4D;IAC5D,oEAAwE;IAGxE,oEAA4G;IAO5G,uCAAiF;IAGjF,uCAA4E;IAK5E,gCAAgD;IAOhD,wDAA8D;IAG9D,6BAQG;IAKH,sBAAiC;IACjC,sBAAsB;IAEtB,4BAAwC;IAExC,uBAAkC;IAClC,uBAAkC;IAClC,uBAAkC;IAwB1C,uCAoBC;IAED,uDA8BC;IAED,0DA2EC;IAED,4BASC;IAED,gGAqIC;IAED,yCA0CC;IAED,2CA0CC;IAED,yDAkDC;IAED,qCAgDC;CAEF;;;;;qBAzlBoC,cAAc;sBAD5C,OAAO;wBAAP,OAAO;kCAAP,OAAO;kCAAP,OAAO;kCAAP,OAAO;+BAAP,OAAO;+BACuB,cAAc;wBAD5C,OAAO"}
@@ -1,5 +1,4 @@
1
- import{AdditiveBlending as e,Color as r,DoubleSide as t,LinearFilter as i,Matrix4 as a,MeshBasicMaterial as s,MeshDepthMaterial as n,NoBlending as l,RGBADepthPacking as u,RGBAFormat as o,ShaderMaterial as d,UniformsUtils as h,Vector2 as f,Vector3 as v,WebGLRenderTarget as g}from"three";import{Pass as c,FullScreenQuad as m}from"three-stdlib";import{CopyShader as p}from"three-stdlib";class x extends c{constructor(e,v,c,x){super(),this.renderScene=v,this.renderCamera=c,this.selectedObjects=void 0!==x?x:[],this.visibleEdgeColor=new r(1,1,1),this.hiddenEdgeColor=new r(.1,.04,.02),this.edgeGlow=0,this.usePatternTexture=!1,this.edgeThickness=1,this.edgeStrength=3,this.downSampleRatio=2,this.pulsePeriod=0,this._visibilityCache=new Map,this.resolution=void 0!==e?new f(e.x,e.y):new f(256,256);const M={minFilter:i,magFilter:i,format:o},T=Math.round(this.resolution.x/this.downSampleRatio),B=Math.round(this.resolution.y/this.downSampleRatio);this.maskBufferMaterial=new s({color:16777215}),this.maskBufferMaterial.side=t,this.renderTargetMaskBuffer=new g(this.resolution.x,this.resolution.y,M),this.renderTargetMaskBuffer.texture.name="OutlinePass.mask",this.renderTargetMaskBuffer.texture.generateMipmaps=!1,this.depthMaterial=new n,this.depthMaterial.side=t,this.depthMaterial.depthPacking=u,this.depthMaterial.blending=l,this.prepareMaskMaterial=this.getPrepareMaskMaterial(),this.prepareMaskMaterial.side=t,this.prepareMaskMaterial.fragmentShader=function(e,r){var t=r.isPerspectiveCamera?"perspective":"orthographic";return e.replace(/DEPTH_TO_VIEW_Z/g,t+"DepthToViewZ")}(this.prepareMaskMaterial.fragmentShader,this.renderCamera),this.renderTargetDepthBuffer=new g(this.resolution.x,this.resolution.y,M),this.renderTargetDepthBuffer.texture.name="OutlinePass.depth",this.renderTargetDepthBuffer.texture.generateMipmaps=!1,this.renderTargetMaskDownSampleBuffer=new g(T,B,M),this.renderTargetMaskDownSampleBuffer.texture.name="OutlinePass.depthDownSample",this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps=!1,this.renderTargetBlurBuffer1=new g(T,B,M),this.renderTargetBlurBuffer1.texture.name="OutlinePass.blur1",this.renderTargetBlurBuffer1.texture.generateMipmaps=!1,this.renderTargetBlurBuffer2=new g(Math.round(T/2),Math.round(B/2),M),this.renderTargetBlurBuffer2.texture.name="OutlinePass.blur2",this.renderTargetBlurBuffer2.texture.generateMipmaps=!1,this.edgeDetectionMaterial=this.getEdgeDetectionMaterial(),this.renderTargetEdgeBuffer1=new g(T,B,M),this.renderTargetEdgeBuffer1.texture.name="OutlinePass.edge1",this.renderTargetEdgeBuffer1.texture.generateMipmaps=!1,this.renderTargetEdgeBuffer2=new g(Math.round(T/2),Math.round(B/2),M),this.renderTargetEdgeBuffer2.texture.name="OutlinePass.edge2",this.renderTargetEdgeBuffer2.texture.generateMipmaps=!1;this.separableBlurMaterial1=this.getSeperableBlurMaterial(4),this.separableBlurMaterial1.uniforms.texSize.value.set(T,B),this.separableBlurMaterial1.uniforms.kernelRadius.value=1,this.separableBlurMaterial2=this.getSeperableBlurMaterial(4),this.separableBlurMaterial2.uniforms.texSize.value.set(Math.round(T/2),Math.round(B/2)),this.separableBlurMaterial2.uniforms.kernelRadius.value=4,this.overlayMaterial=this.getOverlayMaterial(),void 0===p&&console.error("THREE.OutlinePass relies on CopyShader");const S=p;this.copyUniforms=h.clone(S.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new d({uniforms:this.copyUniforms,vertexShader:S.vertexShader,fragmentShader:S.fragmentShader,blending:l,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new r,this.oldClearAlpha=1,this.fsQuad=new m(null),this.tempPulseColor1=new r,this.tempPulseColor2=new r,this.textureMatrix=new a}dispose(){this.renderTargetMaskBuffer.dispose(),this.renderTargetDepthBuffer.dispose(),this.renderTargetMaskDownSampleBuffer.dispose(),this.renderTargetBlurBuffer1.dispose(),this.renderTargetBlurBuffer2.dispose(),this.renderTargetEdgeBuffer1.dispose(),this.renderTargetEdgeBuffer2.dispose()}setSize(e,r){this.renderTargetMaskBuffer.setSize(e,r),this.renderTargetDepthBuffer.setSize(e,r);let t=Math.round(e/this.downSampleRatio),i=Math.round(r/this.downSampleRatio);this.renderTargetMaskDownSampleBuffer.setSize(t,i),this.renderTargetBlurBuffer1.setSize(t,i),this.renderTargetEdgeBuffer1.setSize(t,i),this.separableBlurMaterial1.uniforms.texSize.value.set(t,i),t=Math.round(t/2),i=Math.round(i/2),this.renderTargetBlurBuffer2.setSize(t,i),this.renderTargetEdgeBuffer2.setSize(t,i),this.separableBlurMaterial2.uniforms.texSize.value.set(t,i)}changeVisibilityOfSelectedObjects(e){const r=this._visibilityCache;function t(t){t.isMesh&&(!0===e?t.visible=r.get(t):(r.set(t,t.visible),t.visible=e))}for(let e=0;e<this.selectedObjects.length;e++){this.selectedObjects[e].traverse(t)}}changeVisibilityOfNonSelectedObjects(e){const r=this._visibilityCache,t=[];function i(e){e.isMesh&&t.push(e)}for(let e=0;e<this.selectedObjects.length;e++){this.selectedObjects[e].traverse(i)}this.renderScene.traverse((function(i){if(i.isMesh||i.isSprite||i.isTransformControls){let a=!1;for(let e=0;e<t.length;e++){if(t[e].id===i.id){a=!0;break}}if(!1===a){const t=i.visible;!1!==e&&!0!==r.get(i)||(i.visible=e),r.set(i,t)}}else(i.isPoints||i.isLine)&&(!0===e?i.visible=r.get(i):(r.set(i,i.visible),i.visible=e))}))}updateTextureMatrix(){this.textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),this.textureMatrix.multiply(this.renderCamera.projectionMatrix),this.textureMatrix.multiply(this.renderCamera.matrixWorldInverse)}render(e,r,t,i,a){if(this.selectedObjects.length>0){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const r=e.autoClear;e.autoClear=!1,a&&e.state.buffers.stencil.setTest(!1),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);const i=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.setRenderTarget(this.renderTargetDepthBuffer),e.clear(),e.render(this.renderScene,this.renderCamera),this.changeVisibilityOfSelectedObjects(!0),this._visibilityCache.clear(),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value.set(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.setRenderTarget(this.renderTargetMaskBuffer),e.clear(),e.render(this.renderScene,this.renderCamera),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this._visibilityCache.clear(),this.renderScene.background=i,this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.setRenderTarget(this.renderTargetMaskDownSampleBuffer),e.clear(),this.fsQuad.render(e),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){const e=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(e),this.tempPulseColor2.multiplyScalar(e)}this.fsQuad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value.set(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=x.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.setRenderTarget(this.renderTargetBlurBuffer1),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=x.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=x.BlurDirectionX,e.setRenderTarget(this.renderTargetBlurBuffer2),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=x.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer2),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,a&&e.state.buffers.stencil.setTest(!0),e.setRenderTarget(t),this.fsQuad.render(e),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=r}this.renderToScreen&&(this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=t.texture,e.setRenderTarget(null),this.fsQuad.render(e))}getPrepareMaskMaterial(){return new d({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new f(.5,.5)},textureMatrix:{value:null}},vertexShader:"#include <morphtarget_pars_vertex>\n #include <skinning_pars_vertex>\n varying vec4 projTexCoord;\n varying vec4 vPosition;\n uniform mat4 textureMatrix;\n void main() {\n #include <skinbase_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n vPosition = mvPosition;\n vec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n projTexCoord = textureMatrix * worldPosition;\n }",fragmentShader:"#include <packing>\n varying vec4 vPosition;\n varying vec4 projTexCoord;\n uniform sampler2D depthTexture;\n uniform vec2 cameraNearFar;\n void main() {\n float depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));\n float viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );\n float depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;\n gl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);\n }"})}getEdgeDetectionMaterial(){return new d({uniforms:{maskTexture:{value:null},texSize:{value:new f(.5,.5)},visibleEdgeColor:{value:new v(1,1,1)},hiddenEdgeColor:{value:new v(1,1,1)}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"varying vec2 vUv;\n uniform sampler2D maskTexture;\n uniform vec2 texSize;\n uniform vec3 visibleEdgeColor;\n uniform vec3 hiddenEdgeColor;\n void main() {\n vec2 invSize = 1.0 / texSize;\n vec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\n vec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\n vec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\n vec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\n vec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\n float diff1 = (c1.r - c2.r)*0.5;\n float diff2 = (c3.r - c4.r)*0.5;\n float d = length( vec2(diff1, diff2) );\n float a1 = min(c1.g, c2.g);\n float a2 = min(c3.g, c4.g);\n float visibilityFactor = min(a1, a2);\n vec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\n gl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\n }"})}getSeperableBlurMaterial(e){return new d({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new f(.5,.5)},direction:{value:new f(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"#include <common>\n varying vec2 vUv;\n uniform sampler2D colorTexture;\n uniform vec2 texSize;\n uniform vec2 direction;\n uniform float kernelRadius;\n float gaussianPdf(in float x, in float sigma) {\n return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n }\n void main() {\n vec2 invSize = 1.0 / texSize;\n float weightSum = gaussianPdf(0.0, kernelRadius);\n vec4 diffuseSum = texture2D( colorTexture, vUv) * weightSum;\n vec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\n vec2 uvOffset = delta;\n for( int i = 1; i <= MAX_RADIUS; i ++ ) {\n float w = gaussianPdf(uvOffset.x, kernelRadius);\n vec4 sample1 = texture2D( colorTexture, vUv + uvOffset);\n vec4 sample2 = texture2D( colorTexture, vUv - uvOffset);\n diffuseSum += ((sample1 + sample2) * w);\n weightSum += (2.0 * w);\n uvOffset += delta;\n }\n gl_FragColor = diffuseSum/weightSum;\n }"})}getOverlayMaterial(){return new d({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"varying vec2 vUv;\n uniform sampler2D maskTexture;\n uniform sampler2D edgeTexture1;\n uniform sampler2D edgeTexture2;\n uniform sampler2D patternTexture;\n uniform float edgeStrength;\n uniform float edgeGlow;\n uniform bool usePatternTexture;\n void main() {\n vec4 edgeValue1 = texture2D(edgeTexture1, vUv);\n vec4 edgeValue2 = texture2D(edgeTexture2, vUv);\n vec4 maskColor = texture2D(maskTexture, vUv);\n vec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\n float visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\n vec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\n vec4 finalColor = edgeStrength * maskColor.r * edgeValue;\n if(usePatternTexture)\n finalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\n gl_FragColor = finalColor;\n }",blending:e,depthTest:!1,depthWrite:!1,transparent:!0})}}x.BlurDirectionX=new f(1,0),x.BlurDirectionY=new f(0,1);export{x as OutlinePass};
2
- /*
1
+ import{AdditiveBlending as e,Color as r,DoubleSide as t,LinearFilter as i,Matrix4 as a,MeshBasicMaterial as s,MeshDepthMaterial as n,NoBlending as l,RGBADepthPacking as u,RGBAFormat as o,ShaderMaterial as d,UniformsUtils as h,Vector2 as f,Vector3 as v,WebGLRenderTarget as g}from"three";import{Pass as c,FullScreenQuad as m}from"three-stdlib";import{CopyShader as p}from"three-stdlib";class x extends c{constructor(e,v,c,x){super(),this.renderScene=v,this.renderCamera=c,this.selectedObjects=void 0!==x?x:[],this.visibleEdgeColor=new r(1,1,1),this.hiddenEdgeColor=new r(.1,.04,.02),this.edgeGlow=0,this.usePatternTexture=!1,this.edgeThickness=1,this.edgeStrength=3,this.downSampleRatio=2,this.pulsePeriod=0,this._visibilityCache=new Map,this.resolution=void 0!==e?new f(e.x,e.y):new f(256,256);const M={minFilter:i,magFilter:i,format:o},T=Math.round(this.resolution.x/this.downSampleRatio),B=Math.round(this.resolution.y/this.downSampleRatio);this.maskBufferMaterial=new s({color:16777215}),this.maskBufferMaterial.side=t,this.renderTargetMaskBuffer=new g(this.resolution.x,this.resolution.y,M),this.renderTargetMaskBuffer.texture.name="OutlinePass.mask",this.renderTargetMaskBuffer.texture.generateMipmaps=!1,this.depthMaterial=new n,this.depthMaterial.side=t,this.depthMaterial.depthPacking=u,this.depthMaterial.blending=l,this.prepareMaskMaterial=this.getPrepareMaskMaterial(),this.prepareMaskMaterial.side=t,this.prepareMaskMaterial.fragmentShader=function(e,r){var t=r.isPerspectiveCamera?"perspective":"orthographic";return e.replace(/DEPTH_TO_VIEW_Z/g,t+"DepthToViewZ")}(this.prepareMaskMaterial.fragmentShader,this.renderCamera),this.renderTargetDepthBuffer=new g(this.resolution.x,this.resolution.y,M),this.renderTargetDepthBuffer.texture.name="OutlinePass.depth",this.renderTargetDepthBuffer.texture.generateMipmaps=!1,this.renderTargetMaskDownSampleBuffer=new g(T,B,M),this.renderTargetMaskDownSampleBuffer.texture.name="OutlinePass.depthDownSample",this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps=!1,this.renderTargetBlurBuffer1=new g(T,B,M),this.renderTargetBlurBuffer1.texture.name="OutlinePass.blur1",this.renderTargetBlurBuffer1.texture.generateMipmaps=!1,this.renderTargetBlurBuffer2=new g(Math.round(T/2),Math.round(B/2),M),this.renderTargetBlurBuffer2.texture.name="OutlinePass.blur2",this.renderTargetBlurBuffer2.texture.generateMipmaps=!1,this.edgeDetectionMaterial=this.getEdgeDetectionMaterial(),this.renderTargetEdgeBuffer1=new g(T,B,M),this.renderTargetEdgeBuffer1.texture.name="OutlinePass.edge1",this.renderTargetEdgeBuffer1.texture.generateMipmaps=!1,this.renderTargetEdgeBuffer2=new g(Math.round(T/2),Math.round(B/2),M),this.renderTargetEdgeBuffer2.texture.name="OutlinePass.edge2",this.renderTargetEdgeBuffer2.texture.generateMipmaps=!1;this.separableBlurMaterial1=this.getSeperableBlurMaterial(4),this.separableBlurMaterial1.uniforms.texSize.value.set(T,B),this.separableBlurMaterial1.uniforms.kernelRadius.value=1,this.separableBlurMaterial2=this.getSeperableBlurMaterial(4),this.separableBlurMaterial2.uniforms.texSize.value.set(Math.round(T/2),Math.round(B/2)),this.separableBlurMaterial2.uniforms.kernelRadius.value=4,this.overlayMaterial=this.getOverlayMaterial(),void 0===p&&console.error("THREE.OutlinePass relies on CopyShader");const S=p;this.copyUniforms=h.clone(S.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new d({uniforms:this.copyUniforms,vertexShader:S.vertexShader,fragmentShader:S.fragmentShader,blending:l,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new r,this.oldClearAlpha=1,this.fsQuad=new m(null),this.tempPulseColor1=new r,this.tempPulseColor2=new r,this.textureMatrix=new a}dispose(){this.renderTargetMaskBuffer.dispose(),this.renderTargetDepthBuffer.dispose(),this.renderTargetMaskDownSampleBuffer.dispose(),this.renderTargetBlurBuffer1.dispose(),this.renderTargetBlurBuffer2.dispose(),this.renderTargetEdgeBuffer1.dispose(),this.renderTargetEdgeBuffer2.dispose()}setSize(e,r){this.renderTargetMaskBuffer.setSize(e,r),this.renderTargetDepthBuffer.setSize(e,r);let t=Math.round(e/this.downSampleRatio),i=Math.round(r/this.downSampleRatio);this.renderTargetMaskDownSampleBuffer.setSize(t,i),this.renderTargetBlurBuffer1.setSize(t,i),this.renderTargetEdgeBuffer1.setSize(t,i),this.separableBlurMaterial1.uniforms.texSize.value.set(t,i),t=Math.round(t/2),i=Math.round(i/2),this.renderTargetBlurBuffer2.setSize(t,i),this.renderTargetEdgeBuffer2.setSize(t,i),this.separableBlurMaterial2.uniforms.texSize.value.set(t,i)}changeVisibilityOfSelectedObjects(e){const r=this._visibilityCache;function t(t){t.isMesh&&(!0===e?t.visible=r.get(t):(r.set(t,t.visible),t.visible=e))}for(let e=0;e<this.selectedObjects.length;e++){this.selectedObjects[e].traverse(t)}}changeVisibilityOfNonSelectedObjects(e){const r=this._visibilityCache,t=[];function i(e){e.isMesh&&t.push(e)}for(let e=0;e<this.selectedObjects.length;e++){this.selectedObjects[e].traverse(i)}this.renderScene.traverse((function(i){if(i.isMesh||i.isSprite||i.isTransformControls){let a=!1;for(let e=0;e<t.length;e++){if(t[e].id===i.id){a=!0;break}}if(!1===a){const t=i.visible;!1!==e&&!0!==r.get(i)||(i.visible=e),r.set(i,t)}}else(i.isPoints||i.isLine)&&(!0===e?i.visible=r.get(i):(r.set(i,i.visible),i.visible=e))}))}updateTextureMatrix(){this.textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),this.textureMatrix.multiply(this.renderCamera.projectionMatrix),this.textureMatrix.multiply(this.renderCamera.matrixWorldInverse)}render(e,r,t,i,a){if(this.selectedObjects.length>0){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const r=e.autoClear;e.autoClear=!1,a&&e.state.buffers.stencil.setTest(!1),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);const i=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.setRenderTarget(this.renderTargetDepthBuffer),e.clear(),e.render(this.renderScene,this.renderCamera),this.changeVisibilityOfSelectedObjects(!0),this._visibilityCache.clear(),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value.set(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.setRenderTarget(this.renderTargetMaskBuffer),e.clear(),e.render(this.renderScene,this.renderCamera),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this._visibilityCache.clear(),this.renderScene.background=i,this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.setRenderTarget(this.renderTargetMaskDownSampleBuffer),e.clear(),this.fsQuad.render(e),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){const e=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(e),this.tempPulseColor2.multiplyScalar(e)}this.fsQuad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value.set(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=x.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.setRenderTarget(this.renderTargetBlurBuffer1),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=x.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=x.BlurDirectionX,e.setRenderTarget(this.renderTargetBlurBuffer2),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=x.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer2),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,a&&e.state.buffers.stencil.setTest(!0),e.setRenderTarget(t),this.fsQuad.render(e),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=r}this.renderToScreen&&(this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=t.texture,e.setRenderTarget(null),this.fsQuad.render(e))}getPrepareMaskMaterial(){return new d({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new f(.5,.5)},textureMatrix:{value:null}},vertexShader:"#include <morphtarget_pars_vertex>\n #include <skinning_pars_vertex>\n varying vec4 projTexCoord;\n varying vec4 vPosition;\n uniform mat4 textureMatrix;\n void main() {\n #include <skinbase_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n vPosition = mvPosition;\n vec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n projTexCoord = textureMatrix * worldPosition;\n }",fragmentShader:"#include <packing>\n varying vec4 vPosition;\n varying vec4 projTexCoord;\n uniform sampler2D depthTexture;\n uniform vec2 cameraNearFar;\n void main() {\n float depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));\n float viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );\n float depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;\n gl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);\n }"})}getEdgeDetectionMaterial(){return new d({uniforms:{maskTexture:{value:null},texSize:{value:new f(.5,.5)},visibleEdgeColor:{value:new v(1,1,1)},hiddenEdgeColor:{value:new v(1,1,1)}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"varying vec2 vUv;\n uniform sampler2D maskTexture;\n uniform vec2 texSize;\n uniform vec3 visibleEdgeColor;\n uniform vec3 hiddenEdgeColor;\n void main() {\n vec2 invSize = 1.0 / texSize;\n vec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\n vec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\n vec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\n vec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\n vec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\n float diff1 = (c1.r - c2.r)*0.5;\n float diff2 = (c3.r - c4.r)*0.5;\n float d = length( vec2(diff1, diff2) );\n float a1 = min(c1.g, c2.g);\n float a2 = min(c3.g, c4.g);\n float visibilityFactor = min(a1, a2);\n vec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\n gl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\n }"})}getSeperableBlurMaterial(e){return new d({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new f(.5,.5)},direction:{value:new f(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"#include <common>\n varying vec2 vUv;\n uniform sampler2D colorTexture;\n uniform vec2 texSize;\n uniform vec2 direction;\n uniform float kernelRadius;\n float gaussianPdf(in float x, in float sigma) {\n return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n }\n void main() {\n vec2 invSize = 1.0 / texSize;\n float weightSum = gaussianPdf(0.0, kernelRadius);\n vec4 diffuseSum = texture2D( colorTexture, vUv) * weightSum;\n vec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\n vec2 uvOffset = delta;\n for( int i = 1; i <= MAX_RADIUS; i ++ ) {\n float w = gaussianPdf(uvOffset.x, kernelRadius);\n vec4 sample1 = texture2D( colorTexture, vUv + uvOffset);\n vec4 sample2 = texture2D( colorTexture, vUv - uvOffset);\n diffuseSum += ((sample1 + sample2) * w);\n weightSum += (2.0 * w);\n uvOffset += delta;\n }\n gl_FragColor = diffuseSum/weightSum;\n }"})}getOverlayMaterial(){return new d({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"varying vec2 vUv;\n uniform sampler2D maskTexture;\n uniform sampler2D edgeTexture1;\n uniform sampler2D edgeTexture2;\n uniform sampler2D patternTexture;\n uniform float edgeStrength;\n uniform float edgeGlow;\n uniform bool usePatternTexture;\n void main() {\n vec4 edgeValue1 = texture2D(edgeTexture1, vUv);\n vec4 edgeValue2 = texture2D(edgeTexture2, vUv);\n vec4 maskColor = texture2D(maskTexture, vUv);\n vec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\n float visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\n vec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\n vec4 finalColor = edgeStrength * maskColor.r * edgeValue;\n if(usePatternTexture)\n finalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\n gl_FragColor = finalColor;\n }",blending:e,depthTest:!1,depthWrite:!1,transparent:!0})}}x.BlurDirectionX=new f(1,0),x.BlurDirectionY=new f(0,1);export{x as OutlinePass};/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -10,3 +10,4 @@ export class PositionalAudioHelper extends Line<BufferGeometry<import("three").N
10
10
  }
11
11
  import { BufferGeometry } from 'three';
12
12
  import { Line } from 'three';
13
+ //# sourceMappingURL=positional-audio-helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"positional-audio-helper.d.ts","sourceRoot":"","sources":["../../../src/utils/three/positional-audio-helper.js"],"names":[],"mappings":"AAEA;IACE,oGAkBC;IAPC,aAAmC;IACnC,WAAkB;IAClB,cAAkB;IAClB,4BAA8C;IAC9C,4BAA8C;IAKhD,eA6DC;IAED,gBAIC;CACF;+BA3FmF,OAAO;qBAAP,OAAO"}
@@ -1,5 +1,4 @@
1
- import{BufferGeometry as t,BufferAttribute as e,LineBasicMaterial as i,Line as s,MathUtils as n}from"three";class o extends s{constructor(s,n=1,o=16,r=2){const a=new t,d=new Float32Array(3*(3*(o+2*r)+3));a.setAttribute("position",new e(d,3));const h=new i({color:65280,linewidth:2});super(a,[new i({color:16776960,linewidth:2}),h]),this.type="PositionalAudioHelper",this.audio=s,this.range=n,this.divisionsInnerAngle=o,this.divisionsOuterAngle=r,this.update()}update(){const t=this.audio,e=this.range,i=this.divisionsInnerAngle,s=this.divisionsOuterAngle,o=n.degToRad(t.panner.coneInnerAngle),r=n.degToRad(t.panner.coneOuterAngle),a=o/2,d=r/2;let h,l,p=0,c=0;const u=this.geometry,g=u.attributes.position;function m(t,i,s,n){const o=(i-t)/s;for(g.setXYZ(p,0,0,0),c++,h=t;h<i;h+=o)l=p+c,g.setXYZ(l,Math.sin(h)*e,0,Math.cos(h)*e),g.setXYZ(l+1,Math.sin(Math.min(h+o,i))*e,0,Math.cos(Math.min(h+o,i))*e),g.setXYZ(l+2,0,0,0),c+=3;u.addGroup(p,c,n),p+=c,c=0}u.clearGroups(),m(-d,-a,s,0),m(-a,a,i,1),m(a,d,s,0),g.needsUpdate=!0,o===r&&(this.material[0].visible=!1)}dispose(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()}}export{o as PositionalAudioHelper};
2
- /*
1
+ import{BufferGeometry as t,BufferAttribute as e,LineBasicMaterial as i,Line as s,MathUtils as n}from"three";class o extends s{constructor(s,n=1,o=16,r=2){const a=new t,d=new Float32Array(3*(3*(o+2*r)+3));a.setAttribute("position",new e(d,3));const h=new i({color:65280,linewidth:2});super(a,[new i({color:16776960,linewidth:2}),h]),this.type="PositionalAudioHelper",this.audio=s,this.range=n,this.divisionsInnerAngle=o,this.divisionsOuterAngle=r,this.update()}update(){const t=this.audio,e=this.range,i=this.divisionsInnerAngle,s=this.divisionsOuterAngle,o=n.degToRad(t.panner.coneInnerAngle),r=n.degToRad(t.panner.coneOuterAngle),a=o/2,d=r/2;let h,l,p=0,c=0;const u=this.geometry,g=u.attributes.position;function m(t,i,s,n){const o=(i-t)/s;for(g.setXYZ(p,0,0,0),c++,h=t;h<i;h+=o)l=p+c,g.setXYZ(l,Math.sin(h)*e,0,Math.cos(h)*e),g.setXYZ(l+1,Math.sin(Math.min(h+o,i))*e,0,Math.cos(Math.min(h+o,i))*e),g.setXYZ(l+2,0,0,0),c+=3;u.addGroup(p,c,n),p+=c,c=0}u.clearGroups(),m(-d,-a,s,0),m(-a,a,i,1),m(a,d,s,0),g.needsUpdate=!0,o===r&&(this.material[0].visible=!1)}dispose(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()}}export{o as PositionalAudioHelper};/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -10,3 +10,4 @@ declare var Stats: () => {
10
10
  setMode: (id: any) => void;
11
11
  };
12
12
  export default Stats;
13
+ //# sourceMappingURL=stats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/utils/three/stats.ts"],"names":[],"mappings":"AAAA,QAAA,IAAI,KAAK;;;;;;;;;;CAyGR,CAAC;AA6DF,eAAe,KAAK,CAAC"}
@@ -1,5 +1,4 @@
1
- var e=function(){var t=0,l=document.createElement("div");function n(e){return l.appendChild(e.dom),e}function a(e){for(var n=0;n<l.children.length;n++)l.children[n].style.display=n===e?"block":"none";t=e}l.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",l.addEventListener("click",(function(e){e.preventDefault(),a(++t%l.children.length)}),!1);var i=(performance||Date).now(),o=i,r=0,f=n(new e.Panel("FPS","#0ff","#002")),c=n(new e.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var d=n(new e.Panel("MB","#f08","#201"));return a(0),{REVISION:16,dom:l,addPanel:n,showPanel:a,begin:function(){i=(performance||Date).now()},end:function(){r++;var e=(performance||Date).now();if(c.update(e-i,200),e>=o+1e3&&(f.update(1e3*r/(e-o),100),o=e,r=0,d)){var t=performance.memory;d.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){i=this.end()},domElement:l,setMode:a}};e.Panel=function(e,t,l){var n=1/0,a=0,i=Math.round,o=i(window.devicePixelRatio||1),r=80*o,f=48*o,c=3*o,d=2*o,p=3*o,u=15*o,m=74*o,s=30*o,h=document.createElement("canvas");h.width=r,h.height=f,h.style.cssText="width:80px;height:48px";var v=h.getContext("2d");return v.font="bold "+9*o+"px Helvetica,Arial,sans-serif",v.textBaseline="top",v.fillStyle=l,v.fillRect(0,0,r,f),v.fillStyle=t,v.fillText(e,c,d),v.fillRect(p,u,m,s),v.fillStyle=l,v.globalAlpha=.9,v.fillRect(p,u,m,s),{dom:h,update:function(f,x){n=Math.min(n,f),a=Math.max(a,f),v.fillStyle=l,v.globalAlpha=1,v.fillRect(0,0,r,u),v.fillStyle=t,v.fillText(i(f)+" "+e+" ("+i(n)+"-"+i(a)+")",c,d),v.drawImage(h,p+o,u,m-o,s,p,u,m-o,s),v.fillRect(p+m-o,u,o,s),v.fillStyle=l,v.globalAlpha=.9,v.fillRect(p+m-o,u,o,i((1-f/x)*s))}}};export default e;
2
- /*
1
+ var e=function(){var t=0,l=document.createElement("div");function n(e){return l.appendChild(e.dom),e}function a(e){for(var n=0;n<l.children.length;n++)l.children[n].style.display=n===e?"block":"none";t=e}l.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",l.addEventListener("click",(function(e){e.preventDefault(),a(++t%l.children.length)}),!1);var i=(performance||Date).now(),o=i,r=0,f=n(new e.Panel("FPS","#0ff","#002")),c=n(new e.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var d=n(new e.Panel("MB","#f08","#201"));return a(0),{REVISION:16,dom:l,addPanel:n,showPanel:a,begin:function(){i=(performance||Date).now()},end:function(){r++;var e=(performance||Date).now();if(c.update(e-i,200),e>=o+1e3&&(f.update(1e3*r/(e-o),100),o=e,r=0,d)){var t=performance.memory;d.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){i=this.end()},domElement:l,setMode:a}};e.Panel=function(e,t,l){var n=1/0,a=0,i=Math.round,o=i(window.devicePixelRatio||1),r=80*o,f=48*o,c=3*o,d=2*o,p=3*o,u=15*o,m=74*o,s=30*o,h=document.createElement("canvas");h.width=r,h.height=f,h.style.cssText="width:80px;height:48px";var v=h.getContext("2d");return v.font="bold "+9*o+"px Helvetica,Arial,sans-serif",v.textBaseline="top",v.fillStyle=l,v.fillRect(0,0,r,f),v.fillStyle=t,v.fillText(e,c,d),v.fillRect(p,u,m,s),v.fillStyle=l,v.globalAlpha=.9,v.fillRect(p,u,m,s),{dom:h,update:function(f,x){n=Math.min(n,f),a=Math.max(a,f),v.fillStyle=l,v.globalAlpha=1,v.fillRect(0,0,r,u),v.fillStyle=t,v.fillText(i(f)+" "+e+" ("+i(n)+"-"+i(a)+")",c,d),v.drawImage(h,p+o,u,m-o,s,p,u,m-o,s),v.fillRect(p+m-o,u,o,s),v.fillStyle=l,v.globalAlpha=.9,v.fillRect(p+m-o,u,o,i((1-f/x)*s))}}};export default e;/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -75,3 +75,4 @@ import { Vector3 } from 'three';
75
75
  import { Quaternion } from 'three';
76
76
  import { BufferGeometry } from 'three';
77
77
  import { Mesh } from 'three';
78
+ //# sourceMappingURL=transform-controls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform-controls.d.ts","sourceRoot":"","sources":["../../../src/utils/three/transform-controls.js"],"names":[],"mappings":"AAsCA;IAEC,0CA0IC;IAtIA,qBAA2B;IAS3B,gBAA4B;IAI5B,+BAAoB;IACpB,8BAAmB;IAInB,+BAAoB;IAwFpB,iBAA4B;IAC5B,oBAA+B;IAC/B,kBAA6B;IAC7B,sBAAiC;IAEjC,yBAAoC;IACpC,8BAAyC;IACzC,iCAA4C;IAC5C,sBAAiC;IAEjC,0BAAqC;IACrC,gCAA2C;IAC3C,qBAAgC;IAEhC,wBAAmC;IACnC,6BAAwC;IACxC,qBAAgC;IAEhC,iBAA0C;IAC1C,oBAAgD;IAChD,qBAAkD;IAClD,oBAAgD;IAChD,kBAA4C;IAS7C,0BA8BC;IAED,iCAkBC;IARC,UAAiC;IAUnC,gCA+BC;IANC,kBAAoB;IAQtB,gCAuPC;IAnDE,mBAA6D;IAqDhE,8BAcC;IAED,gBAcC;IAGD,0BAOC;IALA,YAAoB;IAQrB,eAQC;IAED,cAiBC;IAED,0BAIC;IAID,eAIC;IAED,yBAIC;IAFA,UAAgB;IAIjB,+CAIC;IAFA,qBAAsC;IAIvC,yCAIC;IAFA,kBAAgC;IAIjC,mCAIC;IAFA,eAA0B;IAI3B,yBAIC;IAFA,UAAgB;IAIjB,2BAIC;IAFA,WAAkB;IAInB,eAIC;IAIF,6BAA+C;CAF9C;yBA/mBM,OAAO;0BAAP,OAAO;AAwuBd;IAEC,cAqXC;IAjXA,aAAoC;IA6VpC,UAAe;IACf,WAAgB;IAChB,WAAgB;IAsBjB,oCAyTC;IAIF,kCAAyD;CAFxD;AAMD;IAEC,cASC;IAFA,aAAoC;IAIrC,oCA0EC;IAIF,kCAAyD;CAFxD;wBA7/CM,OAAO;2BAAP,OAAO;+BAAP,OAAO;qBAAP,OAAO"}
@@ -1,5 +1,4 @@
1
- import{BoxGeometry as t,BufferGeometry as e,CylinderGeometry as i,DoubleSide as n,Euler as o,Float32BufferAttribute as s,Line as a,LineBasicMaterial as r,Matrix4 as h,Mesh as l,MeshBasicMaterial as c,Object3D as p,OctahedronGeometry as d,PlaneGeometry as m,Quaternion as w,Raycaster as u,SphereGeometry as y,TorusGeometry as b,Vector3 as v}from"three";const M=new u,P=new v,g=new v,S=new w,x={X:new v(1,0,0),Y:new v(0,1,0),Z:new v(0,0,1)},_={type:"change"},f={type:"mouseDown"},E={type:"mouseUp",mode:null},I={type:"objectChange"};export class TransformControls extends p{constructor(t,e){super(),this.raycaster=M,void 0===e&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),e=document),this.visible=!1,this.domElement=e,this.domElement.style.touchAction="none";const i=new G;this._gizmo=i,this.gizmo=i,this.add(i);const n=new B;this._plane=n,this.add(n);const o=this;function s(t,e){let s=e;Object.defineProperty(o,t,{get:function(){return void 0!==s?s:e},set:function(e){s!==e&&(s=e,n[t]=e,i[t]=e,o.dispatchEvent({type:t+"-changed",value:e}),o.dispatchEvent(_))}}),o[t]=e,n[t]=e,i[t]=e}s("camera",t),s("object",void 0),s("enabled",!0),s("axis",null),s("mode","translate"),s("translationSnap",null),s("rotationSnap",null),s("scaleSnap",null),s("space","world"),s("size",1),s("dragging",!1),s("showX",!0),s("showY",!0),s("showZ",!0);const a=new v,r=new v,h=new w,l=new w,c=new v,p=new w,d=new v,m=new v,u=new v,y=new v;s("worldPosition",a),s("worldPositionStart",r),s("worldQuaternion",h),s("worldQuaternionStart",l),s("cameraPosition",c),s("cameraQuaternion",p),s("pointStart",d),s("pointEnd",m),s("rotationAxis",u),s("rotationAngle",0),s("eye",y),this._offset=new v,this._startNorm=new v,this._endNorm=new v,this._cameraScale=new v,this._parentPosition=new v,this._parentQuaternion=new w,this._parentQuaternionInv=new w,this._parentScale=new v,this._worldScaleStart=new v,this._worldQuaternionInv=new w,this._worldScale=new v,this._positionStart=new v,this._quaternionStart=new w,this._scaleStart=new v,this._getPointer=X.bind(this),this._onPointerDown=Y.bind(this),this._onPointerHover=Q.bind(this),this._onPointerMove=Z.bind(this),this._onPointerUp=A.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){void 0!==this.object&&(this.object.updateMatrixWorld(),null===this.object.parent?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(t){if(void 0===this.object||!0===this.dragging)return;M.setFromCamera(t,this.camera);const e=z(this._gizmo.picker[this.mode],M);this.axis=e?e.object.name:null}pointerDown(t){if(void 0!==this.object&&!0!==this.dragging&&0===t.button&&null!==this.axis){M.setFromCamera(t,this.camera);const e=z(this._plane,M,!0);e&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(e.point).sub(this.worldPositionStart)),this.dragging=!0,f.mode=this.mode,this.dispatchEvent(f)}}pointerMove(t){const e=this.axis,i=this.mode,n=this.object;let o=this.space;if("scale"===i?o="local":"E"!==e&&"XYZE"!==e&&"XYZ"!==e||(o="world"),void 0===n||null===e||!1===this.dragging||-1!==t.button)return;M.setFromCamera(t,this.camera);const s=z(this._plane,M,!0);if(s){if(this.pointEnd.copy(s.point).sub(this.worldPositionStart),"translate"===i)this._offset.copy(this.pointEnd).sub(this.pointStart),"local"===o&&"XYZ"!==e&&this._offset.applyQuaternion(this._worldQuaternionInv),-1===e.indexOf("X")&&(this._offset.x=0),-1===e.indexOf("Y")&&(this._offset.y=0),-1===e.indexOf("Z")&&(this._offset.z=0),"local"===o&&"XYZ"!==e?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),n.position.copy(this._offset).add(this._positionStart),this.translationSnap&&("local"===o&&(n.position.applyQuaternion(S.copy(this._quaternionStart).invert()),-1!==e.search("X")&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),-1!==e.search("Y")&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),-1!==e.search("Z")&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.position.applyQuaternion(this._quaternionStart)),"world"===o&&(n.parent&&n.position.add(P.setFromMatrixPosition(n.parent.matrixWorld)),-1!==e.search("X")&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),-1!==e.search("Y")&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),-1!==e.search("Z")&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.parent&&n.position.sub(P.setFromMatrixPosition(n.parent.matrixWorld))));else if("scale"===i){if(-1!==e.search("XYZ")){let t=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(t*=-1),g.set(t,t,t)}else P.copy(this.pointStart),g.copy(this.pointEnd),P.applyQuaternion(this._worldQuaternionInv),g.applyQuaternion(this._worldQuaternionInv),g.divide(P),-1===e.search("X")&&(g.x=1),-1===e.search("Y")&&(g.y=1),-1===e.search("Z")&&(g.z=1);n.scale.copy(this._scaleStart).multiply(g),this.scaleSnap&&(-1!==e.search("X")&&(n.scale.x=Math.round(n.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==e.search("Y")&&(n.scale.y=Math.round(n.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==e.search("Z")&&(n.scale.z=Math.round(n.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if("rotate"===i){this._offset.copy(this.pointEnd).sub(this.pointStart);const t=20/this.worldPosition.distanceTo(P.setFromMatrixPosition(this.camera.matrixWorld));"E"===e?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1):"XYZE"===e?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(P.copy(this.rotationAxis).cross(this.eye))*t):"X"!==e&&"Y"!==e&&"Z"!==e||(this.rotationAxis.copy(x[e]),P.copy(x[e]),"local"===o&&P.applyQuaternion(this.worldQuaternion),this.rotationAngle=this._offset.dot(P.cross(this.eye).normalize())*t),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),"local"===o&&"E"!==e&&"XYZE"!==e?(n.quaternion.copy(this._quaternionStart),n.quaternion.multiply(S.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),n.quaternion.copy(S.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),n.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(_),this.dispatchEvent(I)}}pointerUp(t){0===t.button&&(this.dragging&&null!==this.axis&&(E.mode=this.mode,this.dispatchEvent(E)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse((function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()}))}attach(t){return this.object=t,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(_),this.dispatchEvent(I),this.pointStart.copy(this.pointEnd))}getRaycaster(){return M}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}update(){console.warn("THREE.TransformControls: update function has no more functionality and therefore has been deprecated.")}}function X(t){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:t.button};{const e=this.domElement.getBoundingClientRect();return{x:(t.clientX-e.left)/e.width*2-1,y:-(t.clientY-e.top)/e.height*2+1,button:t.button}}}function Q(t){if(this.enabled)switch(t.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(t))}}function Y(t){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(t.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(t)),this.pointerDown(this._getPointer(t)))}function Z(t){this.enabled&&this.pointerMove(this._getPointer(t))}function A(t){this.enabled&&(this.domElement.releasePointerCapture(t.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(t)))}function z(t,e,i){const n=e.intersectObject(t,!0);for(let t=0;t<n.length;t++)if(n[t].object.visible||i)return n[t];return!1}TransformControls.prototype.isTransformControls=!0;const q=new o,T=new v(0,1,0),j=new v(0,0,0),k=new h,W=new w,C=new w,F=new v,H=new h,L=new v(1,0,0),D=new v(0,1,0),O=new v(0,0,1),R=new v,N=new v,U=new v;class G extends p{constructor(){super(),this.type="TransformControlsGizmo";const n=new c({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),o=new r({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),h=n.clone();h.opacity=.15;const m=o.clone();m.opacity=.5;const w=n.clone();w.color.setHex(16711680);const u=n.clone();u.color.setHex(65280);const v=n.clone();v.color.setHex(255);const M=n.clone();M.color.setHex(16711680),M.opacity=.5;const P=n.clone();P.color.setHex(65280),P.opacity=.5;const g=n.clone();g.color.setHex(255),g.opacity=.5;const S=n.clone();S.opacity=.25;const x=n.clone();x.color.setHex(16776960),x.opacity=.25;n.clone().color.setHex(16776960);const _=n.clone();_.color.setHex(7895160);const f=new i(0,.04,.1,12);f.translate(0,.05,0);const E=new t(.08,.08,.08);E.translate(0,.04,0);const I=new e;I.setAttribute("position",new s([0,0,0,1,0,0],3));const X=new i(.0075,.0075,.5,3);function Q(t,e){const i=new b(t,.0075,3,64,e*Math.PI*2);return i.rotateY(Math.PI/2),i.rotateX(Math.PI/2),i}X.translate(0,.25,0);const Y={X:[[new l(f,w),[.5,0,0],[0,0,-Math.PI/2]],[new l(f,w),[-.5,0,0],[0,0,Math.PI/2]],[new l(X,w),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new l(f,u),[0,.5,0]],[new l(f,u),[0,-.5,0],[Math.PI,0,0]],[new l(X,u)]],Z:[[new l(f,v),[0,0,.5],[Math.PI/2,0,0]],[new l(f,v),[0,0,-.5],[-Math.PI/2,0,0]],[new l(X,v),null,[Math.PI/2,0,0]]],XYZ:[[new l(new d(.1,0),S.clone()),[0,0,0]]],XY:[[new l(new t(.15,.15,.01),g.clone()),[.15,.15,0]]],YZ:[[new l(new t(.15,.15,.01),M.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new l(new t(.15,.15,.01),P.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},Z={X:[[new l(new i(.2,0,.6,4),h),[.3,0,0],[0,0,-Math.PI/2]],[new l(new i(.2,0,.6,4),h),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new l(new i(.2,0,.6,4),h),[0,.3,0]],[new l(new i(.2,0,.6,4),h),[0,-.3,0],[0,0,Math.PI]]],Z:[[new l(new i(.2,0,.6,4),h),[0,0,.3],[Math.PI/2,0,0]],[new l(new i(.2,0,.6,4),h),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new l(new d(.2,0),h)]],XY:[[new l(new t(.2,.2,.01),h),[.15,.15,0]]],YZ:[[new l(new t(.2,.2,.01),h),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new l(new t(.2,.2,.01),h),[.15,0,.15],[-Math.PI/2,0,0]]]},A={START:[[new l(new d(.01,2),m),null,null,null,"helper"]],END:[[new l(new d(.01,2),m),null,null,null,"helper"]],DELTA:[[new a(function(){const t=new e;return t.setAttribute("position",new s([0,0,0,1,1,1],3)),t}(),m),null,null,null,"helper"]],X:[[new a(I,m.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new a(I,m.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new a(I,m.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},z={XYZE:[[new l(Q(.5,1),_),null,[0,Math.PI/2,0]]],X:[[new l(Q(.5,.5),w)]],Y:[[new l(Q(.5,.5),u),null,[0,0,-Math.PI/2]]],Z:[[new l(Q(.5,.5),v),null,[0,Math.PI/2,0]]],E:[[new l(Q(.75,1),x),null,[0,Math.PI/2,0]]]},q={AXIS:[[new a(I,m.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},T={XYZE:[[new l(new y(.25,10,8),h)]],X:[[new l(new b(.5,.1,4,24),h),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new l(new b(.5,.1,4,24),h),[0,0,0],[Math.PI/2,0,0]]],Z:[[new l(new b(.5,.1,4,24),h),[0,0,0],[0,0,-Math.PI/2]]],E:[[new l(new b(.75,.1,2,24),h)]]},j={X:[[new l(E,w),[.5,0,0],[0,0,-Math.PI/2]],[new l(X,w),[0,0,0],[0,0,-Math.PI/2]],[new l(E,w),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new l(E,u),[0,.5,0]],[new l(X,u)],[new l(E,u),[0,-.5,0],[0,0,Math.PI]]],Z:[[new l(E,v),[0,0,.5],[Math.PI/2,0,0]],[new l(X,v),[0,0,0],[Math.PI/2,0,0]],[new l(E,v),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new l(new t(.15,.15,.01),g),[.15,.15,0]]],YZ:[[new l(new t(.15,.15,.01),M),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new l(new t(.15,.15,.01),P),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new l(new t(.1,.1,.1),S.clone())]]},k={X:[[new l(new i(.2,0,.6,4),h),[.3,0,0],[0,0,-Math.PI/2]],[new l(new i(.2,0,.6,4),h),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new l(new i(.2,0,.6,4),h),[0,.3,0]],[new l(new i(.2,0,.6,4),h),[0,-.3,0],[0,0,Math.PI]]],Z:[[new l(new i(.2,0,.6,4),h),[0,0,.3],[Math.PI/2,0,0]],[new l(new i(.2,0,.6,4),h),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new l(new t(.2,.2,.01),h),[.15,.15,0]]],YZ:[[new l(new t(.2,.2,.01),h),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new l(new t(.2,.2,.01),h),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new l(new t(.2,.2,.2),h),[0,0,0]]]},W={X:[[new a(I,m.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new a(I,m.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new a(I,m.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function C(t){const e=new p;for(const i in t)for(let n=t[i].length;n--;){const o=t[i][n][0].clone(),s=t[i][n][1],a=t[i][n][2],r=t[i][n][3],h=t[i][n][4];o.name=i,o.tag=h,s&&o.position.set(s[0],s[1],s[2]),a&&o.rotation.set(a[0],a[1],a[2]),r&&o.scale.set(r[0],r[1],r[2]),o.updateMatrix();const l=o.geometry.clone();l.applyMatrix4(o.matrix),o.geometry=l,o.renderOrder=1/0,o.position.set(0,0,0),o.rotation.set(0,0,0),o.scale.set(1,1,1),e.add(o)}return e}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=C(Y)),this.add(this.gizmo.rotate=C(z)),this.add(this.gizmo.scale=C(j)),this.add(this.picker.translate=C(Z)),this.add(this.picker.rotate=C(T)),this.add(this.picker.scale=C(k)),this.add(this.helper.translate=C(A)),this.add(this.helper.rotate=C(q)),this.add(this.helper.scale=C(W)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(t){const e="local"===("scale"===this.mode?"local":this.space)?this.worldQuaternion:C;this.gizmo.translate.visible="translate"===this.mode,this.gizmo.rotate.visible="rotate"===this.mode,this.gizmo.scale.visible="scale"===this.mode,this.helper.translate.visible="translate"===this.mode,this.helper.rotate.visible="rotate"===this.mode,this.helper.scale.visible="scale"===this.mode;let i=[];i=i.concat(this.picker[this.mode].children),i=i.concat(this.gizmo[this.mode].children),i=i.concat(this.helper[this.mode].children);for(let t=0;t<i.length;t++){const n=i[t];let o;if(n.visible=!0,n.rotation.set(0,0,0),n.position.copy(this.worldPosition),o=this.camera.isOrthographicCamera?(this.camera.top-this.camera.bottom)/this.camera.zoom:this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),n.scale.set(1,1,1).multiplyScalar(o*this.size/4),"helper"!==n.tag){if(n.quaternion.copy(e),"translate"===this.mode||"scale"===this.mode){const t=.99,i=.2;"X"===n.name&&Math.abs(T.copy(L).applyQuaternion(e).dot(this.eye))>t&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),"Y"===n.name&&Math.abs(T.copy(D).applyQuaternion(e).dot(this.eye))>t&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),"Z"===n.name&&Math.abs(T.copy(O).applyQuaternion(e).dot(this.eye))>t&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),"XY"===n.name&&Math.abs(T.copy(O).applyQuaternion(e).dot(this.eye))<i&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),"YZ"===n.name&&Math.abs(T.copy(L).applyQuaternion(e).dot(this.eye))<i&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),"XZ"===n.name&&Math.abs(T.copy(D).applyQuaternion(e).dot(this.eye))<i&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)}else"rotate"===this.mode&&(W.copy(e),T.copy(this.eye).applyQuaternion(S.copy(e).invert()),-1!==n.name.search("E")&&n.quaternion.setFromRotationMatrix(k.lookAt(this.eye,j,D)),"X"===n.name&&(S.setFromAxisAngle(L,Math.atan2(-T.y,T.z)),S.multiplyQuaternions(W,S),n.quaternion.copy(S)),"Y"===n.name&&(S.setFromAxisAngle(D,Math.atan2(T.x,T.z)),S.multiplyQuaternions(W,S),n.quaternion.copy(S)),"Z"===n.name&&(S.setFromAxisAngle(O,Math.atan2(T.y,T.x)),S.multiplyQuaternions(W,S),n.quaternion.copy(S)));n.visible=n.visible&&(-1===n.name.indexOf("X")||this.showX),n.visible=n.visible&&(-1===n.name.indexOf("Y")||this.showY),n.visible=n.visible&&(-1===n.name.indexOf("Z")||this.showZ),n.visible=n.visible&&(-1===n.name.indexOf("E")||this.showX&&this.showY&&this.showZ),n.material._color=n.material._color||n.material.color.clone(),n.material._opacity=n.material._opacity||n.material.opacity,n.material.color.copy(n.material._color),n.material.opacity=n.material._opacity,this.enabled&&this.axis&&(n.name===this.axis||this.axis.split("").some((function(t){return n.name===t})))&&(n.material.color.setHex(16776960),n.material.opacity=1)}else n.visible=!1,"AXIS"===n.name?(n.position.copy(this.worldPositionStart),n.visible=!!this.axis,"X"===this.axis&&(S.setFromEuler(q.set(0,0,0)),n.quaternion.copy(e).multiply(S),Math.abs(T.copy(L).applyQuaternion(e).dot(this.eye))>.9&&(n.visible=!1)),"Y"===this.axis&&(S.setFromEuler(q.set(0,0,Math.PI/2)),n.quaternion.copy(e).multiply(S),Math.abs(T.copy(D).applyQuaternion(e).dot(this.eye))>.9&&(n.visible=!1)),"Z"===this.axis&&(S.setFromEuler(q.set(0,Math.PI/2,0)),n.quaternion.copy(e).multiply(S),Math.abs(T.copy(O).applyQuaternion(e).dot(this.eye))>.9&&(n.visible=!1)),"XYZE"===this.axis&&(S.setFromEuler(q.set(0,Math.PI/2,0)),T.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(k.lookAt(j,T,D)),n.quaternion.multiply(S),n.visible=this.dragging),"E"===this.axis&&(n.visible=!1)):"START"===n.name?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):"END"===n.name?(n.position.copy(this.worldPosition),n.visible=this.dragging):"DELTA"===n.name?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),P.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),P.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(P),n.visible=this.dragging):(n.quaternion.copy(e),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=-1!==this.axis.search(n.name)))}super.updateMatrixWorld(t)}}G.prototype.isTransformControlsGizmo=!0;class B extends l{constructor(){super(new m(1e5,1e5,2,2),new c({visible:!1,wireframe:!0,side:n,transparent:!0,opacity:.1,toneMapped:!1})),this.type="TransformControlsPlane"}updateMatrixWorld(t){let e=this.space;switch(this.position.copy(this.worldPosition),"scale"===this.mode&&(e="local"),R.copy(L).applyQuaternion("local"===e?this.worldQuaternion:C),N.copy(D).applyQuaternion("local"===e?this.worldQuaternion:C),U.copy(O).applyQuaternion("local"===e?this.worldQuaternion:C),T.copy(N),this.mode){case"translate":case"scale":switch(this.axis){case"X":T.copy(this.eye).cross(R),F.copy(R).cross(T);break;case"Y":T.copy(this.eye).cross(N),F.copy(N).cross(T);break;case"Z":T.copy(this.eye).cross(U),F.copy(U).cross(T);break;case"XY":F.copy(U);break;case"YZ":F.copy(R);break;case"XZ":T.copy(U),F.copy(N);break;case"XYZ":case"E":F.set(0,0,0)}break;default:F.set(0,0,0)}0===F.length()?this.quaternion.copy(this.cameraQuaternion):(H.lookAt(P.set(0,0,0),F,T),this.quaternion.setFromRotationMatrix(H)),super.updateMatrixWorld(t)}}B.prototype.isTransformControlsPlane=!0;export{G as TransformControlsGizmo,B as TransformControlsPlane};
2
- /*
1
+ import{BoxGeometry as t,BufferGeometry as e,CylinderGeometry as i,DoubleSide as n,Euler as o,Float32BufferAttribute as s,Line as a,LineBasicMaterial as r,Matrix4 as h,Mesh as l,MeshBasicMaterial as c,Object3D as p,OctahedronGeometry as d,PlaneGeometry as m,Quaternion as w,Raycaster as u,SphereGeometry as y,TorusGeometry as b,Vector3 as v}from"three";const M=new u,P=new v,g=new v,S=new w,x={X:new v(1,0,0),Y:new v(0,1,0),Z:new v(0,0,1)},_={type:"change"},f={type:"mouseDown"},E={type:"mouseUp",mode:null},I={type:"objectChange"};export class TransformControls extends p{constructor(t,e){super(),this.raycaster=M,void 0===e&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),e=document),this.visible=!1,this.domElement=e,this.domElement.style.touchAction="none";const i=new G;this._gizmo=i,this.gizmo=i,this.add(i);const n=new B;this._plane=n,this.add(n);const o=this;function s(t,e){let s=e;Object.defineProperty(o,t,{get:function(){return void 0!==s?s:e},set:function(e){s!==e&&(s=e,n[t]=e,i[t]=e,o.dispatchEvent({type:t+"-changed",value:e}),o.dispatchEvent(_))}}),o[t]=e,n[t]=e,i[t]=e}s("camera",t),s("object",void 0),s("enabled",!0),s("axis",null),s("mode","translate"),s("translationSnap",null),s("rotationSnap",null),s("scaleSnap",null),s("space","world"),s("size",1),s("dragging",!1),s("showX",!0),s("showY",!0),s("showZ",!0);const a=new v,r=new v,h=new w,l=new w,c=new v,p=new w,d=new v,m=new v,u=new v,y=new v;s("worldPosition",a),s("worldPositionStart",r),s("worldQuaternion",h),s("worldQuaternionStart",l),s("cameraPosition",c),s("cameraQuaternion",p),s("pointStart",d),s("pointEnd",m),s("rotationAxis",u),s("rotationAngle",0),s("eye",y),this._offset=new v,this._startNorm=new v,this._endNorm=new v,this._cameraScale=new v,this._parentPosition=new v,this._parentQuaternion=new w,this._parentQuaternionInv=new w,this._parentScale=new v,this._worldScaleStart=new v,this._worldQuaternionInv=new w,this._worldScale=new v,this._positionStart=new v,this._quaternionStart=new w,this._scaleStart=new v,this._getPointer=X.bind(this),this._onPointerDown=Y.bind(this),this._onPointerHover=Q.bind(this),this._onPointerMove=Z.bind(this),this._onPointerUp=A.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){void 0!==this.object&&(this.object.updateMatrixWorld(),null===this.object.parent?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(t){if(void 0===this.object||!0===this.dragging)return;M.setFromCamera(t,this.camera);const e=z(this._gizmo.picker[this.mode],M);this.axis=e?e.object.name:null}pointerDown(t){if(void 0!==this.object&&!0!==this.dragging&&0===t.button&&null!==this.axis){M.setFromCamera(t,this.camera);const e=z(this._plane,M,!0);e&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(e.point).sub(this.worldPositionStart)),this.dragging=!0,f.mode=this.mode,this.dispatchEvent(f)}}pointerMove(t){const e=this.axis,i=this.mode,n=this.object;let o=this.space;if("scale"===i?o="local":"E"!==e&&"XYZE"!==e&&"XYZ"!==e||(o="world"),void 0===n||null===e||!1===this.dragging||-1!==t.button)return;M.setFromCamera(t,this.camera);const s=z(this._plane,M,!0);if(s){if(this.pointEnd.copy(s.point).sub(this.worldPositionStart),"translate"===i)this._offset.copy(this.pointEnd).sub(this.pointStart),"local"===o&&"XYZ"!==e&&this._offset.applyQuaternion(this._worldQuaternionInv),-1===e.indexOf("X")&&(this._offset.x=0),-1===e.indexOf("Y")&&(this._offset.y=0),-1===e.indexOf("Z")&&(this._offset.z=0),"local"===o&&"XYZ"!==e?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),n.position.copy(this._offset).add(this._positionStart),this.translationSnap&&("local"===o&&(n.position.applyQuaternion(S.copy(this._quaternionStart).invert()),-1!==e.search("X")&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),-1!==e.search("Y")&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),-1!==e.search("Z")&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.position.applyQuaternion(this._quaternionStart)),"world"===o&&(n.parent&&n.position.add(P.setFromMatrixPosition(n.parent.matrixWorld)),-1!==e.search("X")&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),-1!==e.search("Y")&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),-1!==e.search("Z")&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.parent&&n.position.sub(P.setFromMatrixPosition(n.parent.matrixWorld))));else if("scale"===i){if(-1!==e.search("XYZ")){let t=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(t*=-1),g.set(t,t,t)}else P.copy(this.pointStart),g.copy(this.pointEnd),P.applyQuaternion(this._worldQuaternionInv),g.applyQuaternion(this._worldQuaternionInv),g.divide(P),-1===e.search("X")&&(g.x=1),-1===e.search("Y")&&(g.y=1),-1===e.search("Z")&&(g.z=1);n.scale.copy(this._scaleStart).multiply(g),this.scaleSnap&&(-1!==e.search("X")&&(n.scale.x=Math.round(n.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==e.search("Y")&&(n.scale.y=Math.round(n.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==e.search("Z")&&(n.scale.z=Math.round(n.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if("rotate"===i){this._offset.copy(this.pointEnd).sub(this.pointStart);const t=20/this.worldPosition.distanceTo(P.setFromMatrixPosition(this.camera.matrixWorld));"E"===e?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1):"XYZE"===e?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(P.copy(this.rotationAxis).cross(this.eye))*t):"X"!==e&&"Y"!==e&&"Z"!==e||(this.rotationAxis.copy(x[e]),P.copy(x[e]),"local"===o&&P.applyQuaternion(this.worldQuaternion),this.rotationAngle=this._offset.dot(P.cross(this.eye).normalize())*t),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),"local"===o&&"E"!==e&&"XYZE"!==e?(n.quaternion.copy(this._quaternionStart),n.quaternion.multiply(S.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),n.quaternion.copy(S.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),n.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(_),this.dispatchEvent(I)}}pointerUp(t){0===t.button&&(this.dragging&&null!==this.axis&&(E.mode=this.mode,this.dispatchEvent(E)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse((function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()}))}attach(t){return this.object=t,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(_),this.dispatchEvent(I),this.pointStart.copy(this.pointEnd))}getRaycaster(){return M}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}update(){console.warn("THREE.TransformControls: update function has no more functionality and therefore has been deprecated.")}}function X(t){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:t.button};{const e=this.domElement.getBoundingClientRect();return{x:(t.clientX-e.left)/e.width*2-1,y:-(t.clientY-e.top)/e.height*2+1,button:t.button}}}function Q(t){if(this.enabled)switch(t.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(t))}}function Y(t){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(t.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(t)),this.pointerDown(this._getPointer(t)))}function Z(t){this.enabled&&this.pointerMove(this._getPointer(t))}function A(t){this.enabled&&(this.domElement.releasePointerCapture(t.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(t)))}function z(t,e,i){const n=e.intersectObject(t,!0);for(let t=0;t<n.length;t++)if(n[t].object.visible||i)return n[t];return!1}TransformControls.prototype.isTransformControls=!0;const q=new o,T=new v(0,1,0),j=new v(0,0,0),k=new h,W=new w,C=new w,F=new v,H=new h,L=new v(1,0,0),D=new v(0,1,0),O=new v(0,0,1),R=new v,N=new v,U=new v;class G extends p{constructor(){super(),this.type="TransformControlsGizmo";const n=new c({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),o=new r({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),h=n.clone();h.opacity=.15;const m=o.clone();m.opacity=.5;const w=n.clone();w.color.setHex(16711680);const u=n.clone();u.color.setHex(65280);const v=n.clone();v.color.setHex(255);const M=n.clone();M.color.setHex(16711680),M.opacity=.5;const P=n.clone();P.color.setHex(65280),P.opacity=.5;const g=n.clone();g.color.setHex(255),g.opacity=.5;const S=n.clone();S.opacity=.25;const x=n.clone();x.color.setHex(16776960),x.opacity=.25;n.clone().color.setHex(16776960);const _=n.clone();_.color.setHex(7895160);const f=new i(0,.04,.1,12);f.translate(0,.05,0);const E=new t(.08,.08,.08);E.translate(0,.04,0);const I=new e;I.setAttribute("position",new s([0,0,0,1,0,0],3));const X=new i(.0075,.0075,.5,3);function Q(t,e){const i=new b(t,.0075,3,64,e*Math.PI*2);return i.rotateY(Math.PI/2),i.rotateX(Math.PI/2),i}X.translate(0,.25,0);const Y={X:[[new l(f,w),[.5,0,0],[0,0,-Math.PI/2]],[new l(f,w),[-.5,0,0],[0,0,Math.PI/2]],[new l(X,w),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new l(f,u),[0,.5,0]],[new l(f,u),[0,-.5,0],[Math.PI,0,0]],[new l(X,u)]],Z:[[new l(f,v),[0,0,.5],[Math.PI/2,0,0]],[new l(f,v),[0,0,-.5],[-Math.PI/2,0,0]],[new l(X,v),null,[Math.PI/2,0,0]]],XYZ:[[new l(new d(.1,0),S.clone()),[0,0,0]]],XY:[[new l(new t(.15,.15,.01),g.clone()),[.15,.15,0]]],YZ:[[new l(new t(.15,.15,.01),M.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new l(new t(.15,.15,.01),P.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},Z={X:[[new l(new i(.2,0,.6,4),h),[.3,0,0],[0,0,-Math.PI/2]],[new l(new i(.2,0,.6,4),h),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new l(new i(.2,0,.6,4),h),[0,.3,0]],[new l(new i(.2,0,.6,4),h),[0,-.3,0],[0,0,Math.PI]]],Z:[[new l(new i(.2,0,.6,4),h),[0,0,.3],[Math.PI/2,0,0]],[new l(new i(.2,0,.6,4),h),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new l(new d(.2,0),h)]],XY:[[new l(new t(.2,.2,.01),h),[.15,.15,0]]],YZ:[[new l(new t(.2,.2,.01),h),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new l(new t(.2,.2,.01),h),[.15,0,.15],[-Math.PI/2,0,0]]]},A={START:[[new l(new d(.01,2),m),null,null,null,"helper"]],END:[[new l(new d(.01,2),m),null,null,null,"helper"]],DELTA:[[new a(function(){const t=new e;return t.setAttribute("position",new s([0,0,0,1,1,1],3)),t}(),m),null,null,null,"helper"]],X:[[new a(I,m.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new a(I,m.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new a(I,m.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},z={XYZE:[[new l(Q(.5,1),_),null,[0,Math.PI/2,0]]],X:[[new l(Q(.5,.5),w)]],Y:[[new l(Q(.5,.5),u),null,[0,0,-Math.PI/2]]],Z:[[new l(Q(.5,.5),v),null,[0,Math.PI/2,0]]],E:[[new l(Q(.75,1),x),null,[0,Math.PI/2,0]]]},q={AXIS:[[new a(I,m.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},T={XYZE:[[new l(new y(.25,10,8),h)]],X:[[new l(new b(.5,.1,4,24),h),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new l(new b(.5,.1,4,24),h),[0,0,0],[Math.PI/2,0,0]]],Z:[[new l(new b(.5,.1,4,24),h),[0,0,0],[0,0,-Math.PI/2]]],E:[[new l(new b(.75,.1,2,24),h)]]},j={X:[[new l(E,w),[.5,0,0],[0,0,-Math.PI/2]],[new l(X,w),[0,0,0],[0,0,-Math.PI/2]],[new l(E,w),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new l(E,u),[0,.5,0]],[new l(X,u)],[new l(E,u),[0,-.5,0],[0,0,Math.PI]]],Z:[[new l(E,v),[0,0,.5],[Math.PI/2,0,0]],[new l(X,v),[0,0,0],[Math.PI/2,0,0]],[new l(E,v),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new l(new t(.15,.15,.01),g),[.15,.15,0]]],YZ:[[new l(new t(.15,.15,.01),M),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new l(new t(.15,.15,.01),P),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new l(new t(.1,.1,.1),S.clone())]]},k={X:[[new l(new i(.2,0,.6,4),h),[.3,0,0],[0,0,-Math.PI/2]],[new l(new i(.2,0,.6,4),h),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new l(new i(.2,0,.6,4),h),[0,.3,0]],[new l(new i(.2,0,.6,4),h),[0,-.3,0],[0,0,Math.PI]]],Z:[[new l(new i(.2,0,.6,4),h),[0,0,.3],[Math.PI/2,0,0]],[new l(new i(.2,0,.6,4),h),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new l(new t(.2,.2,.01),h),[.15,.15,0]]],YZ:[[new l(new t(.2,.2,.01),h),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new l(new t(.2,.2,.01),h),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new l(new t(.2,.2,.2),h),[0,0,0]]]},W={X:[[new a(I,m.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new a(I,m.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new a(I,m.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function C(t){const e=new p;for(const i in t)for(let n=t[i].length;n--;){const o=t[i][n][0].clone(),s=t[i][n][1],a=t[i][n][2],r=t[i][n][3],h=t[i][n][4];o.name=i,o.tag=h,s&&o.position.set(s[0],s[1],s[2]),a&&o.rotation.set(a[0],a[1],a[2]),r&&o.scale.set(r[0],r[1],r[2]),o.updateMatrix();const l=o.geometry.clone();l.applyMatrix4(o.matrix),o.geometry=l,o.renderOrder=1/0,o.position.set(0,0,0),o.rotation.set(0,0,0),o.scale.set(1,1,1),e.add(o)}return e}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=C(Y)),this.add(this.gizmo.rotate=C(z)),this.add(this.gizmo.scale=C(j)),this.add(this.picker.translate=C(Z)),this.add(this.picker.rotate=C(T)),this.add(this.picker.scale=C(k)),this.add(this.helper.translate=C(A)),this.add(this.helper.rotate=C(q)),this.add(this.helper.scale=C(W)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(t){const e="local"===("scale"===this.mode?"local":this.space)?this.worldQuaternion:C;this.gizmo.translate.visible="translate"===this.mode,this.gizmo.rotate.visible="rotate"===this.mode,this.gizmo.scale.visible="scale"===this.mode,this.helper.translate.visible="translate"===this.mode,this.helper.rotate.visible="rotate"===this.mode,this.helper.scale.visible="scale"===this.mode;let i=[];i=i.concat(this.picker[this.mode].children),i=i.concat(this.gizmo[this.mode].children),i=i.concat(this.helper[this.mode].children);for(let t=0;t<i.length;t++){const n=i[t];let o;if(n.visible=!0,n.rotation.set(0,0,0),n.position.copy(this.worldPosition),o=this.camera.isOrthographicCamera?(this.camera.top-this.camera.bottom)/this.camera.zoom:this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),n.scale.set(1,1,1).multiplyScalar(o*this.size/4),"helper"!==n.tag){if(n.quaternion.copy(e),"translate"===this.mode||"scale"===this.mode){const t=.99,i=.2;"X"===n.name&&Math.abs(T.copy(L).applyQuaternion(e).dot(this.eye))>t&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),"Y"===n.name&&Math.abs(T.copy(D).applyQuaternion(e).dot(this.eye))>t&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),"Z"===n.name&&Math.abs(T.copy(O).applyQuaternion(e).dot(this.eye))>t&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),"XY"===n.name&&Math.abs(T.copy(O).applyQuaternion(e).dot(this.eye))<i&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),"YZ"===n.name&&Math.abs(T.copy(L).applyQuaternion(e).dot(this.eye))<i&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),"XZ"===n.name&&Math.abs(T.copy(D).applyQuaternion(e).dot(this.eye))<i&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)}else"rotate"===this.mode&&(W.copy(e),T.copy(this.eye).applyQuaternion(S.copy(e).invert()),-1!==n.name.search("E")&&n.quaternion.setFromRotationMatrix(k.lookAt(this.eye,j,D)),"X"===n.name&&(S.setFromAxisAngle(L,Math.atan2(-T.y,T.z)),S.multiplyQuaternions(W,S),n.quaternion.copy(S)),"Y"===n.name&&(S.setFromAxisAngle(D,Math.atan2(T.x,T.z)),S.multiplyQuaternions(W,S),n.quaternion.copy(S)),"Z"===n.name&&(S.setFromAxisAngle(O,Math.atan2(T.y,T.x)),S.multiplyQuaternions(W,S),n.quaternion.copy(S)));n.visible=n.visible&&(-1===n.name.indexOf("X")||this.showX),n.visible=n.visible&&(-1===n.name.indexOf("Y")||this.showY),n.visible=n.visible&&(-1===n.name.indexOf("Z")||this.showZ),n.visible=n.visible&&(-1===n.name.indexOf("E")||this.showX&&this.showY&&this.showZ),n.material._color=n.material._color||n.material.color.clone(),n.material._opacity=n.material._opacity||n.material.opacity,n.material.color.copy(n.material._color),n.material.opacity=n.material._opacity,this.enabled&&this.axis&&(n.name===this.axis||this.axis.split("").some((function(t){return n.name===t})))&&(n.material.color.setHex(16776960),n.material.opacity=1)}else n.visible=!1,"AXIS"===n.name?(n.position.copy(this.worldPositionStart),n.visible=!!this.axis,"X"===this.axis&&(S.setFromEuler(q.set(0,0,0)),n.quaternion.copy(e).multiply(S),Math.abs(T.copy(L).applyQuaternion(e).dot(this.eye))>.9&&(n.visible=!1)),"Y"===this.axis&&(S.setFromEuler(q.set(0,0,Math.PI/2)),n.quaternion.copy(e).multiply(S),Math.abs(T.copy(D).applyQuaternion(e).dot(this.eye))>.9&&(n.visible=!1)),"Z"===this.axis&&(S.setFromEuler(q.set(0,Math.PI/2,0)),n.quaternion.copy(e).multiply(S),Math.abs(T.copy(O).applyQuaternion(e).dot(this.eye))>.9&&(n.visible=!1)),"XYZE"===this.axis&&(S.setFromEuler(q.set(0,Math.PI/2,0)),T.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(k.lookAt(j,T,D)),n.quaternion.multiply(S),n.visible=this.dragging),"E"===this.axis&&(n.visible=!1)):"START"===n.name?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):"END"===n.name?(n.position.copy(this.worldPosition),n.visible=this.dragging):"DELTA"===n.name?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),P.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),P.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(P),n.visible=this.dragging):(n.quaternion.copy(e),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=-1!==this.axis.search(n.name)))}super.updateMatrixWorld(t)}}G.prototype.isTransformControlsGizmo=!0;class B extends l{constructor(){super(new m(1e5,1e5,2,2),new c({visible:!1,wireframe:!0,side:n,transparent:!0,opacity:.1,toneMapped:!1})),this.type="TransformControlsPlane"}updateMatrixWorld(t){let e=this.space;switch(this.position.copy(this.worldPosition),"scale"===this.mode&&(e="local"),R.copy(L).applyQuaternion("local"===e?this.worldQuaternion:C),N.copy(D).applyQuaternion("local"===e?this.worldQuaternion:C),U.copy(O).applyQuaternion("local"===e?this.worldQuaternion:C),T.copy(N),this.mode){case"translate":case"scale":switch(this.axis){case"X":T.copy(this.eye).cross(R),F.copy(R).cross(T);break;case"Y":T.copy(this.eye).cross(N),F.copy(N).cross(T);break;case"Z":T.copy(this.eye).cross(U),F.copy(U).cross(T);break;case"XY":F.copy(U);break;case"YZ":F.copy(R);break;case"XZ":T.copy(U),F.copy(N);break;case"XYZ":case"E":F.set(0,0,0)}break;default:F.set(0,0,0)}0===F.length()?this.quaternion.copy(this.cameraQuaternion):(H.lookAt(P.set(0,0,0),F,T),this.quaternion.setFromRotationMatrix(H)),super.updateMatrixWorld(t)}}B.prototype.isTransformControlsPlane=!0;export{G as TransformControlsGizmo,B as TransformControlsPlane};/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -12,3 +12,4 @@ export declare function filterChildrenShallow<C extends {
12
12
  }, T extends C = C>(scene: T, predicate: ObjectPredicate<C>, traversePredicate?: ObjectPredicate<C>): C[];
13
13
  export declare function calculateEffectiveScale(obj: Object3D): Vector3;
14
14
  export {};
15
+ //# sourceMappingURL=traverse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traverse.d.ts","sourceRoot":"","sources":["../../../src/utils/three/traverse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAS,OAAO,EAAE,MAAM,OAAO,CAAC;AAGjD,KAAK,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAA;AAE7C,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,CAAC,QAAQ,CAAC,gDAShF;AAGD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAatG;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC,EAAE,eAAe,CAAC,QAAQ,CAAC,GAAG,QAAQ,EAAE,CAEnJ;AAGD,wBAAgB,qBAAqB,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAA;CAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAczK;AAID,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,QAAQ,WAMpD"}
@@ -1,5 +1,4 @@
1
- import{Scene as e,Vector3 as n}from"three";export function filterScene(e,n){const t=[];return e.traverse((e=>{n(e)&&t.push(e)})),t}export function findFirstVisibleObject(e,n){const t=[e];for(;t.length>0;){const e=t.pop();if(n(e))return e;e.visible&&null!=e.children&&t.push(...e.children)}return null}export function filterSceneShallow(e,n,t){return filterChildrenShallow(e,n,t)}export function filterChildrenShallow(n,t,r){const l=[],o=[n];for(;o.length>0;){const n=o.pop();t(n)?l.push(n):(null==r||r(n)||n instanceof e)&&null!=n.children&&o.push(...n.children)}return l}const t=new n;export function calculateEffectiveScale(e){return t.copy(e.scale),e.traverseAncestors((e=>{t.multiply(e.scale)})),t}
2
- /*
1
+ import{Scene as e,Vector3 as n}from"three";export function filterScene(e,n){const t=[];return e.traverse((e=>{n(e)&&t.push(e)})),t}export function findFirstVisibleObject(e,n){const t=[e];for(;t.length>0;){const e=t.pop();if(n(e))return e;e.visible&&null!=e.children&&t.push(...e.children)}return null}export function filterSceneShallow(e,n,t){return filterChildrenShallow(e,n,t)}export function filterChildrenShallow(n,t,r){const l=[],o=[n];for(;o.length>0;){const n=o.pop();t(n)?l.push(n):(null==r||r(n)||n instanceof e)&&null!=n.children&&o.push(...n.children)}return l}const t=new n;export function calculateEffectiveScale(e){return t.copy(e.scale),e.traverseAncestors((e=>{t.multiply(e.scale)})),t}/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -3,3 +3,4 @@ export interface Type<T> extends Function {
3
3
  }
4
4
  export type AbstractType<T> = abstract new (...args: any[]) => T;
5
5
  export declare function assertType<T, K extends T>(value: T, type: Type<K>): asserts value is K;
6
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/utils/type.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,IAAI,CAAC,CAAC,CAAE,SAAQ,QAAQ;IACvC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CACzB;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEjE,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,CAItF"}
@@ -1,5 +1,4 @@
1
- export function assertType(e,n){if(!(e instanceof n))throw new Error(`Invalid type: expected instance of ${n.name}`)}
2
- /*
1
+ export function assertType(e,n){if(!(e instanceof n))throw new Error(`Invalid type: expected instance of ${n.name}`)}/*
3
2
  * Copyright (©) 2023. All rights reserved.
4
3
  * See the LICENSE.md file for details.
5
4
  */
@@ -1 +1,2 @@
1
1
  export declare function randomUUID(): string;
2
+ //# sourceMappingURL=uuid.d.ts.map