@xort/cga 0.0.93 → 0.1.1

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 (384) hide show
  1. package/THIRD_PARTY_NOTICES.md +76 -0
  2. package/build/@xort_cga.js +20213 -12091
  3. package/build/cga.d.ts +3151 -2032
  4. package/build/cga.esm.js +20175 -0
  5. package/{src/shader → build/shaders}/cga.glsl +204 -202
  6. package/build/shaders/common.glsl +36 -0
  7. package/{src/shader → build/shaders}/noise/GLSL-Noise.md +1108 -1108
  8. package/build/shaders/noise/LICENSE +20 -0
  9. package/build/shaders/noise/cellular2D.glsl +69 -0
  10. package/{src/shader → build/shaders}/noise/cellular2x2.glsl +64 -64
  11. package/build/shaders/noise/cellular2x2x2.glsl +88 -0
  12. package/build/shaders/noise/cellular3D.glsl +187 -0
  13. package/{src/shader → build/shaders}/noise/classicnoise2D.glsl +113 -113
  14. package/{src/shader → build/shaders}/noise/classicnoise3D.glsl +177 -177
  15. package/{src/shader → build/shaders}/noise/classicnoise4D.glsl +302 -302
  16. package/{src/shader → build/shaders}/noise/noise2D.glsl +71 -71
  17. package/{src/shader → build/shaders}/noise/noise3D.glsl +103 -103
  18. package/{src/shader → build/shaders}/noise/noise3Dgrad.glsl +111 -111
  19. package/{src/shader → build/shaders}/noise/noise4D.glsl +129 -129
  20. package/{src/shader → build/shaders}/noise/psrdnoise2D.glsl +463 -462
  21. package/dist/THIRD_PARTY_NOTICES.md +76 -0
  22. package/dist/index.cjs +20352 -0
  23. package/dist/index.cjs.map +1 -0
  24. package/dist/index.d.cts +3176 -0
  25. package/dist/index.d.ts +3176 -38
  26. package/dist/index.js +20177 -56
  27. package/dist/index.js.map +1 -0
  28. package/dist/shaders.cjs +21 -0
  29. package/dist/shaders.d.cts +20 -0
  30. package/dist/shaders.d.ts +20 -0
  31. package/dist/shaders.js +20 -0
  32. package/dist/three.cjs +3034 -0
  33. package/dist/three.cjs.map +1 -0
  34. package/dist/three.d.cts +308 -0
  35. package/dist/three.d.ts +308 -0
  36. package/dist/three.js +3007 -0
  37. package/dist/three.js.map +1 -0
  38. package/package.json +96 -47
  39. package/readme.md +111 -247
  40. package/.github/FUNDING.yml +0 -12
  41. package/cga/1./347/202/271/344/270/216/347/272/277/346/200/247/345/205/203/347/264/240/347/232/204/350/267/235/347/246/273.html +0 -601
  42. package/cga/1./347/202/271/344/270/216/347/272/277/346/200/247/345/205/203/347/264/240/347/232/204/350/267/235/347/246/273.md +0 -111
  43. package/cga/2./347/202/271/344/270/216/351/235/242/346/200/247/345/205/203/347/264/240.md +0 -4
  44. package/cga/img//347/202/271/344/270/216/345/260/204/347/272/277.png +0 -0
  45. package/cga/img//347/202/271/344/270/216/347/233/264/347/272/277.png +0 -0
  46. package/cga/img//347/202/271/344/270/216/347/272/277/346/256/265.png +0 -0
  47. package/cga/img//347/233/264/347/272/277/347/232/204/350/241/250/350/276/276/345/274/217.png +0 -0
  48. package/deploy.sh +0 -39
  49. package/dist/IKanimation/Bone.d.ts +0 -7
  50. package/dist/IKanimation/Bone.js +0 -20
  51. package/dist/IKanimation/CCDSolver.d.ts +0 -37
  52. package/dist/IKanimation/CCDSolver.js +0 -93
  53. package/dist/IKanimation/Joint.d.ts +0 -3
  54. package/dist/IKanimation/Joint.js +0 -17
  55. package/dist/IKanimation/constaint/constraint.d.ts +0 -10
  56. package/dist/IKanimation/constaint/constraint.js +0 -25
  57. package/dist/IKanimation/constaint/hinge.d.ts +0 -12
  58. package/dist/IKanimation/constaint/hinge.js +0 -46
  59. package/dist/IKanimation/constaint/slider.d.ts +0 -12
  60. package/dist/IKanimation/constaint/slider.js +0 -44
  61. package/dist/IKanimation/index.d.ts +0 -0
  62. package/dist/IKanimation/index.js +0 -9
  63. package/dist/IKanimation/isolver.d.ts +0 -4
  64. package/dist/IKanimation/isolver.js +0 -10
  65. package/dist/IKanimation/skeleton.d.ts +0 -13
  66. package/dist/IKanimation/skeleton.js +0 -31
  67. package/dist/alg/common.d.ts +0 -114
  68. package/dist/alg/common.js +0 -302
  69. package/dist/alg/curve.d.ts +0 -4
  70. package/dist/alg/curve.js +0 -11
  71. package/dist/alg/delaunator.d.ts +0 -29
  72. package/dist/alg/delaunator.js +0 -442
  73. package/dist/alg/delaunay.d.ts +0 -20
  74. package/dist/alg/delaunay.js +0 -199
  75. package/dist/alg/delaunayslow.d.ts +0 -18
  76. package/dist/alg/delaunayslow.js +0 -140
  77. package/dist/alg/extrude/extrude.d.ts +0 -3
  78. package/dist/alg/extrude/extrude.js +0 -17
  79. package/dist/alg/extrude.d.ts +0 -199
  80. package/dist/alg/extrude.js +0 -728
  81. package/dist/alg/offset/index.d.ts +0 -0
  82. package/dist/alg/offset/index.js +0 -9
  83. package/dist/alg/offset.d.ts +0 -0
  84. package/dist/alg/offset.js +0 -472
  85. package/dist/alg/pointset.d.ts +0 -94
  86. package/dist/alg/pointset.js +0 -223
  87. package/dist/alg/recognition.d.ts +0 -14
  88. package/dist/alg/recognition.js +0 -37
  89. package/dist/alg/result.d.ts +0 -22
  90. package/dist/alg/result.js +0 -2
  91. package/dist/alg/segmentset.d.ts +0 -11
  92. package/dist/alg/segmentset.js +0 -45
  93. package/dist/alg/sort.d.ts +0 -2
  94. package/dist/alg/sort.js +0 -14
  95. package/dist/alg/split.d.ts +0 -8
  96. package/dist/alg/split.js +0 -10
  97. package/dist/alg/trianglution.d.ts +0 -15
  98. package/dist/alg/trianglution.js +0 -70
  99. package/dist/alg/vol.d.ts +0 -6
  100. package/dist/alg/vol.js +0 -18
  101. package/dist/alg/voronoi.d.ts +0 -31
  102. package/dist/alg/voronoi.js +0 -418
  103. package/dist/app.d.ts +0 -1
  104. package/dist/app.js +0 -248
  105. package/dist/basic/distance.d.ts +0 -12
  106. package/dist/basic/distance.js +0 -39
  107. package/dist/csg/bsp.d.ts +0 -9
  108. package/dist/csg/bsp.js +0 -22
  109. package/dist/csg/node.d.ts +0 -12
  110. package/dist/csg/node.js +0 -75
  111. package/dist/csg/polygon.d.ts +0 -43
  112. package/dist/csg/polygon.js +0 -161
  113. package/dist/diamondMaterialShader.d.ts +0 -92
  114. package/dist/diamondMaterialShader.js +0 -118
  115. package/dist/effect/breath-light.d.ts +0 -4
  116. package/dist/effect/breath-light.js +0 -39
  117. package/dist/extends/geometryaid.d.ts +0 -28
  118. package/dist/extends/geometryaid.js +0 -71
  119. package/dist/extends/split.d.ts +0 -3
  120. package/dist/extends/split.js +0 -13
  121. package/dist/glview.d.ts +0 -112
  122. package/dist/glview.js +0 -564
  123. package/dist/math/Color.d.ts +0 -33
  124. package/dist/math/Color.js +0 -235
  125. package/dist/math/Euler.d.ts +0 -46
  126. package/dist/math/Euler.js +0 -225
  127. package/dist/math/HVec3.d.ts +0 -43
  128. package/dist/math/HVec3.js +0 -176
  129. package/dist/math/Mat3.d.ts +0 -29
  130. package/dist/math/Mat3.js +0 -244
  131. package/dist/math/Mat4.d.ts +0 -85
  132. package/dist/math/Mat4.js +0 -791
  133. package/dist/math/Math.d.ts +0 -130
  134. package/dist/math/Math.js +0 -198
  135. package/dist/math/Quat.d.ts +0 -82
  136. package/dist/math/Quat.js +0 -418
  137. package/dist/math/Vec2.d.ts +0 -68
  138. package/dist/math/Vec2.js +0 -328
  139. package/dist/math/Vec3.d.ts +0 -240
  140. package/dist/math/Vec3.js +0 -1082
  141. package/dist/math/Vec4.d.ts +0 -81
  142. package/dist/math/Vec4.js +0 -475
  143. package/dist/math/vecs.d.ts +0 -134
  144. package/dist/math/vecs.js +0 -464
  145. package/dist/render/bufferAttribute.d.ts +0 -104
  146. package/dist/render/bufferAttribute.js +0 -344
  147. package/dist/render/geometry.d.ts +0 -87
  148. package/dist/render/geometry.js +0 -769
  149. package/dist/render/mesh.d.ts +0 -30
  150. package/dist/render/mesh.js +0 -87
  151. package/dist/render/types.d.ts +0 -3
  152. package/dist/render/types.js +0 -8
  153. package/dist/robust/plane.d.ts +0 -7
  154. package/dist/robust/plane.js +0 -17
  155. package/dist/robust/vec.d.ts +0 -15
  156. package/dist/robust/vec.js +0 -71
  157. package/dist/struct/3d/Box.d.ts +0 -23
  158. package/dist/struct/3d/Box.js +0 -109
  159. package/dist/struct/3d/Capsule.d.ts +0 -12
  160. package/dist/struct/3d/Capsule.js +0 -36
  161. package/dist/struct/3d/Circle.d.ts +0 -52
  162. package/dist/struct/3d/Circle.js +0 -138
  163. package/dist/struct/3d/Disk.d.ts +0 -10
  164. package/dist/struct/3d/Disk.js +0 -22
  165. package/dist/struct/3d/Frustum.d.ts +0 -35
  166. package/dist/struct/3d/Frustum.js +0 -159
  167. package/dist/struct/3d/Line.d.ts +0 -40
  168. package/dist/struct/3d/Line.js +0 -340
  169. package/dist/struct/3d/Path.d.ts +0 -75
  170. package/dist/struct/3d/Path.js +0 -308
  171. package/dist/struct/3d/Plane.d.ts +0 -74
  172. package/dist/struct/3d/Plane.js +0 -298
  173. package/dist/struct/3d/Point.d.ts +0 -4
  174. package/dist/struct/3d/Point.js +0 -30
  175. package/dist/struct/3d/Polygon.d.ts +0 -8
  176. package/dist/struct/3d/Polygon.js +0 -55
  177. package/dist/struct/3d/Polyline.d.ts +0 -34
  178. package/dist/struct/3d/Polyline.js +0 -130
  179. package/dist/struct/3d/Ray.d.ts +0 -21
  180. package/dist/struct/3d/Ray.js +0 -262
  181. package/dist/struct/3d/Rectangle.d.ts +0 -7
  182. package/dist/struct/3d/Rectangle.js +0 -35
  183. package/dist/struct/3d/Segment.d.ts +0 -32
  184. package/dist/struct/3d/Segment.js +0 -334
  185. package/dist/struct/3d/Shape.d.ts +0 -4
  186. package/dist/struct/3d/Shape.js +0 -27
  187. package/dist/struct/3d/Sphere.d.ts +0 -11
  188. package/dist/struct/3d/Sphere.js +0 -30
  189. package/dist/struct/3d/Triangle.d.ts +0 -8
  190. package/dist/struct/3d/Triangle.js +0 -53
  191. package/dist/struct/bsp.d.ts +0 -9
  192. package/dist/struct/bsp.js +0 -44
  193. package/dist/struct/btree.d.ts +0 -0
  194. package/dist/struct/btree.js +0 -1
  195. package/dist/struct/data/ArrayList.d.ts +0 -42
  196. package/dist/struct/data/ArrayList.js +0 -172
  197. package/dist/struct/data/ArrayObject.d.ts +0 -30
  198. package/dist/struct/data/ArrayObject.js +0 -131
  199. package/dist/struct/data/type.d.ts +0 -13
  200. package/dist/struct/data/type.js +0 -18
  201. package/dist/struct/kdtree.d.ts +0 -0
  202. package/dist/struct/kdtree.js +0 -1
  203. package/dist/struct/polyTree.d.ts +0 -4
  204. package/dist/struct/polyTree.js +0 -27
  205. package/dist/struct/quatTree.d.ts +0 -0
  206. package/dist/struct/quatTree.js +0 -1
  207. package/dist/struct/tree.d.ts +0 -11
  208. package/dist/struct/tree.js +0 -26
  209. package/dist/utils/array.d.ts +0 -24
  210. package/dist/utils/array.js +0 -89
  211. package/dist/utils/types.d.ts +0 -24
  212. package/dist/utils/types.js +0 -20
  213. package/docs/.vuepress/components/distance.vue +0 -125
  214. package/docs/.vuepress/components/intersect.vue +0 -0
  215. package/docs/.vuepress/components/trianglution.vue +0 -121
  216. package/docs/.vuepress/components/utils.js +0 -314
  217. package/docs/.vuepress/config.js +0 -99
  218. package/docs/.vuepress/enhanceApp.js +0 -13
  219. package/docs/.vuepress/public/delaunay.png +0 -0
  220. package/docs/.vuepress/public/logo.png +0 -0
  221. package/docs/.vuepress/public/plane-set-convex.png +0 -0
  222. package/docs/.vuepress/public/sponsor/alipay.jpg +0 -0
  223. package/docs/.vuepress/public/sponsor/wechat.png +0 -0
  224. package/docs/README.md +0 -14
  225. package/docs/demo/README.md +0 -9
  226. package/docs/guide/README.md +0 -94
  227. package/docs/guide/array.md +0 -10
  228. package/docs/guide/cy/trianglution.html +0 -2
  229. package/docs/guide/distLineAll.md +0 -85
  230. package/docs/guide/distPointAll.md +0 -137
  231. package/docs/guide/distRayAll.md +0 -69
  232. package/docs/guide/distSegmentAll.md +0 -19
  233. package/docs/guide/point.vue +0 -12
  234. package/docs/guide/vector.md +0 -10
  235. package/docs/guide//345/270/270/347/224/250.md +0 -156
  236. package/docs/sponsor/README.md +0 -15
  237. package/docs//345/274/200/345/217/221/346/227/245/345/277/227/2020/345/271/2643/346/234/21013/346/227/245.md +0 -6
  238. package/effect/common.glsl +0 -34
  239. package/effect/drawing.glsl +0 -36
  240. package/effect/shape.arc.glsl +0 -13
  241. package/effect/shape.circle.glsl +0 -13
  242. package/effect/shape.grid.glsl +0 -42
  243. package/effect/shape.line.glsl +0 -18
  244. package/effect/shape.pie.glsl +0 -18
  245. package/effect/shape.plot.glsl +0 -10
  246. package/effect/shape.poly.glsl +0 -15
  247. package/effect/shape.rect.glsl +0 -14
  248. package/effect/shape.rectround.glsl +0 -15
  249. package/effect/shape.segment.glsl +0 -10
  250. package/effect/shape.spiral.glsl +0 -12
  251. package/effect/shape.star.glsl +0 -16
  252. package/examples/index.html +0 -31
  253. package/git.sh +0 -12
  254. package/gitproxy.sh +0 -6
  255. package/image/readme/1640758500266.png +0 -0
  256. package/image/readme/1640758513361.png +0 -0
  257. package/index.html +0 -14
  258. package/linear algorithm//346/225/260/345/255/246/350/241/250/350/276/276/345/274/217.md" +0 -122
  259. package/linear algorithm//347/237/251/351/230/265.md" +0 -91
  260. package/rollup.config.js +0 -82
  261. package/scripttest.html +0 -23
  262. package/src/IKanimation/Bone.ts +0 -20
  263. package/src/IKanimation/CCDSolver.ts +0 -114
  264. package/src/IKanimation/Joint.ts +0 -13
  265. package/src/IKanimation/constaint/constraint.ts +0 -23
  266. package/src/IKanimation/constaint/hinge.ts +0 -29
  267. package/src/IKanimation/constaint/slider.ts +0 -25
  268. package/src/IKanimation/index.ts +0 -8
  269. package/src/IKanimation/isolver.ts +0 -13
  270. package/src/IKanimation/skeleton.ts +0 -30
  271. package/src/alg/common.ts +0 -304
  272. package/src/alg/curve.ts +0 -9
  273. package/src/alg/delaunator.ts +0 -519
  274. package/src/alg/delaunay.ts +0 -163
  275. package/src/alg/delaunayslow.ts +0 -183
  276. package/src/alg/extrude/extrude.ts +0 -19
  277. package/src/alg/extrude.ts +0 -941
  278. package/src/alg/offset/index.ts +0 -8
  279. package/src/alg/offset.ts +0 -501
  280. package/src/alg/pointset.ts +0 -219
  281. package/src/alg/recognition.ts +0 -43
  282. package/src/alg/result.ts +0 -24
  283. package/src/alg/segmentset.ts +0 -44
  284. package/src/alg/sort.ts +0 -11
  285. package/src/alg/split.ts +0 -15
  286. package/src/alg/trianglution.ts +0 -53
  287. package/src/alg/vol.ts +0 -18
  288. package/src/alg/voronoi.ts +0 -303
  289. package/src/app.css +0 -12
  290. package/src/app.ts +0 -285
  291. package/src/assets/color.jpg +0 -0
  292. package/src/basic/distance.ts +0 -40
  293. package/src/clipper/clipper.d.ts +0 -323
  294. package/src/clipper/clipper.js +0 -7626
  295. package/src/clipper/clipper_float.js +0 -185
  296. package/src/clipper/clipper_float_unminified.js +0 -5639
  297. package/src/clipper/clipperint.js +0 -7626
  298. package/src/csg/bsp.ts +0 -24
  299. package/src/csg/csg.js +0 -583
  300. package/src/csg/node.ts +0 -91
  301. package/src/csg/polygon.ts +0 -177
  302. package/src/diamondMaterialShader.ts +0 -93
  303. package/src/effect/breath-light.ts +0 -24
  304. package/src/extends/geometryaid.ts +0 -86
  305. package/src/extends/split.ts +0 -15
  306. package/src/glview.ts +0 -570
  307. package/src/index.ts +0 -47
  308. package/src/math/Color.ts +0 -225
  309. package/src/math/Euler.ts +0 -238
  310. package/src/math/HVec3.ts +0 -1144
  311. package/src/math/Mat3.ts +0 -365
  312. package/src/math/Mat4.ts +0 -1134
  313. package/src/math/Math.ts +0 -213
  314. package/src/math/Quat.ts +0 -536
  315. package/src/math/Vec2.ts +0 -408
  316. package/src/math/Vec3.ts +0 -1307
  317. package/src/math/Vec4.ts +0 -587
  318. package/src/math/vecs.ts +0 -486
  319. package/src/render/bufferAttribute.ts +0 -491
  320. package/src/render/geometry.ts +0 -1329
  321. package/src/render/mesh.ts +0 -82
  322. package/src/render/types.ts +0 -17
  323. package/src/robust/plane.ts +0 -12
  324. package/src/robust/readme.md +0 -1
  325. package/src/robust/vec.ts +0 -61
  326. package/src/shader/common.glsl +0 -87
  327. package/src/shader/noise/cellular2D.glsl +0 -69
  328. package/src/shader/noise/cellular2x2x2.glsl +0 -88
  329. package/src/shader/noise/cellular3D.glsl +0 -187
  330. package/src/struct/3d/Box.ts +0 -124
  331. package/src/struct/3d/Capsule.ts +0 -18
  332. package/src/struct/3d/Circle.ts +0 -149
  333. package/src/struct/3d/Disk.ts +0 -22
  334. package/src/struct/3d/Frustum.ts +0 -189
  335. package/src/struct/3d/Line.ts +0 -378
  336. package/src/struct/3d/Path.ts +0 -314
  337. package/src/struct/3d/Plane.ts +0 -341
  338. package/src/struct/3d/Point.ts +0 -7
  339. package/src/struct/3d/PolyLine.ts +0 -115
  340. package/src/struct/3d/Polygon.ts +0 -46
  341. package/src/struct/3d/Ray.ts +0 -285
  342. package/src/struct/3d/Rectangle.ts +0 -18
  343. package/src/struct/3d/Segment.ts +0 -330
  344. package/src/struct/3d/Shape.ts +0 -7
  345. package/src/struct/3d/Sphere.ts +0 -31
  346. package/src/struct/3d/Triangle.ts +0 -28
  347. package/src/struct/bsp.ts +0 -18
  348. package/src/struct/btree.ts +0 -0
  349. package/src/struct/data/ArrayList.ts +0 -144
  350. package/src/struct/data/ArrayObject.ts +0 -105
  351. package/src/struct/data/type.ts +0 -14
  352. package/src/struct/kdtree.ts +0 -0
  353. package/src/struct/polyTree.ts +0 -8
  354. package/src/struct/quatTree.ts +0 -0
  355. package/src/struct/tree.ts +0 -30
  356. package/src/utils/array.ts +0 -106
  357. package/src/utils/types.ts +0 -42
  358. package/src-gis/app.ts +0 -7
  359. package/src-gis/core/Cartographic.ts +0 -48
  360. package/src-gis/core/EllipsoidGeodesic.ts +0 -56
  361. package/src-gis/core/EllipsoidTerrainProvider.ts +0 -35
  362. package/src-gis/core/HeightmapTerrainData.ts +0 -5
  363. package/src-gis/core/Rectangle.ts +0 -112
  364. package/src-gis/core/TaskProcessor.ts +0 -222
  365. package/src-gis/gis.ts +0 -25
  366. package/src-gis/globe.ts +0 -54
  367. package/src-gis/math/Cartographic.ts +0 -24
  368. package/src-gis/math/GVec3.ts +0 -55
  369. package/src-gis/math/ellipsoid.ts +0 -13
  370. package/src-gis/provider/DcTerrainProvider.ts +0 -36
  371. package/src-gis/provider/TerrainProvider.ts +0 -12
  372. package/src-gis/scene/DcImageryProvider.ts +0 -36
  373. package/src-gis/scene/GeographicTilingScheme.ts +0 -65
  374. package/src-gis/scene/Globe.ts +0 -76
  375. package/src-gis/scene/GlobeSurfaceShaderSet.ts +0 -9
  376. package/src-gis/scene/GlobeSurfaceTileProvider.ts +0 -25
  377. package/src-gis/scene/ImageryLayerCollection.ts +0 -75
  378. package/src-gis/scene/ImageryProvider.ts +0 -28
  379. package/src-gis/scene/QuadtreeTile.ts +0 -162
  380. package/src-gis/scene/UrlTemplateImageryProvider.ts +0 -32
  381. package/src-gis/scene/quadtree_primitive.ts +0 -58
  382. package/tsconfig.json +0 -77
  383. package/webpack.config.js +0 -112
  384. package//350/256/241/347/256/227/345/207/240/344/275/225/351/227/256/351/242/230.md +0 -26
@@ -0,0 +1,3176 @@
1
+ import Decimal from 'decimal.js';
2
+
3
+ declare class Quat {
4
+ _x: number;
5
+ _y: number;
6
+ _z: number;
7
+ _w: number;
8
+ isQuat: boolean;
9
+ constructor(_x?: number, _y?: number, _z?: number, _w?: number);
10
+ get x(): number;
11
+ set x(value: number);
12
+ get y(): number;
13
+ set y(value: number);
14
+ get z(): number;
15
+ set z(value: number);
16
+ get w(): number;
17
+ set w(value: number);
18
+ static slerp(qa: any, qb: any, qm: {
19
+ copy: (arg0: any) => {
20
+ (): any;
21
+ new (): any;
22
+ slerp: {
23
+ (arg0: any, arg1: any): any;
24
+ new (): any;
25
+ };
26
+ };
27
+ }, t: any): any;
28
+ static slerpFlat(dst: {
29
+ [x: string]: any;
30
+ }, dstOffset: number, src0: {
31
+ [x: string]: any;
32
+ }, srcOffset0: number, src1: {
33
+ [x: string]: any;
34
+ }, srcOffset1: number, t: number): void;
35
+ static multiplyQuatsFlat(dst: {
36
+ [x: string]: number;
37
+ }, dstOffset: number, src0: {
38
+ [x: string]: any;
39
+ }, srcOffset0: number, src1: {
40
+ [x: string]: any;
41
+ }, srcOffset1: number): {
42
+ [x: string]: number;
43
+ };
44
+ set(x: number, y: number, z: number, w: number): this;
45
+ clone(): Quat;
46
+ copy(quat: Quat): this;
47
+ setFromEuler(euler: Euler, update?: boolean): this;
48
+ setFromAxisAngle(axis: {
49
+ x: number;
50
+ y: number;
51
+ z: number;
52
+ }, angle: number): this;
53
+ setFromRotationMat(m: {
54
+ elements: any;
55
+ }): this;
56
+ setFromUnitVecs(vFrom: {
57
+ dot: (arg0: any) => number;
58
+ x: number;
59
+ z: number;
60
+ y: number;
61
+ }, vTo: {
62
+ z: number;
63
+ y: number;
64
+ x: number;
65
+ }): this;
66
+ angleTo(q: any): number;
67
+ rotateTowards(q: any, step: number): this;
68
+ inverse(): this;
69
+ invert(): this;
70
+ conjugate(): this;
71
+ dot(v: Quat): number;
72
+ lengthSq(): number;
73
+ length(): number;
74
+ normalize(): this;
75
+ multiply(q: Quat, p?: Quat): this;
76
+ premultiply(q: Quat): this;
77
+ multiplyQuats(a: Quat, b: Quat): this;
78
+ slerp(qb: Quat, t: number): this;
79
+ equals(quat: Quat): boolean;
80
+ fromArray(array: Array<number>, offset?: number): this;
81
+ toArray(array?: number[], offset?: number): number[];
82
+ }
83
+ declare function quat(x?: number, y?: number, z?: number, w?: number): Quat;
84
+
85
+ type DistanceParameter = number | number[];
86
+ interface DistanceResult {
87
+ /** Absolute bound on numerical distance error for iterative curved queries. */
88
+ errorBound?: number;
89
+ iterations?: number;
90
+ rayParameter?: number;
91
+ lineParameter?: number;
92
+ closests: [Vec3, Vec3];
93
+ parameters: [DistanceParameter, DistanceParameter];
94
+ distance: number;
95
+ distanceSqr: number;
96
+ equidistant?: boolean;
97
+ interior?: boolean;
98
+ triangleParameters?: number[];
99
+ rectangleParameters?: number[];
100
+ circleClosest?: Vec3;
101
+ signedDistance?: number;
102
+ segmentIndex?: number;
103
+ diskClosest?: Vec3;
104
+ }
105
+ interface IntersectResult extends DistanceResult {
106
+ interserct?: boolean;
107
+ equals?: boolean;
108
+ intersetctPts: Array<Array<Vec3>>;
109
+ }
110
+
111
+ /** Shared contract of the basic geometric primitives. Set/copy mutate and chain;
112
+ * clone owns its coordinates; queries do not mutate either operand. */
113
+ interface GeometryQuery<T> {
114
+ readonly kind: GeometryKind;
115
+ copy(source: T): this;
116
+ clone(): T;
117
+ distancePoint(point: Vec3): DistanceResult;
118
+ queryDistance(other: GeometryQuery<any>, options?: CurvedQueryOptions): DistanceResult;
119
+ toJSON(): GeometryData;
120
+ }
121
+ type GeometryKind = 'Point' | 'Line' | 'Ray' | 'Segment' | 'Triangle' | 'Plane' | 'Rectangle' | 'Circle' | 'Disk' | 'Sphere' | 'Capsule' | 'Box' | 'Polyline' | 'Polygon' | 'Shape';
122
+ interface GeometryData {
123
+ kind: GeometryKind;
124
+ vertices: number[][];
125
+ normal?: number[];
126
+ radius?: number;
127
+ w?: number;
128
+ startAngle?: number;
129
+ lengthAngle?: number;
130
+ empty?: boolean;
131
+ holes?: number[][][];
132
+ }
133
+
134
+ declare class Circle implements GeometryQuery<Circle> {
135
+ center: Vec3;
136
+ radius: number;
137
+ normal: Vec3;
138
+ queryCurved(other: GeometryQuery<any>, options?: CurvedQueryOptions): DistanceResult;
139
+ queryDistance(other: GeometryQuery<any>, options?: CurvedQueryOptions): DistanceResult;
140
+ basis(): [Vec3, Vec3];
141
+ pointAt(angle: number): Vec3;
142
+ containsAngle(angle: number): boolean;
143
+ closestPoint(point: Vec3): Vec3;
144
+ startAngle: number;
145
+ lengthAngle: number;
146
+ radiusSqr: number;
147
+ /**
148
+ * 圆圈
149
+ * @param {Vec3} center 中心点
150
+ * @param {Vec3} normal 法线
151
+ * @param {Number} radius 半径
152
+ */
153
+ constructor(center?: Vec3, radius?: number, startAngle?: number, lengthAngle?: number, normal?: Vec3);
154
+ area(): number;
155
+ /**
156
+ * 两个点
157
+ * @param fixp0
158
+ * @param fixp1
159
+ * @param movep
160
+ * @param normal
161
+ */
162
+ arc1(fixp0: Vec3, fixp1: Vec3, movep: Vec3, normal?: Vec3): this;
163
+ /**
164
+ * 全两个点确定半径,后面点确定 弧度 ,只需要检测鼠标移动时鼠标是否跨过第一条半径即可确定顺逆时针
165
+ * @param fixp0
166
+ * @param fixp1
167
+ * @param movep
168
+ */
169
+ arc2(center: Vec3, fixp1: Vec3, movep: Vec3, ccw?: boolean, normal?: Vec3): this;
170
+ setFrom3Points(p0: Vec3, p1: Vec3, p2: Vec3, normal?: Vec3): this;
171
+ /**
172
+ * 将圆环或者圆弧转化为路径点,生成XY平面上得三维点
173
+ * @param center 中心点
174
+ * @param radius 半径
175
+ * @param startAngle 起始角 右手坐标系 以X正坐标轴为起点 单位弧度
176
+ * @param lengthAngle 弧度长度 单位弧度
177
+ * @param segment 分段
178
+ */
179
+ static toVecs(center: Vec3, radius: number, startAngle?: number, lengthAngle?: number, up?: Vec3, segment?: number): Vec3[];
180
+ /**
181
+ * 在p点延伸a,b两个方向,生成半径为r的圆弧,圆弧所在位置在a,b向量的内夹角
182
+ * @param p 位置
183
+ * @param a a方向
184
+ * @param b b方向
185
+ * @param r 圆弧半径
186
+ */
187
+ static PAdBdtoVecs(p: Vec3, a: Vec3, b: Vec3, r: number, segment?: number): Vec3[];
188
+ static PApBptoVecs(p: Vec3, a: Vec3, b: Vec3, r: number, segment?: number): Vec3[];
189
+ set(center: Vec3, radius: number, normal?: Vec3): this;
190
+ copy(source: Circle): this;
191
+ clone(): Circle;
192
+ distancePoint(point: Vec3): DistanceResult;
193
+ readonly kind: GeometryKind;
194
+ toJSON(): GeometryData;
195
+ }
196
+ declare function circle(center?: Vec3, radius?: number): Circle;
197
+
198
+ declare class Disk implements GeometryQuery<Disk> {
199
+ queryCurved(other: GeometryQuery<any>, options?: CurvedQueryOptions): DistanceResult;
200
+ queryDistance(other: GeometryQuery<any>, options?: CurvedQueryOptions): DistanceResult;
201
+ center: Vec3;
202
+ normal: Vec3;
203
+ radius: number;
204
+ w: number;
205
+ constructor(center: Vec3, radius: number, normal?: Vec3);
206
+ area(): number;
207
+ set(center: Vec3, radius: number, normal?: Vec3): this;
208
+ copy(source: Disk): this;
209
+ clone(): Disk;
210
+ distancePoint(point: Vec3): DistanceResult;
211
+ readonly kind: GeometryKind;
212
+ toJSON(): GeometryData;
213
+ }
214
+ declare function disk(center: Vec3, radius: number, normal: Vec3): Disk;
215
+
216
+ type Geometry = GeometryQuery<any>;
217
+ interface CurvedQueryOptions {
218
+ tolerance?: number;
219
+ maximumIterations?: number;
220
+ }
221
+ /** Certified adaptive arc/chord bounds. errorBound is an absolute distance bound. */
222
+ declare function circleDistance(circle: Circle, other: Geometry, options?: CurvedQueryOptions): DistanceResult;
223
+ declare function diskDistance(disk: Disk, other: Geometry, options?: CurvedQueryOptions): DistanceResult;
224
+
225
+ type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
226
+ type TypedArrayLike = number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
227
+
228
+ declare class Mat3 {
229
+ elements: number[];
230
+ isMat3: boolean;
231
+ constructor();
232
+ set(n11: number, n12: number, n13: number, n21: number, n22: number, n23: number, n31: number, n32: number, n33: number): this;
233
+ identity(): this;
234
+ clone(): Mat3;
235
+ copy(m: Mat3): this;
236
+ setFromMat4(m: Mat4): this;
237
+ applyToBufferAttribute(attribute: any): any;
238
+ multiply(m: Mat3): this;
239
+ premultiply(m: Mat3): this;
240
+ multiplyMatrices(a: Mat3, b: Mat3): this;
241
+ multiplyScalar(s: number): this;
242
+ determinant(): number;
243
+ getInverse(matrix: Mat3 | Mat4 | any, throwOnDegenerate?: boolean): this;
244
+ transpose(): this;
245
+ getNormalMat(mat4: Mat4): this;
246
+ transposeIntoArray(r: number[]): this;
247
+ setUvTransform(tx: any, ty: any, sx: number, sy: number, rotation: number, cx: number, cy: number): void;
248
+ scale(sx: number, sy: number): this;
249
+ rotate(theta: number): this;
250
+ translate(tx: number, ty: number): this;
251
+ equals(matrix: Mat3): boolean;
252
+ fromArray(array: number[], offset?: number): this;
253
+ toArray(array?: number[], offset?: number): number[];
254
+ }
255
+ declare function m3(): Mat3;
256
+
257
+ declare class Vec2 {
258
+ private _x;
259
+ private _y;
260
+ isVec2: boolean;
261
+ constructor(_x?: number, _y?: number);
262
+ get x(): number;
263
+ set x(value: number);
264
+ get y(): number;
265
+ set y(value: number);
266
+ static isVec2(v: any): boolean;
267
+ get width(): number;
268
+ set width(value: number);
269
+ get height(): number;
270
+ set height(value: number);
271
+ static get UnitX(): Vec2;
272
+ static get UnitY(): Vec2;
273
+ set(x: number, y: number): this;
274
+ setScalar(scalar: number): this;
275
+ setX(x: number): this;
276
+ setY(y: number): this;
277
+ setComponent(index: number, value: number): this;
278
+ getComponent(index: number): number;
279
+ clone(): Vec2;
280
+ copy(v: Vec2): Vec2;
281
+ add(v: Vec2, w?: Vec2): this;
282
+ addScalar(s: number): this;
283
+ addVecs(a: Vec2, b: Vec2): this;
284
+ addScaledVec(v: Vec2, s: number): this;
285
+ sub(v: Vec2, w: Vec2): this;
286
+ subScalar(s: number): this;
287
+ subVecs(a: Vec2, b: Vec2): this;
288
+ multiply(v: Vec2): this;
289
+ multiplyScalar(scalar: number): this;
290
+ divide(v: Vec2): this;
291
+ divideScalar(scalar: number): this;
292
+ applyMat3(m: Mat3): this;
293
+ min(v: Vec2): this;
294
+ max(v: Vec2): this;
295
+ clamp(min: Vec2, max: Vec2): this;
296
+ clampScalar(minVal: number, maxVal: number): this;
297
+ clampLength(min: number, max: number): this;
298
+ floor(): this;
299
+ ceil(): this;
300
+ round(): this;
301
+ roundToZero(): this;
302
+ negate(): this;
303
+ dot(v: Vec2): number;
304
+ cross(v: Vec2): number;
305
+ lengthSq(): number;
306
+ length(): number;
307
+ manhattanLength(): number;
308
+ normalize(): this;
309
+ angle(): number;
310
+ distanceTo(v: Vec2): number;
311
+ distanceToSquared(v: Vec2): number;
312
+ manhattanDistanceTo(v: Vec2): number;
313
+ setLength(length: number): this;
314
+ lerp(v: Vec2, alpha: number): this;
315
+ lerpVecs(v1: Vec2, v2: Vec2, alpha: number): this;
316
+ equals(v: Vec2): boolean;
317
+ fromArray(array: TypedArrayLike, offset?: number): this;
318
+ toArray(array?: TypedArrayLike, offset?: number): TypedArrayLike;
319
+ fromBufferAttribute(attribute: any, index: number, offset: any): this;
320
+ rotateAround(center: Vec2, angle: number): this;
321
+ }
322
+ declare function v2(): Vec2;
323
+
324
+ declare class Vec4 {
325
+ private _x;
326
+ private _y;
327
+ private _z;
328
+ private _w;
329
+ isVec4: boolean;
330
+ constructor(_x?: number, _y?: number, _z?: number, _w?: number);
331
+ get x(): number;
332
+ set x(value: number);
333
+ get y(): number;
334
+ set y(value: number);
335
+ get z(): number;
336
+ set z(value: number);
337
+ get w(): number;
338
+ set w(value: number);
339
+ static isVec4(v: Vec4): boolean;
340
+ get width(): number;
341
+ set width(value: number);
342
+ get height(): number;
343
+ set height(value: number);
344
+ set(x: number, y: number, z: number, w: number): this;
345
+ setScalar(scalar: number): this;
346
+ setX(x: number): this;
347
+ setY(y: number): this;
348
+ setZ(z: number): this;
349
+ setW(w: number): this;
350
+ setComponent(index: number, value: number): this;
351
+ getComponent(index: number): number;
352
+ clone(): Vec4;
353
+ copy(v: {
354
+ x: number;
355
+ y: number;
356
+ z: number;
357
+ w: number | undefined;
358
+ }): this;
359
+ add(v: Vec4, w?: Vec4): Vec4;
360
+ addScalar(s: number): this;
361
+ addVecs(a: Vec4, b: Vec4): this;
362
+ addScaledVec(v: Vec4, s: number): this;
363
+ sub(v: Vec4, w?: Vec4): this;
364
+ subScalar(s: number): this;
365
+ subVecs(a: Vec4, b: Vec4): this;
366
+ multiplyScalar(scalar: number): this;
367
+ applyMat4(m: {
368
+ elements: any;
369
+ }): this;
370
+ divideScalar(scalar: number): this;
371
+ setAxisAngleFromQuat(q: {
372
+ w: number;
373
+ x: number;
374
+ y: number;
375
+ z: number;
376
+ }): this;
377
+ setAxisAngleFromRotationMat(m: {
378
+ elements: any;
379
+ }): this;
380
+ min(v: Vec4): this;
381
+ max(v: Vec4): this;
382
+ clamp(min: Vec4, max: Vec4): this;
383
+ clampScalar(minVal: number, maxVal: number): this;
384
+ clampLength(min: number, max: number): this;
385
+ floor(): this;
386
+ ceil(): this;
387
+ round(): this;
388
+ roundToZero(): this;
389
+ negate(): this;
390
+ dot(v: Vec4): number;
391
+ lengthSq(): number;
392
+ length(): number;
393
+ manhattanLength(): number;
394
+ normalize(): this;
395
+ setLength(length: any): this;
396
+ lerp(v: Vec4, alpha: number): this;
397
+ lerpVecs(v1: Vec4, v2: any, alpha: any): Vec4;
398
+ equals(v: Vec4): boolean;
399
+ fromArray(array: TypedArrayLike, offset?: number): this;
400
+ toArray(array?: TypedArrayLike, offset?: number): TypedArrayLike;
401
+ fromBufferAttribute(attribute: any, index: any, offset: undefined): this;
402
+ }
403
+ declare function v4(x?: number, y?: number, z?: number, w?: number): Vec4;
404
+
405
+ declare enum JoinType {
406
+ Square = 0,
407
+ Round = 1,
408
+ Miter = 2,
409
+ Bevel = 0
410
+ }
411
+ declare enum EndType {
412
+ Square = 0,
413
+ Round = 1,
414
+ Butt = 2,
415
+ etClosedLine = 3,
416
+ etClosedPolygon = 4,
417
+ etOpenButt = 5,
418
+ etOpenSquare = 6
419
+ }
420
+
421
+ declare class ArrayList<T> {
422
+ protected _array: Array<T>;
423
+ isArrayList: boolean;
424
+ constructor(data?: Array<T> | ArrayList<T>);
425
+ get array(): T[];
426
+ set array(val: T[]);
427
+ get length(): number;
428
+ get last(): any;
429
+ get first(): T;
430
+ map(callbackfn: (value: T, index: number, array: T[]) => unknown): unknown[];
431
+ push(...values: any[]): void;
432
+ reverse(): this;
433
+ pop(): any;
434
+ unshift(...items: any[]): number;
435
+ insertAt(i: number, ...value: T[]): void;
436
+ splice(start: number, deleteCount: number, ...items: any[]): void;
437
+ get(index: number): any;
438
+ /**
439
+ * 遍历
440
+ * @param {*} method
441
+ */
442
+ forall(method: (arg0: any) => void): void;
443
+ /**
444
+ * 克隆
445
+ */
446
+ clone(): any;
447
+ /**
448
+ * 分类
449
+ * example:
450
+ * var arry = [1,2,3,4,5,6]
451
+ * var result = classify(this._array,(a)={return a%2===0})
452
+ *
453
+ * @param {Function} classifyMethod 分类方法
454
+ */
455
+ classify(classifyMethod: (value: T, representative: T, group: T[]) => boolean): T[][];
456
+ /**
457
+ * 去掉重复元素
458
+ * @param {Function} uniqueMethod 去重复
459
+ * @param {Function} sortMethod 排序
460
+ */
461
+ unique(uniqueMethod: (arg0: T, arg1: T) => boolean, sortMethod?: (a: T, b: T) => number): this;
462
+ }
463
+
464
+ declare class Polygon$1<T> extends Polyline<T> {
465
+ queryCompound(other: GeometryQuery<any>, options?: CurvedQueryOptions): DistanceResult;
466
+ readonly kind: GeometryKind;
467
+ isPolygon: boolean;
468
+ constructor(vs?: any[], normal?: Vec3);
469
+ offset(distance: number, normal?: Vec3): Polygon$1<T>;
470
+ containPoint(point: Vec3, tolerance?: number): boolean;
471
+ containsPoint(point: Vec3, tolerance?: number): boolean;
472
+ distancePoint(point: Vec3): DistanceResult;
473
+ }
474
+
475
+ declare enum ClipType {
476
+ Intersection = 0,
477
+ Union = 1,
478
+ Difference = 2,
479
+ Xor = 3
480
+ }
481
+ /**
482
+ * 线段正反原则:右手坐标系中,所在平面为XZ平面,把指向方向看着负Z轴,x正为正方向,x负为负方向
483
+ */
484
+ declare class Polyline<T> extends ArrayList<T> implements GeometryQuery<Polyline<T>> {
485
+ queryCompound(other: GeometryQuery<any>, options?: CurvedQueryOptions): DistanceResult;
486
+ queryDistance(other: GeometryQuery<any>, options?: CurvedQueryOptions): DistanceResult;
487
+ readonly kind: GeometryKind;
488
+ isCoPlanar: boolean;
489
+ isPolyline: boolean;
490
+ normal: Vec3;
491
+ constructor(vs?: Array<T> | Polyline<T> | Polygon$1<T>, normal?: Vec3);
492
+ static CleanPolygon(points: Vec3[], delta?: number): Vec3[];
493
+ static OffsetPaths(paths: Vec3[][], delta: number, jointype?: JoinType, endtype?: EndType, limit?: number): Vec3[][];
494
+ static SimplifyPolygon(points: Vec3[]): Vec3[][];
495
+ /**
496
+ * 偏移
497
+ * @param {Number} distance 偏移距离
498
+ * @param {Vector3} normal 折线所在平面法线
499
+ */
500
+ offset(distance: number, normal?: Vec3, endtype?: EndType, jointype?: JoinType): Polyline<T>;
501
+ /**
502
+ * 圆角 将折线拐点圆角化
503
+ * @param {Number} useDistance 圆角段距离
504
+ * @param {Number} segments 分切割段数
505
+ */
506
+ corner(useDistance: number, normal?: Vec3): Polyline<T>;
507
+ set(points: T[]): this;
508
+ copy(source: Polyline<T>): this;
509
+ clone(): this;
510
+ distancePoint(point: Vec3): DistanceResult;
511
+ toJSON(): GeometryData;
512
+ }
513
+
514
+ /** A fixed-size geometry owns its vertices; array operations cannot change its arity. */
515
+ declare abstract class FixedVertices implements Iterable<Vec3> {
516
+ queryDistance(other: GeometryQuery<any>, options?: CurvedQueryOptions): DistanceResult;
517
+ readonly [index: number]: Vec3;
518
+ protected readonly vertices: Vec3[];
519
+ protected constructor(points: readonly Vec3[]);
520
+ get length(): number;
521
+ [Symbol.iterator](): IterableIterator<Vec3>;
522
+ map<T>(callback: (point: Vec3, index: number) => T): T[];
523
+ forEach(callback: (point: Vec3, index: number) => void): void;
524
+ slice(start?: number, end?: number): Vec3[];
525
+ toArray(): Vec3[];
526
+ }
527
+
528
+ declare class Triangle extends FixedVertices implements GeometryQuery<Triangle> {
529
+ constructor(a: Vec3, b: Vec3, c: Vec3);
530
+ get p0(): Vec3;
531
+ get p1(): Vec3;
532
+ get p2(): Vec3;
533
+ distanceTriangle(triangle: Triangle): DistanceResult;
534
+ distancePoint(point: Vec3): DistanceResult;
535
+ distanceSegment(segment: Segment): DistanceResult;
536
+ distancePlane(plane: Plane$1): DistanceResult;
537
+ set(a: Vec3, b: Vec3, c: Vec3): this;
538
+ copy(source: Triangle): this;
539
+ clone(): Triangle;
540
+ distanceLine(line: Line): DistanceResult;
541
+ distanceRay(ray: Ray): DistanceResult;
542
+ readonly kind: GeometryKind;
543
+ distanceSphere(sphere: Sphere): DistanceResult;
544
+ distanceCapsule(capsule: Capsule): DistanceResult;
545
+ distanceRectangle(rectangle: Rectangle$1): DistanceResult;
546
+ toJSON(): GeometryData;
547
+ }
548
+
549
+ declare class Segment extends FixedVertices implements GeometryQuery<Segment> {
550
+ normal: Vec3 | undefined;
551
+ /**
552
+ * 线段
553
+ * @param {Point|Vec3} p0
554
+ * @param {Point|Vec3} p1
555
+ */
556
+ constructor(p0?: Vec3, p1?: Vec3);
557
+ set(p0: Vec3, p1: Vec3): this;
558
+ get center(): Vec3;
559
+ get extentDirection(): Vec3;
560
+ get extentSqr(): number;
561
+ get extent(): number;
562
+ get direction(): Vec3;
563
+ get p0(): Vec3;
564
+ set p0(v: Vec3);
565
+ get p1(): Vec3;
566
+ set p1(v: Vec3);
567
+ offset(distance: number, normal?: Vec3): this;
568
+ /**
569
+ * 线段到线段的距离
570
+ * @param {Segment} segment
571
+ */
572
+ distanceSegment(segment: Segment): DistanceResult;
573
+ distancePlane(plane: Plane$1): DistanceResult;
574
+ intersectSegment(segment: Segment, tolerance?: number): {
575
+ colinear: boolean;
576
+ intersected: boolean;
577
+ points: Vec3[];
578
+ errorBound?: number;
579
+ iterations?: number;
580
+ rayParameter?: number;
581
+ lineParameter?: number;
582
+ closests: [Vec3, Vec3];
583
+ parameters: [DistanceParameter, DistanceParameter];
584
+ distance: number;
585
+ distanceSqr: number;
586
+ equidistant?: boolean;
587
+ interior?: boolean;
588
+ triangleParameters?: number[];
589
+ rectangleParameters?: number[];
590
+ circleClosest?: Vec3;
591
+ signedDistance?: number;
592
+ segmentIndex?: number;
593
+ diskClosest?: Vec3;
594
+ };
595
+ distancePoint(point: Vec3): DistanceResult;
596
+ distanceLine(line: Line): DistanceResult;
597
+ distanceRay(ray: Ray): DistanceResult;
598
+ distanceTriangle(triangle: Triangle): DistanceResult;
599
+ intersectPlane(plane: Plane$1): Vec3 | Vec3[] | null;
600
+ distanceSphere(sphere: Sphere): DistanceResult;
601
+ distanceCapsule(capsule: Capsule): DistanceResult;
602
+ copy(source: Segment): this;
603
+ clone(): Segment;
604
+ readonly kind: GeometryKind;
605
+ distanceBox(box: Box): DistanceResult;
606
+ distanceRectangle(rectangle: Rectangle$1): DistanceResult;
607
+ toJSON(): GeometryData;
608
+ }
609
+ declare function segment(p0: Vec3, p1: Vec3): Segment;
610
+
611
+ declare class Rectangle$1 extends FixedVertices implements GeometryQuery<Rectangle$1> {
612
+ constructor(a: Vec3, b: Vec3, c: Vec3, d?: Vec3);
613
+ set(a: Vec3, b: Vec3, c: Vec3, d?: Vec3): this;
614
+ get center(): Vec3;
615
+ get axis(): Vec3[];
616
+ get extent(): number[];
617
+ copy(source: Rectangle$1): this;
618
+ clone(): Rectangle$1;
619
+ distancePoint(point: Vec3): DistanceResult;
620
+ private query;
621
+ distanceLine(line: Line): DistanceResult;
622
+ distanceRay(ray: Ray): DistanceResult;
623
+ distanceSegment(segment: Segment): DistanceResult;
624
+ distanceTriangle(triangle: Triangle): DistanceResult;
625
+ distancePlane(plane: Plane$1): DistanceResult;
626
+ distanceRectangle(rectangle: Rectangle$1): DistanceResult;
627
+ readonly kind: GeometryKind;
628
+ toJSON(): GeometryData;
629
+ }
630
+
631
+ declare class Ray implements GeometryQuery<Ray> {
632
+ queryDistance(other: GeometryQuery<any>, options?: CurvedQueryOptions): DistanceResult;
633
+ origin: Vec3;
634
+ direction: Vec3;
635
+ constructor(origin: Vec3, direction: Vec3);
636
+ /**
637
+ * 射线到射线的距离
638
+ * @param {Ray} ray
639
+ */
640
+ distanceRay(ray: Ray): DistanceResult;
641
+ /**
642
+ * 射线到线段的距离
643
+ * @param segment
644
+ */
645
+ distanceSegment(segment: Segment): DistanceResult;
646
+ distanceTriangle(triangle: Triangle): DistanceResult;
647
+ /** @deprecated Use distancePolyline. */
648
+ distancePloyline(polyline: Polyline<Vec3> | Vec3[]): DistanceResult;
649
+ distancePolyline(polyline: Polyline<Vec3> | Vec3[]): DistanceResult;
650
+ distancePoint(point: Vec3): DistanceResult;
651
+ intersectPlane(plane: Plane$1, result?: Vec3): Vec3 | undefined;
652
+ distancePlane(plane: Plane$1): DistanceResult;
653
+ distanceSphere(sphere: Sphere): DistanceResult;
654
+ distanceCapsule(capsule: Capsule): DistanceResult;
655
+ set(origin: Vec3, direction: Vec3): this;
656
+ copy(source: Ray): this;
657
+ clone(): Ray;
658
+ distanceLine(line: Line): DistanceResult;
659
+ readonly kind: GeometryKind;
660
+ distanceBox(box: Box): DistanceResult;
661
+ distanceRectangle(rectangle: Rectangle$1): DistanceResult;
662
+ toJSON(): GeometryData;
663
+ }
664
+
665
+ declare class Sphere implements GeometryQuery<Sphere> {
666
+ queryDistance(other: GeometryQuery<any>, options?: CurvedQueryOptions): DistanceResult;
667
+ applyMat4(mat: Mat4): this;
668
+ center: Vec3;
669
+ radius: number;
670
+ constructor(center?: Vec3, radius?: number);
671
+ setComponents(cx: number, cy: number, cz: number, radius: number): this;
672
+ copy(sphere: Sphere): this;
673
+ clone(): Sphere;
674
+ set(center: Vec3, radius: number): this;
675
+ distancePoint(point: Vec3): DistanceResult;
676
+ distanceLine(line: Line): DistanceResult;
677
+ distanceRay(ray: Ray): DistanceResult;
678
+ distanceSegment(segment: Segment): DistanceResult;
679
+ distancePlane(plane: Plane$1): DistanceResult;
680
+ distanceTriangle(triangle: Triangle): DistanceResult;
681
+ distanceSphere(sphere: Sphere): DistanceResult;
682
+ distanceCapsule(capsule: Capsule): DistanceResult;
683
+ containsPoint(point: Vec3): boolean;
684
+ readonly kind: GeometryKind;
685
+ distanceBox(box: Box): DistanceResult;
686
+ distanceRectangle(rectangle: Rectangle$1): DistanceResult;
687
+ toJSON(): GeometryData;
688
+ }
689
+
690
+ /**
691
+ * 几何体buffer属性
692
+ * 记录每个几何数据属性的细节
693
+ */
694
+ declare class BufferAttribute {
695
+ name: string;
696
+ itemSize: number;
697
+ array: TypedArray;
698
+ version: number;
699
+ normalized: boolean;
700
+ count: number;
701
+ updateRange: {
702
+ offset: number;
703
+ count: number;
704
+ };
705
+ readonly isBufferAttribute: true;
706
+ /**
707
+ *
708
+ * @param array {BufferArray} Buffer数据
709
+ * @param itemSize 单元长度,vec3是3,vec4是4
710
+ * @param normalized
711
+ */
712
+ constructor(array: TypedArray, itemSize: number, normalized?: boolean);
713
+ set needsUpdate(value: boolean);
714
+ onUploadCallback?: () => void;
715
+ onUpload(callback: () => void): this;
716
+ setUsage(usage: any): this;
717
+ copy(source: BufferAttribute): this;
718
+ copyAt(index1: number, attribute: BufferAttribute, index2: number): this;
719
+ copyArray(array: ArrayLike<number>): this;
720
+ copyColorsArray(colors: {
721
+ r: number;
722
+ g: number;
723
+ b: number;
724
+ }[]): this;
725
+ copyVec2sArray(vectors: {
726
+ x: number;
727
+ y: number;
728
+ }[]): this;
729
+ copyVec3sArray(vectors: {
730
+ x: number;
731
+ y: number;
732
+ z: number;
733
+ }[]): this;
734
+ copyVec4sArray(vectors: {
735
+ x: number;
736
+ y: number;
737
+ z: number;
738
+ w: number;
739
+ }[]): this;
740
+ applyMat3(m: Mat3): this;
741
+ applyMat4(m: Mat4): this;
742
+ applyNormalMat(m: Mat3): this;
743
+ transformDirection(m: Mat4): this;
744
+ set(value: ArrayLike<number>, offset: number): this;
745
+ getX(index: number): number;
746
+ setX(index: number, x: number): this;
747
+ getY(index: number): number;
748
+ setY(index: number, y: number): this;
749
+ getZ(index: number): number;
750
+ setZ(index: number, z: number): this;
751
+ getW(index: number): number;
752
+ setW(index: number, w: number): this;
753
+ setXY(index: number, x: number, y: number): this;
754
+ setXYZ(index: number, x: number, y: number, z: number): this;
755
+ setXYZW(index: number, x: number, y: number, z: number, w: number): this;
756
+ clone(): BufferAttribute;
757
+ toJSON(): {
758
+ itemSize: number;
759
+ type: string;
760
+ array: number[];
761
+ normalized: boolean;
762
+ };
763
+ }
764
+ declare class Int8BufferAttribute extends BufferAttribute {
765
+ constructor(array: any, itemSize: number, normalized?: boolean);
766
+ }
767
+ declare class Uint8BufferAttribute extends BufferAttribute {
768
+ constructor(array: any, itemSize: number, normalized?: boolean);
769
+ }
770
+ declare class Uint8ClampedBufferAttribute extends BufferAttribute {
771
+ constructor(array: any, itemSize: number, normalized?: boolean);
772
+ }
773
+ declare class Int16BufferAttribute extends BufferAttribute {
774
+ constructor(array: any, itemSize: number, normalized?: boolean);
775
+ }
776
+ declare class Uint16BufferAttribute extends BufferAttribute {
777
+ constructor(array: any, itemSize: number, normalized?: boolean);
778
+ }
779
+ declare class Int32BufferAttribute extends BufferAttribute {
780
+ constructor(array: any, itemSize: number, normalized?: boolean);
781
+ }
782
+ declare class Uint32BufferAttribute extends BufferAttribute {
783
+ constructor(array: any, itemSize: number, normalized?: boolean);
784
+ }
785
+ declare class Float32BufferAttribute extends BufferAttribute {
786
+ constructor(array: any, itemSize: number, normalized?: boolean);
787
+ }
788
+ declare class Float64BufferAttribute extends BufferAttribute {
789
+ constructor(array: any, itemSize: number, normalized?: boolean);
790
+ }
791
+
792
+ interface IGeometry {
793
+ position: number[];
794
+ normal?: number[];
795
+ index?: number[];
796
+ uv?: number[];
797
+ uv2?: number[];
798
+ tangent?: number[];
799
+ }
800
+ interface IBufferGeometry {
801
+ position: Float32Array | undefined;
802
+ index?: Uint32Array | Uint16Array;
803
+ normal?: Float32Array;
804
+ uv?: Float32Array;
805
+ uv2?: Float32Array;
806
+ tangent?: Float32Array;
807
+ }
808
+ /**
809
+ * BufferType 几何体,用于独立计算几何体
810
+ */
811
+ declare class BufferGeometry {
812
+ userData: Record<string, unknown>;
813
+ name: string;
814
+ boundingBox: Box | undefined;
815
+ boundingSphere: Sphere | undefined;
816
+ morphAttributes: any;
817
+ morphTargetsRelative: boolean;
818
+ index: BufferAttribute | undefined;
819
+ attributes: {
820
+ [key: string]: BufferAttribute;
821
+ };
822
+ groups: {
823
+ start: number;
824
+ count: number;
825
+ materialIndex?: number;
826
+ }[];
827
+ drawRange: {
828
+ start: number;
829
+ count: number;
830
+ };
831
+ parameters: any;
832
+ readonly isBufferGeometry: true;
833
+ constructor();
834
+ /**
835
+ * 转化成BufferArray来计算
836
+ * @param geo
837
+ */
838
+ setFromGeometry(geo: IGeometry | IBufferGeometry): this;
839
+ getIndex(): BufferAttribute | undefined;
840
+ setIndex(index: BufferAttribute | TypedArray | number[]): void;
841
+ getAttribute(name: string): BufferAttribute;
842
+ setAttribute(name: string, attribute: BufferAttribute): this;
843
+ addAttribute(name: string, attribute: BufferAttribute | TypedArray | Array<number | Vec2 | Vec3 | Vec4>, itemSize?: number): this;
844
+ deleteAttribute(name: string): this;
845
+ addGroup(start: number, count: number, materialIndex?: number): void;
846
+ clearGroups(): void;
847
+ setDrawRange(start: number, count: number): void;
848
+ applyMat4(matrix: Mat4): this;
849
+ rotateX(angle: number): this;
850
+ rotateY(angle: number): this;
851
+ rotateZ(angle: number): this;
852
+ translate(x: number, y: number, z: number): this;
853
+ scale(x: number, y: number, z: number): this;
854
+ lookAt(vector: Vec3): this;
855
+ center(): this;
856
+ setFromObject(object: any): this;
857
+ setFromPoints(points: Vec3[]): this;
858
+ updateFromObject(object: any): this;
859
+ computeBoundingBox(): void;
860
+ computeBoundingSphere(): void;
861
+ computeFaceNormals(): this;
862
+ computeVertexNormals(): void;
863
+ merge(geometry: BufferGeometry, offset: number): this | undefined;
864
+ normalizeNormals(): void;
865
+ toFlat(): BufferGeometry;
866
+ toNonIndexed(): BufferGeometry;
867
+ toJSON(): any;
868
+ clone(): BufferGeometry;
869
+ copy(source: BufferGeometry): this;
870
+ }
871
+
872
+ interface MeshSplitOptions {
873
+ cap?: boolean;
874
+ tolerance?: number;
875
+ }
876
+
877
+ declare enum IntersectType {
878
+ None = 0,
879
+ Parallel = 1,
880
+ Perpendicular = 2,
881
+ Collineation = 3
882
+ }
883
+ declare enum Orientation {
884
+ None = -1,
885
+ Positive = 1,
886
+ Negative = 2,
887
+ Common = 3,//共面
888
+ Intersect = 3
889
+ }
890
+
891
+ interface ISplitResult {
892
+ negative: Vec3[];
893
+ positive: Vec3[];
894
+ common: Vec3[];
895
+ orientation: Orientation;
896
+ }
897
+
898
+ /** Plane equation: normal.dot(point) + w = 0. */
899
+ declare class Plane$1 implements GeometryQuery<Plane$1> {
900
+ queryDistance(other: GeometryQuery<any>, options?: CurvedQueryOptions): DistanceResult;
901
+ normal: Vec3;
902
+ w: number;
903
+ constructor(normal?: Vec3, w?: number);
904
+ private validate;
905
+ get origin(): Vec3;
906
+ static setFromPointNormal(point: Vec3, normal: Vec3): Plane$1;
907
+ setFromPointNormal(point: Vec3, normal: Vec3): this;
908
+ set(normal: Vec3, w: number): this;
909
+ copy(plane: Plane$1): this;
910
+ clone(): Plane$1;
911
+ setComponents(x: number, y: number, z: number, w: number): this;
912
+ normalize(): this;
913
+ setFromThreePoint(a: Vec3, b: Vec3, c: Vec3): this;
914
+ negate(): this;
915
+ signedDistanceToPoint(point: Vec3): number;
916
+ frontback(point: Vec3): number;
917
+ distancePoint(point: Vec3): DistanceResult;
918
+ distanceRay(ray: Ray): DistanceResult;
919
+ distanceLine(line: Line): DistanceResult;
920
+ distanceSegment(segment: Segment): DistanceResult;
921
+ distanceTriangle(triangle: Triangle): DistanceResult;
922
+ distancePlane(plane: Plane$1): DistanceResult;
923
+ intersectSegmentLw(segment: Segment | Vec3[]): Vec3 | Vec3[] | null;
924
+ intersectLine(line: Line, result?: Vec3): Vec3 | undefined;
925
+ intersectRay(ray: Ray, result?: Vec3): Vec3 | undefined;
926
+ splitSegment(segment: Segment | Vec3[]): {
927
+ intersectPoint: Vec3 | undefined;
928
+ negative: Vec3[];
929
+ positive: Vec3[];
930
+ common: Vec3[];
931
+ orientation: Orientation;
932
+ };
933
+ splitTriangle(triangle: Triangle | Vec3[], tolerance?: number): ISplitResult;
934
+ /** Ordered polygons on either side; cut vertices are included in both. */
935
+ splitConvexPolygon(polygon: Vec3[], tolerance?: number): ISplitResult;
936
+ orientationPoint(point: Vec3): Orientation;
937
+ /** Split a triangle mesh, interpolating attributes; optional closed manifold caps. */
938
+ static splitGeometry(plane: Plane$1, geometry: IGeometry, options?: MeshSplitOptions): {
939
+ positive: IGeometry;
940
+ negative: IGeometry;
941
+ common: IGeometry;
942
+ };
943
+ readonly kind: GeometryKind;
944
+ toJSON(): GeometryData;
945
+ }
946
+
947
+ declare class Line implements GeometryQuery<Line> {
948
+ origin: Vec3;
949
+ end: Vec3;
950
+ queryDistance(other: GeometryQuery<any>, options?: CurvedQueryOptions): DistanceResult;
951
+ direction: Vec3;
952
+ constructor(origin?: Vec3, end?: Vec3);
953
+ set(origin: Vec3, end: Vec3): this;
954
+ distancePoint(point: Vec3): DistanceResult;
955
+ distanceSegment(segment: Segment): DistanceResult;
956
+ /**
957
+ * 直线到直线的距离
958
+ * 参数与最近点顺序一致
959
+ * @param {Line} line
960
+ */
961
+ distanceLine(line: Line): DistanceResult;
962
+ /**
963
+ * 直线与射线的距离
964
+ * @param {Ray} ray
965
+ */
966
+ distanceRay(ray: Ray): DistanceResult;
967
+ /**
968
+ *
969
+ * @param triangle
970
+ */
971
+ distanceTriangle(triangle: Triangle): DistanceResult;
972
+ distancePolyline(polyline: Polyline<Vec3> | Vec3[]): DistanceResult;
973
+ /**
974
+ * 线与平面相交
975
+ * @param plane
976
+ * @param result
977
+ */
978
+ intersectPlane(plane: Plane$1, result?: Vec3): Vec3 | undefined;
979
+ distancePlane(plane: Plane$1): DistanceResult;
980
+ distanceSphere(sphere: Sphere): DistanceResult;
981
+ distanceCapsule(capsule: Capsule): DistanceResult;
982
+ copy(source: Line): this;
983
+ clone(): Line;
984
+ readonly kind: GeometryKind;
985
+ distanceBox(box: Box): DistanceResult;
986
+ distanceRectangle(rectangle: Rectangle$1): DistanceResult;
987
+ toJSON(): GeometryData;
988
+ }
989
+ declare function line(start?: Vec3, end?: Vec3): Line;
990
+
991
+ declare class Capsule extends Segment implements GeometryQuery<Capsule> {
992
+ radius: number;
993
+ /**
994
+ * 胶囊体
995
+ * @param {Point|Vec3} p0 点0
996
+ * @param {Point|Vec3} p1 点1
997
+ * @param {Number} radius 半径
998
+ */
999
+ constructor(p0: Vec3, p1: Vec3, radius?: number);
1000
+ copy(source: Capsule): this;
1001
+ clone(): Capsule;
1002
+ set(p0: Vec3, p1: Vec3, radius?: number): this;
1003
+ distancePoint(point: Vec3): DistanceResult;
1004
+ distanceSphere(sphere: Sphere): DistanceResult;
1005
+ distanceCapsule(capsule: Capsule): DistanceResult;
1006
+ distanceSegment(segment: Segment): DistanceResult;
1007
+ distanceLine(line: Line): DistanceResult;
1008
+ distanceRay(ray: Ray): DistanceResult;
1009
+ distancePlane(plane: Plane$1): DistanceResult;
1010
+ distanceTriangle(triangle: Triangle): DistanceResult;
1011
+ containsPoint(point: Vec3): boolean;
1012
+ readonly kind: GeometryKind;
1013
+ distanceBox(box: Box): DistanceResult;
1014
+ distanceRectangle(rectangle: Rectangle$1): DistanceResult;
1015
+ toJSON(): GeometryData;
1016
+ }
1017
+
1018
+ declare class Box implements GeometryQuery<Box> {
1019
+ queryDistance(other: GeometryQuery<any>, options?: CurvedQueryOptions): DistanceResult;
1020
+ min: Vec3;
1021
+ max: Vec3;
1022
+ _center: Vec3;
1023
+ constructor(min?: Vec3, max?: Vec3);
1024
+ get center(): Vec3;
1025
+ /**
1026
+ *
1027
+ * @param {Array<Vec3>} points
1028
+ */
1029
+ setFromPoints(points: any): this;
1030
+ expand(...points: any[]): this;
1031
+ makeEmpty(): this;
1032
+ clone(): Box;
1033
+ copy(box: Box): this;
1034
+ setFromCenterAndSize(center: Vec3, size: Vec3): this;
1035
+ setFromBufferAttribute(attribute: BufferAttribute): this;
1036
+ expandByPoint(point: Vec3): this;
1037
+ isEmpty(): boolean;
1038
+ getCenter(target: Vec3): Vec3;
1039
+ set(min: Vec3, max: Vec3): this;
1040
+ containsPoint(point: Vec3): boolean;
1041
+ distancePoint(point: Vec3): DistanceResult;
1042
+ distanceBox(box: Box): DistanceResult;
1043
+ readonly kind: GeometryKind;
1044
+ distanceLine(line: Line): DistanceResult;
1045
+ distanceRay(ray: Ray): DistanceResult;
1046
+ distanceSegment(segment: Segment): DistanceResult;
1047
+ distanceSphere(sphere: Sphere): DistanceResult;
1048
+ distanceCapsule(capsule: Capsule): DistanceResult;
1049
+ distancePlane(plane: Plane$1): DistanceResult;
1050
+ distanceTriangle(triangle: Triangle): DistanceResult;
1051
+ distanceRectangle(rectangle: Rectangle$1): DistanceResult;
1052
+ toJSON(): GeometryData;
1053
+ }
1054
+
1055
+ interface IVec2 {
1056
+ x: number;
1057
+ y: number;
1058
+ }
1059
+ interface IVec3 extends IVec2 {
1060
+ z: number;
1061
+ }
1062
+ interface IVec4 extends IVec3 {
1063
+ w: number;
1064
+ }
1065
+ declare class Vec3 implements IVec3 {
1066
+ private _x;
1067
+ private _y;
1068
+ private _z;
1069
+ queryDistance(other: GeometryQuery<any>, options?: CurvedQueryOptions): DistanceResult;
1070
+ constructor(_x?: number, _y?: number, _z?: number);
1071
+ get x(): number;
1072
+ set x(value: number);
1073
+ get y(): number;
1074
+ set y(value: number);
1075
+ get z(): number;
1076
+ set z(value: number);
1077
+ static isVec3(v: any): boolean;
1078
+ get isVec3(): boolean;
1079
+ static get Up(): Vec3;
1080
+ static get Down(): Vec3;
1081
+ static get UnitX(): Vec3;
1082
+ static get UnitY(): Vec3;
1083
+ static get UnitZ(): Vec3;
1084
+ set(x: number, y: number, z: number): this;
1085
+ setScalar(scalar: number): this;
1086
+ setComponent(index: number, value: number): this;
1087
+ getComponent(index: number): number;
1088
+ clone(): Vec3;
1089
+ copy(v: Vec3): this;
1090
+ add(v: Vec3, w?: Vec3): this;
1091
+ addScalar(s: number): this;
1092
+ addVecs(a: Vec3, b: Vec3): this;
1093
+ addScaledVec(v: Vec3, s: number): this;
1094
+ sub(v: Vec3, w?: Vec3): this;
1095
+ subScalar(s: number): this;
1096
+ subVecs(a: Vec3, b: Vec3): this;
1097
+ multiply(v: Vec3, w?: Vec3): this;
1098
+ multiplyScalar(scalar: number): this;
1099
+ multiplyVecs(a: Vec3, b: Vec3): this;
1100
+ applyEuler(euler: Euler): this;
1101
+ applyAxisAngle(axis: any, angle: any): this;
1102
+ applyNormalMat(m: Mat3): this;
1103
+ applyMat3(m: Mat3): this;
1104
+ applyMat4(m: Mat4): this;
1105
+ applyQuat(q: Quat): this;
1106
+ project(camera: {
1107
+ matrixWorldInverse: any;
1108
+ projectionMat: any;
1109
+ }): this;
1110
+ unproject(camera: {
1111
+ projectionMatInverse: any;
1112
+ matrixWorld: any;
1113
+ }): this;
1114
+ transformDirection(m: Mat4): this;
1115
+ divide(v: Vec3): this;
1116
+ divideScalar(scalar: number): this;
1117
+ min(v: Vec3): this;
1118
+ max(v: Vec3): this;
1119
+ clamp(min: Vec3, max: Vec3): this;
1120
+ clampScalar(minVal: number, maxVal: number): this;
1121
+ clampLength(min: number, max: number): this;
1122
+ floor(): this;
1123
+ ceil(): this;
1124
+ round(): this;
1125
+ roundToZero(): this;
1126
+ negate(): this;
1127
+ dot(v: Vec3): number;
1128
+ lengthSq(): number;
1129
+ length(): number;
1130
+ manhattanLength(): number;
1131
+ normalize(robust?: boolean): this;
1132
+ setLength(length: any): this;
1133
+ lerp(v: Vec3, alpha: number): this;
1134
+ lerpVecs(v1: Vec3, v2: any, alpha: any): this;
1135
+ slerp(v2: any, radian: number): void;
1136
+ /**
1137
+ * v1 到 v2 选择angle弧度 v1,v2构成一个平面
1138
+ * @param v1
1139
+ * @param v2
1140
+ * @param alpha
1141
+ * @returns
1142
+ */
1143
+ slerpVecs(v1: Vec3, v2: any, radian: number): void;
1144
+ cross(v: Vec3, w?: Vec3): this;
1145
+ crossVecs(a: Vec3, b: Vec3): this;
1146
+ projectOnVec(vec: Vec3): this;
1147
+ /**
1148
+ * 投影到法线的所在平面 相当于平面上距离点最近的点
1149
+ * @param planeNormal
1150
+ * @returns
1151
+ */
1152
+ projectOnPlaneNormal(normal: Vec3, w?: number): this;
1153
+ /**
1154
+ * 投影到平面
1155
+ * @param normal 正交化的法线
1156
+ * @param w 距离
1157
+ * @returns
1158
+ */
1159
+ projectOnPlaneNormalDis(normal: Vec3, w: number): this;
1160
+ /**
1161
+ * 投影到平面
1162
+ * @param plane 平面
1163
+ * @returns
1164
+ */
1165
+ projectOnPlane(plane: Plane$1): this;
1166
+ /**
1167
+ * 从指定方向线(斜线,也可能是法线)上投影到平面
1168
+ * @param planeNormal
1169
+ * @param dir
1170
+ */
1171
+ projectDirectionOnPlane(plane: Plane$1, dir: Vec3): this;
1172
+ reflect(normal: any): this;
1173
+ /**
1174
+ * 两个向量的夹角
1175
+ * @param v
1176
+ * @param normal
1177
+ * @returns
1178
+ */
1179
+ angleTo(v: Vec3, normal?: Vec3 | any): number;
1180
+ /**
1181
+ * 一个向量到另一个向量的角度
1182
+ * @param v
1183
+ * @param normal
1184
+ * @returns
1185
+ */
1186
+ angleToEx(v: Vec3, normal: Vec3): number;
1187
+ distanceTo(v: any): number;
1188
+ distanceToSquared(v: Vec3): number;
1189
+ manhattanDistanceTo(v: Vec3): number;
1190
+ setFromSpherical(s: {
1191
+ radius: number;
1192
+ phi: number;
1193
+ theta: number;
1194
+ }): this;
1195
+ setFromSphericalCoords(radius: number, phi: number, theta: number): this;
1196
+ setFromCylindrical(c: {
1197
+ radius: any;
1198
+ theta: any;
1199
+ y: any;
1200
+ }): this;
1201
+ setFromCylindricalCoords(radius: number, theta: number, y: number): this;
1202
+ setFromMatPosition(m: {
1203
+ elements: any;
1204
+ }): this;
1205
+ setFromMatScale(m: any): this;
1206
+ setFromMatColumn(m: {
1207
+ elements: any;
1208
+ }, index: number): this;
1209
+ equals(v: Vec3): boolean;
1210
+ fromArray(array: ArrayLike<number>, offset?: number): this;
1211
+ toArray(): number[];
1212
+ toArray<T extends TypedArrayLike>(array: T, offset?: number): T;
1213
+ fromBufferAttribute(attribute: {
1214
+ getX: (arg0: any) => number;
1215
+ getY: (arg0: any) => number;
1216
+ getZ: (arg0: any) => number;
1217
+ }, index: any, offset?: number): this;
1218
+ toFixed(fractionDigits: number | undefined): this;
1219
+ distancePoint(point: Vec3): DistanceResult;
1220
+ distanceVec3(point: Vec3): DistanceResult;
1221
+ /**
1222
+ * 点到直线的距离 point distance to Line
1223
+ * @param line
1224
+ */
1225
+ distanceLine(line: Line): DistanceResult;
1226
+ /**
1227
+ * Test success
1228
+ * 到射线的距离
1229
+ * @param {Line} line
1230
+ * @returns {Object} lineParameter 最近点的参数 lineClosest 最近点 distanceSqr 到最近点距离的平方 distance 到最近点距离
1231
+ */
1232
+ distanceRay(ray: Ray): DistanceResult;
1233
+ /**
1234
+ * Test success
1235
+ * 到线段的距离
1236
+ * @param {Line} line
1237
+ * @returns {Object} lineParameter 最近点的参数 lineClosest 最近点 distanceSqr 到最近点距离的平方 distance 到最近点距离
1238
+ */
1239
+ distanceSegment(segment: Segment): DistanceResult;
1240
+ /**
1241
+ * 点与线段的距离
1242
+ * @param plane
1243
+ */
1244
+ distancePlane(plane: Plane$1): DistanceResult;
1245
+ /**
1246
+ * 点与圆圈的距离
1247
+ * @param {*} circle
1248
+ * @param {*} disk
1249
+ * @returns {} result
1250
+ */
1251
+ distanceCircle(circle: Circle): DistanceResult;
1252
+ /**
1253
+ * 点与圆盘的距离
1254
+ * @param {*} Disk
1255
+ * @returns {} result
1256
+ */
1257
+ distanceDisk(disk: Disk): DistanceResult;
1258
+ /**
1259
+ * 点与线段的距离
1260
+ * 点与折线的距离 测试排除法,平均比线性检索(暴力法)要快两倍以上
1261
+ * @param { Polyline | Vec3[]} polyline
1262
+ */
1263
+ distancePolyline(polyline: Polyline<Vec3> | Vec3[]): DistanceResult;
1264
+ /**
1265
+ * 点到三角形的距离
1266
+ * @param {Triangle} triangle
1267
+ */
1268
+ distanceTriangle(triangle: Triangle): DistanceResult;
1269
+ /**
1270
+ * 点到矩形的距离
1271
+ * @param {Rectangle} rectangle
1272
+ */
1273
+ distanceRectangle(rectangle: Rectangle$1): DistanceResult;
1274
+ /**
1275
+ * 点到胶囊的距离
1276
+ * @param {Capsule} capsule
1277
+ */
1278
+ distanceCapsule(capsule: Capsule): DistanceResult;
1279
+ distanceSphere(sphere: Sphere): DistanceResult;
1280
+ distanceBox(box: Box): DistanceResult;
1281
+ readonly kind: "Point";
1282
+ toJSON(): GeometryData;
1283
+ }
1284
+ declare function v3(x?: number, y?: number, z?: number): Vec3;
1285
+
1286
+ declare class Mat4 {
1287
+ elements: number[];
1288
+ isMat4: boolean;
1289
+ constructor();
1290
+ set(n11: number, n12: number, n13: number, n14: number, n21: number, n22: number, n23: number, n24: number, n31: number, n32: number, n33: number, n34: number, n41: number, n42: number, n43: number, n44: number): this;
1291
+ static get Identity(): Mat4;
1292
+ identity(): this;
1293
+ clone(): Mat4;
1294
+ copy(m: Mat4): this;
1295
+ copyPosition(m: {
1296
+ elements: any;
1297
+ }): this;
1298
+ extractBasis(xAxis: Vec3, yAxis: Vec3, zAxis: Vec3): this;
1299
+ makeBasis(xAxis: Vec3, yAxis: Vec3, zAxis: Vec3): this;
1300
+ extractRotation(m: Mat4): this;
1301
+ makeRotationFromEuler(euler: Euler): this;
1302
+ makeRotationFromQuat(q: any): this;
1303
+ lookAt(eye: Vec3, target: Vec3, up: Vec3): this;
1304
+ multiply(m: Mat4, n?: Mat4): this;
1305
+ premultiply(m: Mat4): this;
1306
+ multiplyMats(a: Mat4, b: Mat4): this;
1307
+ multiplyScalar(s: number): this;
1308
+ applyToBufferAttribute(attribute: {
1309
+ count: any;
1310
+ getX: (arg0: number) => number;
1311
+ getY: (arg0: number) => number;
1312
+ getZ: (arg0: number) => number;
1313
+ setXYZ: (arg0: number, arg1: number, arg2: number, arg3: number) => void;
1314
+ }): {
1315
+ count: any;
1316
+ getX: (arg0: number) => number;
1317
+ getY: (arg0: number) => number;
1318
+ getZ: (arg0: number) => number;
1319
+ setXYZ: (arg0: number, arg1: number, arg2: number, arg3: number) => void;
1320
+ };
1321
+ determinant(): number;
1322
+ transpose(): this;
1323
+ setPosition(x: number | Vec3 | any, y?: number, z?: number): this;
1324
+ /**
1325
+ * 矩阵求逆
1326
+ * @returns 自己
1327
+ */
1328
+ invert(): Mat4;
1329
+ getInverse(m: Mat4, throwOnDegenerate?: boolean): this;
1330
+ scale(v: {
1331
+ x: any;
1332
+ y: any;
1333
+ z: any;
1334
+ }): this;
1335
+ getMaxScaleOnAxis(): number;
1336
+ makeTranslation(x: number, y: number, z: number): this;
1337
+ makeRotationX(theta: number): this;
1338
+ makeRotationY(theta: number): this;
1339
+ makeRotationZ(theta: number): this;
1340
+ makeRotationAxis(axis: {
1341
+ x: any;
1342
+ y: any;
1343
+ z: any;
1344
+ }, angle: number): this;
1345
+ makeScale(x: number, y: number, z: number): this;
1346
+ /**
1347
+ * 6个参数 都是由两个值来影响 [v1][v2] v1表示v2轴在v1轴产生效果
1348
+ * @param xy
1349
+ * @param xz
1350
+ * @param yx
1351
+ * @param yz
1352
+ * @param zx
1353
+ * @param zy
1354
+ * @returns
1355
+ */
1356
+ makeShear(xy: number, xz: number, yx: number, yz: number, zx: number, zy: number): this;
1357
+ compose(position: Vec3, quat: Quat, scale: Euler | Vec3): this;
1358
+ decompose(position: Vec3, quat: Quat, scale: Vec3): this;
1359
+ makePerspective(left: number, right: number, top: number, bottom: number, near: number, far: number): this;
1360
+ makeOrthographic(left: number, right: number, top: number, bottom: number, near: number, far: number): this;
1361
+ equals(matrix: {
1362
+ elements: any;
1363
+ }): boolean;
1364
+ fromArray(array: number[], offset?: number): this;
1365
+ toArray(array?: number[], offset?: number): number[];
1366
+ }
1367
+ declare function m4(): Mat4;
1368
+
1369
+ declare class Euler {
1370
+ _x: number;
1371
+ _y: number;
1372
+ _z: number;
1373
+ _order: string;
1374
+ isEuler: boolean;
1375
+ constructor(_x?: number, _y?: number, _z?: number, _order?: string);
1376
+ get x(): number;
1377
+ set x(value: number);
1378
+ get y(): number;
1379
+ set y(value: number);
1380
+ get z(): number;
1381
+ set z(value: number);
1382
+ get order(): string;
1383
+ set order(value: string);
1384
+ set(x: number, y: number, z: number, order: string): this;
1385
+ clone(): Euler;
1386
+ copy(Euler: {
1387
+ _x: number;
1388
+ _y: number;
1389
+ _z: number;
1390
+ _order: string;
1391
+ }): this;
1392
+ setFromRotationMat(m: Mat4, order: string, update: boolean | undefined): this | undefined;
1393
+ setFromQuat(q: Quat, order?: any, update?: boolean): this | undefined;
1394
+ setFromVec3(v: {
1395
+ x: any;
1396
+ y: any;
1397
+ z: any;
1398
+ }, order: any): this;
1399
+ reorder(newOrder: any): this | undefined;
1400
+ equals(Euler: {
1401
+ _x: number;
1402
+ _y: number;
1403
+ _z: number;
1404
+ _order: string;
1405
+ }): boolean;
1406
+ fromArray(array: any[]): this;
1407
+ toArray(array?: any[], offset?: number): any[];
1408
+ toVec3(optionalResult: {
1409
+ set: (arg0: number, arg1: number, arg2: number) => any;
1410
+ }): any;
1411
+ }
1412
+ declare function euler(x?: number, y?: number, z?: number): Euler;
1413
+
1414
+ declare const delta4 = 0.0001;
1415
+ declare const delta5 = 0.00001;
1416
+ declare const delta6 = 0.000001;
1417
+ declare const delta7 = 1e-7;
1418
+ declare const delta8 = 1e-8;
1419
+ declare const delta9 = 1e-9;
1420
+ /**
1421
+ * pi
1422
+ *
1423
+ * @type {Number}
1424
+ * @constant
1425
+ */
1426
+ declare const PI: number;
1427
+ /**
1428
+ * 1/pi
1429
+ *
1430
+ * @type {Number}
1431
+ * @constant
1432
+ */
1433
+ declare const ONE_OVER_PI: number;
1434
+ /**
1435
+ * pi/2
1436
+ *
1437
+ * @type {Number}
1438
+ * @constant
1439
+ */
1440
+ declare const PI_OVER_TWO: number;
1441
+ /**
1442
+ * pi/3
1443
+ *
1444
+ * @type {Number}
1445
+ * @constant
1446
+ */
1447
+ declare const PI_OVER_THREE: number;
1448
+ /**
1449
+ * pi/4
1450
+ *
1451
+ * @type {Number}
1452
+ * @constant
1453
+ */
1454
+ declare const PI_OVER_FOUR: number;
1455
+ /**
1456
+ * pi/6
1457
+ *
1458
+ * @type {Number}
1459
+ * @constant
1460
+ */
1461
+ declare const PI_OVER_SIX: number;
1462
+ /**
1463
+ * 3pi/2
1464
+ *
1465
+ * @type {Number}
1466
+ * @constant
1467
+ */
1468
+ declare const THREE_PI_OVER_TWO: number;
1469
+ /**
1470
+ * 2pi
1471
+ *
1472
+ * @type {Number}
1473
+ * @constant
1474
+ */
1475
+ declare const PI_TWO: number;
1476
+ /**
1477
+ * 1/2pi
1478
+ *
1479
+ * @type {Number}
1480
+ * @constant
1481
+ */
1482
+ declare const ONE_OVER_TWO_PI: number;
1483
+ /**
1484
+ * The number of radians in a degree.
1485
+ *
1486
+ * @type {Number}
1487
+ * @constant
1488
+ */
1489
+ declare const RADIANS_PER_DEGREE: number;
1490
+ /**
1491
+ * The number of degrees in a radian.
1492
+ *
1493
+ * @type {Number}
1494
+ * @constant
1495
+ */
1496
+ declare const DEGREES_PER_RADIAN: number;
1497
+ /**
1498
+ * The number of radians in an arc second.
1499
+ *
1500
+ * @type {Number}
1501
+ * @constant
1502
+ */
1503
+ declare const RADIANS_PER_ARCSECOND: number;
1504
+ declare function sign(value: number): 1 | -1;
1505
+ declare function approximateEqual(v1: number, v2: number, precision?: number): boolean;
1506
+ declare function clamp(value: number, min: number, max: number): number;
1507
+ declare function lerp(x: number, y: number, t: number): number;
1508
+ declare function smoothstep(x: number, min: number, max: number): number;
1509
+ declare function smootherstep(x: number, min: number, max: number): number;
1510
+ declare function randInt(low: number, high: number): number;
1511
+ /**
1512
+ * 生成一个low~high之间的浮点数
1513
+ * @param {*} low
1514
+ * @param {*} high
1515
+ */
1516
+ declare function randFloat(low: number, high: number): number;
1517
+ declare function isPowerOfTwo(value: number): boolean;
1518
+ declare function ceilPowerOfTwo(value: number): number;
1519
+ declare function floorPowerOfTwo(value: number): number;
1520
+ declare function toRadians(degrees: number): number;
1521
+ declare function ToDegrees(radians: number): number;
1522
+ /**
1523
+ * 数字或者向量固定位数
1524
+ * @param {Object} obj 数字或者向量
1525
+ * @param {*} fractionDigits
1526
+ */
1527
+ declare function toFixed(obj: {
1528
+ toFixed: (arg0: any) => string;
1529
+ x: number | undefined;
1530
+ y: number | undefined;
1531
+ z: number | undefined;
1532
+ }, fractionDigits: number | undefined): number | {
1533
+ toFixed: (arg0: any) => string;
1534
+ x: number | undefined;
1535
+ y: number | undefined;
1536
+ z: number | undefined;
1537
+ };
1538
+ /**
1539
+ * 数组中所有数字或者向量固定位数
1540
+ * @param {Array} array
1541
+ * @param {Number} precision
1542
+ */
1543
+ declare function toFixedAry(array: Array<any>, precision?: number): void;
1544
+
1545
+ /**
1546
+ * 遍历多级数组中所有对象
1547
+ * @param {Array} array
1548
+ * @param {Function} method
1549
+ */
1550
+ declare function forall(array: Array<any>, method: (arg0: any, index?: number, that?: Array<any>) => void): void;
1551
+ declare function flat(array: any[]): any[];
1552
+ /**
1553
+ * 分类
1554
+ * example:
1555
+ * var arry = [1,2,3,4,5,6]
1556
+ * var result = classify(array,(a)={return a%2===0})
1557
+ *
1558
+ * @param {Array} array
1559
+ * @param {Function} classifyMethod 分类方法
1560
+ */
1561
+ declare function classify(array: Array<any>, classifyMethod: (arg0: any, arg1: any, arg2: any[]) => any): any;
1562
+ /**
1563
+ * 去掉重复元素
1564
+ * @param {Array} array
1565
+ * @param {Function} uniqueMethod 去重复
1566
+ * @param {Function} sortMethod 排序 存在就先排序再去重复
1567
+ */
1568
+ declare function unique(array: any[], uniqueMethod: (arg0: any, arg1: any) => boolean, sortMethod?: (a: any, b: any) => number): any[];
1569
+
1570
+ declare class Color {
1571
+ _r: number;
1572
+ _g: number;
1573
+ _b: number;
1574
+ _a: number;
1575
+ constructor(r?: number, g?: number, b?: number, a?: number);
1576
+ get isColor(): boolean;
1577
+ get r(): number;
1578
+ set r(value: number);
1579
+ get g(): number;
1580
+ set g(value: number);
1581
+ get b(): number;
1582
+ set b(value: number);
1583
+ get a(): number;
1584
+ set a(value: number);
1585
+ set(value: any): this;
1586
+ setHex(hex: number): this;
1587
+ setHexCssString(style: string): this | undefined;
1588
+ setRGB(r: number, g: number, b: number, a?: number): this;
1589
+ clone(): any;
1590
+ copy(color: this): this;
1591
+ equals(c: this): boolean;
1592
+ toArray(array?: number[], offset?: number): number[];
1593
+ fromArray(array?: number[], offset?: number): number[];
1594
+ private byteToFloat;
1595
+ private floatToByte;
1596
+ getHexCssString(): string;
1597
+ toJSON(): string;
1598
+ static get White(): Readonly<Color>;
1599
+ static get Red(): Color;
1600
+ static get Green(): Color;
1601
+ static get Blue(): Color;
1602
+ }
1603
+
1604
+ /**
1605
+ * 当向量以数组的方式出现,一个计算单元库
1606
+ * @Description : 向量数组
1607
+ * @Author : 赵耀圣
1608
+ * @QQ : 549184003
1609
+ * @Date : 2021-08-02 15:09:33
1610
+ * @LastEditTime : 2021-08-02 15:50:16
1611
+ * @FilePath : \cga.js\src\math\VecArray.ts
1612
+ */
1613
+
1614
+ /**
1615
+ * 矢量几何操作,数字数组/矢量数组,常用工具集合
1616
+ */
1617
+ declare class vecs {
1618
+ /**
1619
+ * 去除相邻的重复向量
1620
+ * @param vs 矢量集合
1621
+ * @param delta 误差
1622
+ * @returns
1623
+ */
1624
+ static uniqueNeighborVecs(vs: Array<Vec3>, delta?: number): Vec3[];
1625
+ /**
1626
+ * 找到最大值
1627
+ * @param array
1628
+ * @returns
1629
+ */
1630
+ static max(array: ArrayLike<number>): number;
1631
+ /**
1632
+ * 找到最小值
1633
+ * @param array
1634
+ * @returns
1635
+ */
1636
+ static min(array: ArrayLike<number>): number;
1637
+ /**
1638
+ * 去除相邻没有重复点
1639
+ */
1640
+ static uniqueNeighbor(vs: number[], component?: number, delta?: number): number[];
1641
+ /**
1642
+ * 去除任意重复点
1643
+ * @param vs 向量数组
1644
+ * @param component 向量组件数量
1645
+ * @returns 无重复向量数组
1646
+ */
1647
+ static unique(vs: number[], component?: number): number[];
1648
+ /**
1649
+ * 翻转向量数组
1650
+ * @param vecs 向量数组
1651
+ * @param component 组件数量
1652
+ * @returns
1653
+ */
1654
+ static reverse(vecs: number[], component?: number): number[];
1655
+ /**
1656
+ * 点积
1657
+ * @param vecs
1658
+ * @returns
1659
+ */
1660
+ static dot(...vecs: number[]): number;
1661
+ /**
1662
+ * 长度平方
1663
+ * @param vecs
1664
+ * @returns
1665
+ */
1666
+ static distanceSq(...vecs: number[]): number;
1667
+ /**
1668
+ * 长度
1669
+ * @param vecs
1670
+ * @returns
1671
+ */
1672
+ static distance(...vecs: number[]): number;
1673
+ /**
1674
+ * 相加
1675
+ * @param vecs
1676
+ * @returns
1677
+ */
1678
+ static add(...vecs: number[]): number[] | (number & any[]);
1679
+ /**
1680
+ * 相减
1681
+ * @param vecs
1682
+ * @returns
1683
+ */
1684
+ static sub(...vecs: number[]): number[];
1685
+ /**
1686
+ * 相乘
1687
+ * @param vecs
1688
+ * @returns
1689
+ */
1690
+ static mul(...vecs: number[]): number[] | (number & any[]);
1691
+ /**
1692
+ * 获取矢量数组的i个矢量
1693
+ * @param vecs
1694
+ * @param i
1695
+ * @param component
1696
+ * @returns
1697
+ */
1698
+ static getVecAt(vecs: number[], i: number, component?: number): number[];
1699
+ /**
1700
+ * 在第 i 个位置插入一个向量
1701
+ * @param vecs
1702
+ * @param i
1703
+ * @param vec
1704
+ */
1705
+ static insertAt(vecs: number[], i: number, ...vec: number[]): void;
1706
+ /**
1707
+ * 是否逆时针
1708
+ * counterclockwise
1709
+ */
1710
+ static isCCW<T>(shape: Array<T> | ArrayList<T>, component?: number): boolean;
1711
+ /**
1712
+ * 将向量深度拆解为数字
1713
+ * @param {Array} Array<Vec4 | Vec3 | Vec2 | any> | any
1714
+ * @param {String} comSort 'x','y','z','w' 按顺序选取后自由组合
1715
+ * @returns {Array<Number>} 数字数组
1716
+ */
1717
+ static verctorToNumbers(vectors: Array<Vec4 | Vec3 | Vec2 | any> | any, comSort?: string): number[];
1718
+ static vec(component?: number): Vec3 | Vec2 | Vec4;
1719
+ /**
1720
+ * 数字数组 转 适量数组
1721
+ * @param vss 数字数组
1722
+ * @param component 矢量维度,默认为3
1723
+ * @returns
1724
+ */
1725
+ static numbersToVecs(vss: TypedArrayLike, component?: number): Vec2[] | Vec3[] | Vec4[];
1726
+ static applyQuat(vss: TypedArrayLike, quat: Quat, component?: number): void;
1727
+ static applyMat4(vss: TypedArrayLike, mat: Mat4, component?: number): void;
1728
+ static translate(vss: TypedArrayLike, distance: number[], component?: number): void;
1729
+ static rotate(vss: TypedArrayLike, axis: Vec3, angle: number): void;
1730
+ static scale(vss: TypedArrayLike, _scale: number[], component?: number): void;
1731
+ }
1732
+
1733
+ /**
1734
+ * 数组深度复制
1735
+ * @param {Array} array
1736
+ */
1737
+ declare function clone(array: any | any[]): any;
1738
+ /**
1739
+ * 点排序函数 xyz 有序排序回调
1740
+ * @param {Vector*} a
1741
+ * @param {Vector*} b
1742
+ */
1743
+ declare function vectorCompare(a: any | Vec3, b: any | Vec3): number;
1744
+ /**
1745
+ * 计算包围盒
1746
+ * @param {*} points 点集
1747
+ * @returns {Array[min,max]} 返回最小最大值
1748
+ */
1749
+ declare function boundingBox(points: Vec3[]): Vec3[];
1750
+ /**
1751
+ *
1752
+ * @param {*} points
1753
+ * @param {*} quat
1754
+ * @param {Boolean} ref 是否是引用
1755
+ */
1756
+ declare function applyQuat(points: any | Vec3[], quat: Quat, ref?: boolean): Vec3 | any;
1757
+ /**
1758
+ * 平移
1759
+ * @param {*} points
1760
+ * @param {*} distance
1761
+ * @param {*} ref
1762
+ */
1763
+ declare function translate(points: any | Vec3[], distance: Vec3, ref?: boolean): Vec3[] | any;
1764
+ /**
1765
+ * 旋转
1766
+ * @param {*} points
1767
+ * @param {*} axis
1768
+ * @param {*} angle
1769
+ * @param {*} ref
1770
+ */
1771
+ declare function rotate(points: any | Vec3[], axis: Vec3, angle: number, ref?: boolean): any;
1772
+ /**
1773
+ * 两个向量之间存在的旋转量来旋转点集
1774
+ * @param {*} points
1775
+ * @param {*} axis
1776
+ * @param {*} angle
1777
+ * @param {*} ref
1778
+ */
1779
+ declare function rotateByUnitVectors(points: any | Vec3[], vFrom: Vec3, vTo: Vec3, ref?: boolean): any;
1780
+ /**
1781
+ * 缩放
1782
+ * @param {*} points
1783
+ * @param {*} axis
1784
+ * @param {*} angle
1785
+ * @param {*} ref
1786
+ */
1787
+ declare function scale(points: any | Vec3[], _scale: Vec3, ref?: boolean): Vec3[] | any;
1788
+ /**
1789
+ * 响应矩阵
1790
+ * @param {*} points
1791
+ * @param {*} axis
1792
+ * @param {*} angle
1793
+ * @param {*} ref
1794
+ */
1795
+ declare function applyMatrix4(points: any | Vec3[], matrix: Mat4, ref?: boolean): Vec3[] | any;
1796
+ /**
1797
+ * 简化点集数组,折线,路径
1798
+ * @param {*} points 点集数组,折线,路径 ,继承Array
1799
+ * @param {*} maxDistance 简化最大距离
1800
+ * @param {*} maxAngle 简化最大角度
1801
+ */
1802
+ declare function simplifyPointList(points: any | Vec3[], maxDistance?: number, maxAngle?: number): any;
1803
+ /**
1804
+ * 以某个平面生成对称镜像
1805
+ * @param {*} points 点集
1806
+ * @param {*} plane 对称镜像平面
1807
+ */
1808
+ declare function reverseOnPlane(points: Vec3[], plane: Plane$1, ref?: boolean): Vec3[];
1809
+ /**
1810
+ * 投影到平面
1811
+ * @param {*} points 点集
1812
+ * @param {*} plane 投影平面
1813
+ * @param {*} projectDirect 默认是法线的方向
1814
+ */
1815
+ declare function projectOnPlane(points: Vec3[], plane: Plane$1, direction?: Vec3, ref?: boolean): Vec3[];
1816
+ /**
1817
+ * 计算共面点集所在的平面
1818
+ * @param {Array<Vec3|Point>} points
1819
+ */
1820
+ declare function recognitionPlane(points: Vec3[]): Plane$1;
1821
+ /**
1822
+ * 判断所有点是否在同一个平面
1823
+ * @param {Array<Vec3|Point>} points
1824
+ * @param {*} precision
1825
+ * @returns {Boolean|Plane} 如果在同一个平面返回所在平面,否则返回false
1826
+ */
1827
+ declare function isInOnePlane(points: Vec3[], precision?: number): Plane$1 | false;
1828
+ /**
1829
+ * 判断多边是否共线:
1830
+ * 考虑情况点之间的距离应该大于最小容忍值
1831
+ * @param {...Vec3[]} ps
1832
+ */
1833
+ declare function pointsCollinear(...points: Vec3[]): boolean;
1834
+ /**
1835
+ * 三点计算圆
1836
+ * @param p0
1837
+ * @param p1
1838
+ * @param p2
1839
+ */
1840
+ declare function calcCircleFromThreePoint(p0: Vec3, p1: Vec3, p2: Vec3): Circle;
1841
+ declare function angle(v0: Vec3, v1: Vec3, normal?: Vec3): number;
1842
+
1843
+ declare class Delaunator {
1844
+ coords: Float64Array;
1845
+ _triangles: Uint32Array;
1846
+ _halfedges: Int32Array;
1847
+ _hashSize: number;
1848
+ _hullPrev: Uint32Array;
1849
+ _hullNext: Uint32Array;
1850
+ _hullTri: Uint32Array;
1851
+ _hullHash: Int32Array;
1852
+ _ids: Uint32Array;
1853
+ _dists: Float64Array;
1854
+ hull: Uint32Array;
1855
+ triangles: Uint32Array;
1856
+ halfedges: any;
1857
+ _cx: any;
1858
+ _cy: any;
1859
+ _hullStart: number;
1860
+ trianglesLen: number;
1861
+ static from(points: number[]): Delaunator;
1862
+ static fromVecs(points: Vec2[] | Vec3[]): Delaunator;
1863
+ constructor(coords: Float64Array);
1864
+ update(): void;
1865
+ _hashKey(x: number, y: number): number;
1866
+ _legalize(a: number): number;
1867
+ _link(a: number, b: number): void;
1868
+ _addTriangle(i0: number, i1: number, i2: number, a: number, b: number, c: number): number;
1869
+ }
1870
+
1871
+ declare class Voronoi {
1872
+ delaunay: any;
1873
+ _circumcenters: Float64Array;
1874
+ vectors: Float64Array;
1875
+ xmax: number;
1876
+ xmin: number;
1877
+ ymax: number;
1878
+ ymin: number;
1879
+ circumcenters: any;
1880
+ constructor(delaunay: Delaunay, [xmin, ymin, xmax, ymax]?: [number, number, number, number]);
1881
+ update(): this;
1882
+ _init(): void;
1883
+ cellPolygons(): Generator<any, void, unknown>;
1884
+ cellPolygon(i: number): number[][] | null;
1885
+ _renderSegment(x0: any, y0: any, x1: any, y1: any, context: {
1886
+ moveTo: (arg0: any, arg1: any) => void;
1887
+ lineTo: (arg0: any, arg1: any) => void;
1888
+ }): void;
1889
+ contains(i: any, x: number | any, y: number | any): boolean;
1890
+ neighbors(i: any): Generator<any, void, unknown>;
1891
+ _cell(i: string | number): any[] | null;
1892
+ _clip(i: number): any;
1893
+ _clipFinite(i: any, points: string | any[]): any;
1894
+ _clipSegment(x0: number, y0: number, x1: number, y1: number, c0: number, c1: number): number[] | null;
1895
+ _clipInfinite(i: any, points: any, vx0: number, vy0: number, vxn: number, vyn: number): unknown[];
1896
+ _edge(i: any, e0: number, e1: number, P: any[], j: number): number;
1897
+ _project(x0: any, y0: any, vx: number, vy: number): any[] | null;
1898
+ _edgecode(x: unknown, y: unknown): number;
1899
+ _regioncode(x: number, y: number): number;
1900
+ }
1901
+
1902
+ declare class Delaunay {
1903
+ _delaunator: Delaunator;
1904
+ inedges: Int32Array;
1905
+ _hullIndex: Int32Array;
1906
+ points: Float64Array;
1907
+ collinear?: Int32Array;
1908
+ halfedges: any;
1909
+ hull: Uint32Array;
1910
+ triangles: Uint32Array;
1911
+ static from(points: number[]): Delaunay;
1912
+ constructor(points: Float64Array);
1913
+ update(): this;
1914
+ _init(): void;
1915
+ voronoi(bounds: [number, number, number, number] | undefined): Voronoi;
1916
+ neighbors(i: number): Generator<number, void, unknown>;
1917
+ find(x: number, y: number, i?: number): number;
1918
+ _step(i: number, x: number, y: number): number;
1919
+ }
1920
+
1921
+ interface IDistanceResut {
1922
+ isNode: boolean;
1923
+ point: Vec3;
1924
+ direction: Vec3;
1925
+ }
1926
+ /** Polyline with mileage and frame caches. Call init after editing coordinates through array. */
1927
+ declare class Path<T extends Vec3 = Vec3> extends ArrayList<T> {
1928
+ _closed: boolean;
1929
+ _calcNoraml: boolean;
1930
+ constructor(vs?: T[] | ArrayList<T>, closed?: boolean, calcNormal?: boolean);
1931
+ init(calcNormal?: boolean): this;
1932
+ set closed(value: boolean);
1933
+ get closed(): boolean;
1934
+ get tlen(): any;
1935
+ applyMat4(matrix: Mat4): this;
1936
+ scale(x: number, y: number, z: number): this;
1937
+ getPointByDistance(distance: number, left?: number, right?: number): IDistanceResut | null;
1938
+ getPointByDistancePure(distance: number, left?: number, right?: number): Vec3 | null;
1939
+ splitByFromToDistance(from?: number, to?: number): Path<Vec3> | null;
1940
+ splitAverage(count: number): Path<T>;
1941
+ splitAverageLength(length: number, integer?: boolean): Path<T>;
1942
+ add(...points: T[]): this;
1943
+ push(...points: T[]): void;
1944
+ pop(): T | undefined;
1945
+ unshift(...points: T[]): number;
1946
+ insertAt(index: number, ...points: T[]): void;
1947
+ splice(start: number, deleteCount: number, ...points: T[]): void;
1948
+ reverse(): this;
1949
+ clone(): Path<T>;
1950
+ static totalMileages(points: ArrayLike<Vec3>): number;
1951
+ static getPerMileages(points: ArrayLike<Vec3>, normalize?: boolean, totalMileage?: number): number[];
1952
+ }
1953
+
1954
+ type AxisPlane = 'xy' | 'xz' | 'yz' | 'xyz';
1955
+ interface ITriangulationOption {
1956
+ feature?: AxisPlane;
1957
+ dim?: number;
1958
+ normal?: Vec3;
1959
+ }
1960
+ /**
1961
+ * 三角剖分 earcut.js
1962
+ * @param {Array} boundary 边界
1963
+ * @param {Array<Array>} holes 洞的数组
1964
+ * @param {options:{feature,dim,normal}} feature 选择平平面
1965
+ * @returns {Array<Number>} 三角形索引数组
1966
+ */
1967
+ declare function triangulation(boundary: Vec3[], holes?: Vec3[][], options?: ITriangulationOption): number[];
1968
+
1969
+ type Position = IVec3 | IVec2;
1970
+ interface ILinkSideOption {
1971
+ side0: Position[] | number[];
1972
+ side1: Position[] | number[];
1973
+ holes0?: Vec3[][];
1974
+ holes1?: Vec3[][];
1975
+ shapeClosed?: boolean;
1976
+ autoUV?: boolean;
1977
+ uvScalars?: number[];
1978
+ segs?: number[];
1979
+ }
1980
+ declare function linkSide(options: ILinkSideOption): Array<number | Vec3>;
1981
+ interface ILinkSideOptions {
1982
+ shapes: Position[][];
1983
+ orgShape?: Position[];
1984
+ orgHoles?: Position[][];
1985
+ sealStart?: boolean;
1986
+ sealEnd?: boolean;
1987
+ shapeClosed?: boolean;
1988
+ pathClosed?: boolean;
1989
+ index?: {
1990
+ index: number;
1991
+ };
1992
+ autoIndex?: boolean;
1993
+ generateUV?: boolean;
1994
+ axisPlane?: AxisPlane;
1995
+ holes?: Position[][][];
1996
+ enableSmooth?: boolean;
1997
+ smoothAngle?: number;
1998
+ }
1999
+ /** Stitch profiles and holes, adding oriented caps and complete vertex attributes. */
2000
+ declare function linkSides(options: ILinkSideOptions): IGeometry;
2001
+ interface IExtrudeOptions {
2002
+ fixedY?: boolean;
2003
+ shapeClosed?: boolean;
2004
+ isClosed2?: boolean;
2005
+ textureEnable?: boolean;
2006
+ textureScale?: Vec2;
2007
+ smoothAngle?: number;
2008
+ sealStart?: boolean;
2009
+ sealEnd?: boolean;
2010
+ normal?: Vec3;
2011
+ }
2012
+ interface IExtrudeOptionsEx {
2013
+ shape: Array<Vec3 | IVec3 | Vec2 | IVec2>;
2014
+ path: Array<Vec3 | IVec3>;
2015
+ holes?: Array<Vec3 | IVec3 | Vec2 | IVec2>[];
2016
+ ups?: Array<Vec3 | IVec3>;
2017
+ up?: Vec3 | IVec3;
2018
+ right?: Vec3;
2019
+ shapeClosed?: boolean;
2020
+ pathClosed?: boolean;
2021
+ textureEnable?: boolean;
2022
+ smoothAngle?: number;
2023
+ enableSmooth?: boolean;
2024
+ sealStart?: boolean;
2025
+ sealEnd?: boolean;
2026
+ normal?: Vec3;
2027
+ autoIndex?: boolean;
2028
+ axisPlane?: AxisPlane;
2029
+ generateUV?: boolean;
2030
+ index?: {
2031
+ index: number;
2032
+ };
2033
+ }
2034
+ interface IExtrudeOptionsNext extends Omit<IExtrudeOptionsEx, 'up' | 'right'> {
2035
+ up?: Array<Vec3 | IVec3> | Vec3 | IVec3;
2036
+ right?: Vec3[] | Vec3;
2037
+ shapeCenter?: Vec3;
2038
+ jtType?: JoinType;
2039
+ etType?: EndType;
2040
+ bevelSize?: number;
2041
+ roundSegments?: number;
2042
+ miterLimit?: number;
2043
+ }
2044
+ declare function extrude(options: IExtrudeOptionsEx): IGeometry;
2045
+ declare function extrudeNext(options: IExtrudeOptionsNext): IGeometry;
2046
+ /** @deprecated Use extrude with explicit options. */
2047
+ declare function extrude_obsolete<T extends Vec3>(shape: ArrayList<T>, path: Vec3[] | Path<Vec3>, options?: IExtrudeOptions): IGeometry;
2048
+
2049
+ /** Monotone-chain convex hull of coplanar points, without a repeated end point. */
2050
+ declare function convexHull(points: Vec3[], normal?: Vec3): Vec3[];
2051
+ /** Compatibility wrapper for the class historically shown in the README. */
2052
+ declare class ConvexHull {
2053
+ hull: Vec3[];
2054
+ constructor(points: Vec3[], options?: {
2055
+ planeNormal?: Vec3;
2056
+ });
2057
+ }
2058
+ /** 3D closest pair, divide-and-conquer with a packed YZ strip grid: O(n log n). */
2059
+ declare function closestPair(points: Vec3[]): DistanceResult;
2060
+ interface ConvexHull3DResult {
2061
+ dimension: 0 | 1 | 2 | 3;
2062
+ vertices: Vec3[];
2063
+ faces: number[][];
2064
+ }
2065
+ /** Incremental outward oriented 3D hull. Degenerate inputs report their affine dimension. */
2066
+ declare function convexHull3D(points: readonly Vec3[], tolerance?: number): ConvexHull3DResult;
2067
+
2068
+ /** Uniform entry point; also resolves symmetric queries defined on one operand. */
2069
+ declare function distance(a: GeometryQuery<any>, b: GeometryQuery<any>, options?: CurvedQueryOptions): DistanceResult;
2070
+ declare function intersects(a: GeometryQuery<any>, b: GeometryQuery<any>, tolerance?: number): boolean;
2071
+
2072
+ /**
2073
+ * 计算体积
2074
+ * @param faces 一个几何体的所有三角面
2075
+ */
2076
+ declare function calculateVolume(faces: Vec3[][]): number;
2077
+
2078
+ declare class Distance {
2079
+ static Point2Point_Number(x0: number, y0: number, z0: number, x1: number, y1: number, z1: number): number;
2080
+ static Point2Line_Number(x: number, y: number, z: number, ox: number, oy: number, oz: number, dx: number, dy: number, dz: number): number;
2081
+ /**
2082
+ *
2083
+ * @param point
2084
+ * @param origin
2085
+ * @param dir 默认已经正交化
2086
+ */
2087
+ static Point2Line_Vec3(point: Vec3, origin: Vec3, dir: Vec3, result?: Vec3): Vec3;
2088
+ }
2089
+
2090
+ /**
2091
+ * 网格工具
2092
+ */
2093
+ declare class MeshTool {
2094
+ static indexable(obj: any[] | any, refIndexInfo?: {
2095
+ index: number;
2096
+ }, force?: boolean): void;
2097
+ static triangListToBuffer(vertices: Vec3[], triangleList: Vec3[]): BufferGeometry;
2098
+ /**
2099
+ * 顶点纹理坐标所以转化为buffer数据
2100
+ * @param {Array<Verctor3|Number>} vertices
2101
+ * @param {Array<Number>} indices
2102
+ * @param {Array<Verctor2|Number>} uvs
2103
+ */
2104
+ static toGeoBuffer(vertices: BufferAttribute | Array<number | Vec2 | Vec3 | Vec4> | TypedArray, indices: number[] | Uint32Array | Uint16Array, uvs?: BufferAttribute | TypedArray | Array<Vec2 | number>): BufferGeometry;
2105
+ /**
2106
+ * 三角剖分后转成几何体
2107
+ * 只考虑XY平面
2108
+ * @param {*} boundary
2109
+ * @param {*} hole
2110
+ * @param {*} options
2111
+ */
2112
+ static trianglutionToGeometryBuffer(boundary: any, holes?: any[], options?: any): BufferGeometry;
2113
+ }
2114
+
2115
+ /**
2116
+ * 视锥体
2117
+ */
2118
+ declare class Frustum {
2119
+ planes: Plane$1[];
2120
+ constructor();
2121
+ get front(): Plane$1;
2122
+ get back(): Plane$1;
2123
+ get top(): Plane$1;
2124
+ get bottom(): Plane$1;
2125
+ get left(): Plane$1;
2126
+ get right(): Plane$1;
2127
+ /**
2128
+ * 从投影矩阵计算视锥体
2129
+ * @param m
2130
+ * @returns
2131
+ */
2132
+ setFromProjectionMatrix(m: Mat4): this;
2133
+ static fromProjectionMatrix(m: Mat4): Frustum;
2134
+ setFromPerspective(position: Vec3, target: Vec3, up: Vec3, fov: number, aspect: number, near: number, far: number): void;
2135
+ intersectsObject(geometry: BufferGeometry, mat: Mat4): boolean;
2136
+ intersectsSphere(sphere: Sphere): boolean;
2137
+ intersectsSphereComponents(cx: number, cy: number, cz: number, radius: number): boolean;
2138
+ containsPoint(point: Vec3): boolean;
2139
+ intersectSegment(segment: Segment | Vec3[]): Vec3 | Vec3[] | null;
2140
+ simpleIntersectVS(vs: Vec3[]): Vec3[];
2141
+ copy(frustum: Frustum): this;
2142
+ clone(): any;
2143
+ }
2144
+
2145
+ declare class Point extends Vec3 implements GeometryQuery<Point> {
2146
+ constructor(_x?: number, _y?: number, _z?: number);
2147
+ clone(): Point;
2148
+ }
2149
+
2150
+ declare function toGeometryBuffer(geo: IGeometry): BufferGeometry;
2151
+ /**
2152
+ * shape 挤压后转几何体
2153
+ * @param {*} shape
2154
+ * @param {*} arg_path
2155
+ * @param {*} options
2156
+ */
2157
+ declare function extrudeToGeometryBuffer(shape: ArrayList<Vec3>, arg_path: Array<Vec3>, options: IExtrudeOptions): BufferGeometry;
2158
+ /**
2159
+ * 两个轮廓缝合
2160
+ * @param {*} shape
2161
+ * @param {*} arg_path
2162
+ * @param {*} options
2163
+ * @param {*} material
2164
+ */
2165
+ declare function linkToGeometry(shape: Array<Vec3>, shape1: Array<Vec3>, axisPlane?: AxisPlane, shapeClose?: boolean): BufferGeometry;
2166
+ /**
2167
+ * 多个轮廓缝合
2168
+ * @param shapes
2169
+ * @param isClose
2170
+ * @param material
2171
+ */
2172
+ declare function linksToGeometry(shapes: Array<Vec3>[], pathClosed?: boolean, shapeClosed?: boolean): BufferGeometry;
2173
+
2174
+ declare class Tree<T = any> {
2175
+ /**
2176
+ * N个子节点
2177
+ */
2178
+ N: number;
2179
+ /**
2180
+ * 最大深度
2181
+ */
2182
+ maxDepth: number;
2183
+ /**
2184
+ * 子节点
2185
+ */
2186
+ children: Array<Tree<T> | undefined>;
2187
+ /**
2188
+ * 容器,用来放满足该层级条件的数据
2189
+ */
2190
+ protected readonly items: T[];
2191
+ get objects(): readonly T[];
2192
+ constructor(N?: number);
2193
+ add(obj: T): this;
2194
+ remove(obj: T): boolean;
2195
+ find(condition: T | ((obj: T) => boolean)): T[];
2196
+ }
2197
+
2198
+ /**
2199
+ *
2200
+ */
2201
+ declare class BSP$1<T = any> extends Tree<T> {
2202
+ plane?: Plane$1;
2203
+ constructor();
2204
+ /** Classify whole objects; straddling objects stay at the dividing node. */
2205
+ partition(plane: Plane$1, classify: (value: T, plane: Plane$1) => number): this;
2206
+ static fromPoints(points: readonly Vec3[], leafSize?: number): BSP$1<Vec3>;
2207
+ /** Visit the containing leaf plus every ancestor's straddling objects. */
2208
+ queryPoint(point: Vec3): T[];
2209
+ get pos(): Tree<T> | undefined;
2210
+ get neg(): Tree<T> | undefined;
2211
+ add(obj: any): this;
2212
+ remove(obj: any): boolean;
2213
+ find(condition: any): any[];
2214
+ }
2215
+
2216
+ /** Balanced binary search tree, rebuilt after edits. Equal keys retain duplicates. */
2217
+ declare class BTree<T = number> extends Tree<T> {
2218
+ private readonly compare;
2219
+ private root?;
2220
+ private dirty;
2221
+ constructor(compare?: (a: T, b: T) => number);
2222
+ add(value: T): this;
2223
+ remove(value: T): boolean;
2224
+ find(condition: T | ((value: T) => boolean)): T[];
2225
+ }
2226
+
2227
+ /** Lazily rebuilt balanced 3D k-d tree. Coordinates are copied on insertion. */
2228
+ declare class KdTree extends Tree<Vec3> {
2229
+ private root?;
2230
+ private dirty;
2231
+ constructor(points?: readonly Vec3[]);
2232
+ get size(): number;
2233
+ get objects(): readonly Vec3[];
2234
+ add(point: Vec3): this;
2235
+ remove(point: Vec3): boolean;
2236
+ find(condition: Vec3 | ((point: Vec3) => boolean)): Vec3[];
2237
+ private rebuild;
2238
+ nearest(point: Vec3, count?: number): Vec3[];
2239
+ range(min: Vec3, max: Vec3): Vec3[];
2240
+ }
2241
+
2242
+ interface PolyNode {
2243
+ contour: Vec3[];
2244
+ parent?: PolyNode;
2245
+ children: PolyNode[];
2246
+ depth: number;
2247
+ isHole: boolean;
2248
+ }
2249
+ declare class PolyTree extends Tree {
2250
+ contours: PolyNode[];
2251
+ buildContours(rings: readonly (readonly Vec3[])[], tolerance?: number): this;
2252
+ containsPoint(point: Vec3, tolerance?: number): boolean;
2253
+ constructor();
2254
+ add(obj: any): this;
2255
+ remove(obj: any): boolean;
2256
+ find(condition: any): any[];
2257
+ }
2258
+
2259
+ /** Balanced-by-subdivision XY quadtree, with lazy rebuilds after edits. */
2260
+ declare class QuadTree extends Tree<Vec3> {
2261
+ private readonly capacity;
2262
+ private root?;
2263
+ private dirty;
2264
+ constructor(points?: readonly Vec3[], capacity?: number);
2265
+ get size(): number;
2266
+ get objects(): readonly Vec3[];
2267
+ add(point: Vec3): this;
2268
+ remove(point: Vec3): boolean;
2269
+ find(condition: Vec3 | ((point: Vec3) => boolean)): Vec3[];
2270
+ private rebuild;
2271
+ range(min: Vec3, max: Vec3): Vec3[];
2272
+ nearest(point: Vec3, count?: number): Vec3[];
2273
+ }
2274
+
2275
+ declare function clipPolygons(subject: Vec3[][], clip: Vec3[][], operation?: 'intersection' | 'union' | 'difference' | 'xor', normal?: Vec3, scale?: number): Vec3[][];
2276
+ declare function offsetPaths(rings: Vec3[][], delta: number, normal?: Vec3, join?: number, end?: number, miterLimit?: number, scale?: number): Vec3[][];
2277
+ declare function cleanPolygon(points: Vec3[], tolerance?: number, normal?: Vec3): Vec3[];
2278
+ declare function simplifyPolygon(points: Vec3[], normal?: Vec3): Vec3[][];
2279
+
2280
+ /** Restore owned geometry from plain data. Never trusts a serialized prototype. */
2281
+ declare function geometryFromJSON(data: GeometryData): GeometryQuery<any>;
2282
+
2283
+ interface IHVec2 {
2284
+ x: Decimal;
2285
+ y: Decimal;
2286
+ }
2287
+ interface IHVec3 extends IHVec2 {
2288
+ z: Decimal;
2289
+ }
2290
+ interface IHVec4 extends IHVec3 {
2291
+ w: Decimal;
2292
+ }
2293
+ /** Mutable decimal vector. Pass strings to preserve more precision than a JS number. */
2294
+ declare class HVec3 implements IHVec3 {
2295
+ x: Decimal;
2296
+ y: Decimal;
2297
+ z: Decimal;
2298
+ constructor(x?: Decimal.Value, y?: Decimal.Value, z?: Decimal.Value);
2299
+ static isVec3(v: unknown): v is IHVec3;
2300
+ get isVec3(): boolean;
2301
+ static get Up(): HVec3;
2302
+ static get Down(): HVec3;
2303
+ static get UnitX(): HVec3;
2304
+ static get UnitY(): HVec3;
2305
+ static get UnitZ(): HVec3;
2306
+ set(x: Decimal.Value, y: Decimal.Value, z: Decimal.Value): this;
2307
+ setScalar(s: Decimal.Value): this;
2308
+ setComponent(index: number, value: Decimal.Value): this;
2309
+ getComponent(index: number): Decimal;
2310
+ copy(v: IHVec3): this;
2311
+ clone(): HVec3;
2312
+ add(v: IHVec3, w?: IHVec3): this;
2313
+ addVecs(a: IHVec3, b: IHVec3): this;
2314
+ sub(v: IHVec3, w?: IHVec3): this;
2315
+ subVecs(a: IHVec3, b: IHVec3): this;
2316
+ multiplyScalar(s: Decimal.Value): this;
2317
+ divideScalar(s: Decimal.Value): this;
2318
+ cross(v: IHVec3, w?: IHVec3): this;
2319
+ crossVecs(a: IHVec3, b: IHVec3): this;
2320
+ dot(v: IHVec3): Decimal;
2321
+ lengthSq(): Decimal;
2322
+ length(): Decimal;
2323
+ normalize(): this;
2324
+ lerp(v: IHVec3, alpha: Decimal.Value): this;
2325
+ distanceTo(v: IHVec3): Decimal;
2326
+ equals(v: IHVec3): boolean;
2327
+ toArray(): Decimal[];
2328
+ toJSON(): string[];
2329
+ }
2330
+
2331
+ declare class Vec {
2332
+ _data: Decimal[];
2333
+ constructor(...values: Decimal.Value[]);
2334
+ get dim(): number;
2335
+ check(v: Vec): boolean;
2336
+ private requireDimension;
2337
+ copy(v: Vec): this;
2338
+ clone(): Vec;
2339
+ add(v: Vec): this;
2340
+ sub(v: Vec): this;
2341
+ multiplyScalar(s: Decimal.Value): this;
2342
+ cross(v: Vec): this;
2343
+ get extentSq(): Decimal;
2344
+ get extent(): Decimal;
2345
+ normalize(): this;
2346
+ dot(v: Vec): Decimal;
2347
+ toJSON(): string[];
2348
+ }
2349
+
2350
+ /** n·p + w = 0; normals are normalized on construction. */
2351
+ declare class Plane {
2352
+ normal: Vec;
2353
+ w: Decimal;
2354
+ constructor(point: Vec, normal: Vec);
2355
+ signedDistanceTo(point: Vec): Decimal;
2356
+ projectPoint(point: Vec): Vec;
2357
+ clone(): Plane;
2358
+ flip(): this;
2359
+ }
2360
+
2361
+ type index_d$3_HVec3 = HVec3;
2362
+ declare const index_d$3_HVec3: typeof HVec3;
2363
+ type index_d$3_Plane = Plane;
2364
+ declare const index_d$3_Plane: typeof Plane;
2365
+ type index_d$3_Vec = Vec;
2366
+ declare const index_d$3_Vec: typeof Vec;
2367
+ declare namespace index_d$3 {
2368
+ export {
2369
+ index_d$3_HVec3 as HVec3,
2370
+ index_d$3_Plane as Plane,
2371
+ index_d$3_Vec as Vec,
2372
+ };
2373
+ }
2374
+
2375
+ declare enum Side {
2376
+ COPLANAR = 0,
2377
+ FRONT = 1,
2378
+ BACK = 2,
2379
+ SPANNING = 3
2380
+ }
2381
+ declare class Polygon {
2382
+ w: Decimal;
2383
+ normal: HVec3;
2384
+ vertices: HVec3[];
2385
+ readonly epsilon: Decimal;
2386
+ constructor(vertices?: readonly HVec3[], epsilon?: Decimal.Value);
2387
+ calcPlane(): this;
2388
+ flip(): this;
2389
+ classifyVertex(v: HVec3): Side.COPLANAR | Side.FRONT | Side.BACK;
2390
+ classifySide(p: Polygon): Side;
2391
+ splitPolygon(p: Polygon, coplanarFront?: Polygon[], coplanarBack?: Polygon[], front?: Polygon[], back?: Polygon[]): void;
2392
+ clone(): Polygon;
2393
+ }
2394
+
2395
+ declare class Node {
2396
+ front?: Node;
2397
+ back?: Node;
2398
+ divider?: Polygon;
2399
+ polygons: Polygon[];
2400
+ constructor(polygons?: readonly Polygon[]);
2401
+ clone(): Node;
2402
+ invert(): this;
2403
+ clipPolygons(polygons: readonly Polygon[]): Polygon[];
2404
+ clipTo(node: Node): this;
2405
+ allPolygons(): Polygon[];
2406
+ build(polygons: readonly Polygon[]): this;
2407
+ }
2408
+
2409
+ /** BSP solid booleans on closed, consistently outward oriented convex polygon faces. */
2410
+ declare class BSP {
2411
+ tree: Node;
2412
+ constructor(faces?: readonly Polygon[]);
2413
+ toPolygons(): Polygon[];
2414
+ clone(): BSP;
2415
+ inverse(): BSP;
2416
+ sub(other: BSP): BSP;
2417
+ subtract(other: BSP): BSP;
2418
+ union(other: BSP): BSP;
2419
+ intersect(other: BSP): BSP;
2420
+ }
2421
+
2422
+ type index_d$2_BSP = BSP;
2423
+ declare const index_d$2_BSP: typeof BSP;
2424
+ type index_d$2_Node = Node;
2425
+ declare const index_d$2_Node: typeof Node;
2426
+ type index_d$2_Polygon = Polygon;
2427
+ declare const index_d$2_Polygon: typeof Polygon;
2428
+ type index_d$2_Side = Side;
2429
+ declare const index_d$2_Side: typeof Side;
2430
+ declare namespace index_d$2 {
2431
+ export {
2432
+ index_d$2_BSP as BSP,
2433
+ BSP as CSG,
2434
+ Polygon as CSGPolygon,
2435
+ index_d$2_Node as Node,
2436
+ index_d$2_Polygon as Polygon,
2437
+ index_d$2_Side as Side,
2438
+ };
2439
+ }
2440
+
2441
+ declare class Joint {
2442
+ position: Vec3;
2443
+ rotation: Quat;
2444
+ constructor(position?: Vec3);
2445
+ }
2446
+
2447
+ declare enum ISpace {
2448
+ Globe = 0,
2449
+ Local = 1
2450
+ }
2451
+ declare abstract class TypedConstraint {
2452
+ space: ISpace;
2453
+ matrix: Mat4;
2454
+ abstract readonly kind: 'hinge' | 'slider';
2455
+ abstract axis: Vec3;
2456
+ worldAxis(bone: Bone): Vec3;
2457
+ }
2458
+
2459
+ declare class Bone {
2460
+ constraints: TypedConstraint[];
2461
+ matrix: Mat4;
2462
+ rotation: Quat;
2463
+ start: Joint;
2464
+ end: Joint;
2465
+ readonly restDirection: Vec3;
2466
+ constructor(start?: Joint | Vec3, end?: Joint | Vec3);
2467
+ /** @deprecated Typo retained for source compatibility. */
2468
+ get contraints(): TypedConstraint[];
2469
+ set contraints(value: TypedConstraint[]);
2470
+ get length(): number;
2471
+ updateMatrix(): this;
2472
+ }
2473
+
2474
+ /** One connected chain; distinct branches use distinct Skeleton instances. */
2475
+ declare class Skeleton {
2476
+ bones: Bone[][];
2477
+ constructor(chain?: readonly Bone[]);
2478
+ static fromPoints(points: readonly Vec3[]): Skeleton;
2479
+ get chain(): Bone[];
2480
+ get rootBone(): Bone;
2481
+ get boneNum(): number;
2482
+ get effector(): Vec3 | undefined;
2483
+ }
2484
+
2485
+ interface SolveOptions {
2486
+ iterations?: number;
2487
+ tolerance?: number;
2488
+ }
2489
+ interface SolveResult {
2490
+ converged: boolean;
2491
+ iterations: number;
2492
+ distance: number;
2493
+ }
2494
+ interface ISolver {
2495
+ updateTarget(target: Vec3): this;
2496
+ solveIK(skeleton: Skeleton, target?: Vec3, options?: SolveOptions): SolveResult;
2497
+ }
2498
+
2499
+ declare class CCDSolver implements ISolver {
2500
+ target: Vec3;
2501
+ constructor(target?: Vec3);
2502
+ updateTarget(target: Vec3): this;
2503
+ projectPlane(v: Vec3, normal: Vec3): Vec3;
2504
+ calcAngle(a: Vec3, b: Vec3, axis: Vec3): number;
2505
+ solveTranslate(target: Vec3, zeroPos: Vec3, effector: Vec3): Vec3;
2506
+ solveRotation(target: Vec3, origin: Vec3, effector: Vec3, constraints?: TypedConstraint[], bone?: Bone): Quat;
2507
+ solveIK(skeleton: Skeleton, target?: Vec3, options?: SolveOptions): SolveResult;
2508
+ solve(bones: Skeleton | readonly Bone[], target?: Vec3, options?: SolveOptions): SolveResult;
2509
+ }
2510
+
2511
+ declare class HingeConstraint extends TypedConstraint {
2512
+ axis: Vec3;
2513
+ minAngle: number;
2514
+ maxAngle: number;
2515
+ readonly kind = "hinge";
2516
+ angle: number;
2517
+ constructor(axis?: Vec3, minAngle?: number, maxAngle?: number);
2518
+ clampDelta(delta: number): number;
2519
+ }
2520
+
2521
+ declare class SliderConstraint extends TypedConstraint {
2522
+ axis: Vec3;
2523
+ min: number;
2524
+ max: number;
2525
+ readonly kind = "slider";
2526
+ position: number;
2527
+ constructor(axis?: Vec3, min?: number, max?: number);
2528
+ clampDelta(delta: number): number;
2529
+ }
2530
+
2531
+ type index_d$1_Bone = Bone;
2532
+ declare const index_d$1_Bone: typeof Bone;
2533
+ type index_d$1_CCDSolver = CCDSolver;
2534
+ declare const index_d$1_CCDSolver: typeof CCDSolver;
2535
+ type index_d$1_HingeConstraint = HingeConstraint;
2536
+ declare const index_d$1_HingeConstraint: typeof HingeConstraint;
2537
+ type index_d$1_ISolver = ISolver;
2538
+ type index_d$1_ISpace = ISpace;
2539
+ declare const index_d$1_ISpace: typeof ISpace;
2540
+ type index_d$1_Joint = Joint;
2541
+ declare const index_d$1_Joint: typeof Joint;
2542
+ type index_d$1_Skeleton = Skeleton;
2543
+ declare const index_d$1_Skeleton: typeof Skeleton;
2544
+ type index_d$1_SliderConstraint = SliderConstraint;
2545
+ declare const index_d$1_SliderConstraint: typeof SliderConstraint;
2546
+ type index_d$1_SolveOptions = SolveOptions;
2547
+ type index_d$1_SolveResult = SolveResult;
2548
+ type index_d$1_TypedConstraint = TypedConstraint;
2549
+ declare const index_d$1_TypedConstraint: typeof TypedConstraint;
2550
+ declare namespace index_d$1 {
2551
+ export { index_d$1_Bone as Bone, index_d$1_CCDSolver as CCDSolver, index_d$1_HingeConstraint as HingeConstraint, HingeConstraint as HingeContraint, index_d$1_ISpace as ISpace, index_d$1_Joint as Joint, index_d$1_Skeleton as Skeleton, index_d$1_SliderConstraint as SliderConstraint, index_d$1_TypedConstraint as TypedConstraint };
2552
+ export type { index_d$1_ISolver as ISolver, index_d$1_SolveOptions as SolveOptions, index_d$1_SolveResult as SolveResult };
2553
+ }
2554
+
2555
+ /** Earth centered, Earth fixed frame: X at 0°E, Y at 90°E, Z north. */
2556
+ declare class Ellipsoid {
2557
+ readonly x: number;
2558
+ readonly y: number;
2559
+ readonly z: number;
2560
+ static readonly WGS84: Readonly<Ellipsoid>;
2561
+ static readonly UNIT_SPHERE: Readonly<Ellipsoid>;
2562
+ constructor(x: number, y: number, z: number);
2563
+ get radii(): Vec3;
2564
+ get radiiSquared(): Vec3;
2565
+ get maximumRadius(): number;
2566
+ get minimumRadius(): number;
2567
+ geodeticSurfaceNormal(p: Vec3, result?: Vec3): Vec3;
2568
+ cartographicToCartesian(c: Cartographic, result?: Vec3): Vec3;
2569
+ scaleToGeodeticSurface(p: Vec3, result?: Vec3): Vec3 | undefined;
2570
+ cartesianToCartographic(p: Vec3, result?: Cartographic): Cartographic | undefined;
2571
+ }
2572
+
2573
+ declare const wgs84Radii: Vec3;
2574
+ declare const wgs84RadiiSquared: Vec3;
2575
+ declare const wgs84OneOverRadii: Vec3;
2576
+ declare const wgs84OneOverRadiiSquared: Vec3;
2577
+
2578
+ /** Longitude / geodetic latitude in radians; height in meters for WGS84. */
2579
+ declare class Cartographic {
2580
+ longitude: number;
2581
+ latitude: number;
2582
+ height: number;
2583
+ constructor(longitude?: number, latitude?: number, height?: number);
2584
+ validate(): this;
2585
+ static fromRadians(longitude?: number, latitude?: number, height?: number, result?: Cartographic): Cartographic;
2586
+ static fromDegrees(longitude?: number, latitude?: number, height?: number, result?: Cartographic): Cartographic;
2587
+ static fromGVec3(vec: Vec3, ellipsoid?: Readonly<Ellipsoid>): Cartographic | undefined;
2588
+ clone(): Cartographic;
2589
+ }
2590
+
2591
+ /**
2592
+ * A two dimensional region specified as longitude and latitude coordinates.
2593
+ *
2594
+ * @alias Rectangle
2595
+ * @constructor
2596
+ *
2597
+ * @param {Number} [west=0.0] The westernmost longitude, in radians, in the range [-Pi, Pi].
2598
+ * @param {Number} [south=0.0] The southernmost latitude, in radians, in the range [-Pi/2, Pi/2].
2599
+ * @param {Number} [east=0.0] The easternmost longitude, in radians, in the range [-Pi, Pi].
2600
+ * @param {Number} [north=0.0] The northernmost latitude, in radians, in the range [-Pi/2, Pi/2].
2601
+ *
2602
+ * @see Packable
2603
+ */
2604
+ declare class Rectangle {
2605
+ west: number;
2606
+ south: number;
2607
+ east: number;
2608
+ north: number;
2609
+ validate(): this;
2610
+ clone(): Rectangle;
2611
+ contains(position: Cartographic): boolean;
2612
+ constructor(west?: number, south?: number, east?: number, north?: number);
2613
+ /**
2614
+ * 计算宽度 单位弧度
2615
+ */
2616
+ static computeWidth: (rectangle: Rectangle) => number;
2617
+ /**
2618
+ * 计算高度弧度
2619
+ */
2620
+ static computeHeight: (rectangle: Rectangle) => number;
2621
+ static fromDegrees(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle;
2622
+ static fromRadians(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle;
2623
+ get width(): number;
2624
+ get height(): number;
2625
+ /**
2626
+ * Computes the northeast corner of a rectangle.
2627
+ *
2628
+ * @param {Rectangle} rectangle The rectangle for which to find the corner
2629
+ * @param {Cartographic} [result] The object onto which to store the result.
2630
+ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.
2631
+ */
2632
+ northeast(result?: Cartographic): Cartographic;
2633
+ /**
2634
+ * Computes the southeast corner of a rectangle.
2635
+ */
2636
+ southeast(result?: Cartographic): Cartographic;
2637
+ }
2638
+
2639
+ /** Karney geodesics via GeographicLib; antipodal inputs are supported. */
2640
+ declare class EllipsoidGeodesic {
2641
+ ellipsoid: Ellipsoid;
2642
+ start: Cartographic;
2643
+ end: Cartographic;
2644
+ surfaceDistance: number;
2645
+ startHeading: number;
2646
+ endHeading: number;
2647
+ private geodesic;
2648
+ constructor(ellipsoid?: Ellipsoid, start?: Cartographic, end?: Cartographic);
2649
+ private createGeodesic;
2650
+ setEndPoints(start: Cartographic, end: Cartographic): this;
2651
+ computeProperties(ellipsoid?: Ellipsoid): this;
2652
+ interpolateUsingSurfaceDistance(distance: number, result?: Cartographic): Cartographic;
2653
+ interpolateUsingFraction(fraction: number, result?: Cartographic): Cartographic;
2654
+ }
2655
+
2656
+ declare class GVec3 extends Vec3 {
2657
+ static fromDegrees(longitude: number, latitude: number, height?: number, ellipsoid?: Vec3 | Ellipsoid): GVec3;
2658
+ static fromRadians(longitude: number, latitude: number, height?: number, ellipsoid?: Vec3 | Ellipsoid): GVec3;
2659
+ static toCartographic(point: Vec3, ellipsoid?: Readonly<Ellipsoid>): Cartographic | undefined;
2660
+ toCartographic(ellipsoid?: Readonly<Ellipsoid>): Cartographic | undefined;
2661
+ }
2662
+
2663
+ interface IGeographicTilingScheme {
2664
+ ellipsoid?: Ellipsoid;
2665
+ rectangle?: Rectangle;
2666
+ numberOfLevelZeroTilesX?: number;
2667
+ numberOfLevelZeroTilesY?: number;
2668
+ }
2669
+ declare class GeographicTilingScheme {
2670
+ static readonly MAX_VALUE: Readonly<Rectangle>;
2671
+ readonly ellipsoid: Ellipsoid;
2672
+ readonly rectangle: Rectangle;
2673
+ private nx;
2674
+ private ny;
2675
+ constructor(options?: IGeographicTilingScheme);
2676
+ private count;
2677
+ getNumberOfXTilesAtLevel(level: number): number;
2678
+ getNumberOfYTilesAtLevel(level: number): number;
2679
+ tileXYToRectangle(x: number, y: number, level: number, result?: Rectangle): Rectangle;
2680
+ positionToTileXY(position: Cartographic, level: number): {
2681
+ x: number;
2682
+ y: number;
2683
+ } | undefined;
2684
+ }
2685
+
2686
+ interface TaskMessage<Result = unknown> {
2687
+ id: number;
2688
+ result?: Result;
2689
+ error?: {
2690
+ name?: string;
2691
+ message?: string;
2692
+ stack?: string;
2693
+ } | string;
2694
+ }
2695
+ interface TaskWorker {
2696
+ postMessage(message: unknown, transfer: Transferable[]): void;
2697
+ addEventListener(type: 'message' | 'error', listener: (event: any) => void): void;
2698
+ removeEventListener(type: 'message' | 'error', listener: (event: any) => void): void;
2699
+ terminate(): unknown;
2700
+ }
2701
+ type TaskExecutor<Input, Output> = (input: Input) => Output | Promise<Output>;
2702
+ declare class TaskProcessor<Input = unknown, Output = unknown> {
2703
+ private executor;
2704
+ private maximumActiveTasks;
2705
+ private workerFactory;
2706
+ private nextID;
2707
+ private worker?;
2708
+ private destroyed;
2709
+ private pending;
2710
+ constructor(executor: string | URL | TaskExecutor<Input, Output> | TaskWorker, maximumActiveTasks?: number, workerFactory?: (url: string | URL) => TaskWorker);
2711
+ get activeTasks(): number;
2712
+ private complete;
2713
+ private fail;
2714
+ private detachWorker;
2715
+ scheduleTask(parameters: Input, transferableObjects?: Transferable[]): Promise<Output> | undefined;
2716
+ isDestroyed(): boolean;
2717
+ destroy(): void;
2718
+ }
2719
+
2720
+ interface HeightmapOptions {
2721
+ buffer: ArrayLike<number>;
2722
+ width: number;
2723
+ height: number;
2724
+ heightScale?: number;
2725
+ heightOffset?: number;
2726
+ }
2727
+ /** Samples run west to east, rows north to south. Heights are meters on WGS84. */
2728
+ declare class HeightmapTerrainData {
2729
+ readonly buffer: Float64Array;
2730
+ readonly width: number;
2731
+ readonly height: number;
2732
+ constructor(options: HeightmapOptions);
2733
+ interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number | undefined;
2734
+ createMesh(rectangle: Rectangle, ellipsoid?: Ellipsoid): IGeometry;
2735
+ }
2736
+
2737
+ interface TileRequest {
2738
+ signal?: AbortSignal;
2739
+ }
2740
+ declare abstract class TerrainProvider {
2741
+ abstract readonly tilingScheme: GeographicTilingScheme;
2742
+ abstract readonly ready: boolean;
2743
+ abstract requestTileGeometry(x: number, y: number, level: number, request?: TileRequest): Promise<HeightmapTerrainData>;
2744
+ getTileDataAvailable(x: number, y: number, level: number): boolean;
2745
+ }
2746
+
2747
+ interface IEllipsoidTerrainProviderOprion {
2748
+ ellipsoid?: Ellipsoid;
2749
+ }
2750
+ declare class EllipsoidTerrainProvider extends TerrainProvider {
2751
+ readonly ready = true;
2752
+ readonly tilingScheme: GeographicTilingScheme;
2753
+ constructor(options?: IEllipsoidTerrainProviderOprion);
2754
+ requestTileGeometry(x: number, y: number, level: number, request?: TileRequest): Promise<HeightmapTerrainData>;
2755
+ }
2756
+
2757
+ interface IDcTerrainProviderParamters {
2758
+ url: string;
2759
+ ellipsoid?: Ellipsoid;
2760
+ fetch?: typeof fetch;
2761
+ minimumLevel?: number;
2762
+ maximumLevel?: number;
2763
+ }
2764
+ /** URL template returning JSON { width, height, buffer: number[], heightScale?, heightOffset? }. */
2765
+ declare class DcTerrainProvider extends TerrainProvider {
2766
+ private options;
2767
+ readonly ready = true;
2768
+ readonly tilingScheme: GeographicTilingScheme;
2769
+ private fetcher;
2770
+ constructor(options: IDcTerrainProviderParamters);
2771
+ getTileDataAvailable(x: number, y: number, level: number): boolean;
2772
+ requestTileGeometry(x: number, y: number, level: number, request?: TileRequest): Promise<HeightmapTerrainData>;
2773
+ }
2774
+
2775
+ type ImageResource = ImageBitmap | HTMLImageElement | Blob;
2776
+ interface ImageLoaderOptions {
2777
+ fetch?: typeof fetch;
2778
+ decodeImage?: (blob: Blob, url: string) => ImageResource | Promise<ImageResource>;
2779
+ }
2780
+ declare abstract class ImageryProvider {
2781
+ abstract readonly ready: boolean;
2782
+ abstract readonly tilingScheme: GeographicTilingScheme;
2783
+ abstract requestImage(x: number, y: number, level: number, request?: TileRequest): Promise<ImageResource>;
2784
+ static loadImage(options: ImageLoaderOptions, url: string, request?: TileRequest): Promise<ImageResource>;
2785
+ }
2786
+
2787
+ interface UrlTemplateOptions extends ImageLoaderOptions {
2788
+ url: string;
2789
+ tilingScheme?: GeographicTilingScheme;
2790
+ tileWidth?: number;
2791
+ tileHeight?: number;
2792
+ minimumLevel?: number;
2793
+ maximumLevel?: number;
2794
+ subdomains?: readonly string[];
2795
+ }
2796
+ declare class UrlTemplateImageryProvider extends ImageryProvider {
2797
+ readonly options: UrlTemplateOptions;
2798
+ readonly ready = true;
2799
+ readonly tilingScheme: GeographicTilingScheme;
2800
+ readonly tileWidth: number;
2801
+ readonly tileHeight: number;
2802
+ constructor(options: UrlTemplateOptions);
2803
+ get rectangle(): Rectangle;
2804
+ buildImageUrl(x: number, y: number, level: number): string;
2805
+ requestImage(x: number, y: number, level: number, request?: TileRequest): Promise<ImageResource>;
2806
+ }
2807
+
2808
+ declare class DcImageryProvider extends ImageryProvider {
2809
+ private provider;
2810
+ constructor(options: UrlTemplateOptions | ImageryProvider);
2811
+ get ready(): boolean;
2812
+ get tilingScheme(): GeographicTilingScheme;
2813
+ requestImage(x: number, y: number, level: number, request?: TileRequest): Promise<ImageResource>;
2814
+ }
2815
+
2816
+ type EventListener<T = unknown> = (data: T) => void;
2817
+ declare class EventHandler<Events extends object = Record<string, unknown>> {
2818
+ private listeners;
2819
+ on<K extends keyof Events>(type: K, listener: EventListener<Events[K]>): () => this;
2820
+ off<K extends keyof Events>(type: K, listener: EventListener<Events[K]>): this;
2821
+ once<K extends keyof Events>(type: K, listener: EventListener<Events[K]>): () => this;
2822
+ fire<K extends keyof Events>(type: K, data: Events[K]): this;
2823
+ removeAllListeners(): void;
2824
+ }
2825
+
2826
+ declare class ImageryLayer {
2827
+ imageryProvider: ImageryProvider;
2828
+ show: boolean;
2829
+ alpha: number;
2830
+ layerIndex: number;
2831
+ constructor(imageryProvider: ImageryProvider);
2832
+ destroy(): void;
2833
+ }
2834
+ interface LayerEvent {
2835
+ layer: ImageryLayer;
2836
+ index: number;
2837
+ previousIndex?: number;
2838
+ }
2839
+ interface LayerEvents {
2840
+ layerAdded: LayerEvent;
2841
+ layerRemoved: LayerEvent;
2842
+ layerMoved: LayerEvent;
2843
+ layerShownOrHidden: LayerEvent;
2844
+ }
2845
+ declare class ImageryLayerCollection extends EventHandler<LayerEvents> {
2846
+ static readonly EventType: {
2847
+ readonly layerAdded: "layerAdded";
2848
+ readonly layerRemoved: "layerRemoved";
2849
+ readonly layerMoved: "layerMoved";
2850
+ readonly layerShownOrHidden: "layerShownOrHidden";
2851
+ };
2852
+ private layers;
2853
+ revision: number;
2854
+ get length(): number;
2855
+ get(index: number): ImageryLayer;
2856
+ [Symbol.iterator](): ArrayIterator<ImageryLayer>;
2857
+ add(layer: ImageryLayer, index?: number): ImageryLayer;
2858
+ addImageryProvider(provider: ImageryProvider, index?: number): ImageryLayer;
2859
+ remove(layer: ImageryLayer, destroy?: boolean): boolean;
2860
+ removeAll(destroy?: boolean): void;
2861
+ contains(layer: ImageryLayer): boolean;
2862
+ indexOf(layer: ImageryLayer): number;
2863
+ move(layer: ImageryLayer, index: number): void;
2864
+ raise(layer: ImageryLayer): void;
2865
+ lower(layer: ImageryLayer): void;
2866
+ show(layer: ImageryLayer, value: boolean): void;
2867
+ _update(): void;
2868
+ }
2869
+
2870
+ /**
2871
+ * Defines a member that can have a value or be undefined.
2872
+ */
2873
+ type Undefinable<T> = undefined | T;
2874
+
2875
+ declare enum QuadtreeTileLoadState {
2876
+ /**
2877
+ * The tile is new and loading has not yet begun.
2878
+ */
2879
+ START = 0,
2880
+ /**
2881
+ * Loading is in progress.
2882
+ */
2883
+ LOADING = 1,
2884
+ /**
2885
+ * Loading is complete.
2886
+ */
2887
+ DONE = 2,
2888
+ /**
2889
+ * The tile has failed to load.
2890
+ */
2891
+ FAILED = 3
2892
+ }
2893
+ interface IQuadtreeTileOptions {
2894
+ tilingScheme: GeographicTilingScheme;
2895
+ x: number;
2896
+ y: number;
2897
+ level: number;
2898
+ parent?: QuadtreeTile;
2899
+ }
2900
+ declare class QuadtreeTile {
2901
+ get x(): number;
2902
+ get y(): number;
2903
+ get level(): number;
2904
+ get parent(): Undefinable<QuadtreeTile>;
2905
+ get rectangle(): Rectangle;
2906
+ get tilingScheme(): GeographicTilingScheme;
2907
+ get key(): string;
2908
+ private _tilingScheme;
2909
+ private _x;
2910
+ private _y;
2911
+ private _level;
2912
+ private _parent;
2913
+ private _rectangle;
2914
+ private _southwestChild;
2915
+ private _southeastChild;
2916
+ private _northwestChild;
2917
+ private _northeastChild;
2918
+ replacementPrevious: any;
2919
+ replacementNext: any;
2920
+ state: QuadtreeTileLoadState;
2921
+ constructor(options: IQuadtreeTileOptions);
2922
+ get northwestChild(): QuadtreeTile;
2923
+ get southwestChild(): QuadtreeTile;
2924
+ get southeastChild(): QuadtreeTile;
2925
+ get northeastChild(): QuadtreeTile;
2926
+ get children(): QuadtreeTile[];
2927
+ static createLevelZeroTiles(tilingScheme: GeographicTilingScheme): QuadtreeTile[];
2928
+ }
2929
+
2930
+ interface SurfaceShader {
2931
+ vertex: string;
2932
+ fragment: string;
2933
+ }
2934
+ /** GLSL ES 1.00 source; the host renderer owns compilation and GPU resources. */
2935
+ declare class GlobeSurfaceShaderSet {
2936
+ baseVertexShaderSource: string;
2937
+ baseFragmentShaderSource: string;
2938
+ private cache;
2939
+ getShader(textureCount?: number): SurfaceShader;
2940
+ clear(): void;
2941
+ destroy(): void;
2942
+ }
2943
+
2944
+ interface SurfaceTile {
2945
+ tile: QuadtreeTile;
2946
+ terrain: HeightmapTerrainData;
2947
+ mesh: IGeometry;
2948
+ imagery: Array<{
2949
+ layer: ImageryLayer;
2950
+ image: ImageResource;
2951
+ }>;
2952
+ }
2953
+ interface IGlobeSurfaceTileProviderOption {
2954
+ terrainProvider: TerrainProvider;
2955
+ imageryLayers: ImageryLayerCollection;
2956
+ surfaceShaderSet?: GlobeSurfaceShaderSet;
2957
+ }
2958
+ declare class GlobeSurfaceTileProvider {
2959
+ quadtree?: QuadtreePrimitive;
2960
+ readonly imageryLayers: ImageryLayerCollection;
2961
+ readonly surfaceShaderSet: GlobeSurfaceShaderSet;
2962
+ private terrain;
2963
+ private cache;
2964
+ private pending;
2965
+ private controller;
2966
+ private revision;
2967
+ private generation;
2968
+ private destroyed;
2969
+ constructor(options: IGlobeSurfaceTileProviderOption);
2970
+ get terrainProvider(): TerrainProvider;
2971
+ set terrainProvider(provider: TerrainProvider);
2972
+ get tilingScheme(): GeographicTilingScheme;
2973
+ get ready(): boolean;
2974
+ get tilesLoaded(): boolean;
2975
+ get loadedTiles(): SurfaceTile[];
2976
+ private dispose;
2977
+ invalidate(): void;
2978
+ loadTile(tile: QuadtreeTile): Promise<SurfaceTile>;
2979
+ trimCache(limit: number, keep?: ReadonlySet<string>): void;
2980
+ destroy(): void;
2981
+ }
2982
+
2983
+ interface IQuadtreePrimitiveOption {
2984
+ tileProvider: GlobeSurfaceTileProvider;
2985
+ }
2986
+ interface TileFrameState {
2987
+ maximumConcurrentLoads?: number;
2988
+ maximumLevel?: number;
2989
+ maximumTiles?: number;
2990
+ isVisible?: (tile: QuadtreeTile) => boolean;
2991
+ shouldRefine?: (tile: QuadtreeTile) => boolean;
2992
+ renderTile?: (tile: SurfaceTile) => void;
2993
+ }
2994
+ declare class QuadtreePrimitive {
2995
+ private roots;
2996
+ private selected;
2997
+ tileCacheSize: number;
2998
+ private activeUpdates;
2999
+ get tilesLoaded(): boolean;
3000
+ readonly tileProvider: GlobeSurfaceTileProvider;
3001
+ constructor(options: IQuadtreePrimitiveOption);
3002
+ get tilesToRender(): QuadtreeTile[];
3003
+ reset(): void;
3004
+ selectTilesForRendering(frameState?: TileFrameState): QuadtreeTile[];
3005
+ update(frameState?: TileFrameState): Promise<SurfaceTile[]>;
3006
+ destroy(): void;
3007
+ }
3008
+
3009
+ declare class Globe extends EventHandler<{
3010
+ terrainProviderChanged: TerrainProvider;
3011
+ }> {
3012
+ readonly ellipsoid: Ellipsoid;
3013
+ readonly imageLayers: ImageryLayerCollection;
3014
+ readonly _surfaceShaderSet: GlobeSurfaceShaderSet;
3015
+ readonly _surface: QuadtreePrimitive;
3016
+ constructor(ellipsoid?: Ellipsoid);
3017
+ get imageryLayers(): ImageryLayerCollection;
3018
+ get terrainProvider(): TerrainProvider;
3019
+ set terrainProvider(value: TerrainProvider);
3020
+ get tileCacheSize(): number;
3021
+ set tileCacheSize(value: number);
3022
+ get tilesLoaded(): boolean;
3023
+ update(frameState?: TileFrameState): Promise<SurfaceTile[]>;
3024
+ getHeight(cartographic: Cartographic): number | undefined;
3025
+ /** Ray intersection with the reference ellipsoid (terrain sampling is getHeight). */
3026
+ pick(ray: Ray, _scene?: unknown, result?: Vec3): Vec3 | undefined;
3027
+ destroy(): void;
3028
+ }
3029
+
3030
+ type index_d_Cartographic = Cartographic;
3031
+ declare const index_d_Cartographic: typeof Cartographic;
3032
+ type index_d_DcImageryProvider = DcImageryProvider;
3033
+ declare const index_d_DcImageryProvider: typeof DcImageryProvider;
3034
+ type index_d_DcTerrainProvider = DcTerrainProvider;
3035
+ declare const index_d_DcTerrainProvider: typeof DcTerrainProvider;
3036
+ type index_d_Ellipsoid = Ellipsoid;
3037
+ declare const index_d_Ellipsoid: typeof Ellipsoid;
3038
+ type index_d_EllipsoidGeodesic = EllipsoidGeodesic;
3039
+ declare const index_d_EllipsoidGeodesic: typeof EllipsoidGeodesic;
3040
+ type index_d_EllipsoidTerrainProvider = EllipsoidTerrainProvider;
3041
+ declare const index_d_EllipsoidTerrainProvider: typeof EllipsoidTerrainProvider;
3042
+ type index_d_GVec3 = GVec3;
3043
+ declare const index_d_GVec3: typeof GVec3;
3044
+ type index_d_GeographicTilingScheme = GeographicTilingScheme;
3045
+ declare const index_d_GeographicTilingScheme: typeof GeographicTilingScheme;
3046
+ type index_d_Globe = Globe;
3047
+ declare const index_d_Globe: typeof Globe;
3048
+ type index_d_GlobeSurfaceShaderSet = GlobeSurfaceShaderSet;
3049
+ declare const index_d_GlobeSurfaceShaderSet: typeof GlobeSurfaceShaderSet;
3050
+ type index_d_GlobeSurfaceTileProvider = GlobeSurfaceTileProvider;
3051
+ declare const index_d_GlobeSurfaceTileProvider: typeof GlobeSurfaceTileProvider;
3052
+ type index_d_HeightmapOptions = HeightmapOptions;
3053
+ type index_d_HeightmapTerrainData = HeightmapTerrainData;
3054
+ declare const index_d_HeightmapTerrainData: typeof HeightmapTerrainData;
3055
+ type index_d_IDcTerrainProviderParamters = IDcTerrainProviderParamters;
3056
+ type index_d_IEllipsoidTerrainProviderOprion = IEllipsoidTerrainProviderOprion;
3057
+ type index_d_IGeographicTilingScheme = IGeographicTilingScheme;
3058
+ type index_d_IGlobeSurfaceTileProviderOption = IGlobeSurfaceTileProviderOption;
3059
+ type index_d_IQuadtreePrimitiveOption = IQuadtreePrimitiveOption;
3060
+ type index_d_IQuadtreeTileOptions = IQuadtreeTileOptions;
3061
+ type index_d_ImageLoaderOptions = ImageLoaderOptions;
3062
+ type index_d_ImageResource = ImageResource;
3063
+ type index_d_ImageryLayer = ImageryLayer;
3064
+ declare const index_d_ImageryLayer: typeof ImageryLayer;
3065
+ type index_d_ImageryLayerCollection = ImageryLayerCollection;
3066
+ declare const index_d_ImageryLayerCollection: typeof ImageryLayerCollection;
3067
+ type index_d_ImageryProvider = ImageryProvider;
3068
+ declare const index_d_ImageryProvider: typeof ImageryProvider;
3069
+ type index_d_LayerEvent = LayerEvent;
3070
+ type index_d_QuadtreePrimitive = QuadtreePrimitive;
3071
+ declare const index_d_QuadtreePrimitive: typeof QuadtreePrimitive;
3072
+ type index_d_QuadtreeTile = QuadtreeTile;
3073
+ declare const index_d_QuadtreeTile: typeof QuadtreeTile;
3074
+ type index_d_QuadtreeTileLoadState = QuadtreeTileLoadState;
3075
+ declare const index_d_QuadtreeTileLoadState: typeof QuadtreeTileLoadState;
3076
+ type index_d_Rectangle = Rectangle;
3077
+ declare const index_d_Rectangle: typeof Rectangle;
3078
+ type index_d_SurfaceShader = SurfaceShader;
3079
+ type index_d_SurfaceTile = SurfaceTile;
3080
+ type index_d_TaskExecutor<Input, Output> = TaskExecutor<Input, Output>;
3081
+ type index_d_TaskMessage<Result = unknown> = TaskMessage<Result>;
3082
+ type index_d_TaskProcessor<Input = unknown, Output = unknown> = TaskProcessor<Input, Output>;
3083
+ declare const index_d_TaskProcessor: typeof TaskProcessor;
3084
+ type index_d_TaskWorker = TaskWorker;
3085
+ type index_d_TerrainProvider = TerrainProvider;
3086
+ declare const index_d_TerrainProvider: typeof TerrainProvider;
3087
+ type index_d_TileFrameState = TileFrameState;
3088
+ type index_d_TileRequest = TileRequest;
3089
+ type index_d_UrlTemplateImageryProvider = UrlTemplateImageryProvider;
3090
+ declare const index_d_UrlTemplateImageryProvider: typeof UrlTemplateImageryProvider;
3091
+ type index_d_UrlTemplateOptions = UrlTemplateOptions;
3092
+ declare const index_d_wgs84OneOverRadii: typeof wgs84OneOverRadii;
3093
+ declare const index_d_wgs84OneOverRadiiSquared: typeof wgs84OneOverRadiiSquared;
3094
+ declare const index_d_wgs84Radii: typeof wgs84Radii;
3095
+ declare const index_d_wgs84RadiiSquared: typeof wgs84RadiiSquared;
3096
+ declare namespace index_d {
3097
+ export { index_d_Cartographic as Cartographic, index_d_DcImageryProvider as DcImageryProvider, index_d_DcTerrainProvider as DcTerrainProvider, index_d_Ellipsoid as Ellipsoid, index_d_EllipsoidGeodesic as EllipsoidGeodesic, index_d_EllipsoidTerrainProvider as EllipsoidTerrainProvider, index_d_GVec3 as GVec3, index_d_GeographicTilingScheme as GeographicTilingScheme, index_d_Globe as Globe, index_d_GlobeSurfaceShaderSet as GlobeSurfaceShaderSet, index_d_GlobeSurfaceTileProvider as GlobeSurfaceTileProvider, index_d_HeightmapTerrainData as HeightmapTerrainData, index_d_ImageryLayer as ImageryLayer, index_d_ImageryLayerCollection as ImageryLayerCollection, index_d_ImageryProvider as ImageryProvider, index_d_QuadtreePrimitive as QuadtreePrimitive, index_d_QuadtreeTile as QuadtreeTile, index_d_QuadtreeTileLoadState as QuadtreeTileLoadState, index_d_Rectangle as Rectangle, index_d_TaskProcessor as TaskProcessor, index_d_TerrainProvider as TerrainProvider, index_d_UrlTemplateImageryProvider as UrlTemplateImageryProvider, index_d_wgs84OneOverRadii as wgs84OneOverRadii, index_d_wgs84OneOverRadiiSquared as wgs84OneOverRadiiSquared, index_d_wgs84Radii as wgs84Radii, index_d_wgs84RadiiSquared as wgs84RadiiSquared };
3098
+ export type { index_d_HeightmapOptions as HeightmapOptions, index_d_IDcTerrainProviderParamters as IDcTerrainProviderParamters, index_d_IEllipsoidTerrainProviderOprion as IEllipsoidTerrainProviderOprion, index_d_IGeographicTilingScheme as IGeographicTilingScheme, index_d_IGlobeSurfaceTileProviderOption as IGlobeSurfaceTileProviderOption, index_d_IQuadtreePrimitiveOption as IQuadtreePrimitiveOption, index_d_IQuadtreeTileOptions as IQuadtreeTileOptions, index_d_ImageLoaderOptions as ImageLoaderOptions, index_d_ImageResource as ImageResource, index_d_LayerEvent as LayerEvent, index_d_SurfaceShader as SurfaceShader, index_d_SurfaceTile as SurfaceTile, index_d_TaskExecutor as TaskExecutor, index_d_TaskMessage as TaskMessage, index_d_TaskWorker as TaskWorker, index_d_TileFrameState as TileFrameState, index_d_TileRequest as TileRequest, index_d_UrlTemplateOptions as UrlTemplateOptions };
3099
+ }
3100
+
3101
+ interface CatmullRomOptions {
3102
+ closed?: boolean;
3103
+ alpha?: number;
3104
+ }
3105
+ declare class Curve {
3106
+ /** Barry-Goldman interpolation; alpha=0 uniform, .5 centripetal, 1 chordal. */
3107
+ static catmullRom(points: readonly Vec3[], t: number, options?: CatmullRomOptions): Vec3;
3108
+ /** @deprecated Historical spelling. */
3109
+ static cutmull(points: readonly Vec3[], t: number, options?: CatmullRomOptions): Vec3;
3110
+ static sample(points: readonly Vec3[], segments?: number, options?: CatmullRomOptions): Vec3[];
3111
+ }
3112
+
3113
+ declare function splitPlaneGeometry(plane: Plane$1, geometry: BufferGeometry, options?: MeshSplitOptions): {
3114
+ positive: BufferGeometry;
3115
+ negative: BufferGeometry;
3116
+ common: BufferGeometry;
3117
+ };
3118
+
3119
+ declare class Shape<T extends Vec3 = Vec3> extends Polygon$1<T> {
3120
+ readonly kind: GeometryKind;
3121
+ holes: T[][];
3122
+ constructor(points?: T[], holes?: T[][], normal?: Vec3);
3123
+ triangulate(): number[];
3124
+ toGeometry(): IGeometry;
3125
+ toBufferGeometry(): BufferGeometry;
3126
+ clone(): this;
3127
+ copy(source: Shape<T>): this;
3128
+ containPoint(point: Vec3, tolerance?: number): boolean;
3129
+ queryCompound(other: GeometryQuery<any>, options?: CurvedQueryOptions): DistanceResult;
3130
+ private queryTriangles;
3131
+ distancePoint(point: Vec3): DistanceResult;
3132
+ toJSON(): GeometryData;
3133
+ }
3134
+
3135
+ /** @deprecated Use ArrayList for new collections. Native array behavior is retained. */
3136
+ declare class ArrayObject<T = any> extends Array<T> {
3137
+ static get [Symbol.species](): ArrayConstructor;
3138
+ get(index: number): T | undefined;
3139
+ get first(): T;
3140
+ get last(): T | undefined;
3141
+ forall(callback: (value: T) => void): void;
3142
+ clone(): ArrayObject<T>;
3143
+ classify(predicate: (value: T, representative: T, group: T[]) => boolean): T[][];
3144
+ unique(equal: (a: T, b: T) => boolean, compare?: (a: T, b: T) => number): this;
3145
+ }
3146
+
3147
+ /** Object-oriented facade over the maintained sweep implementation. */
3148
+ declare class Extrude {
3149
+ options: IExtrudeOptionsEx;
3150
+ constructor(options: IExtrudeOptionsEx);
3151
+ toGeometry(): IGeometry;
3152
+ toBufferGeometry(): BufferGeometry;
3153
+ }
3154
+
3155
+ /** Compose unordered segments into oriented chains, preserving all input objects. */
3156
+ declare function compose(segments: readonly Segment[], tolerance?: number): Segment[][];
3157
+
3158
+ declare class DelaunaySlow {
3159
+ private vs?;
3160
+ constructor(vs?: Vec3[] | undefined);
3161
+ supertriangle(vertices: Vec3[]): Vec3[];
3162
+ triangulation(vs: Vec3[]): number[];
3163
+ /**
3164
+ * 外接圆
3165
+ * @param vertices 点击
3166
+ * @param i
3167
+ * @param j
3168
+ * @param k
3169
+ */
3170
+ circumcircle(vertices: Vec3[], i: number, j: number, k: number): Circle;
3171
+ dedup(edges: any[]): void;
3172
+ contains(tri: Vec3[], p: Vec3): number[] | null;
3173
+ }
3174
+
3175
+ export { ArrayObject, BSP$1 as BSP, BTree, Box, BufferAttribute, BufferGeometry, index_d$2 as CSG, Capsule, Circle, ClipType, Color, ConvexHull, Curve, DEGREES_PER_RADIAN, Delaunator, Delaunay, DelaunaySlow, Disk, Distance, EndType, Euler, EventHandler, Extrude, Float32BufferAttribute, Float64BufferAttribute, Frustum, index_d as GIS, HVec3, index_d$1 as IK, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntersectType, JoinType, KdTree, Line, Mat3, Mat4, MeshTool, ONE_OVER_PI, ONE_OVER_TWO_PI, Orientation, PI, PI_OVER_FOUR, PI_OVER_SIX, PI_OVER_THREE, PI_OVER_TWO, PI_TWO, Path, Plane$1 as Plane, Point, PolyTree, Polygon$1 as Polygon, Polyline, QuadTree, Quat, QuadTree as QuatTree, RADIANS_PER_ARCSECOND, RADIANS_PER_DEGREE, Ray, Rectangle$1 as Rectangle, index_d$3 as Robust, Segment, Shape, Sphere, THREE_PI_OVER_TWO, ToDegrees, Tree, Triangle, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Vec2, Vec3, Vec4, Voronoi, angle, applyMatrix4, applyQuat, approximateEqual, boundingBox, calcCircleFromThreePoint, calculateVolume, ceilPowerOfTwo, circle, circleDistance, clamp, classify, cleanPolygon, clipPolygons, clone, closestPair, compose, convexHull, convexHull3D, delta4, delta5, delta6, delta7, delta8, delta9, disk, diskDistance, distance, euler, extrude, extrudeNext, extrudeToGeometryBuffer, extrude_obsolete, flat, floorPowerOfTwo, forall, geometryFromJSON, intersects, isInOnePlane, isPowerOfTwo, lerp, line, linkSide, linkSides, linkToGeometry, linksToGeometry, m3, m4, offsetPaths, pointsCollinear, projectOnPlane, quat, randFloat, randInt, recognitionPlane, reverseOnPlane, rotate, rotateByUnitVectors, scale, segment, sign, simplifyPointList, simplifyPolygon, smootherstep, smoothstep, splitPlaneGeometry, toFixed, toFixedAry, toGeometryBuffer, toRadians, translate, triangulation, unique, v2, v3, v4, vecs, vectorCompare };
3176
+ export type { AxisPlane, CatmullRomOptions, ConvexHull3DResult, CurvedQueryOptions, DistanceParameter, DistanceResult, EventListener, GeometryData, GeometryKind, GeometryQuery, IBufferGeometry, IDistanceResut, IExtrudeOptions, IExtrudeOptionsEx, IExtrudeOptionsNext, IGeometry, IHVec2, IHVec3, IHVec4, ILinkSideOption, ILinkSideOptions, ITriangulationOption, IVec2, IVec3, IVec4, IntersectResult, MeshSplitOptions, PolyNode };