Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 229.57 KB | None | 0 0
  1. ! function(e) {
  2. var t = {};
  3.  
  4. function n(r) {
  5. if (t[r]) return t[r].exports;
  6. var i = t[r] = {
  7. i: r,
  8. l: !1,
  9. exports: {}
  10. };
  11. return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports
  12. }
  13. n.m = e, n.c = t, n.d = function(e, t, r) {
  14. n.o(e, t) || Object.defineProperty(e, t, {
  15. enumerable: !0,
  16. get: r
  17. })
  18. }, n.r = function(e) {
  19. "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
  20. value: "Module"
  21. }), Object.defineProperty(e, "__esModule", {
  22. value: !0
  23. })
  24. }, n.t = function(e, t) {
  25. if (1 & t && (e = n(e)), 8 & t) return e;
  26. if (4 & t && "object" == typeof e && e && e.__esModule) return e;
  27. var r = Object.create(null);
  28. if (n.r(r), Object.defineProperty(r, "default", {
  29. enumerable: !0,
  30. value: e
  31. }), 2 & t && "string" != typeof e)
  32. for (var i in e) n.d(r, i, function(t) {
  33. return e[t]
  34. }.bind(null, i));
  35. return r
  36. }, n.n = function(e) {
  37. var t = e && e.__esModule ? function() {
  38. return e.default
  39. } : function() {
  40. return e
  41. };
  42. return n.d(t, "a", t), t
  43. }, n.o = function(e, t) {
  44. return Object.prototype.hasOwnProperty.call(e, t)
  45. }, n.p = "", n(n.s = 114)
  46. }([function(e, t, n) {
  47. "use strict";
  48.  
  49. function r(e = {}, t = "") {
  50. const n = document.createElement(e.tag || "div");
  51. for (let t in e) o(n, t, e[t]);
  52. return e.canChange && function(e, t) {
  53. new Proxy(t, {
  54. set(t, n, r) {
  55. if ("tag" == n) return !1;
  56. t[n] = r, o(e, n, r)
  57. }
  58. })
  59. }(n, e), Array.isArray(t) || (t = [t]), t.forEach(e => {
  60. e && (e.tagName ? n.appendChild(e) : n.appendChild(document.createTextNode(e)))
  61. }), n
  62. }
  63.  
  64. function i(e, t) {
  65. new Proxy(t, {
  66. set: (n, r, i) => (e[r] = i, t[r] = i, !0)
  67. })
  68. }
  69.  
  70. function o(e, t, n) {
  71. if ("tag" != t)
  72. if ("onClick" === t) ! function(e, t) {
  73. const n = e.lastOnClick || null;
  74. n && e.removeEventListener("click", n), e.addEventListener("click", t), e.lastOnClick = t
  75. }(e, n);
  76. else if ("dataset" == t) {
  77. for (let t in n) e.dataset[t] = n[t];
  78. i(e.dataset, n)
  79. } else if ("styles" == t) {
  80. for (let t in n) e.style[t] = n[t];
  81. i(e.style, n)
  82. } else e.setAttribute(t, n)
  83. }
  84. n.d(t, "b", function() {
  85. return r
  86. }), n.d(t, "c", function() {
  87. return a
  88. }), n.d(t, "a", function() {
  89. return s
  90. });
  91.  
  92. function a(e, t, n) {
  93. const {
  94. classList: r
  95. } = e;
  96. n && !r.contains(t) ? r.add(t) : !n && r.contains(t) && r.remove(t)
  97. }
  98. class s {
  99. constructor(e = {}) {
  100. this.dom = e.dom || this.build(e)
  101. }
  102. build(e) {
  103. return r()
  104. }
  105. render() {
  106. return this.dom
  107. }
  108. setMode(e) {
  109. return this.dom.dataset.mode = e, this
  110. }
  111. setClass(e, t) {
  112. const {
  113. classList: n
  114. } = this.dom;
  115. return t && !n.contains(e) ? n.add(e) : !t && n.contains(e) && n.remove(e), this
  116. }
  117. onClick(e) {
  118. return this.dom.addEventListener("click", e), this
  119. }
  120. }
  121. }, function(e, t) {
  122. class n {
  123. constructor() {
  124. this.list = {}
  125. }
  126. on(e, t) {
  127. this.list[e] || (this.list[e] = []), this.list[e].push(t)
  128. }
  129. off(e, t) {
  130. this.list[e] || (this.list[e] = []), this.list[e] = this.list[e].filter(e => e != t)
  131. }
  132. call(e, ...t) {
  133. if (!this.list[e]) return this.log("not found event", e);
  134. this.list[e].forEach(e => e(...t))
  135. }
  136. clear(e) {
  137. if (!this.list[e]) return this.log("not found", e);
  138. this.list[e] = []
  139. }
  140. delete() {
  141. for (let e in this.list) delete this.list[e]
  142. }
  143. log() {}
  144. }
  145. const r = new n;
  146. e.exports = {
  147. Event: n,
  148. events: r,
  149. dispatchEvent: function(e) {
  150. const t = {};
  151. e.on = (e, n) => {
  152. t[e] || (t[e] = []), t.push(n)
  153. }, e.off = (e, n) => {
  154. t[e] || (t[e] = []), t[e] = t[e].filter(e => e != n)
  155. }, e.call = (e, ...n) => {
  156. t[e] || (t[e] = []), t[e].forEach(e => e(...n))
  157. }
  158. }
  159. }
  160. }, function(e, t, n) {
  161. "use strict";
  162.  
  163. function r() {}
  164. n.r(t), n.d(t, "ACESFilmicToneMapping", function() {
  165. return ue
  166. }), n.d(t, "AddEquation", function() {
  167. return O
  168. }), n.d(t, "AddOperation", function() {
  169. return ie
  170. }), n.d(t, "AdditiveBlending", function() {
  171. return A
  172. }), n.d(t, "AlphaFormat", function() {
  173. return Ue
  174. }), n.d(t, "AlwaysDepth", function() {
  175. return Z
  176. }), n.d(t, "AmbientLight", function() {
  177. return Dc
  178. }), n.d(t, "AmbientLightProbe", function() {
  179. return ll
  180. }), n.d(t, "AnimationClip", function() {
  181. return Vs
  182. }), n.d(t, "AnimationLoader", function() {
  183. return Js
  184. }), n.d(t, "AnimationMixer", function() {
  185. return jl
  186. }), n.d(t, "AnimationObjectGroup", function() {
  187. return Il
  188. }), n.d(t, "AnimationUtils", function() {
  189. return Rs
  190. }), n.d(t, "ArcCurve", function() {
  191. return oc
  192. }), n.d(t, "ArrayCamera", function() {
  193. return Ao
  194. }), n.d(t, "ArrowHelper", function() {
  195. return lu
  196. }), n.d(t, "Audio", function() {
  197. return pl
  198. }), n.d(t, "AudioAnalyser", function() {
  199. return ml
  200. }), n.d(t, "AudioContext", function() {
  201. return il
  202. }), n.d(t, "AudioListener", function() {
  203. return dl
  204. }), n.d(t, "AudioLoader", function() {
  205. return ol
  206. }), n.d(t, "AxesHelper", function() {
  207. return uu
  208. }), n.d(t, "AxisHelper", function() {
  209. return ju
  210. }), n.d(t, "BackSide", function() {
  211. return b
  212. }), n.d(t, "BasicDepthPacking", function() {
  213. return Bt
  214. }), n.d(t, "BasicShadowMap", function() {
  215. return m
  216. }), n.d(t, "BinaryTextureLoader", function() {
  217. return Fu
  218. }), n.d(t, "Bone", function() {
  219. return Ko
  220. }), n.d(t, "BooleanKeyframeTrack", function() {
  221. return Ns
  222. }), n.d(t, "BoundingBoxHelper", function() {
  223. return Nu
  224. }), n.d(t, "Box2", function() {
  225. return Vl
  226. }), n.d(t, "Box3", function() {
  227. return jn
  228. }), n.d(t, "Box3Helper", function() {
  229. return su
  230. }), n.d(t, "BoxBufferGeometry", function() {
  231. return yr
  232. }), n.d(t, "BoxGeometry", function() {
  233. return gr
  234. }), n.d(t, "BoxHelper", function() {
  235. return au
  236. }), n.d(t, "BufferAttribute", function() {
  237. return $n
  238. }), n.d(t, "BufferGeometry", function() {
  239. return pr
  240. }), n.d(t, "BufferGeometryLoader", function() {
  241. return Fc
  242. }), n.d(t, "ByteType", function() {
  243. return Ce
  244. }), n.d(t, "Cache", function() {
  245. return qs
  246. }), n.d(t, "Camera", function() {
  247. return Sr
  248. }), n.d(t, "CameraHelper", function() {
  249. return ou
  250. }), n.d(t, "CanvasRenderer", function() {
  251. return Hu
  252. }), n.d(t, "CanvasTexture", function() {
  253. return oa
  254. }), n.d(t, "CatmullRomCurve3", function() {
  255. return hc
  256. }), n.d(t, "CineonToneMapping", function() {
  257. return le
  258. }), n.d(t, "CircleBufferGeometry", function() {
  259. return ys
  260. }), n.d(t, "CircleGeometry", function() {
  261. return gs
  262. }), n.d(t, "ClampToEdgeWrapping", function() {
  263. return xe
  264. }), n.d(t, "Clock", function() {
  265. return hl
  266. }), n.d(t, "ClosedSplineCurve3", function() {
  267. return ku
  268. }), n.d(t, "Color", function() {
  269. return Vn
  270. }), n.d(t, "ColorKeyframeTrack", function() {
  271. return Bs
  272. }), n.d(t, "CompressedTexture", function() {
  273. return ia
  274. }), n.d(t, "CompressedTextureLoader", function() {
  275. return $s
  276. }), n.d(t, "ConeBufferGeometry", function() {
  277. return vs
  278. }), n.d(t, "ConeGeometry", function() {
  279. return ms
  280. }), n.d(t, "CubeCamera", function() {
  281. return Rr
  282. }), n.d(t, "CubeGeometry", function() {
  283. return gr
  284. }), n.d(t, "CubeReflectionMapping", function() {
  285. return de
  286. }), n.d(t, "CubeRefractionMapping", function() {
  287. return pe
  288. }), n.d(t, "CubeTexture", function() {
  289. return ei
  290. }), n.d(t, "CubeTextureLoader", function() {
  291. return tc
  292. }), n.d(t, "CubeUVReflectionMapping", function() {
  293. return ge
  294. }), n.d(t, "CubeUVRefractionMapping", function() {
  295. return ye
  296. }), n.d(t, "CubicBezierCurve", function() {
  297. return mc
  298. }), n.d(t, "CubicBezierCurve3", function() {
  299. return vc
  300. }), n.d(t, "CubicInterpolant", function() {
  301. return ks
  302. }), n.d(t, "CullFaceBack", function() {
  303. return u
  304. }), n.d(t, "CullFaceFront", function() {
  305. return h
  306. }), n.d(t, "CullFaceFrontBack", function() {
  307. return d
  308. }), n.d(t, "CullFaceNone", function() {
  309. return l
  310. }), n.d(t, "Curve", function() {
  311. return rc
  312. }), n.d(t, "CurvePath", function() {
  313. return Mc
  314. }), n.d(t, "CustomBlending", function() {
  315. return R
  316. }), n.d(t, "CylinderBufferGeometry", function() {
  317. return fs
  318. }), n.d(t, "CylinderGeometry", function() {
  319. return ps
  320. }), n.d(t, "Cylindrical", function() {
  321. return Hl
  322. }), n.d(t, "DataTexture", function() {
  323. return kr
  324. }), n.d(t, "DataTexture2DArray", function() {
  325. return ti
  326. }), n.d(t, "DataTexture3D", function() {
  327. return ni
  328. }), n.d(t, "DataTextureLoader", function() {
  329. return Qs
  330. }), n.d(t, "DefaultLoadingManager", function() {
  331. return Ys
  332. }), n.d(t, "DepthFormat", function() {
  333. return qe
  334. }), n.d(t, "DepthStencilFormat", function() {
  335. return Xe
  336. }), n.d(t, "DepthTexture", function() {
  337. return aa
  338. }), n.d(t, "DirectionalLight", function() {
  339. return Ic
  340. }), n.d(t, "DirectionalLightHelper", function() {
  341. return iu
  342. }), n.d(t, "DirectionalLightShadow", function() {
  343. return kc
  344. }), n.d(t, "DiscreteInterpolant", function() {
  345. return Ds
  346. }), n.d(t, "DodecahedronBufferGeometry", function() {
  347. return ba
  348. }), n.d(t, "DodecahedronGeometry", function() {
  349. return ya
  350. }), n.d(t, "DoubleSide", function() {
  351. return x
  352. }), n.d(t, "DstAlphaFactor", function() {
  353. return H
  354. }), n.d(t, "DstColorFactor", function() {
  355. return W
  356. }), n.d(t, "DynamicBufferAttribute", function() {
  357. return Mu
  358. }), n.d(t, "EdgesGeometry", function() {
  359. return ds
  360. }), n.d(t, "EdgesHelper", function() {
  361. return Bu
  362. }), n.d(t, "EllipseCurve", function() {
  363. return ic
  364. }), n.d(t, "EqualDepth", function() {
  365. return $
  366. }), n.d(t, "EquirectangularReflectionMapping", function() {
  367. return fe
  368. }), n.d(t, "EquirectangularRefractionMapping", function() {
  369. return me
  370. }), n.d(t, "Euler", function() {
  371. return hn
  372. }), n.d(t, "EventDispatcher", function() {
  373. return r
  374. }), n.d(t, "ExtrudeBufferGeometry", function() {
  375. return $a
  376. }), n.d(t, "ExtrudeGeometry", function() {
  377. return Ja
  378. }), n.d(t, "Face3", function() {
  379. return Yn
  380. }), n.d(t, "Face4", function() {
  381. return hu
  382. }), n.d(t, "FaceColors", function() {
  383. return E
  384. }), n.d(t, "FaceNormalsHelper", function() {
  385. return ru
  386. }), n.d(t, "FileLoader", function() {
  387. return Ks
  388. }), n.d(t, "FlatShading", function() {
  389. return w
  390. }), n.d(t, "Float32Attribute", function() {
  391. return Ru
  392. }), n.d(t, "Float32BufferAttribute", function() {
  393. return ar
  394. }), n.d(t, "Float64Attribute", function() {
  395. return Ou
  396. }), n.d(t, "Float64BufferAttribute", function() {
  397. return sr
  398. }), n.d(t, "FloatType", function() {
  399. return Ie
  400. }), n.d(t, "Fog", function() {
  401. return Go
  402. }), n.d(t, "FogExp2", function() {
  403. return Fo
  404. }), n.d(t, "Font", function() {
  405. return el
  406. }), n.d(t, "FontLoader", function() {
  407. return nl
  408. }), n.d(t, "FrontFaceDirectionCCW", function() {
  409. return f
  410. }), n.d(t, "FrontFaceDirectionCW", function() {
  411. return p
  412. }), n.d(t, "FrontSide", function() {
  413. return y
  414. }), n.d(t, "Frustum", function() {
  415. return Dr
  416. }), n.d(t, "GammaEncoding", function() {
  417. return Ot
  418. }), n.d(t, "Geometry", function() {
  419. return vr
  420. }), n.d(t, "GeometryUtils", function() {
  421. return Gu
  422. }), n.d(t, "GreaterDepth", function() {
  423. return ee
  424. }), n.d(t, "GreaterEqualDepth", function() {
  425. return Q
  426. }), n.d(t, "GridHelper", function() {
  427. return eu
  428. }), n.d(t, "Group", function() {
  429. return Lo
  430. }), n.d(t, "HalfFloatType", function() {
  431. return De
  432. }), n.d(t, "HemisphereLight", function() {
  433. return Lc
  434. }), n.d(t, "HemisphereLightHelper", function() {
  435. return $l
  436. }), n.d(t, "HemisphereLightProbe", function() {
  437. return cl
  438. }), n.d(t, "IcosahedronBufferGeometry", function() {
  439. return ga
  440. }), n.d(t, "IcosahedronGeometry", function() {
  441. return va
  442. }), n.d(t, "ImageBitmapLoader", function() {
  443. return $c
  444. }), n.d(t, "ImageLoader", function() {
  445. return ec
  446. }), n.d(t, "ImageUtils", function() {
  447. return rn
  448. }), n.d(t, "ImmediateRenderObject", function() {
  449. return ql
  450. }), n.d(t, "InstancedBufferAttribute", function() {
  451. return Uc
  452. }), n.d(t, "InstancedBufferGeometry", function() {
  453. return zc
  454. }), n.d(t, "InstancedInterleavedBuffer", function() {
  455. return Bl
  456. }), n.d(t, "Int16Attribute", function() {
  457. return Lu
  458. }), n.d(t, "Int16BufferAttribute", function() {
  459. return nr
  460. }), n.d(t, "Int32Attribute", function() {
  461. return Cu
  462. }), n.d(t, "Int32BufferAttribute", function() {
  463. return ir
  464. }), n.d(t, "Int8Attribute", function() {
  465. return Eu
  466. }), n.d(t, "Int8BufferAttribute", function() {
  467. return Qn
  468. }), n.d(t, "IntType", function() {
  469. return Oe
  470. }), n.d(t, "InterleavedBuffer", function() {
  471. return Ho
  472. }), n.d(t, "InterleavedBufferAttribute", function() {
  473. return Vo
  474. }), n.d(t, "Interpolant", function() {
  475. return Os
  476. }), n.d(t, "InterpolateDiscrete", function() {
  477. return wt
  478. }), n.d(t, "InterpolateLinear", function() {
  479. return _t
  480. }), n.d(t, "InterpolateSmooth", function() {
  481. return Mt
  482. }), n.d(t, "JSONLoader", function() {
  483. return Vu
  484. }), n.d(t, "KeyframeTrack", function() {
  485. return js
  486. }), n.d(t, "LOD", function() {
  487. return Xo
  488. }), n.d(t, "LatheBufferGeometry", function() {
  489. return cs
  490. }), n.d(t, "LatheGeometry", function() {
  491. return ss
  492. }), n.d(t, "Layers", function() {
  493. return dn
  494. }), n.d(t, "LensFlare", function() {
  495. return qu
  496. }), n.d(t, "LessDepth", function() {
  497. return K
  498. }), n.d(t, "LessEqualDepth", function() {
  499. return J
  500. }), n.d(t, "Light", function() {
  501. return Tc
  502. }), n.d(t, "LightProbe", function() {
  503. return sl
  504. }), n.d(t, "LightProbeHelper", function() {
  505. return Ql
  506. }), n.d(t, "LightShadow", function() {
  507. return Ac
  508. }), n.d(t, "Line", function() {
  509. return $o
  510. }), n.d(t, "Line3", function() {
  511. return Wl
  512. }), n.d(t, "LineBasicMaterial", function() {
  513. return Jo
  514. }), n.d(t, "LineCurve", function() {
  515. return gc
  516. }), n.d(t, "LineCurve3", function() {
  517. return yc
  518. }), n.d(t, "LineDashedMaterial", function() {
  519. return Cs
  520. }), n.d(t, "LineLoop", function() {
  521. return ea
  522. }), n.d(t, "LinePieces", function() {
  523. return pu
  524. }), n.d(t, "LineSegments", function() {
  525. return Qo
  526. }), n.d(t, "LineStrip", function() {
  527. return du
  528. }), n.d(t, "LinearEncoding", function() {
  529. return Pt
  530. }), n.d(t, "LinearFilter", function() {
  531. return Se
  532. }), n.d(t, "LinearInterpolant", function() {
  533. return Is
  534. }), n.d(t, "LinearMipMapLinearFilter", function() {
  535. return Le
  536. }), n.d(t, "LinearMipMapNearestFilter", function() {
  537. return Te
  538. }), n.d(t, "LinearToneMapping", function() {
  539. return ae
  540. }), n.d(t, "Loader", function() {
  541. return rl
  542. }), n.d(t, "LoaderUtils", function() {
  543. return Bc
  544. }), n.d(t, "LoadingManager", function() {
  545. return Xs
  546. }), n.d(t, "LogLuvEncoding", function() {
  547. return It
  548. }), n.d(t, "LoopOnce", function() {
  549. return yt
  550. }), n.d(t, "LoopPingPong", function() {
  551. return xt
  552. }), n.d(t, "LoopRepeat", function() {
  553. return bt
  554. }), n.d(t, "LuminanceAlphaFormat", function() {
  555. return Ve
  556. }), n.d(t, "LuminanceFormat", function() {
  557. return He
  558. }), n.d(t, "MOUSE", function() {
  559. return c
  560. }), n.d(t, "Material", function() {
  561. return Kn
  562. }), n.d(t, "MaterialLoader", function() {
  563. return Nc
  564. }), n.d(t, "Math", function() {
  565. return Gt
  566. }), n.d(t, "Matrix3", function() {
  567. return qt
  568. }), n.d(t, "Matrix4", function() {
  569. return un
  570. }), n.d(t, "MaxEquation", function() {
  571. return j
  572. }), n.d(t, "Mesh", function() {
  573. return fr
  574. }), n.d(t, "MeshBasicMaterial", function() {
  575. return Jn
  576. }), n.d(t, "MeshDepthMaterial", function() {
  577. return wo
  578. }), n.d(t, "MeshDistanceMaterial", function() {
  579. return _o
  580. }), n.d(t, "MeshFaceMaterial", function() {
  581. return fu
  582. }), n.d(t, "MeshLambertMaterial", function() {
  583. return Ls
  584. }), n.d(t, "MeshMatcapMaterial", function() {
  585. return As
  586. }), n.d(t, "MeshNormalMaterial", function() {
  587. return Ts
  588. }), n.d(t, "MeshPhongMaterial", function() {
  589. return Es
  590. }), n.d(t, "MeshPhysicalMaterial", function() {
  591. return Ms
  592. }), n.d(t, "MeshStandardMaterial", function() {
  593. return _s
  594. }), n.d(t, "MeshToonMaterial", function() {
  595. return Ss
  596. }), n.d(t, "MinEquation", function() {
  597. return D
  598. }), n.d(t, "MirroredRepeatWrapping", function() {
  599. return we
  600. }), n.d(t, "MixOperation", function() {
  601. return re
  602. }), n.d(t, "MultiMaterial", function() {
  603. return mu
  604. }), n.d(t, "MultiplyBlending", function() {
  605. return P
  606. }), n.d(t, "MultiplyOperation", function() {
  607. return ne
  608. }), n.d(t, "NearestFilter", function() {
  609. return _e
  610. }), n.d(t, "NearestMipMapLinearFilter", function() {
  611. return Ee
  612. }), n.d(t, "NearestMipMapNearestFilter", function() {
  613. return Me
  614. }), n.d(t, "NeverDepth", function() {
  615. return Y
  616. }), n.d(t, "NoBlending", function() {
  617. return T
  618. }), n.d(t, "NoColors", function() {
  619. return M
  620. }), n.d(t, "NoToneMapping", function() {
  621. return oe
  622. }), n.d(t, "NormalBlending", function() {
  623. return L
  624. }), n.d(t, "NotEqualDepth", function() {
  625. return te
  626. }), n.d(t, "NumberKeyframeTrack", function() {
  627. return zs
  628. }), n.d(t, "Object3D", function() {
  629. return In
  630. }), n.d(t, "ObjectLoader", function() {
  631. return Hc
  632. }), n.d(t, "ObjectSpaceNormalMap", function() {
  633. return Ft
  634. }), n.d(t, "OctahedronBufferGeometry", function() {
  635. return ma
  636. }), n.d(t, "OctahedronGeometry", function() {
  637. return fa
  638. }), n.d(t, "OneFactor", function() {
  639. return B
  640. }), n.d(t, "OneMinusDstAlphaFactor", function() {
  641. return V
  642. }), n.d(t, "OneMinusDstColorFactor", function() {
  643. return q
  644. }), n.d(t, "OneMinusSrcAlphaFactor", function() {
  645. return G
  646. }), n.d(t, "OneMinusSrcColorFactor", function() {
  647. return U
  648. }), n.d(t, "OrthographicCamera", function() {
  649. return Oc
  650. }), n.d(t, "PCFShadowMap", function() {
  651. return v
  652. }), n.d(t, "PCFSoftShadowMap", function() {
  653. return g
  654. }), n.d(t, "ParametricBufferGeometry", function() {
  655. return la
  656. }), n.d(t, "ParametricGeometry", function() {
  657. return ca
  658. }), n.d(t, "Particle", function() {
  659. return gu
  660. }), n.d(t, "ParticleBasicMaterial", function() {
  661. return xu
  662. }), n.d(t, "ParticleSystem", function() {
  663. return yu
  664. }), n.d(t, "ParticleSystemMaterial", function() {
  665. return wu
  666. }), n.d(t, "Path", function() {
  667. return Ec
  668. }), n.d(t, "PerspectiveCamera", function() {
  669. return Tr
  670. }), n.d(t, "Plane", function() {
  671. return Ir
  672. }), n.d(t, "PlaneBufferGeometry", function() {
  673. return Gr
  674. }), n.d(t, "PlaneGeometry", function() {
  675. return Fr
  676. }), n.d(t, "PlaneHelper", function() {
  677. return cu
  678. }), n.d(t, "PointCloud", function() {
  679. return vu
  680. }), n.d(t, "PointCloudMaterial", function() {
  681. return bu
  682. }), n.d(t, "PointLight", function() {
  683. return Rc
  684. }), n.d(t, "PointLightHelper", function() {
  685. return Kl
  686. }), n.d(t, "Points", function() {
  687. return na
  688. }), n.d(t, "PointsMaterial", function() {
  689. return ta
  690. }), n.d(t, "PolarGridHelper", function() {
  691. return tu
  692. }), n.d(t, "PolyhedronBufferGeometry", function() {
  693. return ha
  694. }), n.d(t, "PolyhedronGeometry", function() {
  695. return ua
  696. }), n.d(t, "PositionalAudio", function() {
  697. return fl
  698. }), n.d(t, "PositionalAudioHelper", function() {
  699. return nu
  700. }), n.d(t, "PropertyBinding", function() {
  701. return kl
  702. }), n.d(t, "PropertyMixer", function() {
  703. return vl
  704. }), n.d(t, "QuadraticBezierCurve", function() {
  705. return bc
  706. }), n.d(t, "QuadraticBezierCurve3", function() {
  707. return xc
  708. }), n.d(t, "Quaternion", function() {
  709. return Vt
  710. }), n.d(t, "QuaternionKeyframeTrack", function() {
  711. return Fs
  712. }), n.d(t, "QuaternionLinearInterpolant", function() {
  713. return Us
  714. }), n.d(t, "REVISION", function() {
  715. return s
  716. }), n.d(t, "RGBADepthPacking", function() {
  717. return zt
  718. }), n.d(t, "RGBAFormat", function() {
  719. return Ge
  720. }), n.d(t, "RGBA_ASTC_10x10_Format", function() {
  721. return mt
  722. }), n.d(t, "RGBA_ASTC_10x5_Format", function() {
  723. return dt
  724. }), n.d(t, "RGBA_ASTC_10x6_Format", function() {
  725. return pt
  726. }), n.d(t, "RGBA_ASTC_10x8_Format", function() {
  727. return ft
  728. }), n.d(t, "RGBA_ASTC_12x10_Format", function() {
  729. return vt
  730. }), n.d(t, "RGBA_ASTC_12x12_Format", function() {
  731. return gt
  732. }), n.d(t, "RGBA_ASTC_4x4_Format", function() {
  733. return it
  734. }), n.d(t, "RGBA_ASTC_5x4_Format", function() {
  735. return ot
  736. }), n.d(t, "RGBA_ASTC_5x5_Format", function() {
  737. return at
  738. }), n.d(t, "RGBA_ASTC_6x5_Format", function() {
  739. return st
  740. }), n.d(t, "RGBA_ASTC_6x6_Format", function() {
  741. return ct
  742. }), n.d(t, "RGBA_ASTC_8x5_Format", function() {
  743. return lt
  744. }), n.d(t, "RGBA_ASTC_8x6_Format", function() {
  745. return ut
  746. }), n.d(t, "RGBA_ASTC_8x8_Format", function() {
  747. return ht
  748. }), n.d(t, "RGBA_PVRTC_2BPPV1_Format", function() {
  749. return nt
  750. }), n.d(t, "RGBA_PVRTC_4BPPV1_Format", function() {
  751. return tt
  752. }), n.d(t, "RGBA_S3TC_DXT1_Format", function() {
  753. return Ke
  754. }), n.d(t, "RGBA_S3TC_DXT3_Format", function() {
  755. return Je
  756. }), n.d(t, "RGBA_S3TC_DXT5_Format", function() {
  757. return $e
  758. }), n.d(t, "RGBDEncoding", function() {
  759. return Nt
  760. }), n.d(t, "RGBEEncoding", function() {
  761. return kt
  762. }), n.d(t, "RGBEFormat", function() {
  763. return We
  764. }), n.d(t, "RGBFormat", function() {
  765. return Fe
  766. }), n.d(t, "RGBM16Encoding", function() {
  767. return jt
  768. }), n.d(t, "RGBM7Encoding", function() {
  769. return Dt
  770. }), n.d(t, "RGB_ETC1_Format", function() {
  771. return rt
  772. }), n.d(t, "RGB_PVRTC_2BPPV1_Format", function() {
  773. return et
  774. }), n.d(t, "RGB_PVRTC_4BPPV1_Format", function() {
  775. return Qe
  776. }), n.d(t, "RGB_S3TC_DXT1_Format", function() {
  777. return Ze
  778. }), n.d(t, "RawShaderMaterial", function() {
  779. return ws
  780. }), n.d(t, "Ray", function() {
  781. return Bn
  782. }), n.d(t, "Raycaster", function() {
  783. return zl
  784. }), n.d(t, "RectAreaLight", function() {
  785. return jc
  786. }), n.d(t, "RectAreaLightHelper", function() {
  787. return Jl
  788. }), n.d(t, "RedFormat", function() {
  789. return Ye
  790. }), n.d(t, "ReinhardToneMapping", function() {
  791. return se
  792. }), n.d(t, "RepeatWrapping", function() {
  793. return be
  794. }), n.d(t, "ReverseSubtractEquation", function() {
  795. return I
  796. }), n.d(t, "RingBufferGeometry", function() {
  797. return as
  798. }), n.d(t, "RingGeometry", function() {
  799. return os
  800. }), n.d(t, "Scene", function() {
  801. return Dn
  802. }), n.d(t, "SceneUtils", function() {
  803. return Wu
  804. }), n.d(t, "ShaderChunk", function() {
  805. return jr
  806. }), n.d(t, "ShaderLib", function() {
  807. return Br
  808. }), n.d(t, "ShaderMaterial", function() {
  809. return Er
  810. }), n.d(t, "ShadowMaterial", function() {
  811. return xs
  812. }), n.d(t, "Shape", function() {
  813. return Sc
  814. }), n.d(t, "ShapeBufferGeometry", function() {
  815. return us
  816. }), n.d(t, "ShapeGeometry", function() {
  817. return ls
  818. }), n.d(t, "ShapePath", function() {
  819. return Qc
  820. }), n.d(t, "ShapeUtils", function() {
  821. return Ya
  822. }), n.d(t, "ShortType", function() {
  823. return Pe
  824. }), n.d(t, "Skeleton", function() {
  825. return Zo
  826. }), n.d(t, "SkeletonHelper", function() {
  827. return Zl
  828. }), n.d(t, "SkinnedMesh", function() {
  829. return Yo
  830. }), n.d(t, "SmoothShading", function() {
  831. return _
  832. }), n.d(t, "Sphere", function() {
  833. return Nn
  834. }), n.d(t, "SphereBufferGeometry", function() {
  835. return is
  836. }), n.d(t, "SphereGeometry", function() {
  837. return rs
  838. }), n.d(t, "Spherical", function() {
  839. return Gl
  840. }), n.d(t, "SphericalHarmonics3", function() {
  841. return al
  842. }), n.d(t, "SphericalReflectionMapping", function() {
  843. return ve
  844. }), n.d(t, "Spline", function() {
  845. return Du
  846. }), n.d(t, "SplineCurve", function() {
  847. return wc
  848. }), n.d(t, "SplineCurve3", function() {
  849. return Iu
  850. }), n.d(t, "SpotLight", function() {
  851. return Pc
  852. }), n.d(t, "SpotLightHelper", function() {
  853. return Yl
  854. }), n.d(t, "SpotLightShadow", function() {
  855. return Cc
  856. }), n.d(t, "Sprite", function() {
  857. return qo
  858. }), n.d(t, "SpriteMaterial", function() {
  859. return Wo
  860. }), n.d(t, "SrcAlphaFactor", function() {
  861. return F
  862. }), n.d(t, "SrcAlphaSaturateFactor", function() {
  863. return X
  864. }), n.d(t, "SrcColorFactor", function() {
  865. return z
  866. }), n.d(t, "StereoCamera", function() {
  867. return ul
  868. }), n.d(t, "StringKeyframeTrack", function() {
  869. return Gs
  870. }), n.d(t, "SubtractEquation", function() {
  871. return k
  872. }), n.d(t, "SubtractiveBlending", function() {
  873. return C
  874. }), n.d(t, "TangentSpaceNormalMap", function() {
  875. return Ut
  876. }), n.d(t, "TetrahedronBufferGeometry", function() {
  877. return pa
  878. }), n.d(t, "TetrahedronGeometry", function() {
  879. return da
  880. }), n.d(t, "TextBufferGeometry", function() {
  881. return ns
  882. }), n.d(t, "TextGeometry", function() {
  883. return ts
  884. }), n.d(t, "Texture", function() {
  885. return an
  886. }), n.d(t, "TextureLoader", function() {
  887. return nc
  888. }), n.d(t, "TorusBufferGeometry", function() {
  889. return Sa
  890. }), n.d(t, "TorusGeometry", function() {
  891. return Ea
  892. }), n.d(t, "TorusKnotBufferGeometry", function() {
  893. return Ma
  894. }), n.d(t, "TorusKnotGeometry", function() {
  895. return _a
  896. }), n.d(t, "Triangle", function() {
  897. return zn
  898. }), n.d(t, "TriangleFanDrawMode", function() {
  899. return Ct
  900. }), n.d(t, "TriangleStripDrawMode", function() {
  901. return At
  902. }), n.d(t, "TrianglesDrawMode", function() {
  903. return Lt
  904. }), n.d(t, "TubeBufferGeometry", function() {
  905. return wa
  906. }), n.d(t, "TubeGeometry", function() {
  907. return xa
  908. }), n.d(t, "UVMapping", function() {
  909. return he
  910. }), n.d(t, "Uint16Attribute", function() {
  911. return Au
  912. }), n.d(t, "Uint16BufferAttribute", function() {
  913. return rr
  914. }), n.d(t, "Uint32Attribute", function() {
  915. return Pu
  916. }), n.d(t, "Uint32BufferAttribute", function() {
  917. return or
  918. }), n.d(t, "Uint8Attribute", function() {
  919. return Su
  920. }), n.d(t, "Uint8BufferAttribute", function() {
  921. return er
  922. }), n.d(t, "Uint8ClampedAttribute", function() {
  923. return Tu
  924. }), n.d(t, "Uint8ClampedBufferAttribute", function() {
  925. return tr
  926. }), n.d(t, "Uncharted2ToneMapping", function() {
  927. return ce
  928. }), n.d(t, "Uniform", function() {
  929. return Nl
  930. }), n.d(t, "UniformsLib", function() {
  931. return Nr
  932. }), n.d(t, "UniformsUtils", function() {
  933. return wr
  934. }), n.d(t, "UnsignedByteType", function() {
  935. return Ae
  936. }), n.d(t, "UnsignedInt248Type", function() {
  937. return ze
  938. }), n.d(t, "UnsignedIntType", function() {
  939. return ke
  940. }), n.d(t, "UnsignedShort4444Type", function() {
  941. return je
  942. }), n.d(t, "UnsignedShort5551Type", function() {
  943. return Ne
  944. }), n.d(t, "UnsignedShort565Type", function() {
  945. return Be
  946. }), n.d(t, "UnsignedShortType", function() {
  947. return Re
  948. }), n.d(t, "Vector2", function() {
  949. return Ht
  950. }), n.d(t, "Vector3", function() {
  951. return Wt
  952. }), n.d(t, "Vector4", function() {
  953. return sn
  954. }), n.d(t, "VectorKeyframeTrack", function() {
  955. return Hs
  956. }), n.d(t, "Vertex", function() {
  957. return _u
  958. }), n.d(t, "VertexColors", function() {
  959. return S
  960. }), n.d(t, "VertexNormalsHelper", function() {
  961. return Xl
  962. }), n.d(t, "VideoTexture", function() {
  963. return ra
  964. }), n.d(t, "WebGLMultisampleRenderTarget", function() {
  965. return ln
  966. }), n.d(t, "WebGLRenderTarget", function() {
  967. return cn
  968. }), n.d(t, "WebGLRenderTargetCube", function() {
  969. return Or
  970. }), n.d(t, "WebGLRenderer", function() {
  971. return Uo
  972. }), n.d(t, "WebGLUtils", function() {
  973. return To
  974. }), n.d(t, "WireframeGeometry", function() {
  975. return sa
  976. }), n.d(t, "WireframeHelper", function() {
  977. return zu
  978. }), n.d(t, "WrapAroundEnding", function() {
  979. return Tt
  980. }), n.d(t, "XHRLoader", function() {
  981. return Uu
  982. }), n.d(t, "ZeroCurvatureEnding", function() {
  983. return Et
  984. }), n.d(t, "ZeroFactor", function() {
  985. return N
  986. }), n.d(t, "ZeroSlopeEnding", function() {
  987. return St
  988. }), n.d(t, "sRGBEncoding", function() {
  989. return Rt
  990. }), void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)), void 0 === Number.isInteger && (Number.isInteger = function(e) {
  991. return "number" == typeof e && isFinite(e) && Math.floor(e) === e
  992. }), void 0 === Math.sign && (Math.sign = function(e) {
  993. return e < 0 ? -1 : e > 0 ? 1 : +e
  994. }), "name" in Function.prototype == !1 && Object.defineProperty(Function.prototype, "name", {
  995. get: function() {
  996. return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]
  997. }
  998. }), void 0 === Object.assign && (Object.assign = function(e) {
  999. if (null == e) throw new TypeError("Cannot convert undefined or null to object");
  1000. for (var t = Object(e), n = 1; n < arguments.length; n++) {
  1001. var r = arguments[n];
  1002. if (null != r)
  1003. for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (t[i] = r[i])
  1004. }
  1005. return t
  1006. }), Object.assign(r.prototype, {
  1007. addEventListener: function(e, t) {
  1008. void 0 === this._listeners && (this._listeners = {});
  1009. var n = this._listeners;
  1010. void 0 === n[e] && (n[e] = []), -1 === n[e].indexOf(t) && n[e].push(t)
  1011. },
  1012. hasEventListener: function(e, t) {
  1013. if (void 0 === this._listeners) return !1;
  1014. var n = this._listeners;
  1015. return void 0 !== n[e] && -1 !== n[e].indexOf(t)
  1016. },
  1017. removeEventListener: function(e, t) {
  1018. if (void 0 !== this._listeners) {
  1019. var n = this._listeners[e];
  1020. if (void 0 !== n) {
  1021. var r = n.indexOf(t); - 1 !== r && n.splice(r, 1)
  1022. }
  1023. }
  1024. },
  1025. dispatchEvent: function(e) {
  1026. if (void 0 !== this._listeners) {
  1027. var t = this._listeners[e.type];
  1028. if (void 0 !== t) {
  1029. e.target = this;
  1030. for (var n = t.slice(0), r = 0, i = n.length; r < i; r++) n[r].call(this, e)
  1031. }
  1032. }
  1033. }
  1034. });
  1035. var i, o, a, s = "106",
  1036. c = {
  1037. LEFT: 0,
  1038. MIDDLE: 1,
  1039. RIGHT: 2
  1040. },
  1041. l = 0,
  1042. u = 1,
  1043. h = 2,
  1044. d = 3,
  1045. p = 0,
  1046. f = 1,
  1047. m = 0,
  1048. v = 1,
  1049. g = 2,
  1050. y = 0,
  1051. b = 1,
  1052. x = 2,
  1053. w = 1,
  1054. _ = 2,
  1055. M = 0,
  1056. E = 1,
  1057. S = 2,
  1058. T = 0,
  1059. L = 1,
  1060. A = 2,
  1061. C = 3,
  1062. P = 4,
  1063. R = 5,
  1064. O = 100,
  1065. k = 101,
  1066. I = 102,
  1067. D = 103,
  1068. j = 104,
  1069. N = 200,
  1070. B = 201,
  1071. z = 202,
  1072. U = 203,
  1073. F = 204,
  1074. G = 205,
  1075. H = 206,
  1076. V = 207,
  1077. W = 208,
  1078. q = 209,
  1079. X = 210,
  1080. Y = 0,
  1081. Z = 1,
  1082. K = 2,
  1083. J = 3,
  1084. $ = 4,
  1085. Q = 5,
  1086. ee = 6,
  1087. te = 7,
  1088. ne = 0,
  1089. re = 1,
  1090. ie = 2,
  1091. oe = 0,
  1092. ae = 1,
  1093. se = 2,
  1094. ce = 3,
  1095. le = 4,
  1096. ue = 5,
  1097. he = 300,
  1098. de = 301,
  1099. pe = 302,
  1100. fe = 303,
  1101. me = 304,
  1102. ve = 305,
  1103. ge = 306,
  1104. ye = 307,
  1105. be = 1e3,
  1106. xe = 1001,
  1107. we = 1002,
  1108. _e = 1003,
  1109. Me = 1004,
  1110. Ee = 1005,
  1111. Se = 1006,
  1112. Te = 1007,
  1113. Le = 1008,
  1114. Ae = 1009,
  1115. Ce = 1010,
  1116. Pe = 1011,
  1117. Re = 1012,
  1118. Oe = 1013,
  1119. ke = 1014,
  1120. Ie = 1015,
  1121. De = 1016,
  1122. je = 1017,
  1123. Ne = 1018,
  1124. Be = 1019,
  1125. ze = 1020,
  1126. Ue = 1021,
  1127. Fe = 1022,
  1128. Ge = 1023,
  1129. He = 1024,
  1130. Ve = 1025,
  1131. We = Ge,
  1132. qe = 1026,
  1133. Xe = 1027,
  1134. Ye = 1028,
  1135. Ze = 33776,
  1136. Ke = 33777,
  1137. Je = 33778,
  1138. $e = 33779,
  1139. Qe = 35840,
  1140. et = 35841,
  1141. tt = 35842,
  1142. nt = 35843,
  1143. rt = 36196,
  1144. it = 37808,
  1145. ot = 37809,
  1146. at = 37810,
  1147. st = 37811,
  1148. ct = 37812,
  1149. lt = 37813,
  1150. ut = 37814,
  1151. ht = 37815,
  1152. dt = 37816,
  1153. pt = 37817,
  1154. ft = 37818,
  1155. mt = 37819,
  1156. vt = 37820,
  1157. gt = 37821,
  1158. yt = 2200,
  1159. bt = 2201,
  1160. xt = 2202,
  1161. wt = 2300,
  1162. _t = 2301,
  1163. Mt = 2302,
  1164. Et = 2400,
  1165. St = 2401,
  1166. Tt = 2402,
  1167. Lt = 0,
  1168. At = 1,
  1169. Ct = 2,
  1170. Pt = 3e3,
  1171. Rt = 3001,
  1172. Ot = 3007,
  1173. kt = 3002,
  1174. It = 3003,
  1175. Dt = 3004,
  1176. jt = 3005,
  1177. Nt = 3006,
  1178. Bt = 3200,
  1179. zt = 3201,
  1180. Ut = 0,
  1181. Ft = 1,
  1182. Gt = {
  1183. DEG2RAD: Math.PI / 180,
  1184. RAD2DEG: 180 / Math.PI,
  1185. generateUUID: function() {
  1186. for (var e = [], t = 0; t < 256; t++) e[t] = (t < 16 ? "0" : "") + t.toString(16);
  1187. return function() {
  1188. var t = 4294967295 * Math.random() | 0,
  1189. n = 4294967295 * Math.random() | 0,
  1190. r = 4294967295 * Math.random() | 0,
  1191. i = 4294967295 * Math.random() | 0;
  1192. return (e[255 & t] + e[t >> 8 & 255] + e[t >> 16 & 255] + e[t >> 24 & 255] + "-" + e[255 & n] + e[n >> 8 & 255] + "-" + e[n >> 16 & 15 | 64] + e[n >> 24 & 255] + "-" + e[63 & r | 128] + e[r >> 8 & 255] + "-" + e[r >> 16 & 255] + e[r >> 24 & 255] + e[255 & i] + e[i >> 8 & 255] + e[i >> 16 & 255] + e[i >> 24 & 255]).toUpperCase()
  1193. }
  1194. }(),
  1195. clamp: function(e, t, n) {
  1196. return Math.max(t, Math.min(n, e))
  1197. },
  1198. euclideanModulo: function(e, t) {
  1199. return (e % t + t) % t
  1200. },
  1201. mapLinear: function(e, t, n, r, i) {
  1202. return r + (e - t) * (i - r) / (n - t)
  1203. },
  1204. lerp: function(e, t, n) {
  1205. return (1 - n) * e + n * t
  1206. },
  1207. smoothstep: function(e, t, n) {
  1208. return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t)) * e * (3 - 2 * e)
  1209. },
  1210. smootherstep: function(e, t, n) {
  1211. return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t)) * e * e * (e * (6 * e - 15) + 10)
  1212. },
  1213. randInt: function(e, t) {
  1214. return e + Math.floor(Math.random() * (t - e + 1))
  1215. },
  1216. randFloat: function(e, t) {
  1217. return e + Math.random() * (t - e)
  1218. },
  1219. randFloatSpread: function(e) {
  1220. return e * (.5 - Math.random())
  1221. },
  1222. degToRad: function(e) {
  1223. return e * Gt.DEG2RAD
  1224. },
  1225. radToDeg: function(e) {
  1226. return e * Gt.RAD2DEG
  1227. },
  1228. isPowerOfTwo: function(e) {
  1229. return 0 == (e & e - 1) && 0 !== e
  1230. },
  1231. ceilPowerOfTwo: function(e) {
  1232. return Math.pow(2, Math.ceil(Math.log(e) / Math.LN2))
  1233. },
  1234. floorPowerOfTwo: function(e) {
  1235. return Math.pow(2, Math.floor(Math.log(e) / Math.LN2))
  1236. }
  1237. };
  1238.  
  1239. function Ht(e, t) {
  1240. this.x = e || 0, this.y = t || 0
  1241. }
  1242.  
  1243. function Vt(e, t, n, r) {
  1244. this._x = e || 0, this._y = t || 0, this._z = n || 0, this._w = void 0 !== r ? r : 1
  1245. }
  1246.  
  1247. function Wt(e, t, n) {
  1248. this.x = e || 0, this.y = t || 0, this.z = n || 0
  1249. }
  1250.  
  1251. function qt() {
  1252. this.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1], arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  1253. }
  1254. Object.defineProperties(Ht.prototype, {
  1255. width: {
  1256. get: function() {
  1257. return this.x
  1258. },
  1259. set: function(e) {
  1260. this.x = e
  1261. }
  1262. },
  1263. height: {
  1264. get: function() {
  1265. return this.y
  1266. },
  1267. set: function(e) {
  1268. this.y = e
  1269. }
  1270. }
  1271. }), Object.assign(Ht.prototype, {
  1272. isVector2: !0,
  1273. set: function(e, t) {
  1274. return this.x = e, this.y = t, this
  1275. },
  1276. setScalar: function(e) {
  1277. return this.x = e, this.y = e, this
  1278. },
  1279. setX: function(e) {
  1280. return this.x = e, this
  1281. },
  1282. setY: function(e) {
  1283. return this.y = e, this
  1284. },
  1285. setComponent: function(e, t) {
  1286. switch (e) {
  1287. case 0:
  1288. this.x = t;
  1289. break;
  1290. case 1:
  1291. this.y = t;
  1292. break;
  1293. default:
  1294. throw new Error("index is out of range: " + e)
  1295. }
  1296. return this
  1297. },
  1298. getComponent: function(e) {
  1299. switch (e) {
  1300. case 0:
  1301. return this.x;
  1302. case 1:
  1303. return this.y;
  1304. default:
  1305. throw new Error("index is out of range: " + e)
  1306. }
  1307. },
  1308. clone: function() {
  1309. return new this.constructor(this.x, this.y)
  1310. },
  1311. copy: function(e) {
  1312. return this.x = e.x, this.y = e.y, this
  1313. },
  1314. add: function(e, t) {
  1315. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (this.x += e.x, this.y += e.y, this)
  1316. },
  1317. addScalar: function(e) {
  1318. return this.x += e, this.y += e, this
  1319. },
  1320. addVectors: function(e, t) {
  1321. return this.x = e.x + t.x, this.y = e.y + t.y, this
  1322. },
  1323. addScaledVector: function(e, t) {
  1324. return this.x += e.x * t, this.y += e.y * t, this
  1325. },
  1326. sub: function(e, t) {
  1327. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (this.x -= e.x, this.y -= e.y, this)
  1328. },
  1329. subScalar: function(e) {
  1330. return this.x -= e, this.y -= e, this
  1331. },
  1332. subVectors: function(e, t) {
  1333. return this.x = e.x - t.x, this.y = e.y - t.y, this
  1334. },
  1335. multiply: function(e) {
  1336. return this.x *= e.x, this.y *= e.y, this
  1337. },
  1338. multiplyScalar: function(e) {
  1339. return this.x *= e, this.y *= e, this
  1340. },
  1341. divide: function(e) {
  1342. return this.x /= e.x, this.y /= e.y, this
  1343. },
  1344. divideScalar: function(e) {
  1345. return this.multiplyScalar(1 / e)
  1346. },
  1347. applyMatrix3: function(e) {
  1348. var t = this.x,
  1349. n = this.y,
  1350. r = e.elements;
  1351. return this.x = r[0] * t + r[3] * n + r[6], this.y = r[1] * t + r[4] * n + r[7], this
  1352. },
  1353. min: function(e) {
  1354. return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this
  1355. },
  1356. max: function(e) {
  1357. return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this
  1358. },
  1359. clamp: function(e, t) {
  1360. return this.x = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this
  1361. },
  1362. clampScalar: function(e, t) {
  1363. return this.x = Math.max(e, Math.min(t, this.x)), this.y = Math.max(e, Math.min(t, this.y)), this
  1364. },
  1365. clampLength: function(e, t) {
  1366. var n = this.length();
  1367. return this.divideScalar(n || 1).multiplyScalar(Math.max(e, Math.min(t, n)))
  1368. },
  1369. floor: function() {
  1370. return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this
  1371. },
  1372. ceil: function() {
  1373. return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this
  1374. },
  1375. round: function() {
  1376. return this.x = Math.round(this.x), this.y = Math.round(this.y), this
  1377. },
  1378. roundToZero: function() {
  1379. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this
  1380. },
  1381. negate: function() {
  1382. return this.x = -this.x, this.y = -this.y, this
  1383. },
  1384. dot: function(e) {
  1385. return this.x * e.x + this.y * e.y
  1386. },
  1387. cross: function(e) {
  1388. return this.x * e.y - this.y * e.x
  1389. },
  1390. lengthSq: function() {
  1391. return this.x * this.x + this.y * this.y
  1392. },
  1393. length: function() {
  1394. return Math.sqrt(this.x * this.x + this.y * this.y)
  1395. },
  1396. manhattanLength: function() {
  1397. return Math.abs(this.x) + Math.abs(this.y)
  1398. },
  1399. normalize: function() {
  1400. return this.divideScalar(this.length() || 1)
  1401. },
  1402. angle: function() {
  1403. var e = Math.atan2(this.y, this.x);
  1404. return e < 0 && (e += 2 * Math.PI), e
  1405. },
  1406. distanceTo: function(e) {
  1407. return Math.sqrt(this.distanceToSquared(e))
  1408. },
  1409. distanceToSquared: function(e) {
  1410. var t = this.x - e.x,
  1411. n = this.y - e.y;
  1412. return t * t + n * n
  1413. },
  1414. manhattanDistanceTo: function(e) {
  1415. return Math.abs(this.x - e.x) + Math.abs(this.y - e.y)
  1416. },
  1417. setLength: function(e) {
  1418. return this.normalize().multiplyScalar(e)
  1419. },
  1420. lerp: function(e, t) {
  1421. return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this
  1422. },
  1423. lerpVectors: function(e, t, n) {
  1424. return this.subVectors(t, e).multiplyScalar(n).add(e)
  1425. },
  1426. equals: function(e) {
  1427. return e.x === this.x && e.y === this.y
  1428. },
  1429. fromArray: function(e, t) {
  1430. return void 0 === t && (t = 0), this.x = e[t], this.y = e[t + 1], this
  1431. },
  1432. toArray: function(e, t) {
  1433. return void 0 === e && (e = []), void 0 === t && (t = 0), e[t] = this.x, e[t + 1] = this.y, e
  1434. },
  1435. fromBufferAttribute: function(e, t, n) {
  1436. return void 0 !== n && console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(t), this.y = e.getY(t), this
  1437. },
  1438. rotateAround: function(e, t) {
  1439. var n = Math.cos(t),
  1440. r = Math.sin(t),
  1441. i = this.x - e.x,
  1442. o = this.y - e.y;
  1443. return this.x = i * n - o * r + e.x, this.y = i * r + o * n + e.y, this
  1444. }
  1445. }), Object.assign(Vt, {
  1446. slerp: function(e, t, n, r) {
  1447. return n.copy(e).slerp(t, r)
  1448. },
  1449. slerpFlat: function(e, t, n, r, i, o, a) {
  1450. var s = n[r + 0],
  1451. c = n[r + 1],
  1452. l = n[r + 2],
  1453. u = n[r + 3],
  1454. h = i[o + 0],
  1455. d = i[o + 1],
  1456. p = i[o + 2],
  1457. f = i[o + 3];
  1458. if (u !== f || s !== h || c !== d || l !== p) {
  1459. var m = 1 - a,
  1460. v = s * h + c * d + l * p + u * f,
  1461. g = v >= 0 ? 1 : -1,
  1462. y = 1 - v * v;
  1463. if (y > Number.EPSILON) {
  1464. var b = Math.sqrt(y),
  1465. x = Math.atan2(b, v * g);
  1466. m = Math.sin(m * x) / b, a = Math.sin(a * x) / b
  1467. }
  1468. var w = a * g;
  1469. if (s = s * m + h * w, c = c * m + d * w, l = l * m + p * w, u = u * m + f * w, m === 1 - a) {
  1470. var _ = 1 / Math.sqrt(s * s + c * c + l * l + u * u);
  1471. s *= _, c *= _, l *= _, u *= _
  1472. }
  1473. }
  1474. e[t] = s, e[t + 1] = c, e[t + 2] = l, e[t + 3] = u
  1475. }
  1476. }), Object.defineProperties(Vt.prototype, {
  1477. x: {
  1478. get: function() {
  1479. return this._x
  1480. },
  1481. set: function(e) {
  1482. this._x = e, this._onChangeCallback()
  1483. }
  1484. },
  1485. y: {
  1486. get: function() {
  1487. return this._y
  1488. },
  1489. set: function(e) {
  1490. this._y = e, this._onChangeCallback()
  1491. }
  1492. },
  1493. z: {
  1494. get: function() {
  1495. return this._z
  1496. },
  1497. set: function(e) {
  1498. this._z = e, this._onChangeCallback()
  1499. }
  1500. },
  1501. w: {
  1502. get: function() {
  1503. return this._w
  1504. },
  1505. set: function(e) {
  1506. this._w = e, this._onChangeCallback()
  1507. }
  1508. }
  1509. }), Object.assign(Vt.prototype, {
  1510. isQuaternion: !0,
  1511. set: function(e, t, n, r) {
  1512. return this._x = e, this._y = t, this._z = n, this._w = r, this._onChangeCallback(), this
  1513. },
  1514. clone: function() {
  1515. return new this.constructor(this._x, this._y, this._z, this._w)
  1516. },
  1517. copy: function(e) {
  1518. return this._x = e.x, this._y = e.y, this._z = e.z, this._w = e.w, this._onChangeCallback(), this
  1519. },
  1520. setFromEuler: function(e, t) {
  1521. if (!e || !e.isEuler) throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");
  1522. var n = e._x,
  1523. r = e._y,
  1524. i = e._z,
  1525. o = e.order,
  1526. a = Math.cos,
  1527. s = Math.sin,
  1528. c = a(n / 2),
  1529. l = a(r / 2),
  1530. u = a(i / 2),
  1531. h = s(n / 2),
  1532. d = s(r / 2),
  1533. p = s(i / 2);
  1534. return "XYZ" === o ? (this._x = h * l * u + c * d * p, this._y = c * d * u - h * l * p, this._z = c * l * p + h * d * u, this._w = c * l * u - h * d * p) : "YXZ" === o ? (this._x = h * l * u + c * d * p, this._y = c * d * u - h * l * p, this._z = c * l * p - h * d * u, this._w = c * l * u + h * d * p) : "ZXY" === o ? (this._x = h * l * u - c * d * p, this._y = c * d * u + h * l * p, this._z = c * l * p + h * d * u, this._w = c * l * u - h * d * p) : "ZYX" === o ? (this._x = h * l * u - c * d * p, this._y = c * d * u + h * l * p, this._z = c * l * p - h * d * u, this._w = c * l * u + h * d * p) : "YZX" === o ? (this._x = h * l * u + c * d * p, this._y = c * d * u + h * l * p, this._z = c * l * p - h * d * u, this._w = c * l * u - h * d * p) : "XZY" === o && (this._x = h * l * u - c * d * p, this._y = c * d * u - h * l * p, this._z = c * l * p + h * d * u, this._w = c * l * u + h * d * p), !1 !== t && this._onChangeCallback(), this
  1535. },
  1536. setFromAxisAngle: function(e, t) {
  1537. var n = t / 2,
  1538. r = Math.sin(n);
  1539. return this._x = e.x * r, this._y = e.y * r, this._z = e.z * r, this._w = Math.cos(n), this._onChangeCallback(), this
  1540. },
  1541. setFromRotationMatrix: function(e) {
  1542. var t, n = e.elements,
  1543. r = n[0],
  1544. i = n[4],
  1545. o = n[8],
  1546. a = n[1],
  1547. s = n[5],
  1548. c = n[9],
  1549. l = n[2],
  1550. u = n[6],
  1551. h = n[10],
  1552. d = r + s + h;
  1553. return d > 0 ? (t = .5 / Math.sqrt(d + 1), this._w = .25 / t, this._x = (u - c) * t, this._y = (o - l) * t, this._z = (a - i) * t) : r > s && r > h ? (t = 2 * Math.sqrt(1 + r - s - h), this._w = (u - c) / t, this._x = .25 * t, this._y = (i + a) / t, this._z = (o + l) / t) : s > h ? (t = 2 * Math.sqrt(1 + s - r - h), this._w = (o - l) / t, this._x = (i + a) / t, this._y = .25 * t, this._z = (c + u) / t) : (t = 2 * Math.sqrt(1 + h - r - s), this._w = (a - i) / t, this._x = (o + l) / t, this._y = (c + u) / t, this._z = .25 * t), this._onChangeCallback(), this
  1554. },
  1555. setFromUnitVectors: function(e, t) {
  1556. var n = e.dot(t) + 1;
  1557. return n < 1e-6 ? (n = 0, Math.abs(e.x) > Math.abs(e.z) ? (this._x = -e.y, this._y = e.x, this._z = 0, this._w = n) : (this._x = 0, this._y = -e.z, this._z = e.y, this._w = n)) : (this._x = e.y * t.z - e.z * t.y, this._y = e.z * t.x - e.x * t.z, this._z = e.x * t.y - e.y * t.x, this._w = n), this.normalize()
  1558. },
  1559. angleTo: function(e) {
  1560. return 2 * Math.acos(Math.abs(Gt.clamp(this.dot(e), -1, 1)))
  1561. },
  1562. rotateTowards: function(e, t) {
  1563. var n = this.angleTo(e);
  1564. if (0 === n) return this;
  1565. var r = Math.min(1, t / n);
  1566. return this.slerp(e, r), this
  1567. },
  1568. inverse: function() {
  1569. return this.conjugate()
  1570. },
  1571. conjugate: function() {
  1572. return this._x *= -1, this._y *= -1, this._z *= -1, this._onChangeCallback(), this
  1573. },
  1574. dot: function(e) {
  1575. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  1576. },
  1577. lengthSq: function() {
  1578. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  1579. },
  1580. length: function() {
  1581. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  1582. },
  1583. normalize: function() {
  1584. var e = this.length();
  1585. return 0 === e ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (e = 1 / e, this._x = this._x * e, this._y = this._y * e, this._z = this._z * e, this._w = this._w * e), this._onChangeCallback(), this
  1586. },
  1587. multiply: function(e, t) {
  1588. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."), this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  1589. },
  1590. premultiply: function(e) {
  1591. return this.multiplyQuaternions(e, this)
  1592. },
  1593. multiplyQuaternions: function(e, t) {
  1594. var n = e._x,
  1595. r = e._y,
  1596. i = e._z,
  1597. o = e._w,
  1598. a = t._x,
  1599. s = t._y,
  1600. c = t._z,
  1601. l = t._w;
  1602. return this._x = n * l + o * a + r * c - i * s, this._y = r * l + o * s + i * a - n * c, this._z = i * l + o * c + n * s - r * a, this._w = o * l - n * a - r * s - i * c, this._onChangeCallback(), this
  1603. },
  1604. slerp: function(e, t) {
  1605. if (0 === t) return this;
  1606. if (1 === t) return this.copy(e);
  1607. var n = this._x,
  1608. r = this._y,
  1609. i = this._z,
  1610. o = this._w,
  1611. a = o * e._w + n * e._x + r * e._y + i * e._z;
  1612. if (a < 0 ? (this._w = -e._w, this._x = -e._x, this._y = -e._y, this._z = -e._z, a = -a) : this.copy(e), a >= 1) return this._w = o, this._x = n, this._y = r, this._z = i, this;
  1613. var s = 1 - a * a;
  1614. if (s <= Number.EPSILON) {
  1615. var c = 1 - t;
  1616. return this._w = c * o + t * this._w, this._x = c * n + t * this._x, this._y = c * r + t * this._y, this._z = c * i + t * this._z, this.normalize(), this._onChangeCallback(), this
  1617. }
  1618. var l = Math.sqrt(s),
  1619. u = Math.atan2(l, a),
  1620. h = Math.sin((1 - t) * u) / l,
  1621. d = Math.sin(t * u) / l;
  1622. return this._w = o * h + this._w * d, this._x = n * h + this._x * d, this._y = r * h + this._y * d, this._z = i * h + this._z * d, this._onChangeCallback(), this
  1623. },
  1624. equals: function(e) {
  1625. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  1626. },
  1627. fromArray: function(e, t) {
  1628. return void 0 === t && (t = 0), this._x = e[t], this._y = e[t + 1], this._z = e[t + 2], this._w = e[t + 3], this._onChangeCallback(), this
  1629. },
  1630. toArray: function(e, t) {
  1631. return void 0 === e && (e = []), void 0 === t && (t = 0), e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, e[t + 3] = this._w, e
  1632. },
  1633. _onChange: function(e) {
  1634. return this._onChangeCallback = e, this
  1635. },
  1636. _onChangeCallback: function() {}
  1637. }), Object.assign(Wt.prototype, {
  1638. isVector3: !0,
  1639. set: function(e, t, n) {
  1640. return this.x = e, this.y = t, this.z = n, this
  1641. },
  1642. setScalar: function(e) {
  1643. return this.x = e, this.y = e, this.z = e, this
  1644. },
  1645. setX: function(e) {
  1646. return this.x = e, this
  1647. },
  1648. setY: function(e) {
  1649. return this.y = e, this
  1650. },
  1651. setZ: function(e) {
  1652. return this.z = e, this
  1653. },
  1654. setComponent: function(e, t) {
  1655. switch (e) {
  1656. case 0:
  1657. this.x = t;
  1658. break;
  1659. case 1:
  1660. this.y = t;
  1661. break;
  1662. case 2:
  1663. this.z = t;
  1664. break;
  1665. default:
  1666. throw new Error("index is out of range: " + e)
  1667. }
  1668. return this
  1669. },
  1670. getComponent: function(e) {
  1671. switch (e) {
  1672. case 0:
  1673. return this.x;
  1674. case 1:
  1675. return this.y;
  1676. case 2:
  1677. return this.z;
  1678. default:
  1679. throw new Error("index is out of range: " + e)
  1680. }
  1681. },
  1682. clone: function() {
  1683. return new this.constructor(this.x, this.y, this.z)
  1684. },
  1685. copy: function(e) {
  1686. return this.x = e.x, this.y = e.y, this.z = e.z, this
  1687. },
  1688. add: function(e, t) {
  1689. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (this.x += e.x, this.y += e.y, this.z += e.z, this)
  1690. },
  1691. addScalar: function(e) {
  1692. return this.x += e, this.y += e, this.z += e, this
  1693. },
  1694. addVectors: function(e, t) {
  1695. return this.x = e.x + t.x, this.y = e.y + t.y, this.z = e.z + t.z, this
  1696. },
  1697. addScaledVector: function(e, t) {
  1698. return this.x += e.x * t, this.y += e.y * t, this.z += e.z * t, this
  1699. },
  1700. sub: function(e, t) {
  1701. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (this.x -= e.x, this.y -= e.y, this.z -= e.z, this)
  1702. },
  1703. subScalar: function(e) {
  1704. return this.x -= e, this.y -= e, this.z -= e, this
  1705. },
  1706. subVectors: function(e, t) {
  1707. return this.x = e.x - t.x, this.y = e.y - t.y, this.z = e.z - t.z, this
  1708. },
  1709. multiply: function(e, t) {
  1710. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."), this.multiplyVectors(e, t)) : (this.x *= e.x, this.y *= e.y, this.z *= e.z, this)
  1711. },
  1712. multiplyScalar: function(e) {
  1713. return this.x *= e, this.y *= e, this.z *= e, this
  1714. },
  1715. multiplyVectors: function(e, t) {
  1716. return this.x = e.x * t.x, this.y = e.y * t.y, this.z = e.z * t.z, this
  1717. },
  1718. applyEuler: (o = new Vt, function(e) {
  1719. return e && e.isEuler || console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."), this.applyQuaternion(o.setFromEuler(e))
  1720. }),
  1721. applyAxisAngle: function() {
  1722. var e = new Vt;
  1723. return function(t, n) {
  1724. return this.applyQuaternion(e.setFromAxisAngle(t, n))
  1725. }
  1726. }(),
  1727. applyMatrix3: function(e) {
  1728. var t = this.x,
  1729. n = this.y,
  1730. r = this.z,
  1731. i = e.elements;
  1732. return this.x = i[0] * t + i[3] * n + i[6] * r, this.y = i[1] * t + i[4] * n + i[7] * r, this.z = i[2] * t + i[5] * n + i[8] * r, this
  1733. },
  1734. applyMatrix4: function(e) {
  1735. var t = this.x,
  1736. n = this.y,
  1737. r = this.z,
  1738. i = e.elements,
  1739. o = 1 / (i[3] * t + i[7] * n + i[11] * r + i[15]);
  1740. return this.x = (i[0] * t + i[4] * n + i[8] * r + i[12]) * o, this.y = (i[1] * t + i[5] * n + i[9] * r + i[13]) * o, this.z = (i[2] * t + i[6] * n + i[10] * r + i[14]) * o, this
  1741. },
  1742. applyQuaternion: function(e) {
  1743. var t = this.x,
  1744. n = this.y,
  1745. r = this.z,
  1746. i = e.x,
  1747. o = e.y,
  1748. a = e.z,
  1749. s = e.w,
  1750. c = s * t + o * r - a * n,
  1751. l = s * n + a * t - i * r,
  1752. u = s * r + i * n - o * t,
  1753. h = -i * t - o * n - a * r;
  1754. return this.x = c * s + h * -i + l * -a - u * -o, this.y = l * s + h * -o + u * -i - c * -a, this.z = u * s + h * -a + c * -o - l * -i, this
  1755. },
  1756. project: function(e) {
  1757. return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)
  1758. },
  1759. unproject: function(e) {
  1760. return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)
  1761. },
  1762. transformDirection: function(e) {
  1763. var t = this.x,
  1764. n = this.y,
  1765. r = this.z,
  1766. i = e.elements;
  1767. return this.x = i[0] * t + i[4] * n + i[8] * r, this.y = i[1] * t + i[5] * n + i[9] * r, this.z = i[2] * t + i[6] * n + i[10] * r, this.normalize()
  1768. },
  1769. divide: function(e) {
  1770. return this.x /= e.x, this.y /= e.y, this.z /= e.z, this
  1771. },
  1772. divideScalar: function(e) {
  1773. return this.multiplyScalar(1 / e)
  1774. },
  1775. min: function(e) {
  1776. return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this.z = Math.min(this.z, e.z), this
  1777. },
  1778. max: function(e) {
  1779. return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this.z = Math.max(this.z, e.z), this
  1780. },
  1781. clamp: function(e, t) {
  1782. return this.x = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this.z = Math.max(e.z, Math.min(t.z, this.z)), this
  1783. },
  1784. clampScalar: function(e, t) {
  1785. return this.x = Math.max(e, Math.min(t, this.x)), this.y = Math.max(e, Math.min(t, this.y)), this.z = Math.max(e, Math.min(t, this.z)), this
  1786. },
  1787. clampLength: function(e, t) {
  1788. var n = this.length();
  1789. return this.divideScalar(n || 1).multiplyScalar(Math.max(e, Math.min(t, n)))
  1790. },
  1791. floor: function() {
  1792. return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this
  1793. },
  1794. ceil: function() {
  1795. return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this
  1796. },
  1797. round: function() {
  1798. return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this
  1799. },
  1800. roundToZero: function() {
  1801. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z), this
  1802. },
  1803. negate: function() {
  1804. return this.x = -this.x, this.y = -this.y, this.z = -this.z, this
  1805. },
  1806. dot: function(e) {
  1807. return this.x * e.x + this.y * e.y + this.z * e.z
  1808. },
  1809. lengthSq: function() {
  1810. return this.x * this.x + this.y * this.y + this.z * this.z
  1811. },
  1812. length: function() {
  1813. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  1814. },
  1815. manhattanLength: function() {
  1816. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  1817. },
  1818. normalize: function() {
  1819. return this.divideScalar(this.length() || 1)
  1820. },
  1821. setLength: function(e) {
  1822. return this.normalize().multiplyScalar(e)
  1823. },
  1824. lerp: function(e, t) {
  1825. return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this.z += (e.z - this.z) * t, this
  1826. },
  1827. lerpVectors: function(e, t, n) {
  1828. return this.subVectors(t, e).multiplyScalar(n).add(e)
  1829. },
  1830. cross: function(e, t) {
  1831. return void 0 !== t ? (console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."), this.crossVectors(e, t)) : this.crossVectors(this, e)
  1832. },
  1833. crossVectors: function(e, t) {
  1834. var n = e.x,
  1835. r = e.y,
  1836. i = e.z,
  1837. o = t.x,
  1838. a = t.y,
  1839. s = t.z;
  1840. return this.x = r * s - i * a, this.y = i * o - n * s, this.z = n * a - r * o, this
  1841. },
  1842. projectOnVector: function(e) {
  1843. var t = e.dot(this) / e.lengthSq();
  1844. return this.copy(e).multiplyScalar(t)
  1845. },
  1846. projectOnPlane: (i = new Wt, function(e) {
  1847. return i.copy(this).projectOnVector(e), this.sub(i)
  1848. }),
  1849. reflect: function() {
  1850. var e = new Wt;
  1851. return function(t) {
  1852. return this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  1853. }
  1854. }(),
  1855. angleTo: function(e) {
  1856. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  1857. return Math.acos(Gt.clamp(t, -1, 1))
  1858. },
  1859. distanceTo: function(e) {
  1860. return Math.sqrt(this.distanceToSquared(e))
  1861. },
  1862. distanceToSquared: function(e) {
  1863. var t = this.x - e.x,
  1864. n = this.y - e.y,
  1865. r = this.z - e.z;
  1866. return t * t + n * n + r * r
  1867. },
  1868. manhattanDistanceTo: function(e) {
  1869. return Math.abs(this.x - e.x) + Math.abs(this.y - e.y) + Math.abs(this.z - e.z)
  1870. },
  1871. setFromSpherical: function(e) {
  1872. return this.setFromSphericalCoords(e.radius, e.phi, e.theta)
  1873. },
  1874. setFromSphericalCoords: function(e, t, n) {
  1875. var r = Math.sin(t) * e;
  1876. return this.x = r * Math.sin(n), this.y = Math.cos(t) * e, this.z = r * Math.cos(n), this
  1877. },
  1878. setFromCylindrical: function(e) {
  1879. return this.setFromCylindricalCoords(e.radius, e.theta, e.y)
  1880. },
  1881. setFromCylindricalCoords: function(e, t, n) {
  1882. return this.x = e * Math.sin(t), this.y = n, this.z = e * Math.cos(t), this
  1883. },
  1884. setFromMatrixPosition: function(e) {
  1885. var t = e.elements;
  1886. return this.x = t[12], this.y = t[13], this.z = t[14], this
  1887. },
  1888. setFromMatrixScale: function(e) {
  1889. var t = this.setFromMatrixColumn(e, 0).length(),
  1890. n = this.setFromMatrixColumn(e, 1).length(),
  1891. r = this.setFromMatrixColumn(e, 2).length();
  1892. return this.x = t, this.y = n, this.z = r, this
  1893. },
  1894. setFromMatrixColumn: function(e, t) {
  1895. return this.fromArray(e.elements, 4 * t)
  1896. },
  1897. equals: function(e) {
  1898. return e.x === this.x && e.y === this.y && e.z === this.z
  1899. },
  1900. fromArray: function(e, t) {
  1901. return void 0 === t && (t = 0), this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this
  1902. },
  1903. toArray: function(e, t) {
  1904. return void 0 === e && (e = []), void 0 === t && (t = 0), e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e
  1905. },
  1906. fromBufferAttribute: function(e, t, n) {
  1907. return void 0 !== n && console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(t), this.y = e.getY(t), this.z = e.getZ(t), this
  1908. }
  1909. }), Object.assign(qt.prototype, {
  1910. isMatrix3: !0,
  1911. set: function(e, t, n, r, i, o, a, s, c) {
  1912. var l = this.elements;
  1913. return l[0] = e, l[1] = r, l[2] = a, l[3] = t, l[4] = i, l[5] = s, l[6] = n, l[7] = o, l[8] = c, this
  1914. },
  1915. identity: function() {
  1916. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this
  1917. },
  1918. clone: function() {
  1919. return (new this.constructor).fromArray(this.elements)
  1920. },
  1921. copy: function(e) {
  1922. var t = this.elements,
  1923. n = e.elements;
  1924. return t[0] = n[0], t[1] = n[1], t[2] = n[2], t[3] = n[3], t[4] = n[4], t[5] = n[5], t[6] = n[6], t[7] = n[7], t[8] = n[8], this
  1925. },
  1926. setFromMatrix4: function(e) {
  1927. var t = e.elements;
  1928. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]), this
  1929. },
  1930. applyToBufferAttribute: function() {
  1931. var e = new Wt;
  1932. return function(t) {
  1933. for (var n = 0, r = t.count; n < r; n++) e.x = t.getX(n), e.y = t.getY(n), e.z = t.getZ(n), e.applyMatrix3(this), t.setXYZ(n, e.x, e.y, e.z);
  1934. return t
  1935. }
  1936. }(),
  1937. multiply: function(e) {
  1938. return this.multiplyMatrices(this, e)
  1939. },
  1940. premultiply: function(e) {
  1941. return this.multiplyMatrices(e, this)
  1942. },
  1943. multiplyMatrices: function(e, t) {
  1944. var n = e.elements,
  1945. r = t.elements,
  1946. i = this.elements,
  1947. o = n[0],
  1948. a = n[3],
  1949. s = n[6],
  1950. c = n[1],
  1951. l = n[4],
  1952. u = n[7],
  1953. h = n[2],
  1954. d = n[5],
  1955. p = n[8],
  1956. f = r[0],
  1957. m = r[3],
  1958. v = r[6],
  1959. g = r[1],
  1960. y = r[4],
  1961. b = r[7],
  1962. x = r[2],
  1963. w = r[5],
  1964. _ = r[8];
  1965. return i[0] = o * f + a * g + s * x, i[3] = o * m + a * y + s * w, i[6] = o * v + a * b + s * _, i[1] = c * f + l * g + u * x, i[4] = c * m + l * y + u * w, i[7] = c * v + l * b + u * _, i[2] = h * f + d * g + p * x, i[5] = h * m + d * y + p * w, i[8] = h * v + d * b + p * _, this
  1966. },
  1967. multiplyScalar: function(e) {
  1968. var t = this.elements;
  1969. return t[0] *= e, t[3] *= e, t[6] *= e, t[1] *= e, t[4] *= e, t[7] *= e, t[2] *= e, t[5] *= e, t[8] *= e, this
  1970. },
  1971. determinant: function() {
  1972. var e = this.elements,
  1973. t = e[0],
  1974. n = e[1],
  1975. r = e[2],
  1976. i = e[3],
  1977. o = e[4],
  1978. a = e[5],
  1979. s = e[6],
  1980. c = e[7],
  1981. l = e[8];
  1982. return t * o * l - t * a * c - n * i * l + n * a * s + r * i * c - r * o * s
  1983. },
  1984. getInverse: function(e, t) {
  1985. e && e.isMatrix4 && console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");
  1986. var n = e.elements,
  1987. r = this.elements,
  1988. i = n[0],
  1989. o = n[1],
  1990. a = n[2],
  1991. s = n[3],
  1992. c = n[4],
  1993. l = n[5],
  1994. u = n[6],
  1995. h = n[7],
  1996. d = n[8],
  1997. p = d * c - l * h,
  1998. f = l * u - d * s,
  1999. m = h * s - c * u,
  2000. v = i * p + o * f + a * m;
  2001. if (0 === v) {
  2002. var g = "THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";
  2003. if (!0 === t) throw new Error(g);
  2004. return console.warn(g), this.identity()
  2005. }
  2006. var y = 1 / v;
  2007. return r[0] = p * y, r[1] = (a * h - d * o) * y, r[2] = (l * o - a * c) * y, r[3] = f * y, r[4] = (d * i - a * u) * y, r[5] = (a * s - l * i) * y, r[6] = m * y, r[7] = (o * u - h * i) * y, r[8] = (c * i - o * s) * y, this
  2008. },
  2009. transpose: function() {
  2010. var e, t = this.elements;
  2011. return e = t[1], t[1] = t[3], t[3] = e, e = t[2], t[2] = t[6], t[6] = e, e = t[5], t[5] = t[7], t[7] = e, this
  2012. },
  2013. getNormalMatrix: function(e) {
  2014. return this.setFromMatrix4(e).getInverse(this).transpose()
  2015. },
  2016. transposeIntoArray: function(e) {
  2017. var t = this.elements;
  2018. return e[0] = t[0], e[1] = t[3], e[2] = t[6], e[3] = t[1], e[4] = t[4], e[5] = t[7], e[6] = t[2], e[7] = t[5], e[8] = t[8], this
  2019. },
  2020. setUvTransform: function(e, t, n, r, i, o, a) {
  2021. var s = Math.cos(i),
  2022. c = Math.sin(i);
  2023. this.set(n * s, n * c, -n * (s * o + c * a) + o + e, -r * c, r * s, -r * (-c * o + s * a) + a + t, 0, 0, 1)
  2024. },
  2025. scale: function(e, t) {
  2026. var n = this.elements;
  2027. return n[0] *= e, n[3] *= e, n[6] *= e, n[1] *= t, n[4] *= t, n[7] *= t, this
  2028. },
  2029. rotate: function(e) {
  2030. var t = Math.cos(e),
  2031. n = Math.sin(e),
  2032. r = this.elements,
  2033. i = r[0],
  2034. o = r[3],
  2035. a = r[6],
  2036. s = r[1],
  2037. c = r[4],
  2038. l = r[7];
  2039. return r[0] = t * i + n * s, r[3] = t * o + n * c, r[6] = t * a + n * l, r[1] = -n * i + t * s, r[4] = -n * o + t * c, r[7] = -n * a + t * l, this
  2040. },
  2041. translate: function(e, t) {
  2042. var n = this.elements;
  2043. return n[0] += e * n[2], n[3] += e * n[5], n[6] += e * n[8], n[1] += t * n[2], n[4] += t * n[5], n[7] += t * n[8], this
  2044. },
  2045. equals: function(e) {
  2046. for (var t = this.elements, n = e.elements, r = 0; r < 9; r++)
  2047. if (t[r] !== n[r]) return !1;
  2048. return !0
  2049. },
  2050. fromArray: function(e, t) {
  2051. void 0 === t && (t = 0);
  2052. for (var n = 0; n < 9; n++) this.elements[n] = e[n + t];
  2053. return this
  2054. },
  2055. toArray: function(e, t) {
  2056. void 0 === e && (e = []), void 0 === t && (t = 0);
  2057. var n = this.elements;
  2058. return e[t] = n[0], e[t + 1] = n[1], e[t + 2] = n[2], e[t + 3] = n[3], e[t + 4] = n[4], e[t + 5] = n[5], e[t + 6] = n[6], e[t + 7] = n[7], e[t + 8] = n[8], e
  2059. }
  2060. });
  2061. var Xt, Yt, Zt, Kt, Jt, $t, Qt, en, tn, nn, rn = {
  2062. getDataURL: function(e) {
  2063. var t;
  2064. if ("undefined" == typeof HTMLCanvasElement) return e.src;
  2065. if (e instanceof HTMLCanvasElement) t = e;
  2066. else {
  2067. void 0 === a && (a = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas")), a.width = e.width, a.height = e.height;
  2068. var n = a.getContext("2d");
  2069. e instanceof ImageData ? n.putImageData(e, 0, 0) : n.drawImage(e, 0, 0, e.width, e.height), t = a
  2070. }
  2071. return t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  2072. }
  2073. },
  2074. on = 0;
  2075.  
  2076. function an(e, t, n, r, i, o, a, s, c, l) {
  2077. Object.defineProperty(this, "id", {
  2078. value: on++
  2079. }), this.uuid = Gt.generateUUID(), this.name = "", this.image = void 0 !== e ? e : an.DEFAULT_IMAGE, this.mipmaps = [], this.mapping = void 0 !== t ? t : an.DEFAULT_MAPPING, this.wrapS = void 0 !== n ? n : xe, this.wrapT = void 0 !== r ? r : xe, this.magFilter = void 0 !== i ? i : Se, this.minFilter = void 0 !== o ? o : Le, this.anisotropy = void 0 !== c ? c : 1, this.format = void 0 !== a ? a : Ge, this.type = void 0 !== s ? s : Ae, this.offset = new Ht(0, 0), this.repeat = new Ht(1, 1), this.center = new Ht(0, 0), this.rotation = 0, this.matrixAutoUpdate = !0, this.matrix = new qt, this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.encoding = void 0 !== l ? l : Pt, this.version = 0, this.onUpdate = null
  2080. }
  2081.  
  2082. function sn(e, t, n, r) {
  2083. this.x = e || 0, this.y = t || 0, this.z = n || 0, this.w = void 0 !== r ? r : 1
  2084. }
  2085.  
  2086. function cn(e, t, n) {
  2087. this.width = e, this.height = t, this.scissor = new sn(0, 0, e, t), this.scissorTest = !1, this.viewport = new sn(0, 0, e, t), n = n || {}, this.texture = new an(void 0, void 0, n.wrapS, n.wrapT, n.magFilter, n.minFilter, n.format, n.type, n.anisotropy, n.encoding), this.texture.image = {}, this.texture.image.width = e, this.texture.image.height = t, this.texture.generateMipmaps = void 0 !== n.generateMipmaps && n.generateMipmaps, this.texture.minFilter = void 0 !== n.minFilter ? n.minFilter : Se, this.depthBuffer = void 0 === n.depthBuffer || n.depthBuffer, this.stencilBuffer = void 0 === n.stencilBuffer || n.stencilBuffer, this.depthTexture = void 0 !== n.depthTexture ? n.depthTexture : null
  2088. }
  2089.  
  2090. function ln(e, t, n) {
  2091. cn.call(this, e, t, n), this.samples = 4
  2092. }
  2093.  
  2094. function un() {
  2095. this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  2096. }
  2097.  
  2098. function hn(e, t, n, r) {
  2099. this._x = e || 0, this._y = t || 0, this._z = n || 0, this._order = r || hn.DefaultOrder
  2100. }
  2101.  
  2102. function dn() {
  2103. this.mask = 1
  2104. }
  2105. an.DEFAULT_IMAGE = void 0, an.DEFAULT_MAPPING = he, an.prototype = Object.assign(Object.create(r.prototype), {
  2106. constructor: an,
  2107. isTexture: !0,
  2108. updateMatrix: function() {
  2109. this.matrix.setUvTransform(this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y)
  2110. },
  2111. clone: function() {
  2112. return (new this.constructor).copy(this)
  2113. },
  2114. copy: function(e) {
  2115. return this.name = e.name, this.image = e.image, this.mipmaps = e.mipmaps.slice(0), this.mapping = e.mapping, this.wrapS = e.wrapS, this.wrapT = e.wrapT, this.magFilter = e.magFilter, this.minFilter = e.minFilter, this.anisotropy = e.anisotropy, this.format = e.format, this.type = e.type, this.offset.copy(e.offset), this.repeat.copy(e.repeat), this.center.copy(e.center), this.rotation = e.rotation, this.matrixAutoUpdate = e.matrixAutoUpdate, this.matrix.copy(e.matrix), this.generateMipmaps = e.generateMipmaps, this.premultiplyAlpha = e.premultiplyAlpha, this.flipY = e.flipY, this.unpackAlignment = e.unpackAlignment, this.encoding = e.encoding, this
  2116. },
  2117. toJSON: function(e) {
  2118. var t = void 0 === e || "string" == typeof e;
  2119. if (!t && void 0 !== e.textures[this.uuid]) return e.textures[this.uuid];
  2120. var n = {
  2121. metadata: {
  2122. version: 4.5,
  2123. type: "Texture",
  2124. generator: "Texture.toJSON"
  2125. },
  2126. uuid: this.uuid,
  2127. name: this.name,
  2128. mapping: this.mapping,
  2129. repeat: [this.repeat.x, this.repeat.y],
  2130. offset: [this.offset.x, this.offset.y],
  2131. center: [this.center.x, this.center.y],
  2132. rotation: this.rotation,
  2133. wrap: [this.wrapS, this.wrapT],
  2134. format: this.format,
  2135. type: this.type,
  2136. encoding: this.encoding,
  2137. minFilter: this.minFilter,
  2138. magFilter: this.magFilter,
  2139. anisotropy: this.anisotropy,
  2140. flipY: this.flipY,
  2141. premultiplyAlpha: this.premultiplyAlpha,
  2142. unpackAlignment: this.unpackAlignment
  2143. };
  2144. if (void 0 !== this.image) {
  2145. var r = this.image;
  2146. if (void 0 === r.uuid && (r.uuid = Gt.generateUUID()), !t && void 0 === e.images[r.uuid]) {
  2147. var i;
  2148. if (Array.isArray(r)) {
  2149. i = [];
  2150. for (var o = 0, a = r.length; o < a; o++) i.push(rn.getDataURL(r[o]))
  2151. } else i = rn.getDataURL(r);
  2152. e.images[r.uuid] = {
  2153. uuid: r.uuid,
  2154. url: i
  2155. }
  2156. }
  2157. n.image = r.uuid
  2158. }
  2159. return t || (e.textures[this.uuid] = n), n
  2160. },
  2161. dispose: function() {
  2162. this.dispatchEvent({
  2163. type: "dispose"
  2164. })
  2165. },
  2166. transformUv: function(e) {
  2167. if (this.mapping !== he) return e;
  2168. if (e.applyMatrix3(this.matrix), e.x < 0 || e.x > 1) switch (this.wrapS) {
  2169. case be:
  2170. e.x = e.x - Math.floor(e.x);
  2171. break;
  2172. case xe:
  2173. e.x = e.x < 0 ? 0 : 1;
  2174. break;
  2175. case we:
  2176. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  2177. }
  2178. if (e.y < 0 || e.y > 1) switch (this.wrapT) {
  2179. case be:
  2180. e.y = e.y - Math.floor(e.y);
  2181. break;
  2182. case xe:
  2183. e.y = e.y < 0 ? 0 : 1;
  2184. break;
  2185. case we:
  2186. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  2187. }
  2188. return this.flipY && (e.y = 1 - e.y), e
  2189. }
  2190. }), Object.defineProperty(an.prototype, "needsUpdate", {
  2191. set: function(e) {
  2192. !0 === e && this.version++
  2193. }
  2194. }), Object.defineProperties(sn.prototype, {
  2195. width: {
  2196. get: function() {
  2197. return this.z
  2198. },
  2199. set: function(e) {
  2200. this.z = e
  2201. }
  2202. },
  2203. height: {
  2204. get: function() {
  2205. return this.w
  2206. },
  2207. set: function(e) {
  2208. this.w = e
  2209. }
  2210. }
  2211. }), Object.assign(sn.prototype, {
  2212. isVector4: !0,
  2213. set: function(e, t, n, r) {
  2214. return this.x = e, this.y = t, this.z = n, this.w = r, this
  2215. },
  2216. setScalar: function(e) {
  2217. return this.x = e, this.y = e, this.z = e, this.w = e, this
  2218. },
  2219. setX: function(e) {
  2220. return this.x = e, this
  2221. },
  2222. setY: function(e) {
  2223. return this.y = e, this
  2224. },
  2225. setZ: function(e) {
  2226. return this.z = e, this
  2227. },
  2228. setW: function(e) {
  2229. return this.w = e, this
  2230. },
  2231. setComponent: function(e, t) {
  2232. switch (e) {
  2233. case 0:
  2234. this.x = t;
  2235. break;
  2236. case 1:
  2237. this.y = t;
  2238. break;
  2239. case 2:
  2240. this.z = t;
  2241. break;
  2242. case 3:
  2243. this.w = t;
  2244. break;
  2245. default:
  2246. throw new Error("index is out of range: " + e)
  2247. }
  2248. return this
  2249. },
  2250. getComponent: function(e) {
  2251. switch (e) {
  2252. case 0:
  2253. return this.x;
  2254. case 1:
  2255. return this.y;
  2256. case 2:
  2257. return this.z;
  2258. case 3:
  2259. return this.w;
  2260. default:
  2261. throw new Error("index is out of range: " + e)
  2262. }
  2263. },
  2264. clone: function() {
  2265. return new this.constructor(this.x, this.y, this.z, this.w)
  2266. },
  2267. copy: function(e) {
  2268. return this.x = e.x, this.y = e.y, this.z = e.z, this.w = void 0 !== e.w ? e.w : 1, this
  2269. },
  2270. add: function(e, t) {
  2271. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(e, t)) : (this.x += e.x, this.y += e.y, this.z += e.z, this.w += e.w, this)
  2272. },
  2273. addScalar: function(e) {
  2274. return this.x += e, this.y += e, this.z += e, this.w += e, this
  2275. },
  2276. addVectors: function(e, t) {
  2277. return this.x = e.x + t.x, this.y = e.y + t.y, this.z = e.z + t.z, this.w = e.w + t.w, this
  2278. },
  2279. addScaledVector: function(e, t) {
  2280. return this.x += e.x * t, this.y += e.y * t, this.z += e.z * t, this.w += e.w * t, this
  2281. },
  2282. sub: function(e, t) {
  2283. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(e, t)) : (this.x -= e.x, this.y -= e.y, this.z -= e.z, this.w -= e.w, this)
  2284. },
  2285. subScalar: function(e) {
  2286. return this.x -= e, this.y -= e, this.z -= e, this.w -= e, this
  2287. },
  2288. subVectors: function(e, t) {
  2289. return this.x = e.x - t.x, this.y = e.y - t.y, this.z = e.z - t.z, this.w = e.w - t.w, this
  2290. },
  2291. multiplyScalar: function(e) {
  2292. return this.x *= e, this.y *= e, this.z *= e, this.w *= e, this
  2293. },
  2294. applyMatrix4: function(e) {
  2295. var t = this.x,
  2296. n = this.y,
  2297. r = this.z,
  2298. i = this.w,
  2299. o = e.elements;
  2300. return this.x = o[0] * t + o[4] * n + o[8] * r + o[12] * i, this.y = o[1] * t + o[5] * n + o[9] * r + o[13] * i, this.z = o[2] * t + o[6] * n + o[10] * r + o[14] * i, this.w = o[3] * t + o[7] * n + o[11] * r + o[15] * i, this
  2301. },
  2302. divideScalar: function(e) {
  2303. return this.multiplyScalar(1 / e)
  2304. },
  2305. setAxisAngleFromQuaternion: function(e) {
  2306. this.w = 2 * Math.acos(e.w);
  2307. var t = Math.sqrt(1 - e.w * e.w);
  2308. return t < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = e.x / t, this.y = e.y / t, this.z = e.z / t), this
  2309. },
  2310. setAxisAngleFromRotationMatrix: function(e) {
  2311. var t, n, r, i, o = e.elements,
  2312. a = o[0],
  2313. s = o[4],
  2314. c = o[8],
  2315. l = o[1],
  2316. u = o[5],
  2317. h = o[9],
  2318. d = o[2],
  2319. p = o[6],
  2320. f = o[10];
  2321. if (Math.abs(s - l) < .01 && Math.abs(c - d) < .01 && Math.abs(h - p) < .01) {
  2322. if (Math.abs(s + l) < .1 && Math.abs(c + d) < .1 && Math.abs(h + p) < .1 && Math.abs(a + u + f - 3) < .1) return this.set(1, 0, 0, 0), this;
  2323. t = Math.PI;
  2324. var m = (a + 1) / 2,
  2325. v = (u + 1) / 2,
  2326. g = (f + 1) / 2,
  2327. y = (s + l) / 4,
  2328. b = (c + d) / 4,
  2329. x = (h + p) / 4;
  2330. return m > v && m > g ? m < .01 ? (n = 0, r = .707106781, i = .707106781) : (r = y / (n = Math.sqrt(m)), i = b / n) : v > g ? v < .01 ? (n = .707106781, r = 0, i = .707106781) : (n = y / (r = Math.sqrt(v)), i = x / r) : g < .01 ? (n = .707106781, r = .707106781, i = 0) : (n = b / (i = Math.sqrt(g)), r = x / i), this.set(n, r, i, t), this
  2331. }
  2332. var w = Math.sqrt((p - h) * (p - h) + (c - d) * (c - d) + (l - s) * (l - s));
  2333. return Math.abs(w) < .001 && (w = 1), this.x = (p - h) / w, this.y = (c - d) / w, this.z = (l - s) / w, this.w = Math.acos((a + u + f - 1) / 2), this
  2334. },
  2335. min: function(e) {
  2336. return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this.z = Math.min(this.z, e.z), this.w = Math.min(this.w, e.w), this
  2337. },
  2338. max: function(e) {
  2339. return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this.z = Math.max(this.z, e.z), this.w = Math.max(this.w, e.w), this
  2340. },
  2341. clamp: function(e, t) {
  2342. return this.x = Math.max(e.x, Math.min(t.x, this.x)), this.y = Math.max(e.y, Math.min(t.y, this.y)), this.z = Math.max(e.z, Math.min(t.z, this.z)), this.w = Math.max(e.w, Math.min(t.w, this.w)), this
  2343. },
  2344. clampScalar: function(e, t) {
  2345. return void 0 === Xt && (Xt = new sn, Yt = new sn), Xt.set(e, e, e, e), Yt.set(t, t, t, t), this.clamp(Xt, Yt)
  2346. },
  2347. clampLength: function(e, t) {
  2348. var n = this.length();
  2349. return this.divideScalar(n || 1).multiplyScalar(Math.max(e, Math.min(t, n)))
  2350. },
  2351. floor: function() {
  2352. return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this.w = Math.floor(this.w), this
  2353. },
  2354. ceil: function() {
  2355. return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this.w = Math.ceil(this.w), this
  2356. },
  2357. round: function() {
  2358. return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this.w = Math.round(this.w), this
  2359. },
  2360. roundToZero: function() {
  2361. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x), this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y), this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z), this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w), this
  2362. },
  2363. negate: function() {
  2364. return this.x = -this.x, this.y = -this.y, this.z = -this.z, this.w = -this.w, this
  2365. },
  2366. dot: function(e) {
  2367. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  2368. },
  2369. lengthSq: function() {
  2370. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  2371. },
  2372. length: function() {
  2373. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  2374. },
  2375. manhattanLength: function() {
  2376. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  2377. },
  2378. normalize: function() {
  2379. return this.divideScalar(this.length() || 1)
  2380. },
  2381. setLength: function(e) {
  2382. return this.normalize().multiplyScalar(e)
  2383. },
  2384. lerp: function(e, t) {
  2385. return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this.z += (e.z - this.z) * t, this.w += (e.w - this.w) * t, this
  2386. },
  2387. lerpVectors: function(e, t, n) {
  2388. return this.subVectors(t, e).multiplyScalar(n).add(e)
  2389. },
  2390. equals: function(e) {
  2391. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  2392. },
  2393. fromArray: function(e, t) {
  2394. return void 0 === t && (t = 0), this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this.w = e[t + 3], this
  2395. },
  2396. toArray: function(e, t) {
  2397. return void 0 === e && (e = []), void 0 === t && (t = 0), e[t] = this.x, e[t + 1] = this.y, e[t + 2] = this.z, e[t + 3] = this.w, e
  2398. },
  2399. fromBufferAttribute: function(e, t, n) {
  2400. return void 0 !== n && console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."), this.x = e.getX(t), this.y = e.getY(t), this.z = e.getZ(t), this.w = e.getW(t), this
  2401. }
  2402. }), cn.prototype = Object.assign(Object.create(r.prototype), {
  2403. constructor: cn,
  2404. isWebGLRenderTarget: !0,
  2405. setSize: function(e, t) {
  2406. this.width === e && this.height === t || (this.width = e, this.height = t, this.texture.image.width = e, this.texture.image.height = t, this.dispose()), this.viewport.set(0, 0, e, t), this.scissor.set(0, 0, e, t)
  2407. },
  2408. clone: function() {
  2409. return (new this.constructor).copy(this)
  2410. },
  2411. copy: function(e) {
  2412. return this.width = e.width, this.height = e.height, this.viewport.copy(e.viewport), this.texture = e.texture.clone(), this.depthBuffer = e.depthBuffer, this.stencilBuffer = e.stencilBuffer, this.depthTexture = e.depthTexture, this
  2413. },
  2414. dispose: function() {
  2415. this.dispatchEvent({
  2416. type: "dispose"
  2417. })
  2418. }
  2419. }), ln.prototype = Object.assign(Object.create(cn.prototype), {
  2420. constructor: ln,
  2421. isWebGLMultisampleRenderTarget: !0,
  2422. copy: function(e) {
  2423. return cn.prototype.copy.call(this, e), this.samples = e.samples, this
  2424. }
  2425. }), Object.assign(un.prototype, {
  2426. isMatrix4: !0,
  2427. set: function(e, t, n, r, i, o, a, s, c, l, u, h, d, p, f, m) {
  2428. var v = this.elements;
  2429. return v[0] = e, v[4] = t, v[8] = n, v[12] = r, v[1] = i, v[5] = o, v[9] = a, v[13] = s, v[2] = c, v[6] = l, v[10] = u, v[14] = h, v[3] = d, v[7] = p, v[11] = f, v[15] = m, this
  2430. },
  2431. identity: function() {
  2432. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  2433. },
  2434. clone: function() {
  2435. return (new un).fromArray(this.elements)
  2436. },
  2437. copy: function(e) {
  2438. var t = this.elements,
  2439. n = e.elements;
  2440. return t[0] = n[0], t[1] = n[1], t[2] = n[2], t[3] = n[3], t[4] = n[4], t[5] = n[5], t[6] = n[6], t[7] = n[7], t[8] = n[8], t[9] = n[9], t[10] = n[10], t[11] = n[11], t[12] = n[12], t[13] = n[13], t[14] = n[14], t[15] = n[15], this
  2441. },
  2442. copyPosition: function(e) {
  2443. var t = this.elements,
  2444. n = e.elements;
  2445. return t[12] = n[12], t[13] = n[13], t[14] = n[14], this
  2446. },
  2447. extractBasis: function(e, t, n) {
  2448. return e.setFromMatrixColumn(this, 0), t.setFromMatrixColumn(this, 1), n.setFromMatrixColumn(this, 2), this
  2449. },
  2450. makeBasis: function(e, t, n) {
  2451. return this.set(e.x, t.x, n.x, 0, e.y, t.y, n.y, 0, e.z, t.z, n.z, 0, 0, 0, 0, 1), this
  2452. },
  2453. extractRotation: function() {
  2454. var e = new Wt;
  2455. return function(t) {
  2456. var n = this.elements,
  2457. r = t.elements,
  2458. i = 1 / e.setFromMatrixColumn(t, 0).length(),
  2459. o = 1 / e.setFromMatrixColumn(t, 1).length(),
  2460. a = 1 / e.setFromMatrixColumn(t, 2).length();
  2461. return n[0] = r[0] * i, n[1] = r[1] * i, n[2] = r[2] * i, n[3] = 0, n[4] = r[4] * o, n[5] = r[5] * o, n[6] = r[6] * o, n[7] = 0, n[8] = r[8] * a, n[9] = r[9] * a, n[10] = r[10] * a, n[11] = 0, n[12] = 0, n[13] = 0, n[14] = 0, n[15] = 1, this
  2462. }
  2463. }(),
  2464. makeRotationFromEuler: function(e) {
  2465. e && e.isEuler || console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  2466. var t = this.elements,
  2467. n = e.x,
  2468. r = e.y,
  2469. i = e.z,
  2470. o = Math.cos(n),
  2471. a = Math.sin(n),
  2472. s = Math.cos(r),
  2473. c = Math.sin(r),
  2474. l = Math.cos(i),
  2475. u = Math.sin(i);
  2476. if ("XYZ" === e.order) {
  2477. var h = o * l,
  2478. d = o * u,
  2479. p = a * l,
  2480. f = a * u;
  2481. t[0] = s * l, t[4] = -s * u, t[8] = c, t[1] = d + p * c, t[5] = h - f * c, t[9] = -a * s, t[2] = f - h * c, t[6] = p + d * c, t[10] = o * s
  2482. } else if ("YXZ" === e.order) {
  2483. var m = s * l,
  2484. v = s * u,
  2485. g = c * l,
  2486. y = c * u;
  2487. t[0] = m + y * a, t[4] = g * a - v, t[8] = o * c, t[1] = o * u, t[5] = o * l, t[9] = -a, t[2] = v * a - g, t[6] = y + m * a, t[10] = o * s
  2488. } else if ("ZXY" === e.order) {
  2489. m = s * l, v = s * u, g = c * l, y = c * u;
  2490. t[0] = m - y * a, t[4] = -o * u, t[8] = g + v * a, t[1] = v + g * a, t[5] = o * l, t[9] = y - m * a, t[2] = -o * c, t[6] = a, t[10] = o * s
  2491. } else if ("ZYX" === e.order) {
  2492. h = o * l, d = o * u, p = a * l, f = a * u;
  2493. t[0] = s * l, t[4] = p * c - d, t[8] = h * c + f, t[1] = s * u, t[5] = f * c + h, t[9] = d * c - p, t[2] = -c, t[6] = a * s, t[10] = o * s
  2494. } else if ("YZX" === e.order) {
  2495. var b = o * s,
  2496. x = o * c,
  2497. w = a * s,
  2498. _ = a * c;
  2499. t[0] = s * l, t[4] = _ - b * u, t[8] = w * u + x, t[1] = u, t[5] = o * l, t[9] = -a * l, t[2] = -c * l, t[6] = x * u + w, t[10] = b - _ * u
  2500. } else if ("XZY" === e.order) {
  2501. b = o * s, x = o * c, w = a * s, _ = a * c;
  2502. t[0] = s * l, t[4] = -u, t[8] = c * l, t[1] = b * u + _, t[5] = o * l, t[9] = x * u - w, t[2] = w * u - x, t[6] = a * l, t[10] = _ * u + b
  2503. }
  2504. return t[3] = 0, t[7] = 0, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this
  2505. },
  2506. makeRotationFromQuaternion: (en = new Wt(0, 0, 0), tn = new Wt(1, 1, 1), function(e) {
  2507. return this.compose(en, e, tn)
  2508. }),
  2509. lookAt: (Jt = new Wt, $t = new Wt, Qt = new Wt, function(e, t, n) {
  2510. var r = this.elements;
  2511. return Qt.subVectors(e, t), 0 === Qt.lengthSq() && (Qt.z = 1), Qt.normalize(), Jt.crossVectors(n, Qt), 0 === Jt.lengthSq() && (1 === Math.abs(n.z) ? Qt.x += 1e-4 : Qt.z += 1e-4, Qt.normalize(), Jt.crossVectors(n, Qt)), Jt.normalize(), $t.crossVectors(Qt, Jt), r[0] = Jt.x, r[4] = $t.x, r[8] = Qt.x, r[1] = Jt.y, r[5] = $t.y, r[9] = Qt.y, r[2] = Jt.z, r[6] = $t.z, r[10] = Qt.z, this
  2512. }),
  2513. multiply: function(e, t) {
  2514. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."), this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  2515. },
  2516. premultiply: function(e) {
  2517. return this.multiplyMatrices(e, this)
  2518. },
  2519. multiplyMatrices: function(e, t) {
  2520. var n = e.elements,
  2521. r = t.elements,
  2522. i = this.elements,
  2523. o = n[0],
  2524. a = n[4],
  2525. s = n[8],
  2526. c = n[12],
  2527. l = n[1],
  2528. u = n[5],
  2529. h = n[9],
  2530. d = n[13],
  2531. p = n[2],
  2532. f = n[6],
  2533. m = n[10],
  2534. v = n[14],
  2535. g = n[3],
  2536. y = n[7],
  2537. b = n[11],
  2538. x = n[15],
  2539. w = r[0],
  2540. _ = r[4],
  2541. M = r[8],
  2542. E = r[12],
  2543. S = r[1],
  2544. T = r[5],
  2545. L = r[9],
  2546. A = r[13],
  2547. C = r[2],
  2548. P = r[6],
  2549. R = r[10],
  2550. O = r[14],
  2551. k = r[3],
  2552. I = r[7],
  2553. D = r[11],
  2554. j = r[15];
  2555. return i[0] = o * w + a * S + s * C + c * k, i[4] = o * _ + a * T + s * P + c * I, i[8] = o * M + a * L + s * R + c * D, i[12] = o * E + a * A + s * O + c * j, i[1] = l * w + u * S + h * C + d * k, i[5] = l * _ + u * T + h * P + d * I, i[9] = l * M + u * L + h * R + d * D, i[13] = l * E + u * A + h * O + d * j, i[2] = p * w + f * S + m * C + v * k, i[6] = p * _ + f * T + m * P + v * I, i[10] = p * M + f * L + m * R + v * D, i[14] = p * E + f * A + m * O + v * j, i[3] = g * w + y * S + b * C + x * k, i[7] = g * _ + y * T + b * P + x * I, i[11] = g * M + y * L + b * R + x * D, i[15] = g * E + y * A + b * O + x * j, this
  2556. },
  2557. multiplyScalar: function(e) {
  2558. var t = this.elements;
  2559. return t[0] *= e, t[4] *= e, t[8] *= e, t[12] *= e, t[1] *= e, t[5] *= e, t[9] *= e, t[13] *= e, t[2] *= e, t[6] *= e, t[10] *= e, t[14] *= e, t[3] *= e, t[7] *= e, t[11] *= e, t[15] *= e, this
  2560. },
  2561. applyToBufferAttribute: function() {
  2562. var e = new Wt;
  2563. return function(t) {
  2564. for (var n = 0, r = t.count; n < r; n++) e.x = t.getX(n), e.y = t.getY(n), e.z = t.getZ(n), e.applyMatrix4(this), t.setXYZ(n, e.x, e.y, e.z);
  2565. return t
  2566. }
  2567. }(),
  2568. determinant: function() {
  2569. var e = this.elements,
  2570. t = e[0],
  2571. n = e[4],
  2572. r = e[8],
  2573. i = e[12],
  2574. o = e[1],
  2575. a = e[5],
  2576. s = e[9],
  2577. c = e[13],
  2578. l = e[2],
  2579. u = e[6],
  2580. h = e[10],
  2581. d = e[14];
  2582. return e[3] * (+i * s * u - r * c * u - i * a * h + n * c * h + r * a * d - n * s * d) + e[7] * (+t * s * d - t * c * h + i * o * h - r * o * d + r * c * l - i * s * l) + e[11] * (+t * c * u - t * a * d - i * o * u + n * o * d + i * a * l - n * c * l) + e[15] * (-r * a * l - t * s * u + t * a * h + r * o * u - n * o * h + n * s * l)
  2583. },
  2584. transpose: function() {
  2585. var e, t = this.elements;
  2586. return e = t[1], t[1] = t[4], t[4] = e, e = t[2], t[2] = t[8], t[8] = e, e = t[6], t[6] = t[9], t[9] = e, e = t[3], t[3] = t[12], t[12] = e, e = t[7], t[7] = t[13], t[13] = e, e = t[11], t[11] = t[14], t[14] = e, this
  2587. },
  2588. setPosition: function(e, t, n) {
  2589. var r = this.elements;
  2590. return e.isVector3 ? (r[12] = e.x, r[13] = e.y, r[14] = e.z) : (r[12] = e, r[13] = t, r[14] = n), this
  2591. },
  2592. getInverse: function(e, t) {
  2593. var n = this.elements,
  2594. r = e.elements,
  2595. i = r[0],
  2596. o = r[1],
  2597. a = r[2],
  2598. s = r[3],
  2599. c = r[4],
  2600. l = r[5],
  2601. u = r[6],
  2602. h = r[7],
  2603. d = r[8],
  2604. p = r[9],
  2605. f = r[10],
  2606. m = r[11],
  2607. v = r[12],
  2608. g = r[13],
  2609. y = r[14],
  2610. b = r[15],
  2611. x = p * y * h - g * f * h + g * u * m - l * y * m - p * u * b + l * f * b,
  2612. w = v * f * h - d * y * h - v * u * m + c * y * m + d * u * b - c * f * b,
  2613. _ = d * g * h - v * p * h + v * l * m - c * g * m - d * l * b + c * p * b,
  2614. M = v * p * u - d * g * u - v * l * f + c * g * f + d * l * y - c * p * y,
  2615. E = i * x + o * w + a * _ + s * M;
  2616. if (0 === E) {
  2617. var S = "THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";
  2618. if (!0 === t) throw new Error(S);
  2619. return console.warn(S), this.identity()
  2620. }
  2621. var T = 1 / E;
  2622. return n[0] = x * T, n[1] = (g * f * s - p * y * s - g * a * m + o * y * m + p * a * b - o * f * b) * T, n[2] = (l * y * s - g * u * s + g * a * h - o * y * h - l * a * b + o * u * b) * T, n[3] = (p * u * s - l * f * s - p * a * h + o * f * h + l * a * m - o * u * m) * T, n[4] = w * T, n[5] = (d * y * s - v * f * s + v * a * m - i * y * m - d * a * b + i * f * b) * T, n[6] = (v * u * s - c * y * s - v * a * h + i * y * h + c * a * b - i * u * b) * T, n[7] = (c * f * s - d * u * s + d * a * h - i * f * h - c * a * m + i * u * m) * T, n[8] = _ * T, n[9] = (v * p * s - d * g * s - v * o * m + i * g * m + d * o * b - i * p * b) * T, n[10] = (c * g * s - v * l * s + v * o * h - i * g * h - c * o * b + i * l * b) * T, n[11] = (d * l * s - c * p * s - d * o * h + i * p * h + c * o * m - i * l * m) * T, n[12] = M * T, n[13] = (d * g * a - v * p * a + v * o * f - i * g * f - d * o * y + i * p * y) * T, n[14] = (v * l * a - c * g * a - v * o * u + i * g * u + c * o * y - i * l * y) * T, n[15] = (c * p * a - d * l * a + d * o * u - i * p * u - c * o * f + i * l * f) * T, this
  2623. },
  2624. scale: function(e) {
  2625. var t = this.elements,
  2626. n = e.x,
  2627. r = e.y,
  2628. i = e.z;
  2629. return t[0] *= n, t[4] *= r, t[8] *= i, t[1] *= n, t[5] *= r, t[9] *= i, t[2] *= n, t[6] *= r, t[10] *= i, t[3] *= n, t[7] *= r, t[11] *= i, this
  2630. },
  2631. getMaxScaleOnAxis: function() {
  2632. var e = this.elements,
  2633. t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2],
  2634. n = e[4] * e[4] + e[5] * e[5] + e[6] * e[6],
  2635. r = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  2636. return Math.sqrt(Math.max(t, n, r))
  2637. },
  2638. makeTranslation: function(e, t, n) {
  2639. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, n, 0, 0, 0, 1), this
  2640. },
  2641. makeRotationX: function(e) {
  2642. var t = Math.cos(e),
  2643. n = Math.sin(e);
  2644. return this.set(1, 0, 0, 0, 0, t, -n, 0, 0, n, t, 0, 0, 0, 0, 1), this
  2645. },
  2646. makeRotationY: function(e) {
  2647. var t = Math.cos(e),
  2648. n = Math.sin(e);
  2649. return this.set(t, 0, n, 0, 0, 1, 0, 0, -n, 0, t, 0, 0, 0, 0, 1), this
  2650. },
  2651. makeRotationZ: function(e) {
  2652. var t = Math.cos(e),
  2653. n = Math.sin(e);
  2654. return this.set(t, -n, 0, 0, n, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  2655. },
  2656. makeRotationAxis: function(e, t) {
  2657. var n = Math.cos(t),
  2658. r = Math.sin(t),
  2659. i = 1 - n,
  2660. o = e.x,
  2661. a = e.y,
  2662. s = e.z,
  2663. c = i * o,
  2664. l = i * a;
  2665. return this.set(c * o + n, c * a - r * s, c * s + r * a, 0, c * a + r * s, l * a + n, l * s - r * o, 0, c * s - r * a, l * s + r * o, i * s * s + n, 0, 0, 0, 0, 1), this
  2666. },
  2667. makeScale: function(e, t, n) {
  2668. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, n, 0, 0, 0, 0, 1), this
  2669. },
  2670. makeShear: function(e, t, n) {
  2671. return this.set(1, t, n, 0, e, 1, n, 0, e, t, 1, 0, 0, 0, 0, 1), this
  2672. },
  2673. compose: function(e, t, n) {
  2674. var r = this.elements,
  2675. i = t._x,
  2676. o = t._y,
  2677. a = t._z,
  2678. s = t._w,
  2679. c = i + i,
  2680. l = o + o,
  2681. u = a + a,
  2682. h = i * c,
  2683. d = i * l,
  2684. p = i * u,
  2685. f = o * l,
  2686. m = o * u,
  2687. v = a * u,
  2688. g = s * c,
  2689. y = s * l,
  2690. b = s * u,
  2691. x = n.x,
  2692. w = n.y,
  2693. _ = n.z;
  2694. return r[0] = (1 - (f + v)) * x, r[1] = (d + b) * x, r[2] = (p - y) * x, r[3] = 0, r[4] = (d - b) * w, r[5] = (1 - (h + v)) * w, r[6] = (m + g) * w, r[7] = 0, r[8] = (p + y) * _, r[9] = (m - g) * _, r[10] = (1 - (h + f)) * _, r[11] = 0, r[12] = e.x, r[13] = e.y, r[14] = e.z, r[15] = 1, this
  2695. },
  2696. decompose: (Zt = new Wt, Kt = new un, function(e, t, n) {
  2697. var r = this.elements,
  2698. i = Zt.set(r[0], r[1], r[2]).length(),
  2699. o = Zt.set(r[4], r[5], r[6]).length(),
  2700. a = Zt.set(r[8], r[9], r[10]).length();
  2701. this.determinant() < 0 && (i = -i), e.x = r[12], e.y = r[13], e.z = r[14], Kt.copy(this);
  2702. var s = 1 / i,
  2703. c = 1 / o,
  2704. l = 1 / a;
  2705. return Kt.elements[0] *= s, Kt.elements[1] *= s, Kt.elements[2] *= s, Kt.elements[4] *= c, Kt.elements[5] *= c, Kt.elements[6] *= c, Kt.elements[8] *= l, Kt.elements[9] *= l, Kt.elements[10] *= l, t.setFromRotationMatrix(Kt), n.x = i, n.y = o, n.z = a, this
  2706. }),
  2707. makePerspective: function(e, t, n, r, i, o) {
  2708. void 0 === o && console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");
  2709. var a = this.elements,
  2710. s = 2 * i / (t - e),
  2711. c = 2 * i / (n - r),
  2712. l = (t + e) / (t - e),
  2713. u = (n + r) / (n - r),
  2714. h = -(o + i) / (o - i),
  2715. d = -2 * o * i / (o - i);
  2716. return a[0] = s, a[4] = 0, a[8] = l, a[12] = 0, a[1] = 0, a[5] = c, a[9] = u, a[13] = 0, a[2] = 0, a[6] = 0, a[10] = h, a[14] = d, a[3] = 0, a[7] = 0, a[11] = -1, a[15] = 0, this
  2717. },
  2718. makeOrthographic: function(e, t, n, r, i, o) {
  2719. var a = this.elements,
  2720. s = 1 / (t - e),
  2721. c = 1 / (n - r),
  2722. l = 1 / (o - i),
  2723. u = (t + e) * s,
  2724. h = (n + r) * c,
  2725. d = (o + i) * l;
  2726. return a[0] = 2 * s, a[4] = 0, a[8] = 0, a[12] = -u, a[1] = 0, a[5] = 2 * c, a[9] = 0, a[13] = -h, a[2] = 0, a[6] = 0, a[10] = -2 * l, a[14] = -d, a[3] = 0, a[7] = 0, a[11] = 0, a[15] = 1, this
  2727. },
  2728. equals: function(e) {
  2729. for (var t = this.elements, n = e.elements, r = 0; r < 16; r++)
  2730. if (t[r] !== n[r]) return !1;
  2731. return !0
  2732. },
  2733. fromArray: function(e, t) {
  2734. void 0 === t && (t = 0);
  2735. for (var n = 0; n < 16; n++) this.elements[n] = e[n + t];
  2736. return this
  2737. },
  2738. toArray: function(e, t) {
  2739. void 0 === e && (e = []), void 0 === t && (t = 0);
  2740. var n = this.elements;
  2741. return e[t] = n[0], e[t + 1] = n[1], e[t + 2] = n[2], e[t + 3] = n[3], e[t + 4] = n[4], e[t + 5] = n[5], e[t + 6] = n[6], e[t + 7] = n[7], e[t + 8] = n[8], e[t + 9] = n[9], e[t + 10] = n[10], e[t + 11] = n[11], e[t + 12] = n[12], e[t + 13] = n[13], e[t + 14] = n[14], e[t + 15] = n[15], e
  2742. }
  2743. }), hn.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"], hn.DefaultOrder = "XYZ", Object.defineProperties(hn.prototype, {
  2744. x: {
  2745. get: function() {
  2746. return this._x
  2747. },
  2748. set: function(e) {
  2749. this._x = e, this._onChangeCallback()
  2750. }
  2751. },
  2752. y: {
  2753. get: function() {
  2754. return this._y
  2755. },
  2756. set: function(e) {
  2757. this._y = e, this._onChangeCallback()
  2758. }
  2759. },
  2760. z: {
  2761. get: function() {
  2762. return this._z
  2763. },
  2764. set: function(e) {
  2765. this._z = e, this._onChangeCallback()
  2766. }
  2767. },
  2768. order: {
  2769. get: function() {
  2770. return this._order
  2771. },
  2772. set: function(e) {
  2773. this._order = e, this._onChangeCallback()
  2774. }
  2775. }
  2776. }), Object.assign(hn.prototype, {
  2777. isEuler: !0,
  2778. set: function(e, t, n, r) {
  2779. return this._x = e, this._y = t, this._z = n, this._order = r || this._order, this._onChangeCallback(), this
  2780. },
  2781. clone: function() {
  2782. return new this.constructor(this._x, this._y, this._z, this._order)
  2783. },
  2784. copy: function(e) {
  2785. return this._x = e._x, this._y = e._y, this._z = e._z, this._order = e._order, this._onChangeCallback(), this
  2786. },
  2787. setFromRotationMatrix: function(e, t, n) {
  2788. var r = Gt.clamp,
  2789. i = e.elements,
  2790. o = i[0],
  2791. a = i[4],
  2792. s = i[8],
  2793. c = i[1],
  2794. l = i[5],
  2795. u = i[9],
  2796. h = i[2],
  2797. d = i[6],
  2798. p = i[10];
  2799. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(r(s, -1, 1)), Math.abs(s) < .99999 ? (this._x = Math.atan2(-u, p), this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, l), this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)), Math.abs(u) < .99999 ? (this._y = Math.atan2(s, p), this._z = Math.atan2(c, l)) : (this._y = Math.atan2(-h, o), this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(d, -1, 1)), Math.abs(d) < .99999 ? (this._y = Math.atan2(-h, p), this._z = Math.atan2(-a, l)) : (this._y = 0, this._z = Math.atan2(c, o))) : "ZYX" === t ? (this._y = Math.asin(-r(h, -1, 1)), Math.abs(h) < .99999 ? (this._x = Math.atan2(d, p), this._z = Math.atan2(c, o)) : (this._x = 0, this._z = Math.atan2(-a, l))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)), Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, l), this._y = Math.atan2(-h, o)) : (this._x = 0, this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-r(a, -1, 1)), Math.abs(a) < .99999 ? (this._x = Math.atan2(d, l), this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-u, p), this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t), this._order = t, !1 !== n && this._onChangeCallback(), this
  2800. },
  2801. setFromQuaternion: function() {
  2802. var e = new un;
  2803. return function(t, n, r) {
  2804. return e.makeRotationFromQuaternion(t), this.setFromRotationMatrix(e, n, r)
  2805. }
  2806. }(),
  2807. setFromVector3: function(e, t) {
  2808. return this.set(e.x, e.y, e.z, t || this._order)
  2809. },
  2810. reorder: (nn = new Vt, function(e) {
  2811. return nn.setFromEuler(this), this.setFromQuaternion(nn, e)
  2812. }),
  2813. equals: function(e) {
  2814. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  2815. },
  2816. fromArray: function(e) {
  2817. return this._x = e[0], this._y = e[1], this._z = e[2], void 0 !== e[3] && (this._order = e[3]), this._onChangeCallback(), this
  2818. },
  2819. toArray: function(e, t) {
  2820. return void 0 === e && (e = []), void 0 === t && (t = 0), e[t] = this._x, e[t + 1] = this._y, e[t + 2] = this._z, e[t + 3] = this._order, e
  2821. },
  2822. toVector3: function(e) {
  2823. return e ? e.set(this._x, this._y, this._z) : new Wt(this._x, this._y, this._z)
  2824. },
  2825. _onChange: function(e) {
  2826. return this._onChangeCallback = e, this
  2827. },
  2828. _onChangeCallback: function() {}
  2829. }), Object.assign(dn.prototype, {
  2830. set: function(e) {
  2831. this.mask = 1 << e | 0
  2832. },
  2833. enable: function(e) {
  2834. this.mask |= 1 << e | 0
  2835. },
  2836. toggle: function(e) {
  2837. this.mask ^= 1 << e | 0
  2838. },
  2839. disable: function(e) {
  2840. this.mask &= ~(1 << e | 0)
  2841. },
  2842. test: function(e) {
  2843. return 0 != (this.mask & e.mask)
  2844. }
  2845. });
  2846. var pn, fn, mn, vn, gn, yn, bn, xn, wn, _n, Mn, En, Sn, Tn, Ln, An, Cn, Pn, Rn, On, kn = 0;
  2847.  
  2848. function In() {
  2849. Object.defineProperty(this, "id", {
  2850. value: kn++
  2851. }), this.uuid = Gt.generateUUID(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = In.DefaultUp.clone();
  2852. var e = new Wt,
  2853. t = new hn,
  2854. n = new Vt,
  2855. r = new Wt(1, 1, 1);
  2856. t._onChange(function() {
  2857. n.setFromEuler(t, !1)
  2858. }), n._onChange(function() {
  2859. t.setFromQuaternion(n, void 0, !1)
  2860. }), Object.defineProperties(this, {
  2861. position: {
  2862. configurable: !0,
  2863. enumerable: !0,
  2864. value: e
  2865. },
  2866. rotation: {
  2867. configurable: !0,
  2868. enumerable: !0,
  2869. value: t
  2870. },
  2871. quaternion: {
  2872. configurable: !0,
  2873. enumerable: !0,
  2874. value: n
  2875. },
  2876. scale: {
  2877. configurable: !0,
  2878. enumerable: !0,
  2879. value: r
  2880. },
  2881. modelViewMatrix: {
  2882. value: new un
  2883. },
  2884. normalMatrix: {
  2885. value: new qt
  2886. }
  2887. }), this.matrix = new un, this.matrixWorld = new un, this.matrixAutoUpdate = In.DefaultMatrixAutoUpdate, this.matrixWorldNeedsUpdate = !1, this.layers = new dn, this.visible = !0, this.castShadow = !1, this.receiveShadow = !1, this.frustumCulled = !0, this.renderOrder = 0, this.userData = {}
  2888. }
  2889.  
  2890. function Dn() {
  2891. In.call(this), this.type = "Scene", this.background = null, this.fog = null, this.overrideMaterial = null, this.autoUpdate = !0, "undefined" != typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", {
  2892. detail: this
  2893. }))
  2894. }
  2895.  
  2896. function jn(e, t) {
  2897. this.min = void 0 !== e ? e : new Wt(1 / 0, 1 / 0, 1 / 0), this.max = void 0 !== t ? t : new Wt(-1 / 0, -1 / 0, -1 / 0)
  2898. }
  2899.  
  2900. function Nn(e, t) {
  2901. this.center = void 0 !== e ? e : new Wt, this.radius = void 0 !== t ? t : 0
  2902. }
  2903.  
  2904. function Bn(e, t) {
  2905. this.origin = void 0 !== e ? e : new Wt, this.direction = void 0 !== t ? t : new Wt
  2906. }
  2907.  
  2908. function zn(e, t, n) {
  2909. this.a = void 0 !== e ? e : new Wt, this.b = void 0 !== t ? t : new Wt, this.c = void 0 !== n ? n : new Wt
  2910. }
  2911. In.DefaultUp = new Wt(0, 1, 0), In.DefaultMatrixAutoUpdate = !0, In.prototype = Object.assign(Object.create(r.prototype), {
  2912. constructor: In,
  2913. isObject3D: !0,
  2914. onBeforeRender: function() {},
  2915. onAfterRender: function() {},
  2916. applyMatrix: function(e) {
  2917. this.matrixAutoUpdate && this.updateMatrix(), this.matrix.premultiply(e), this.matrix.decompose(this.position, this.quaternion, this.scale)
  2918. },
  2919. applyQuaternion: function(e) {
  2920. return this.quaternion.premultiply(e), this
  2921. },
  2922. setRotationFromAxisAngle: function(e, t) {
  2923. this.quaternion.setFromAxisAngle(e, t)
  2924. },
  2925. setRotationFromEuler: function(e) {
  2926. this.quaternion.setFromEuler(e, !0)
  2927. },
  2928. setRotationFromMatrix: function(e) {
  2929. this.quaternion.setFromRotationMatrix(e)
  2930. },
  2931. setRotationFromQuaternion: function(e) {
  2932. this.quaternion.copy(e)
  2933. },
  2934. rotateOnAxis: (gn = new Vt, function(e, t) {
  2935. return gn.setFromAxisAngle(e, t), this.quaternion.multiply(gn), this
  2936. }),
  2937. rotateOnWorldAxis: function() {
  2938. var e = new Vt;
  2939. return function(t, n) {
  2940. return e.setFromAxisAngle(t, n), this.quaternion.premultiply(e), this
  2941. }
  2942. }(),
  2943. rotateX: function() {
  2944. var e = new Wt(1, 0, 0);
  2945. return function(t) {
  2946. return this.rotateOnAxis(e, t)
  2947. }
  2948. }(),
  2949. rotateY: function() {
  2950. var e = new Wt(0, 1, 0);
  2951. return function(t) {
  2952. return this.rotateOnAxis(e, t)
  2953. }
  2954. }(),
  2955. rotateZ: function() {
  2956. var e = new Wt(0, 0, 1);
  2957. return function(t) {
  2958. return this.rotateOnAxis(e, t)
  2959. }
  2960. }(),
  2961. translateOnAxis: function() {
  2962. var e = new Wt;
  2963. return function(t, n) {
  2964. return e.copy(t).applyQuaternion(this.quaternion), this.position.add(e.multiplyScalar(n)), this
  2965. }
  2966. }(),
  2967. translateX: function() {
  2968. var e = new Wt(1, 0, 0);
  2969. return function(t) {
  2970. return this.translateOnAxis(e, t)
  2971. }
  2972. }(),
  2973. translateY: function() {
  2974. var e = new Wt(0, 1, 0);
  2975. return function(t) {
  2976. return this.translateOnAxis(e, t)
  2977. }
  2978. }(),
  2979. translateZ: function() {
  2980. var e = new Wt(0, 0, 1);
  2981. return function(t) {
  2982. return this.translateOnAxis(e, t)
  2983. }
  2984. }(),
  2985. localToWorld: function(e) {
  2986. return e.applyMatrix4(this.matrixWorld)
  2987. },
  2988. worldToLocal: (vn = new un, function(e) {
  2989. return e.applyMatrix4(vn.getInverse(this.matrixWorld))
  2990. }),
  2991. lookAt: function() {
  2992. var e = new Vt,
  2993. t = new un,
  2994. n = new Wt,
  2995. r = new Wt;
  2996. return function(i, o, a) {
  2997. i.isVector3 ? n.copy(i) : n.set(i, o, a);
  2998. var s = this.parent;
  2999. this.updateWorldMatrix(!0, !1), r.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? t.lookAt(r, n, this.up) : t.lookAt(n, r, this.up), this.quaternion.setFromRotationMatrix(t), s && (t.extractRotation(s.matrixWorld), e.setFromRotationMatrix(t), this.quaternion.premultiply(e.inverse()))
  3000. }
  3001. }(),
  3002. add: function(e) {
  3003. if (arguments.length > 1) {
  3004. for (var t = 0; t < arguments.length; t++) this.add(arguments[t]);
  3005. return this
  3006. }
  3007. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e), this) : (e && e.isObject3D ? (null !== e.parent && e.parent.remove(e), e.parent = this, this.children.push(e), e.dispatchEvent({
  3008. type: "added"
  3009. })) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e), this)
  3010. },
  3011. remove: function(e) {
  3012. if (arguments.length > 1) {
  3013. for (var t = 0; t < arguments.length; t++) this.remove(arguments[t]);
  3014. return this
  3015. }
  3016. var n = this.children.indexOf(e);
  3017. return -1 !== n && (e.parent = null, this.children.splice(n, 1), e.dispatchEvent({
  3018. type: "removed"
  3019. })), this
  3020. },
  3021. attach: (mn = new un, function(e) {
  3022. return this.updateWorldMatrix(!0, !1), mn.getInverse(this.matrixWorld), null !== e.parent && (e.parent.updateWorldMatrix(!0, !1), mn.multiply(e.parent.matrixWorld)), e.applyMatrix(mn), e.updateWorldMatrix(!1, !1), this.add(e), this
  3023. }),
  3024. getObjectById: function(e) {
  3025. return this.getObjectByProperty("id", e)
  3026. },
  3027. getObjectByName: function(e) {
  3028. return this.getObjectByProperty("name", e)
  3029. },
  3030. getObjectByProperty: function(e, t) {
  3031. if (this[e] === t) return this;
  3032. for (var n = 0, r = this.children.length; n < r; n++) {
  3033. var i = this.children[n].getObjectByProperty(e, t);
  3034. if (void 0 !== i) return i
  3035. }
  3036. },
  3037. getWorldPosition: function(e) {
  3038. return void 0 === e && (console.warn("THREE.Object3D: .getWorldPosition() target is now required"), e = new Wt), this.updateMatrixWorld(!0), e.setFromMatrixPosition(this.matrixWorld)
  3039. },
  3040. getWorldQuaternion: (pn = new Wt, fn = new Wt, function(e) {
  3041. return void 0 === e && (console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"), e = new Vt), this.updateMatrixWorld(!0), this.matrixWorld.decompose(pn, e, fn), e
  3042. }),
  3043. getWorldScale: function() {
  3044. var e = new Wt,
  3045. t = new Vt;
  3046. return function(n) {
  3047. return void 0 === n && (console.warn("THREE.Object3D: .getWorldScale() target is now required"), n = new Wt), this.updateMatrixWorld(!0), this.matrixWorld.decompose(e, t, n), n
  3048. }
  3049. }(),
  3050. getWorldDirection: function(e) {
  3051. void 0 === e && (console.warn("THREE.Object3D: .getWorldDirection() target is now required"), e = new Wt), this.updateMatrixWorld(!0);
  3052. var t = this.matrixWorld.elements;
  3053. return e.set(t[8], t[9], t[10]).normalize()
  3054. },
  3055. raycast: function() {},
  3056. traverse: function(e) {
  3057. e(this);
  3058. for (var t = this.children, n = 0, r = t.length; n < r; n++) t[n].traverse(e)
  3059. },
  3060. traverseVisible: function(e) {
  3061. if (!1 !== this.visible) {
  3062. e(this);
  3063. for (var t = this.children, n = 0, r = t.length; n < r; n++) t[n].traverseVisible(e)
  3064. }
  3065. },
  3066. traverseAncestors: function(e) {
  3067. var t = this.parent;
  3068. null !== t && (e(t), t.traverseAncestors(e))
  3069. },
  3070. updateMatrix: function() {
  3071. this.matrix.compose(this.position, this.quaternion, this.scale), this.matrixWorldNeedsUpdate = !0
  3072. },
  3073. updateMatrixWorld: function(e) {
  3074. this.matrixAutoUpdate && this.updateMatrix(), (this.matrixWorldNeedsUpdate || e) && (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), this.matrixWorldNeedsUpdate = !1, e = !0);
  3075. for (var t = this.children, n = 0, r = t.length; n < r; n++) t[n].updateMatrixWorld(e)
  3076. },
  3077. updateWorldMatrix: function(e, t) {
  3078. var n = this.parent;
  3079. if (!0 === e && null !== n && n.updateWorldMatrix(!0, !1), this.matrixAutoUpdate && this.updateMatrix(), null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), !0 === t)
  3080. for (var r = this.children, i = 0, o = r.length; i < o; i++) r[i].updateWorldMatrix(!1, !0)
  3081. },
  3082. toJSON: function(e) {
  3083. var t = void 0 === e || "string" == typeof e,
  3084. n = {};
  3085. t && (e = {
  3086. geometries: {},
  3087. materials: {},
  3088. textures: {},
  3089. images: {},
  3090. shapes: {}
  3091. }, n.metadata = {
  3092. version: 4.5,
  3093. type: "Object",
  3094. generator: "Object3D.toJSON"
  3095. });
  3096. var r = {};
  3097.  
  3098. function i(t, n) {
  3099. return void 0 === t[n.uuid] && (t[n.uuid] = n.toJSON(e)), n.uuid
  3100. }
  3101. if (r.uuid = this.uuid, r.type = this.type, "" !== this.name && (r.name = this.name), !0 === this.castShadow && (r.castShadow = !0), !0 === this.receiveShadow && (r.receiveShadow = !0), !1 === this.visible && (r.visible = !1), !1 === this.frustumCulled && (r.frustumCulled = !1), 0 !== this.renderOrder && (r.renderOrder = this.renderOrder), "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData), r.layers = this.layers.mask, r.matrix = this.matrix.toArray(), !1 === this.matrixAutoUpdate && (r.matrixAutoUpdate = !1), this.isMesh && this.drawMode !== Lt && (r.drawMode = this.drawMode), this.isMesh || this.isLine || this.isPoints) {
  3102. r.geometry = i(e.geometries, this.geometry);
  3103. var o = this.geometry.parameters;
  3104. if (void 0 !== o && void 0 !== o.shapes) {
  3105. var a = o.shapes;
  3106. if (Array.isArray(a))
  3107. for (var s = 0, c = a.length; s < c; s++) {
  3108. var l = a[s];
  3109. i(e.shapes, l)
  3110. } else i(e.shapes, a)
  3111. }
  3112. }
  3113. if (void 0 !== this.material)
  3114. if (Array.isArray(this.material)) {
  3115. var u = [];
  3116. for (s = 0, c = this.material.length; s < c; s++) u.push(i(e.materials, this.material[s]));
  3117. r.material = u
  3118. } else r.material = i(e.materials, this.material);
  3119. if (this.children.length > 0) {
  3120. r.children = [];
  3121. for (s = 0; s < this.children.length; s++) r.children.push(this.children[s].toJSON(e).object)
  3122. }
  3123. if (t) {
  3124. var h = m(e.geometries),
  3125. d = m(e.materials),
  3126. p = m(e.textures),
  3127. f = m(e.images);
  3128. a = m(e.shapes);
  3129. h.length > 0 && (n.geometries = h), d.length > 0 && (n.materials = d), p.length > 0 && (n.textures = p), f.length > 0 && (n.images = f), a.length > 0 && (n.shapes = a)
  3130. }
  3131. return n.object = r, n;
  3132.  
  3133. function m(e) {
  3134. var t = [];
  3135. for (var n in e) {
  3136. var r = e[n];
  3137. delete r.metadata, t.push(r)
  3138. }
  3139. return t
  3140. }
  3141. },
  3142. clone: function(e) {
  3143. return (new this.constructor).copy(this, e)
  3144. },
  3145. copy: function(e, t) {
  3146. if (void 0 === t && (t = !0), this.name = e.name, this.up.copy(e.up), this.position.copy(e.position), this.quaternion.copy(e.quaternion), this.scale.copy(e.scale), this.matrix.copy(e.matrix), this.matrixWorld.copy(e.matrixWorld), this.matrixAutoUpdate = e.matrixAutoUpdate, this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate, this.layers.mask = e.layers.mask, this.visible = e.visible, this.castShadow = e.castShadow, this.receiveShadow = e.receiveShadow, this.frustumCulled = e.frustumCulled, this.renderOrder = e.renderOrder, this.userData = JSON.parse(JSON.stringify(e.userData)), !0 === t)
  3147. for (var n = 0; n < e.children.length; n++) {
  3148. var r = e.children[n];
  3149. this.add(r.clone())
  3150. }
  3151. return this
  3152. }
  3153. }), Dn.prototype = Object.assign(Object.create(In.prototype), {
  3154. constructor: Dn,
  3155. isScene: !0,
  3156. copy: function(e, t) {
  3157. return In.prototype.copy.call(this, e, t), null !== e.background && (this.background = e.background.clone()), null !== e.fog && (this.fog = e.fog.clone()), null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()), this.autoUpdate = e.autoUpdate, this.matrixAutoUpdate = e.matrixAutoUpdate, this
  3158. },
  3159. toJSON: function(e) {
  3160. var t = In.prototype.toJSON.call(this, e);
  3161. return null !== this.background && (t.object.background = this.background.toJSON(e)), null !== this.fog && (t.object.fog = this.fog.toJSON()), t
  3162. },
  3163. dispose: function() {
  3164. this.dispatchEvent({
  3165. type: "dispose"
  3166. })
  3167. }
  3168. }), Object.assign(jn.prototype, {
  3169. isBox3: !0,
  3170. set: function(e, t) {
  3171. return this.min.copy(e), this.max.copy(t), this
  3172. },
  3173. setFromArray: function(e) {
  3174. for (var t = 1 / 0, n = 1 / 0, r = 1 / 0, i = -1 / 0, o = -1 / 0, a = -1 / 0, s = 0, c = e.length; s < c; s += 3) {
  3175. var l = e[s],
  3176. u = e[s + 1],
  3177. h = e[s + 2];
  3178. l < t && (t = l), u < n && (n = u), h < r && (r = h), l > i && (i = l), u > o && (o = u), h > a && (a = h)
  3179. }
  3180. return this.min.set(t, n, r), this.max.set(i, o, a), this
  3181. },
  3182. setFromBufferAttribute: function(e) {
  3183. for (var t = 1 / 0, n = 1 / 0, r = 1 / 0, i = -1 / 0, o = -1 / 0, a = -1 / 0, s = 0, c = e.count; s < c; s++) {
  3184. var l = e.getX(s),
  3185. u = e.getY(s),
  3186. h = e.getZ(s);
  3187. l < t && (t = l), u < n && (n = u), h < r && (r = h), l > i && (i = l), u > o && (o = u), h > a && (a = h)
  3188. }
  3189. return this.min.set(t, n, r), this.max.set(i, o, a), this
  3190. },
  3191. setFromPoints: function(e) {
  3192. this.makeEmpty();
  3193. for (var t = 0, n = e.length; t < n; t++) this.expandByPoint(e[t]);
  3194. return this
  3195. },
  3196. setFromCenterAndSize: function() {
  3197. var e = new Wt;
  3198. return function(t, n) {
  3199. var r = e.copy(n).multiplyScalar(.5);
  3200. return this.min.copy(t).sub(r), this.max.copy(t).add(r), this
  3201. }
  3202. }(),
  3203. setFromObject: function(e) {
  3204. return this.makeEmpty(), this.expandByObject(e)
  3205. },
  3206. clone: function() {
  3207. return (new this.constructor).copy(this)
  3208. },
  3209. copy: function(e) {
  3210. return this.min.copy(e.min), this.max.copy(e.max), this
  3211. },
  3212. makeEmpty: function() {
  3213. return this.min.x = this.min.y = this.min.z = 1 / 0, this.max.x = this.max.y = this.max.z = -1 / 0, this
  3214. },
  3215. isEmpty: function() {
  3216. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  3217. },
  3218. getCenter: function(e) {
  3219. return void 0 === e && (console.warn("THREE.Box3: .getCenter() target is now required"), e = new Wt), this.isEmpty() ? e.set(0, 0, 0) : e.addVectors(this.min, this.max).multiplyScalar(.5)
  3220. },
  3221. getSize: function(e) {
  3222. return void 0 === e && (console.warn("THREE.Box3: .getSize() target is now required"), e = new Wt), this.isEmpty() ? e.set(0, 0, 0) : e.subVectors(this.max, this.min)
  3223. },
  3224. expandByPoint: function(e) {
  3225. return this.min.min(e), this.max.max(e), this
  3226. },
  3227. expandByVector: function(e) {
  3228. return this.min.sub(e), this.max.add(e), this
  3229. },
  3230. expandByScalar: function(e) {
  3231. return this.min.addScalar(-e), this.max.addScalar(e), this
  3232. },
  3233. expandByObject: function() {
  3234. var e, t, n, r = new Wt;
  3235.  
  3236. function i(i) {
  3237. var o = i.geometry;
  3238. if (void 0 !== o)
  3239. if (o.isGeometry) {
  3240. var a = o.vertices;
  3241. for (t = 0, n = a.length; t < n; t++) r.copy(a[t]), r.applyMatrix4(i.matrixWorld), e.expandByPoint(r)
  3242. } else if (o.isBufferGeometry) {
  3243. var s = o.attributes.position;
  3244. if (void 0 !== s)
  3245. for (t = 0, n = s.count; t < n; t++) r.fromBufferAttribute(s, t).applyMatrix4(i.matrixWorld), e.expandByPoint(r)
  3246. }
  3247. }
  3248. return function(t) {
  3249. return e = this, t.updateMatrixWorld(!0), t.traverse(i), this
  3250. }
  3251. }(),
  3252. containsPoint: function(e) {
  3253. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y || e.z < this.min.z || e.z > this.max.z)
  3254. },
  3255. containsBox: function(e) {
  3256. return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y && this.min.z <= e.min.z && e.max.z <= this.max.z
  3257. },
  3258. getParameter: function(e, t) {
  3259. return void 0 === t && (console.warn("THREE.Box3: .getParameter() target is now required"), t = new Wt), t.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z))
  3260. },
  3261. intersectsBox: function(e) {
  3262. return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y || e.max.z < this.min.z || e.min.z > this.max.z)
  3263. },
  3264. intersectsSphere: (bn = new Wt, function(e) {
  3265. return this.clampPoint(e.center, bn), bn.distanceToSquared(e.center) <= e.radius * e.radius
  3266. }),
  3267. intersectsPlane: function(e) {
  3268. var t, n;
  3269. return e.normal.x > 0 ? (t = e.normal.x * this.min.x, n = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x, n = e.normal.x * this.min.x), e.normal.y > 0 ? (t += e.normal.y * this.min.y, n += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y, n += e.normal.y * this.min.y), e.normal.z > 0 ? (t += e.normal.z * this.min.z, n += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z, n += e.normal.z * this.min.z), t <= -e.constant && n >= -e.constant
  3270. },
  3271. intersectsTriangle: function() {
  3272. var e = new Wt,
  3273. t = new Wt,
  3274. n = new Wt,
  3275. r = new Wt,
  3276. i = new Wt,
  3277. o = new Wt,
  3278. a = new Wt,
  3279. s = new Wt,
  3280. c = new Wt,
  3281. l = new Wt;
  3282.  
  3283. function u(r) {
  3284. var i, o;
  3285. for (i = 0, o = r.length - 3; i <= o; i += 3) {
  3286. a.fromArray(r, i);
  3287. var s = c.x * Math.abs(a.x) + c.y * Math.abs(a.y) + c.z * Math.abs(a.z),
  3288. l = e.dot(a),
  3289. u = t.dot(a),
  3290. h = n.dot(a);
  3291. if (Math.max(-Math.max(l, u, h), Math.min(l, u, h)) > s) return !1
  3292. }
  3293. return !0
  3294. }
  3295. return function(a) {
  3296. if (this.isEmpty()) return !1;
  3297. this.getCenter(s), c.subVectors(this.max, s), e.subVectors(a.a, s), t.subVectors(a.b, s), n.subVectors(a.c, s), r.subVectors(t, e), i.subVectors(n, t), o.subVectors(e, n);
  3298. var h = [0, -r.z, r.y, 0, -i.z, i.y, 0, -o.z, o.y, r.z, 0, -r.x, i.z, 0, -i.x, o.z, 0, -o.x, -r.y, r.x, 0, -i.y, i.x, 0, -o.y, o.x, 0];
  3299. return !!u(h) && (!!u(h = [1, 0, 0, 0, 1, 0, 0, 0, 1]) && (l.crossVectors(r, i), u(h = [l.x, l.y, l.z])))
  3300. }
  3301. }(),
  3302. clampPoint: function(e, t) {
  3303. return void 0 === t && (console.warn("THREE.Box3: .clampPoint() target is now required"), t = new Wt), t.copy(e).clamp(this.min, this.max)
  3304. },
  3305. distanceToPoint: function() {
  3306. var e = new Wt;
  3307. return function(t) {
  3308. return e.copy(t).clamp(this.min, this.max).sub(t).length()
  3309. }
  3310. }(),
  3311. getBoundingSphere: function() {
  3312. var e = new Wt;
  3313. return function(t) {
  3314. return void 0 === t && console.error("THREE.Box3: .getBoundingSphere() target is now required"), this.getCenter(t.center), t.radius = .5 * this.getSize(e).length(), t
  3315. }
  3316. }(),
  3317. intersect: function(e) {
  3318. return this.min.max(e.min), this.max.min(e.max), this.isEmpty() && this.makeEmpty(), this
  3319. },
  3320. union: function(e) {
  3321. return this.min.min(e.min), this.max.max(e.max), this
  3322. },
  3323. applyMatrix4: (yn = [new Wt, new Wt, new Wt, new Wt, new Wt, new Wt, new Wt, new Wt], function(e) {
  3324. return this.isEmpty() ? this : (yn[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), yn[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), yn[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), yn[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), yn[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), yn[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), yn[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), yn[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.setFromPoints(yn), this)
  3325. }),
  3326. translate: function(e) {
  3327. return this.min.add(e), this.max.add(e), this
  3328. },
  3329. equals: function(e) {
  3330. return e.min.equals(this.min) && e.max.equals(this.max)
  3331. }
  3332. }), Object.assign(Nn.prototype, {
  3333. set: function(e, t) {
  3334. return this.center.copy(e), this.radius = t, this
  3335. },
  3336. setFromPoints: (xn = new jn, function(e, t) {
  3337. var n = this.center;
  3338. void 0 !== t ? n.copy(t) : xn.setFromPoints(e).getCenter(n);
  3339. for (var r = 0, i = 0, o = e.length; i < o; i++) r = Math.max(r, n.distanceToSquared(e[i]));
  3340. return this.radius = Math.sqrt(r), this
  3341. }),
  3342. clone: function() {
  3343. return (new this.constructor).copy(this)
  3344. },
  3345. copy: function(e) {
  3346. return this.center.copy(e.center), this.radius = e.radius, this
  3347. },
  3348. empty: function() {
  3349. return this.radius <= 0
  3350. },
  3351. containsPoint: function(e) {
  3352. return e.distanceToSquared(this.center) <= this.radius * this.radius
  3353. },
  3354. distanceToPoint: function(e) {
  3355. return e.distanceTo(this.center) - this.radius
  3356. },
  3357. intersectsSphere: function(e) {
  3358. var t = this.radius + e.radius;
  3359. return e.center.distanceToSquared(this.center) <= t * t
  3360. },
  3361. intersectsBox: function(e) {
  3362. return e.intersectsSphere(this)
  3363. },
  3364. intersectsPlane: function(e) {
  3365. return Math.abs(e.distanceToPoint(this.center)) <= this.radius
  3366. },
  3367. clampPoint: function(e, t) {
  3368. var n = this.center.distanceToSquared(e);
  3369. return void 0 === t && (console.warn("THREE.Sphere: .clampPoint() target is now required"), t = new Wt), t.copy(e), n > this.radius * this.radius && (t.sub(this.center).normalize(), t.multiplyScalar(this.radius).add(this.center)), t
  3370. },
  3371. getBoundingBox: function(e) {
  3372. return void 0 === e && (console.warn("THREE.Sphere: .getBoundingBox() target is now required"), e = new jn), e.set(this.center, this.center), e.expandByScalar(this.radius), e
  3373. },
  3374. applyMatrix4: function(e) {
  3375. return this.center.applyMatrix4(e), this.radius = this.radius * e.getMaxScaleOnAxis(), this
  3376. },
  3377. translate: function(e) {
  3378. return this.center.add(e), this
  3379. },
  3380. equals: function(e) {
  3381. return e.center.equals(this.center) && e.radius === this.radius
  3382. }
  3383. }), Object.assign(Bn.prototype, {
  3384. set: function(e, t) {
  3385. return this.origin.copy(e), this.direction.copy(t), this
  3386. },
  3387. clone: function() {
  3388. return (new this.constructor).copy(this)
  3389. },
  3390. copy: function(e) {
  3391. return this.origin.copy(e.origin), this.direction.copy(e.direction), this
  3392. },
  3393. at: function(e, t) {
  3394. return void 0 === t && (console.warn("THREE.Ray: .at() target is now required"), t = new Wt), t.copy(this.direction).multiplyScalar(e).add(this.origin)
  3395. },
  3396. lookAt: function(e) {
  3397. return this.direction.copy(e).sub(this.origin).normalize(), this
  3398. },
  3399. recast: function() {
  3400. var e = new Wt;
  3401. return function(t) {
  3402. return this.origin.copy(this.at(t, e)), this
  3403. }
  3404. }(),
  3405. closestPointToPoint: function(e, t) {
  3406. void 0 === t && (console.warn("THREE.Ray: .closestPointToPoint() target is now required"), t = new Wt), t.subVectors(e, this.origin);
  3407. var n = t.dot(this.direction);
  3408. return n < 0 ? t.copy(this.origin) : t.copy(this.direction).multiplyScalar(n).add(this.origin)
  3409. },
  3410. distanceToPoint: function(e) {
  3411. return Math.sqrt(this.distanceSqToPoint(e))
  3412. },
  3413. distanceSqToPoint: function() {
  3414. var e = new Wt;
  3415. return function(t) {
  3416. var n = e.subVectors(t, this.origin).dot(this.direction);
  3417. return n < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(n).add(this.origin), e.distanceToSquared(t))
  3418. }
  3419. }(),
  3420. distanceSqToSegment: (_n = new Wt, Mn = new Wt, En = new Wt, function(e, t, n, r) {
  3421. _n.copy(e).add(t).multiplyScalar(.5), Mn.copy(t).sub(e).normalize(), En.copy(this.origin).sub(_n);
  3422. var i, o, a, s, c = .5 * e.distanceTo(t),
  3423. l = -this.direction.dot(Mn),
  3424. u = En.dot(this.direction),
  3425. h = -En.dot(Mn),
  3426. d = En.lengthSq(),
  3427. p = Math.abs(1 - l * l);
  3428. if (p > 0)
  3429. if (o = l * u - h, s = c * p, (i = l * h - u) >= 0)
  3430. if (o >= -s)
  3431. if (o <= s) {
  3432. var f = 1 / p;
  3433. a = (i *= f) * (i + l * (o *= f) + 2 * u) + o * (l * i + o + 2 * h) + d
  3434. } else o = c, a = -(i = Math.max(0, -(l * o + u))) * i + o * (o + 2 * h) + d;
  3435. else o = -c, a = -(i = Math.max(0, -(l * o + u))) * i + o * (o + 2 * h) + d;
  3436. else o <= -s ? a = -(i = Math.max(0, -(-l * c + u))) * i + (o = i > 0 ? -c : Math.min(Math.max(-c, -h), c)) * (o + 2 * h) + d : o <= s ? (i = 0, a = (o = Math.min(Math.max(-c, -h), c)) * (o + 2 * h) + d) : a = -(i = Math.max(0, -(l * c + u))) * i + (o = i > 0 ? c : Math.min(Math.max(-c, -h), c)) * (o + 2 * h) + d;
  3437. else o = l > 0 ? -c : c, a = -(i = Math.max(0, -(l * o + u))) * i + o * (o + 2 * h) + d;
  3438. return n && n.copy(this.direction).multiplyScalar(i).add(this.origin), r && r.copy(Mn).multiplyScalar(o).add(_n), a
  3439. }),
  3440. intersectSphere: function() {
  3441. var e = new Wt;
  3442. return function(t, n) {
  3443. e.subVectors(t.center, this.origin);
  3444. var r = e.dot(this.direction),
  3445. i = e.dot(e) - r * r,
  3446. o = t.radius * t.radius;
  3447. if (i > o) return null;
  3448. var a = Math.sqrt(o - i),
  3449. s = r - a,
  3450. c = r + a;
  3451. return s < 0 && c < 0 ? null : s < 0 ? this.at(c, n) : this.at(s, n)
  3452. }
  3453. }(),
  3454. intersectsSphere: function(e) {
  3455. return this.distanceSqToPoint(e.center) <= e.radius * e.radius
  3456. },
  3457. distanceToPlane: function(e) {
  3458. var t = e.normal.dot(this.direction);
  3459. if (0 === t) return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  3460. var n = -(this.origin.dot(e.normal) + e.constant) / t;
  3461. return n >= 0 ? n : null
  3462. },
  3463. intersectPlane: function(e, t) {
  3464. var n = this.distanceToPlane(e);
  3465. return null === n ? null : this.at(n, t)
  3466. },
  3467. intersectsPlane: function(e) {
  3468. var t = e.distanceToPoint(this.origin);
  3469. return 0 === t || e.normal.dot(this.direction) * t < 0
  3470. },
  3471. intersectBox: function(e, t) {
  3472. var n, r, i, o, a, s, c = 1 / this.direction.x,
  3473. l = 1 / this.direction.y,
  3474. u = 1 / this.direction.z,
  3475. h = this.origin;
  3476. return c >= 0 ? (n = (e.min.x - h.x) * c, r = (e.max.x - h.x) * c) : (n = (e.max.x - h.x) * c, r = (e.min.x - h.x) * c), l >= 0 ? (i = (e.min.y - h.y) * l, o = (e.max.y - h.y) * l) : (i = (e.max.y - h.y) * l, o = (e.min.y - h.y) * l), n > o || i > r ? null : ((i > n || n != n) && (n = i), (o < r || r != r) && (r = o), u >= 0 ? (a = (e.min.z - h.z) * u, s = (e.max.z - h.z) * u) : (a = (e.max.z - h.z) * u, s = (e.min.z - h.z) * u), n > s || a > r ? null : ((a > n || n != n) && (n = a), (s < r || r != r) && (r = s), r < 0 ? null : this.at(n >= 0 ? n : r, t)))
  3477. },
  3478. intersectsBox: (wn = new Wt, function(e) {
  3479. return null !== this.intersectBox(e, wn)
  3480. }),
  3481. intersectTriangle: function() {
  3482. var e = new Wt,
  3483. t = new Wt,
  3484. n = new Wt,
  3485. r = new Wt;
  3486. return function(i, o, a, s, c) {
  3487. t.subVectors(o, i), n.subVectors(a, i), r.crossVectors(t, n);
  3488. var l, u = this.direction.dot(r);
  3489. if (u > 0) {
  3490. if (s) return null;
  3491. l = 1
  3492. } else {
  3493. if (!(u < 0)) return null;
  3494. l = -1, u = -u
  3495. }
  3496. e.subVectors(this.origin, i);
  3497. var h = l * this.direction.dot(n.crossVectors(e, n));
  3498. if (h < 0) return null;
  3499. var d = l * this.direction.dot(t.cross(e));
  3500. if (d < 0) return null;
  3501. if (h + d > u) return null;
  3502. var p = -l * e.dot(r);
  3503. return p < 0 ? null : this.at(p / u, c)
  3504. }
  3505. }(),
  3506. applyMatrix4: function(e) {
  3507. return this.origin.applyMatrix4(e), this.direction.transformDirection(e), this
  3508. },
  3509. equals: function(e) {
  3510. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  3511. }
  3512. }), Object.assign(zn, {
  3513. getNormal: (Tn = new Wt, function(e, t, n, r) {
  3514. void 0 === r && (console.warn("THREE.Triangle: .getNormal() target is now required"), r = new Wt), r.subVectors(n, t), Tn.subVectors(e, t), r.cross(Tn);
  3515. var i = r.lengthSq();
  3516. return i > 0 ? r.multiplyScalar(1 / Math.sqrt(i)) : r.set(0, 0, 0)
  3517. }),
  3518. getBarycoord: function() {
  3519. var e = new Wt,
  3520. t = new Wt,
  3521. n = new Wt;
  3522. return function(r, i, o, a, s) {
  3523. e.subVectors(a, i), t.subVectors(o, i), n.subVectors(r, i);
  3524. var c = e.dot(e),
  3525. l = e.dot(t),
  3526. u = e.dot(n),
  3527. h = t.dot(t),
  3528. d = t.dot(n),
  3529. p = c * h - l * l;
  3530. if (void 0 === s && (console.warn("THREE.Triangle: .getBarycoord() target is now required"), s = new Wt), 0 === p) return s.set(-2, -1, -1);
  3531. var f = 1 / p,
  3532. m = (h * u - l * d) * f,
  3533. v = (c * d - l * u) * f;
  3534. return s.set(1 - m - v, v, m)
  3535. }
  3536. }(),
  3537. containsPoint: function() {
  3538. var e = new Wt;
  3539. return function(t, n, r, i) {
  3540. return zn.getBarycoord(t, n, r, i, e), e.x >= 0 && e.y >= 0 && e.x + e.y <= 1
  3541. }
  3542. }(),
  3543. getUV: (Sn = new Wt, function(e, t, n, r, i, o, a, s) {
  3544. return this.getBarycoord(e, t, n, r, Sn), s.set(0, 0), s.addScaledVector(i, Sn.x), s.addScaledVector(o, Sn.y), s.addScaledVector(a, Sn.z), s
  3545. }),
  3546. isFrontFacing: function() {
  3547. var e = new Wt,
  3548. t = new Wt;
  3549. return function(n, r, i, o) {
  3550. return e.subVectors(i, r), t.subVectors(n, r), e.cross(t).dot(o) < 0
  3551. }
  3552. }()
  3553. }), Object.assign(zn.prototype, {
  3554. set: function(e, t, n) {
  3555. return this.a.copy(e), this.b.copy(t), this.c.copy(n), this
  3556. },
  3557. setFromPointsAndIndices: function(e, t, n, r) {
  3558. return this.a.copy(e[t]), this.b.copy(e[n]), this.c.copy(e[r]), this
  3559. },
  3560. clone: function() {
  3561. return (new this.constructor).copy(this)
  3562. },
  3563. copy: function(e) {
  3564. return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this
  3565. },
  3566. getArea: function() {
  3567. var e = new Wt,
  3568. t = new Wt;
  3569. return function() {
  3570. return e.subVectors(this.c, this.b), t.subVectors(this.a, this.b), .5 * e.cross(t).length()
  3571. }
  3572. }(),
  3573. getMidpoint: function(e) {
  3574. return void 0 === e && (console.warn("THREE.Triangle: .getMidpoint() target is now required"), e = new Wt), e.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  3575. },
  3576. getNormal: function(e) {
  3577. return zn.getNormal(this.a, this.b, this.c, e)
  3578. },
  3579. getPlane: function(e) {
  3580. return void 0 === e && (console.warn("THREE.Triangle: .getPlane() target is now required"), e = new Wt), e.setFromCoplanarPoints(this.a, this.b, this.c)
  3581. },
  3582. getBarycoord: function(e, t) {
  3583. return zn.getBarycoord(e, this.a, this.b, this.c, t)
  3584. },
  3585. getUV: function(e, t, n, r, i) {
  3586. return zn.getUV(e, this.a, this.b, this.c, t, n, r, i)
  3587. },
  3588. containsPoint: function(e) {
  3589. return zn.containsPoint(e, this.a, this.b, this.c)
  3590. },
  3591. isFrontFacing: function(e) {
  3592. return zn.isFrontFacing(this.a, this.b, this.c, e)
  3593. },
  3594. intersectsBox: function(e) {
  3595. return e.intersectsTriangle(this)
  3596. },
  3597. closestPointToPoint: (Ln = new Wt, An = new Wt, Cn = new Wt, Pn = new Wt, Rn = new Wt, On = new Wt, function(e, t) {
  3598. void 0 === t && (console.warn("THREE.Triangle: .closestPointToPoint() target is now required"), t = new Wt);
  3599. var n, r, i = this.a,
  3600. o = this.b,
  3601. a = this.c;
  3602. Ln.subVectors(o, i), An.subVectors(a, i), Pn.subVectors(e, i);
  3603. var s = Ln.dot(Pn),
  3604. c = An.dot(Pn);
  3605. if (s <= 0 && c <= 0) return t.copy(i);
  3606. Rn.subVectors(e, o);
  3607. var l = Ln.dot(Rn),
  3608. u = An.dot(Rn);
  3609. if (l >= 0 && u <= l) return t.copy(o);
  3610. var h = s * u - l * c;
  3611. if (h <= 0 && s >= 0 && l <= 0) return n = s / (s - l), t.copy(i).addScaledVector(Ln, n);
  3612. On.subVectors(e, a);
  3613. var d = Ln.dot(On),
  3614. p = An.dot(On);
  3615. if (p >= 0 && d <= p) return t.copy(a);
  3616. var f = d * c - s * p;
  3617. if (f <= 0 && c >= 0 && p <= 0) return r = c / (c - p), t.copy(i).addScaledVector(An, r);
  3618. var m = l * p - d * u;
  3619. if (m <= 0 && u - l >= 0 && d - p >= 0) return Cn.subVectors(a, o), r = (u - l) / (u - l + (d - p)), t.copy(o).addScaledVector(Cn, r);
  3620. var v = 1 / (m + f + h);
  3621. return n = f * v, r = h * v, t.copy(i).addScaledVector(Ln, n).addScaledVector(An, r)
  3622. }),
  3623. equals: function(e) {
  3624. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  3625. }
  3626. });
  3627. var Un, Fn, Gn, Hn = {
  3628. aliceblue: 15792383,
  3629. antiquewhite: 16444375,
  3630. aqua: 65535,
  3631. aquamarine: 8388564,
  3632. azure: 15794175,
  3633. beige: 16119260,
  3634. bisque: 16770244,
  3635. black: 0,
  3636. blanchedalmond: 16772045,
  3637. blue: 255,
  3638. blueviolet: 9055202,
  3639. brown: 10824234,
  3640. burlywood: 14596231,
  3641. cadetblue: 6266528,
  3642. chartreuse: 8388352,
  3643. chocolate: 13789470,
  3644. coral: 16744272,
  3645. cornflowerblue: 6591981,
  3646. cornsilk: 16775388,
  3647. crimson: 14423100,
  3648. cyan: 65535,
  3649. darkblue: 139,
  3650. darkcyan: 35723,
  3651. darkgoldenrod: 12092939,
  3652. darkgray: 11119017,
  3653. darkgreen: 25600,
  3654. darkgrey: 11119017,
  3655. darkkhaki: 12433259,
  3656. darkmagenta: 9109643,
  3657. darkolivegreen: 5597999,
  3658. darkorange: 16747520,
  3659. darkorchid: 10040012,
  3660. darkred: 9109504,
  3661. darksalmon: 15308410,
  3662. darkseagreen: 9419919,
  3663. darkslateblue: 4734347,
  3664. darkslategray: 3100495,
  3665. darkslategrey: 3100495,
  3666. darkturquoise: 52945,
  3667. darkviolet: 9699539,
  3668. deeppink: 16716947,
  3669. deepskyblue: 49151,
  3670. dimgray: 6908265,
  3671. dimgrey: 6908265,
  3672. dodgerblue: 2003199,
  3673. firebrick: 11674146,
  3674. floralwhite: 16775920,
  3675. forestgreen: 2263842,
  3676. fuchsia: 16711935,
  3677. gainsboro: 14474460,
  3678. ghostwhite: 16316671,
  3679. gold: 16766720,
  3680. goldenrod: 14329120,
  3681. gray: 8421504,
  3682. green: 32768,
  3683. greenyellow: 11403055,
  3684. grey: 8421504,
  3685. honeydew: 15794160,
  3686. hotpink: 16738740,
  3687. indianred: 13458524,
  3688. indigo: 4915330,
  3689. ivory: 16777200,
  3690. khaki: 15787660,
  3691. lavender: 15132410,
  3692. lavenderblush: 16773365,
  3693. lawngreen: 8190976,
  3694. lemonchiffon: 16775885,
  3695. lightblue: 11393254,
  3696. lightcoral: 15761536,
  3697. lightcyan: 14745599,
  3698. lightgoldenrodyellow: 16448210,
  3699. lightgray: 13882323,
  3700. lightgreen: 9498256,
  3701. lightgrey: 13882323,
  3702. lightpink: 16758465,
  3703. lightsalmon: 16752762,
  3704. lightseagreen: 2142890,
  3705. lightskyblue: 8900346,
  3706. lightslategray: 7833753,
  3707. lightslategrey: 7833753,
  3708. lightsteelblue: 11584734,
  3709. lightyellow: 16777184,
  3710. lime: 65280,
  3711. limegreen: 3329330,
  3712. linen: 16445670,
  3713. magenta: 16711935,
  3714. maroon: 8388608,
  3715. mediumaquamarine: 6737322,
  3716. mediumblue: 205,
  3717. mediumorchid: 12211667,
  3718. mediumpurple: 9662683,
  3719. mediumseagreen: 3978097,
  3720. mediumslateblue: 8087790,
  3721. mediumspringgreen: 64154,
  3722. mediumturquoise: 4772300,
  3723. mediumvioletred: 13047173,
  3724. midnightblue: 1644912,
  3725. mintcream: 16121850,
  3726. mistyrose: 16770273,
  3727. moccasin: 16770229,
  3728. navajowhite: 16768685,
  3729. navy: 128,
  3730. oldlace: 16643558,
  3731. olive: 8421376,
  3732. olivedrab: 7048739,
  3733. orange: 16753920,
  3734. orangered: 16729344,
  3735. orchid: 14315734,
  3736. palegoldenrod: 15657130,
  3737. palegreen: 10025880,
  3738. paleturquoise: 11529966,
  3739. palevioletred: 14381203,
  3740. papayawhip: 16773077,
  3741. peachpuff: 16767673,
  3742. peru: 13468991,
  3743. pink: 16761035,
  3744. plum: 14524637,
  3745. powderblue: 11591910,
  3746. purple: 8388736,
  3747. rebeccapurple: 6697881,
  3748. red: 16711680,
  3749. rosybrown: 12357519,
  3750. royalblue: 4286945,
  3751. saddlebrown: 9127187,
  3752. salmon: 16416882,
  3753. sandybrown: 16032864,
  3754. seagreen: 3050327,
  3755. seashell: 16774638,
  3756. sienna: 10506797,
  3757. silver: 12632256,
  3758. skyblue: 8900331,
  3759. slateblue: 6970061,
  3760. slategray: 7372944,
  3761. slategrey: 7372944,
  3762. snow: 16775930,
  3763. springgreen: 65407,
  3764. steelblue: 4620980,
  3765. tan: 13808780,
  3766. teal: 32896,
  3767. thistle: 14204888,
  3768. tomato: 16737095,
  3769. turquoise: 4251856,
  3770. violet: 15631086,
  3771. wheat: 16113331,
  3772. white: 16777215,
  3773. whitesmoke: 16119285,
  3774. yellow: 16776960,
  3775. yellowgreen: 10145074
  3776. };
  3777.  
  3778. function Vn(e, t, n) {
  3779. return void 0 === t && void 0 === n ? this.set(e) : this.setRGB(e, t, n)
  3780. }
  3781.  
  3782. function Wn(e, t, n) {
  3783. return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + 6 * (t - e) * n : n < .5 ? t : n < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - n) : e
  3784. }
  3785.  
  3786. function qn(e) {
  3787. return e < .04045 ? .0773993808 * e : Math.pow(.9478672986 * e + .0521327014, 2.4)
  3788. }
  3789.  
  3790. function Xn(e) {
  3791. return e < .0031308 ? 12.92 * e : 1.055 * Math.pow(e, .41666) - .055
  3792. }
  3793.  
  3794. function Yn(e, t, n, r, i, o) {
  3795. this.a = e, this.b = t, this.c = n, this.normal = r && r.isVector3 ? r : new Wt, this.vertexNormals = Array.isArray(r) ? r : [], this.color = i && i.isColor ? i : new Vn, this.vertexColors = Array.isArray(i) ? i : [], this.materialIndex = void 0 !== o ? o : 0
  3796. }
  3797. Object.assign(Vn.prototype, {
  3798. isColor: !0,
  3799. r: 1,
  3800. g: 1,
  3801. b: 1,
  3802. set: function(e) {
  3803. return e && e.isColor ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e), this
  3804. },
  3805. setScalar: function(e) {
  3806. return this.r = e, this.g = e, this.b = e, this
  3807. },
  3808. setHex: function(e) {
  3809. return e = Math.floor(e), this.r = (e >> 16 & 255) / 255, this.g = (e >> 8 & 255) / 255, this.b = (255 & e) / 255, this
  3810. },
  3811. setRGB: function(e, t, n) {
  3812. return this.r = e, this.g = t, this.b = n, this
  3813. },
  3814. setHSL: function(e, t, n) {
  3815. if (e = Gt.euclideanModulo(e, 1), t = Gt.clamp(t, 0, 1), n = Gt.clamp(n, 0, 1), 0 === t) this.r = this.g = this.b = n;
  3816. else {
  3817. var r = n <= .5 ? n * (1 + t) : n + t - n * t,
  3818. i = 2 * n - r;
  3819. this.r = Wn(i, r, e + 1 / 3), this.g = Wn(i, r, e), this.b = Wn(i, r, e - 1 / 3)
  3820. }
  3821. return this
  3822. },
  3823. setStyle: function(e) {
  3824. function t(t) {
  3825. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  3826. }
  3827. var n;
  3828. if (n = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  3829. var r, i = n[1],
  3830. o = n[2];
  3831. switch (i) {
  3832. case "rgb":
  3833. case "rgba":
  3834. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) return this.r = Math.min(255, parseInt(r[1], 10)) / 255, this.g = Math.min(255, parseInt(r[2], 10)) / 255, this.b = Math.min(255, parseInt(r[3], 10)) / 255, t(r[5]), this;
  3835. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) return this.r = Math.min(100, parseInt(r[1], 10)) / 100, this.g = Math.min(100, parseInt(r[2], 10)) / 100, this.b = Math.min(100, parseInt(r[3], 10)) / 100, t(r[5]), this;
  3836. break;
  3837. case "hsl":
  3838. case "hsla":
  3839. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  3840. var a = parseFloat(r[1]) / 360,
  3841. s = parseInt(r[2], 10) / 100,
  3842. c = parseInt(r[3], 10) / 100;
  3843. return t(r[5]), this.setHSL(a, s, c)
  3844. }
  3845. }
  3846. } else if (n = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  3847. var l, u = (l = n[1]).length;
  3848. if (3 === u) return this.r = parseInt(l.charAt(0) + l.charAt(0), 16) / 255, this.g = parseInt(l.charAt(1) + l.charAt(1), 16) / 255, this.b = parseInt(l.charAt(2) + l.charAt(2), 16) / 255, this;
  3849. if (6 === u) return this.r = parseInt(l.charAt(0) + l.charAt(1), 16) / 255, this.g = parseInt(l.charAt(2) + l.charAt(3), 16) / 255, this.b = parseInt(l.charAt(4) + l.charAt(5), 16) / 255, this
  3850. }
  3851. e && e.length > 0 && (void 0 !== (l = Hn[e]) ? this.setHex(l) : console.warn("THREE.Color: Unknown color " + e));
  3852. return this
  3853. },
  3854. clone: function() {
  3855. return new this.constructor(this.r, this.g, this.b)
  3856. },
  3857. copy: function(e) {
  3858. return this.r = e.r, this.g = e.g, this.b = e.b, this
  3859. },
  3860. copyGammaToLinear: function(e, t) {
  3861. return void 0 === t && (t = 2), this.r = Math.pow(e.r, t), this.g = Math.pow(e.g, t), this.b = Math.pow(e.b, t), this
  3862. },
  3863. copyLinearToGamma: function(e, t) {
  3864. void 0 === t && (t = 2);
  3865. var n = t > 0 ? 1 / t : 1;
  3866. return this.r = Math.pow(e.r, n), this.g = Math.pow(e.g, n), this.b = Math.pow(e.b, n), this
  3867. },
  3868. convertGammaToLinear: function(e) {
  3869. return this.copyGammaToLinear(this, e), this
  3870. },
  3871. convertLinearToGamma: function(e) {
  3872. return this.copyLinearToGamma(this, e), this
  3873. },
  3874. copySRGBToLinear: function(e) {
  3875. return this.r = qn(e.r), this.g = qn(e.g), this.b = qn(e.b), this
  3876. },
  3877. copyLinearToSRGB: function(e) {
  3878. return this.r = Xn(e.r), this.g = Xn(e.g), this.b = Xn(e.b), this
  3879. },
  3880. convertSRGBToLinear: function() {
  3881. return this.copySRGBToLinear(this), this
  3882. },
  3883. convertLinearToSRGB: function() {
  3884. return this.copyLinearToSRGB(this), this
  3885. },
  3886. getHex: function() {
  3887. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  3888. },
  3889. getHexString: function() {
  3890. return ("000000" + this.getHex().toString(16)).slice(-6)
  3891. },
  3892. getHSL: function(e) {
  3893. void 0 === e && (console.warn("THREE.Color: .getHSL() target is now required"), e = {
  3894. h: 0,
  3895. s: 0,
  3896. l: 0
  3897. });
  3898. var t, n, r = this.r,
  3899. i = this.g,
  3900. o = this.b,
  3901. a = Math.max(r, i, o),
  3902. s = Math.min(r, i, o),
  3903. c = (s + a) / 2;
  3904. if (s === a) t = 0, n = 0;
  3905. else {
  3906. var l = a - s;
  3907. switch (n = c <= .5 ? l / (a + s) : l / (2 - a - s), a) {
  3908. case r:
  3909. t = (i - o) / l + (i < o ? 6 : 0);
  3910. break;
  3911. case i:
  3912. t = (o - r) / l + 2;
  3913. break;
  3914. case o:
  3915. t = (r - i) / l + 4
  3916. }
  3917. t /= 6
  3918. }
  3919. return e.h = t, e.s = n, e.l = c, e
  3920. },
  3921. getStyle: function() {
  3922. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  3923. },
  3924. offsetHSL: (Gn = {}, function(e, t, n) {
  3925. return this.getHSL(Gn), Gn.h += e, Gn.s += t, Gn.l += n, this.setHSL(Gn.h, Gn.s, Gn.l), this
  3926. }),
  3927. add: function(e) {
  3928. return this.r += e.r, this.g += e.g, this.b += e.b, this
  3929. },
  3930. addColors: function(e, t) {
  3931. return this.r = e.r + t.r, this.g = e.g + t.g, this.b = e.b + t.b, this
  3932. },
  3933. addScalar: function(e) {
  3934. return this.r += e, this.g += e, this.b += e, this
  3935. },
  3936. sub: function(e) {
  3937. return this.r = Math.max(0, this.r - e.r), this.g = Math.max(0, this.g - e.g), this.b = Math.max(0, this.b - e.b), this
  3938. },
  3939. multiply: function(e) {
  3940. return this.r *= e.r, this.g *= e.g, this.b *= e.b, this
  3941. },
  3942. multiplyScalar: function(e) {
  3943. return this.r *= e, this.g *= e, this.b *= e, this
  3944. },
  3945. lerp: function(e, t) {
  3946. return this.r += (e.r - this.r) * t, this.g += (e.g - this.g) * t, this.b += (e.b - this.b) * t, this
  3947. },
  3948. lerpHSL: (Un = {
  3949. h: 0,
  3950. s: 0,
  3951. l: 0
  3952. }, Fn = {
  3953. h: 0,
  3954. s: 0,
  3955. l: 0
  3956. }, function(e, t) {
  3957. this.getHSL(Un), e.getHSL(Fn);
  3958. var n = Gt.lerp(Un.h, Fn.h, t),
  3959. r = Gt.lerp(Un.s, Fn.s, t),
  3960. i = Gt.lerp(Un.l, Fn.l, t);
  3961. return this.setHSL(n, r, i), this
  3962. }),
  3963. equals: function(e) {
  3964. return e.r === this.r && e.g === this.g && e.b === this.b
  3965. },
  3966. fromArray: function(e, t) {
  3967. return void 0 === t && (t = 0), this.r = e[t], this.g = e[t + 1], this.b = e[t + 2], this
  3968. },
  3969. toArray: function(e, t) {
  3970. return void 0 === e && (e = []), void 0 === t && (t = 0), e[t] = this.r, e[t + 1] = this.g, e[t + 2] = this.b, e
  3971. },
  3972. toJSON: function() {
  3973. return this.getHex()
  3974. }
  3975. }), Object.assign(Yn.prototype, {
  3976. clone: function() {
  3977. return (new this.constructor).copy(this)
  3978. },
  3979. copy: function(e) {
  3980. this.a = e.a, this.b = e.b, this.c = e.c, this.normal.copy(e.normal), this.color.copy(e.color), this.materialIndex = e.materialIndex;
  3981. for (var t = 0, n = e.vertexNormals.length; t < n; t++) this.vertexNormals[t] = e.vertexNormals[t].clone();
  3982. for (t = 0, n = e.vertexColors.length; t < n; t++) this.vertexColors[t] = e.vertexColors[t].clone();
  3983. return this
  3984. }
  3985. });
  3986. var Zn = 0;
  3987.  
  3988. function Kn() {
  3989. Object.defineProperty(this, "id", {
  3990. value: Zn++
  3991. }), this.uuid = Gt.generateUUID(), this.name = "", this.type = "Material", this.fog = !0, this.lights = !0, this.blending = L, this.side = y, this.flatShading = !1, this.vertexTangents = !1, this.vertexColors = M, this.opacity = 1, this.transparent = !1, this.blendSrc = F, this.blendDst = G, this.blendEquation = O, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.depthFunc = J, this.depthTest = !0, this.depthWrite = !0, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaTest = 0, this.premultipliedAlpha = !1, this.visible = !0, this.userData = {}, this.needsUpdate = !0
  3992. }
  3993.  
  3994. function Jn(e) {
  3995. Kn.call(this), this.type = "MeshBasicMaterial", this.color = new Vn(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.combine = ne, this.reflectivity = 1, this.refractionRatio = .98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.skinning = !1, this.morphTargets = !1, this.lights = !1, this.setValues(e)
  3996. }
  3997.  
  3998. function $n(e, t, n) {
  3999. if (Array.isArray(e)) throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
  4000. this.name = "", this.array = e, this.itemSize = t, this.count = void 0 !== e ? e.length / t : 0, this.normalized = !0 === n, this.dynamic = !1, this.updateRange = {
  4001. offset: 0,
  4002. count: -1
  4003. }, this.version = 0
  4004. }
  4005.  
  4006. function Qn(e, t, n) {
  4007. $n.call(this, new Int8Array(e), t, n)
  4008. }
  4009.  
  4010. function er(e, t, n) {
  4011. $n.call(this, new Uint8Array(e), t, n)
  4012. }
  4013.  
  4014. function tr(e, t, n) {
  4015. $n.call(this, new Uint8ClampedArray(e), t, n)
  4016. }
  4017.  
  4018. function nr(e, t, n) {
  4019. $n.call(this, new Int16Array(e), t, n)
  4020. }
  4021.  
  4022. function rr(e, t, n) {
  4023. $n.call(this, new Uint16Array(e), t, n)
  4024. }
  4025.  
  4026. function ir(e, t, n) {
  4027. $n.call(this, new Int32Array(e), t, n)
  4028. }
  4029.  
  4030. function or(e, t, n) {
  4031. $n.call(this, new Uint32Array(e), t, n)
  4032. }
  4033.  
  4034. function ar(e, t, n) {
  4035. $n.call(this, new Float32Array(e), t, n)
  4036. }
  4037.  
  4038. function sr(e, t, n) {
  4039. $n.call(this, new Float64Array(e), t, n)
  4040. }
  4041.  
  4042. function cr() {
  4043. this.vertices = [], this.normals = [], this.colors = [], this.uvs = [], this.uvs2 = [], this.groups = [], this.morphTargets = {}, this.skinWeights = [], this.skinIndices = [], this.boundingBox = null, this.boundingSphere = null, this.verticesNeedUpdate = !1, this.normalsNeedUpdate = !1, this.colorsNeedUpdate = !1, this.uvsNeedUpdate = !1, this.groupsNeedUpdate = !1
  4044. }
  4045.  
  4046. function lr(e) {
  4047. if (0 === e.length) return -1 / 0;
  4048. for (var t = e[0], n = 1, r = e.length; n < r; ++n) e[n] > t && (t = e[n]);
  4049. return t
  4050. }
  4051. Kn.prototype = Object.assign(Object.create(r.prototype), {
  4052. constructor: Kn,
  4053. isMaterial: !0,
  4054. onBeforeCompile: function() {},
  4055. setValues: function(e) {
  4056. if (void 0 !== e)
  4057. for (var t in e) {
  4058. var n = e[t];
  4059. if (void 0 !== n)
  4060. if ("shading" !== t) {
  4061. var r = this[t];
  4062. void 0 !== r ? r && r.isColor ? r.set(n) : r && r.isVector3 && n && n.isVector3 ? r.copy(n) : this[t] = n : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  4063. } else console.warn("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead."), this.flatShading = n === w;
  4064. else console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  4065. }
  4066. },
  4067. toJSON: function(e) {
  4068. var t = void 0 === e || "string" == typeof e;
  4069. t && (e = {
  4070. textures: {},
  4071. images: {}
  4072. });
  4073. var n = {
  4074. metadata: {
  4075. version: 4.5,
  4076. type: "Material",
  4077. generator: "Material.toJSON"
  4078. }
  4079. };
  4080.  
  4081. function r(e) {
  4082. var t = [];
  4083. for (var n in e) {
  4084. var r = e[n];
  4085. delete r.metadata, t.push(r)
  4086. }
  4087. return t
  4088. }
  4089. if (n.uuid = this.uuid, n.type = this.type, "" !== this.name && (n.name = this.name), this.color && this.color.isColor && (n.color = this.color.getHex()), void 0 !== this.roughness && (n.roughness = this.roughness), void 0 !== this.metalness && (n.metalness = this.metalness), this.emissive && this.emissive.isColor && (n.emissive = this.emissive.getHex()), this.emissiveIntensity && 1 !== this.emissiveIntensity && (n.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (n.specular = this.specular.getHex()), void 0 !== this.shininess && (n.shininess = this.shininess), void 0 !== this.clearCoat && (n.clearCoat = this.clearCoat), void 0 !== this.clearCoatRoughness && (n.clearCoatRoughness = this.clearCoatRoughness), this.map && this.map.isTexture && (n.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (n.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (n.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (n.lightMap = this.lightMap.toJSON(e).uuid), this.aoMap && this.aoMap.isTexture && (n.aoMap = this.aoMap.toJSON(e).uuid, n.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (n.bumpMap = this.bumpMap.toJSON(e).uuid, n.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (n.normalMap = this.normalMap.toJSON(e).uuid, n.normalMapType = this.normalMapType, n.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (n.displacementMap = this.displacementMap.toJSON(e).uuid, n.displacementScale = this.displacementScale, n.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (n.specularMap = this.specularMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (n.envMap = this.envMap.toJSON(e).uuid, n.reflectivity = this.reflectivity, n.refractionRatio = this.refractionRatio, void 0 !== this.combine && (n.combine = this.combine), void 0 !== this.envMapIntensity && (n.envMapIntensity = this.envMapIntensity)), this.gradientMap && this.gradientMap.isTexture && (n.gradientMap = this.gradientMap.toJSON(e).uuid), void 0 !== this.size && (n.size = this.size), void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation), this.blending !== L && (n.blending = this.blending), !0 === this.flatShading && (n.flatShading = this.flatShading), this.side !== y && (n.side = this.side), this.vertexColors !== M && (n.vertexColors = this.vertexColors), this.opacity < 1 && (n.opacity = this.opacity), !0 === this.transparent && (n.transparent = this.transparent), n.depthFunc = this.depthFunc, n.depthTest = this.depthTest, n.depthWrite = this.depthWrite, this.rotation && 0 !== this.rotation && (n.rotation = this.rotation), !0 === this.polygonOffset && (n.polygonOffset = !0), 0 !== this.polygonOffsetFactor && (n.polygonOffsetFactor = this.polygonOffsetFactor), 0 !== this.polygonOffsetUnits && (n.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth && 1 !== this.linewidth && (n.linewidth = this.linewidth), void 0 !== this.dashSize && (n.dashSize = this.dashSize), void 0 !== this.gapSize && (n.gapSize = this.gapSize), void 0 !== this.scale && (n.scale = this.scale), !0 === this.dithering && (n.dithering = !0), this.alphaTest > 0 && (n.alphaTest = this.alphaTest), !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha), !0 === this.wireframe && (n.wireframe = this.wireframe), this.wireframeLinewidth > 1 && (n.wireframeLinewidth = this.wireframeLinewidth), "round" !== this.wireframeLinecap && (n.wireframeLinecap = this.wireframeLinecap), "round" !== this.wireframeLinejoin && (n.wireframeLinejoin = this.wireframeLinejoin), !0 === this.morphTargets && (n.morphTargets = !0), !0 === this.morphNormals && (n.morphNormals = !0), !0 === this.skinning && (n.skinning = !0), !1 === this.visible && (n.visible = !1), "{}" !== JSON.stringify(this.userData) && (n.userData = this.userData), t) {
  4090. var i = r(e.textures),
  4091. o = r(e.images);
  4092. i.length > 0 && (n.textures = i), o.length > 0 && (n.images = o)
  4093. }
  4094. return n
  4095. },
  4096. clone: function() {
  4097. return (new this.constructor).copy(this)
  4098. },
  4099. copy: function(e) {
  4100. this.name = e.name, this.fog = e.fog, this.lights = e.lights, this.blending = e.blending, this.side = e.side, this.flatShading = e.flatShading, this.vertexColors = e.vertexColors, this.opacity = e.opacity, this.transparent = e.transparent, this.blendSrc = e.blendSrc, this.blendDst = e.blendDst, this.blendEquation = e.blendEquation, this.blendSrcAlpha = e.blendSrcAlpha, this.blendDstAlpha = e.blendDstAlpha, this.blendEquationAlpha = e.blendEquationAlpha, this.depthFunc = e.depthFunc, this.depthTest = e.depthTest, this.depthWrite = e.depthWrite, this.colorWrite = e.colorWrite, this.precision = e.precision, this.polygonOffset = e.polygonOffset, this.polygonOffsetFactor = e.polygonOffsetFactor, this.polygonOffsetUnits = e.polygonOffsetUnits, this.dithering = e.dithering, this.alphaTest = e.alphaTest, this.premultipliedAlpha = e.premultipliedAlpha, this.visible = e.visible, this.userData = JSON.parse(JSON.stringify(e.userData)), this.clipShadows = e.clipShadows, this.clipIntersection = e.clipIntersection;
  4101. var t = e.clippingPlanes,
  4102. n = null;
  4103. if (null !== t) {
  4104. var r = t.length;
  4105. n = new Array(r);
  4106. for (var i = 0; i !== r; ++i) n[i] = t[i].clone()
  4107. }
  4108. return this.clippingPlanes = n, this.shadowSide = e.shadowSide, this
  4109. },
  4110. dispose: function() {
  4111. this.dispatchEvent({
  4112. type: "dispose"
  4113. })
  4114. }
  4115. }), Jn.prototype = Object.create(Kn.prototype), Jn.prototype.constructor = Jn, Jn.prototype.isMeshBasicMaterial = !0, Jn.prototype.copy = function(e) {
  4116. return Kn.prototype.copy.call(this, e), this.color.copy(e.color), this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.combine = e.combine, this.reflectivity = e.reflectivity, this.refractionRatio = e.refractionRatio, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.skinning = e.skinning, this.morphTargets = e.morphTargets, this
  4117. }, Object.defineProperty($n.prototype, "needsUpdate", {
  4118. set: function(e) {
  4119. !0 === e && this.version++
  4120. }
  4121. }), Object.assign($n.prototype, {
  4122. isBufferAttribute: !0,
  4123. onUploadCallback: function() {},
  4124. setArray: function(e) {
  4125. if (Array.isArray(e)) throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
  4126. return this.count = void 0 !== e ? e.length / this.itemSize : 0, this.array = e, this
  4127. },
  4128. setDynamic: function(e) {
  4129. return this.dynamic = e, this
  4130. },
  4131. copy: function(e) {
  4132. return this.name = e.name, this.array = new e.array.constructor(e.array), this.itemSize = e.itemSize, this.count = e.count, this.normalized = e.normalized, this.dynamic = e.dynamic, this
  4133. },
  4134. copyAt: function(e, t, n) {
  4135. e *= this.itemSize, n *= t.itemSize;
  4136. for (var r = 0, i = this.itemSize; r < i; r++) this.array[e + r] = t.array[n + r];
  4137. return this
  4138. },
  4139. copyArray: function(e) {
  4140. return this.array.set(e), this
  4141. },
  4142. copyColorsArray: function(e) {
  4143. for (var t = this.array, n = 0, r = 0, i = e.length; r < i; r++) {
  4144. var o = e[r];
  4145. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r), o = new Vn), t[n++] = o.r, t[n++] = o.g, t[n++] = o.b
  4146. }
  4147. return this
  4148. },
  4149. copyVector2sArray: function(e) {
  4150. for (var t = this.array, n = 0, r = 0, i = e.length; r < i; r++) {
  4151. var o = e[r];
  4152. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r), o = new Ht), t[n++] = o.x, t[n++] = o.y
  4153. }
  4154. return this
  4155. },
  4156. copyVector3sArray: function(e) {
  4157. for (var t = this.array, n = 0, r = 0, i = e.length; r < i; r++) {
  4158. var o = e[r];
  4159. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r), o = new Wt), t[n++] = o.x, t[n++] = o.y, t[n++] = o.z
  4160. }
  4161. return this
  4162. },
  4163. copyVector4sArray: function(e) {
  4164. for (var t = this.array, n = 0, r = 0, i = e.length; r < i; r++) {
  4165. var o = e[r];
  4166. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r), o = new sn), t[n++] = o.x, t[n++] = o.y, t[n++] = o.z, t[n++] = o.w
  4167. }
  4168. return this
  4169. },
  4170. set: function(e, t) {
  4171. return void 0 === t && (t = 0), this.array.set(e, t), this
  4172. },
  4173. getX: function(e) {
  4174. return this.array[e * this.itemSize]
  4175. },
  4176. setX: function(e, t) {
  4177. return this.array[e * this.itemSize] = t, this
  4178. },
  4179. getY: function(e) {
  4180. return this.array[e * this.itemSize + 1]
  4181. },
  4182. setY: function(e, t) {
  4183. return this.array[e * this.itemSize + 1] = t, this
  4184. },
  4185. getZ: function(e) {
  4186. return this.array[e * this.itemSize + 2]
  4187. },
  4188. setZ: function(e, t) {
  4189. return this.array[e * this.itemSize + 2] = t, this
  4190. },
  4191. getW: function(e) {
  4192. return this.array[e * this.itemSize + 3]
  4193. },
  4194. setW: function(e, t) {
  4195. return this.array[e * this.itemSize + 3] = t, this
  4196. },
  4197. setXY: function(e, t, n) {
  4198. return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = n, this
  4199. },
  4200. setXYZ: function(e, t, n, r) {
  4201. return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = r, this
  4202. },
  4203. setXYZW: function(e, t, n, r, i) {
  4204. return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = r, this.array[e + 3] = i, this
  4205. },
  4206. onUpload: function(e) {
  4207. return this.onUploadCallback = e, this
  4208. },
  4209. clone: function() {
  4210. return new this.constructor(this.array, this.itemSize).copy(this)
  4211. },
  4212. toJSON: function() {
  4213. return {
  4214. itemSize: this.itemSize,
  4215. type: this.array.constructor.name,
  4216. array: Array.prototype.slice.call(this.array),
  4217. normalized: this.normalized
  4218. }
  4219. }
  4220. }), Qn.prototype = Object.create($n.prototype), Qn.prototype.constructor = Qn, er.prototype = Object.create($n.prototype), er.prototype.constructor = er, tr.prototype = Object.create($n.prototype), tr.prototype.constructor = tr, nr.prototype = Object.create($n.prototype), nr.prototype.constructor = nr, rr.prototype = Object.create($n.prototype), rr.prototype.constructor = rr, ir.prototype = Object.create($n.prototype), ir.prototype.constructor = ir, or.prototype = Object.create($n.prototype), or.prototype.constructor = or, ar.prototype = Object.create($n.prototype), ar.prototype.constructor = ar, sr.prototype = Object.create($n.prototype), sr.prototype.constructor = sr, Object.assign(cr.prototype, {
  4221. computeGroups: function(e) {
  4222. for (var t, n = [], r = void 0, i = e.faces, o = 0; o < i.length; o++) {
  4223. var a = i[o];
  4224. a.materialIndex !== r && (r = a.materialIndex, void 0 !== t && (t.count = 3 * o - t.start, n.push(t)), t = {
  4225. start: 3 * o,
  4226. materialIndex: r
  4227. })
  4228. }
  4229. void 0 !== t && (t.count = 3 * o - t.start, n.push(t)), this.groups = n
  4230. },
  4231. fromGeometry: function(e) {
  4232. var t, n = e.faces,
  4233. r = e.vertices,
  4234. i = e.faceVertexUvs,
  4235. o = i[0] && i[0].length > 0,
  4236. a = i[1] && i[1].length > 0,
  4237. s = e.morphTargets,
  4238. c = s.length;
  4239. if (c > 0) {
  4240. t = [];
  4241. for (var l = 0; l < c; l++) t[l] = {
  4242. name: s[l].name,
  4243. data: []
  4244. };
  4245. this.morphTargets.position = t
  4246. }
  4247. var u, h = e.morphNormals,
  4248. d = h.length;
  4249. if (d > 0) {
  4250. u = [];
  4251. for (l = 0; l < d; l++) u[l] = {
  4252. name: h[l].name,
  4253. data: []
  4254. };
  4255. this.morphTargets.normal = u
  4256. }
  4257. var p = e.skinIndices,
  4258. f = e.skinWeights,
  4259. m = p.length === r.length,
  4260. v = f.length === r.length;
  4261. r.length > 0 && 0 === n.length && console.error("THREE.DirectGeometry: Faceless geometries are not supported.");
  4262. for (l = 0; l < n.length; l++) {
  4263. var g = n[l];
  4264. this.vertices.push(r[g.a], r[g.b], r[g.c]);
  4265. var y = g.vertexNormals;
  4266. if (3 === y.length) this.normals.push(y[0], y[1], y[2]);
  4267. else {
  4268. var b = g.normal;
  4269. this.normals.push(b, b, b)
  4270. }
  4271. var x, w = g.vertexColors;
  4272. if (3 === w.length) this.colors.push(w[0], w[1], w[2]);
  4273. else {
  4274. var _ = g.color;
  4275. this.colors.push(_, _, _)
  4276. }
  4277. if (!0 === o) void 0 !== (x = i[0][l]) ? this.uvs.push(x[0], x[1], x[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", l), this.uvs.push(new Ht, new Ht, new Ht));
  4278. if (!0 === a) void 0 !== (x = i[1][l]) ? this.uvs2.push(x[0], x[1], x[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", l), this.uvs2.push(new Ht, new Ht, new Ht));
  4279. for (var M = 0; M < c; M++) {
  4280. var E = s[M].vertices;
  4281. t[M].data.push(E[g.a], E[g.b], E[g.c])
  4282. }
  4283. for (M = 0; M < d; M++) {
  4284. var S = h[M].vertexNormals[l];
  4285. u[M].data.push(S.a, S.b, S.c)
  4286. }
  4287. m && this.skinIndices.push(p[g.a], p[g.b], p[g.c]), v && this.skinWeights.push(f[g.a], f[g.b], f[g.c])
  4288. }
  4289. return this.computeGroups(e), this.verticesNeedUpdate = e.verticesNeedUpdate, this.normalsNeedUpdate = e.normalsNeedUpdate, this.colorsNeedUpdate = e.colorsNeedUpdate, this.uvsNeedUpdate = e.uvsNeedUpdate, this.groupsNeedUpdate = e.groupsNeedUpdate, null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()), null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()), this
  4290. }
  4291. });
  4292. var ur, hr, dr = 1;
  4293.  
  4294. function pr() {
  4295. Object.defineProperty(this, "id", {
  4296. value: dr += 2
  4297. }), this.uuid = Gt.generateUUID(), this.name = "", this.type = "BufferGeometry", this.index = null, this.attributes = {}, this.morphAttributes = {}, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.drawRange = {
  4298. start: 0,
  4299. count: 1 / 0
  4300. }, this.userData = {}
  4301. }
  4302.  
  4303. function fr(e, t) {
  4304. In.call(this), this.type = "Mesh", this.geometry = void 0 !== e ? e : new pr, this.material = void 0 !== t ? t : new Jn({
  4305. color: 16777215 * Math.random()
  4306. }), this.drawMode = Lt, this.updateMorphTargets()
  4307. }
  4308. pr.prototype = Object.assign(Object.create(r.prototype), {
  4309. constructor: pr,
  4310. isBufferGeometry: !0,
  4311. getIndex: function() {
  4312. return this.index
  4313. },
  4314. setIndex: function(e) {
  4315. Array.isArray(e) ? this.index = new(lr(e) > 65535 ? or : rr)(e, 1) : this.index = e
  4316. },
  4317. addAttribute: function(e, t) {
  4318. return t && t.isBufferAttribute || t && t.isInterleavedBufferAttribute ? "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."), this.setIndex(t), this) : (this.attributes[e] = t, this) : (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."), this.addAttribute(e, new $n(arguments[1], arguments[2])))
  4319. },
  4320. getAttribute: function(e) {
  4321. return this.attributes[e]
  4322. },
  4323. removeAttribute: function(e) {
  4324. return delete this.attributes[e], this
  4325. },
  4326. addGroup: function(e, t, n) {
  4327. this.groups.push({
  4328. start: e,
  4329. count: t,
  4330. materialIndex: void 0 !== n ? n : 0
  4331. })
  4332. },
  4333. clearGroups: function() {
  4334. this.groups = []
  4335. },
  4336. setDrawRange: function(e, t) {
  4337. this.drawRange.start = e, this.drawRange.count = t
  4338. },
  4339. applyMatrix: function(e) {
  4340. var t = this.attributes.position;
  4341. void 0 !== t && (e.applyToBufferAttribute(t), t.needsUpdate = !0);
  4342. var n = this.attributes.normal;
  4343. void 0 !== n && ((new qt).getNormalMatrix(e).applyToBufferAttribute(n), n.needsUpdate = !0);
  4344. var r = this.attributes.tangent;
  4345. void 0 !== r && ((new qt).getNormalMatrix(e).applyToBufferAttribute(r), r.needsUpdate = !0);
  4346. return null !== this.boundingBox && this.computeBoundingBox(), null !== this.boundingSphere && this.computeBoundingSphere(), this
  4347. },
  4348. rotateX: function() {
  4349. var e = new un;
  4350. return function(t) {
  4351. return e.makeRotationX(t), this.applyMatrix(e), this
  4352. }
  4353. }(),
  4354. rotateY: function() {
  4355. var e = new un;
  4356. return function(t) {
  4357. return e.makeRotationY(t), this.applyMatrix(e), this
  4358. }
  4359. }(),
  4360. rotateZ: function() {
  4361. var e = new un;
  4362. return function(t) {
  4363. return e.makeRotationZ(t), this.applyMatrix(e), this
  4364. }
  4365. }(),
  4366. translate: function() {
  4367. var e = new un;
  4368. return function(t, n, r) {
  4369. return e.makeTranslation(t, n, r), this.applyMatrix(e), this
  4370. }
  4371. }(),
  4372. scale: function() {
  4373. var e = new un;
  4374. return function(t, n, r) {
  4375. return e.makeScale(t, n, r), this.applyMatrix(e), this
  4376. }
  4377. }(),
  4378. lookAt: (hr = new In, function(e) {
  4379. hr.lookAt(e), hr.updateMatrix(), this.applyMatrix(hr.matrix)
  4380. }),
  4381. center: (ur = new Wt, function() {
  4382. return this.computeBoundingBox(), this.boundingBox.getCenter(ur).negate(), this.translate(ur.x, ur.y, ur.z), this
  4383. }),
  4384. setFromObject: function(e) {
  4385. var t = e.geometry;
  4386. if (e.isPoints || e.isLine) {
  4387. var n = new ar(3 * t.vertices.length, 3),
  4388. r = new ar(3 * t.colors.length, 3);
  4389. if (this.addAttribute("position", n.copyVector3sArray(t.vertices)), this.addAttribute("color", r.copyColorsArray(t.colors)), t.lineDistances && t.lineDistances.length === t.vertices.length) {
  4390. var i = new ar(t.lineDistances.length, 1);
  4391. this.addAttribute("lineDistance", i.copyArray(t.lineDistances))
  4392. }
  4393. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()), null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  4394. } else e.isMesh && t && t.isGeometry && this.fromGeometry(t);
  4395. return this
  4396. },
  4397. setFromPoints: function(e) {
  4398. for (var t = [], n = 0, r = e.length; n < r; n++) {
  4399. var i = e[n];
  4400. t.push(i.x, i.y, i.z || 0)
  4401. }
  4402. return this.addAttribute("position", new ar(t, 3)), this
  4403. },
  4404. updateFromObject: function(e) {
  4405. var t, n = e.geometry;
  4406. if (e.isMesh) {
  4407. var r = n.__directGeometry;
  4408. if (!0 === n.elementsNeedUpdate && (r = void 0, n.elementsNeedUpdate = !1), void 0 === r) return this.fromGeometry(n);
  4409. r.verticesNeedUpdate = n.verticesNeedUpdate, r.normalsNeedUpdate = n.normalsNeedUpdate, r.colorsNeedUpdate = n.colorsNeedUpdate, r.uvsNeedUpdate = n.uvsNeedUpdate, r.groupsNeedUpdate = n.groupsNeedUpdate, n.verticesNeedUpdate = !1, n.normalsNeedUpdate = !1, n.colorsNeedUpdate = !1, n.uvsNeedUpdate = !1, n.groupsNeedUpdate = !1, n = r
  4410. }
  4411. return !0 === n.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(n.vertices), t.needsUpdate = !0), n.verticesNeedUpdate = !1), !0 === n.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(n.normals), t.needsUpdate = !0), n.normalsNeedUpdate = !1), !0 === n.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(n.colors), t.needsUpdate = !0), n.colorsNeedUpdate = !1), n.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(n.uvs), t.needsUpdate = !0), n.uvsNeedUpdate = !1), n.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(n.lineDistances), t.needsUpdate = !0), n.lineDistancesNeedUpdate = !1), n.groupsNeedUpdate && (n.computeGroups(e.geometry), this.groups = n.groups, n.groupsNeedUpdate = !1), this
  4412. },
  4413. fromGeometry: function(e) {
  4414. return e.__directGeometry = (new cr).fromGeometry(e), this.fromDirectGeometry(e.__directGeometry)
  4415. },
  4416. fromDirectGeometry: function(e) {
  4417. var t = new Float32Array(3 * e.vertices.length);
  4418. if (this.addAttribute("position", new $n(t, 3).copyVector3sArray(e.vertices)), e.normals.length > 0) {
  4419. var n = new Float32Array(3 * e.normals.length);
  4420. this.addAttribute("normal", new $n(n, 3).copyVector3sArray(e.normals))
  4421. }
  4422. if (e.colors.length > 0) {
  4423. var r = new Float32Array(3 * e.colors.length);
  4424. this.addAttribute("color", new $n(r, 3).copyColorsArray(e.colors))
  4425. }
  4426. if (e.uvs.length > 0) {
  4427. var i = new Float32Array(2 * e.uvs.length);
  4428. this.addAttribute("uv", new $n(i, 2).copyVector2sArray(e.uvs))
  4429. }
  4430. if (e.uvs2.length > 0) {
  4431. var o = new Float32Array(2 * e.uvs2.length);
  4432. this.addAttribute("uv2", new $n(o, 2).copyVector2sArray(e.uvs2))
  4433. }
  4434. for (var a in this.groups = e.groups, e.morphTargets) {
  4435. for (var s = [], c = e.morphTargets[a], l = 0, u = c.length; l < u; l++) {
  4436. var h = c[l],
  4437. d = new ar(3 * h.data.length, 3);
  4438. d.name = h.name, s.push(d.copyVector3sArray(h.data))
  4439. }
  4440. this.morphAttributes[a] = s
  4441. }
  4442. if (e.skinIndices.length > 0) {
  4443. var p = new ar(4 * e.skinIndices.length, 4);
  4444. this.addAttribute("skinIndex", p.copyVector4sArray(e.skinIndices))
  4445. }
  4446. if (e.skinWeights.length > 0) {
  4447. var f = new ar(4 * e.skinWeights.length, 4);
  4448. this.addAttribute("skinWeight", f.copyVector4sArray(e.skinWeights))
  4449. }
  4450. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()), null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()), this
  4451. },
  4452. computeBoundingBox: function() {
  4453. var e = new jn;
  4454. return function() {
  4455. null === this.boundingBox && (this.boundingBox = new jn);
  4456. var t = this.attributes.position,
  4457. n = this.morphAttributes.position;
  4458. if (void 0 !== t) {
  4459. if (this.boundingBox.setFromBufferAttribute(t), n)
  4460. for (var r = 0, i = n.length; r < i; r++) {
  4461. var o = n[r];
  4462. e.setFromBufferAttribute(o), this.boundingBox.expandByPoint(e.min), this.boundingBox.expandByPoint(e.max)
  4463. }
  4464. } else this.boundingBox.makeEmpty();
  4465. (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) && console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this)
  4466. }
  4467. }(),
  4468. computeBoundingSphere: function() {
  4469. var e = new jn,
  4470. t = new jn,
  4471. n = new Wt;
  4472. return function() {
  4473. null === this.boundingSphere && (this.boundingSphere = new Nn);
  4474. var r = this.attributes.position,
  4475. i = this.morphAttributes.position;
  4476. if (r) {
  4477. var o = this.boundingSphere.center;
  4478. if (e.setFromBufferAttribute(r), i)
  4479. for (var a = 0, s = i.length; a < s; a++) {
  4480. var c = i[a];
  4481. t.setFromBufferAttribute(c), e.expandByPoint(t.min), e.expandByPoint(t.max)
  4482. }
  4483. e.getCenter(o);
  4484. var l = 0;
  4485. for (a = 0, s = r.count; a < s; a++) n.fromBufferAttribute(r, a), l = Math.max(l, o.distanceToSquared(n));
  4486. if (i)
  4487. for (a = 0, s = i.length; a < s; a++)
  4488. for (var u = 0, h = (c = i[a]).count; u < h; u++) n.fromBufferAttribute(c, u), l = Math.max(l, o.distanceToSquared(n));
  4489. this.boundingSphere.radius = Math.sqrt(l), isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  4490. }
  4491. }
  4492. }(),
  4493. computeFaceNormals: function() {},
  4494. computeVertexNormals: function() {
  4495. var e = this.index,
  4496. t = this.attributes;
  4497. if (t.position) {
  4498. var n = t.position.array;
  4499. if (void 0 === t.normal) this.addAttribute("normal", new $n(new Float32Array(n.length), 3));
  4500. else
  4501. for (var r = t.normal.array, i = 0, o = r.length; i < o; i++) r[i] = 0;
  4502. var a, s, c, l = t.normal.array,
  4503. u = new Wt,
  4504. h = new Wt,
  4505. d = new Wt,
  4506. p = new Wt,
  4507. f = new Wt;
  4508. if (e) {
  4509. var m = e.array;
  4510. for (i = 0, o = e.count; i < o; i += 3) a = 3 * m[i + 0], s = 3 * m[i + 1], c = 3 * m[i + 2], u.fromArray(n, a), h.fromArray(n, s), d.fromArray(n, c), p.subVectors(d, h), f.subVectors(u, h), p.cross(f), l[a] += p.x, l[a + 1] += p.y, l[a + 2] += p.z, l[s] += p.x, l[s + 1] += p.y, l[s + 2] += p.z, l[c] += p.x, l[c + 1] += p.y, l[c + 2] += p.z
  4511. } else
  4512. for (i = 0, o = n.length; i < o; i += 9) u.fromArray(n, i), h.fromArray(n, i + 3), d.fromArray(n, i + 6), p.subVectors(d, h), f.subVectors(u, h), p.cross(f), l[i] = p.x, l[i + 1] = p.y, l[i + 2] = p.z, l[i + 3] = p.x, l[i + 4] = p.y, l[i + 5] = p.z, l[i + 6] = p.x, l[i + 7] = p.y, l[i + 8] = p.z;
  4513. this.normalizeNormals(), t.normal.needsUpdate = !0
  4514. }
  4515. },
  4516. merge: function(e, t) {
  4517. if (e && e.isBufferGeometry) {
  4518. void 0 === t && (t = 0, console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));
  4519. var n = this.attributes;
  4520. for (var r in n)
  4521. if (void 0 !== e.attributes[r])
  4522. for (var i = n[r].array, o = e.attributes[r], a = o.array, s = o.itemSize * t, c = Math.min(a.length, i.length - s), l = 0, u = s; l < c; l++, u++) i[u] = a[l];
  4523. return this
  4524. }
  4525. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  4526. },
  4527. normalizeNormals: function() {
  4528. var e = new Wt;
  4529. return function() {
  4530. for (var t = this.attributes.normal, n = 0, r = t.count; n < r; n++) e.x = t.getX(n), e.y = t.getY(n), e.z = t.getZ(n), e.normalize(), t.setXYZ(n, e.x, e.y, e.z)
  4531. }
  4532. }(),
  4533. toNonIndexed: function() {
  4534. function e(e, t) {
  4535. for (var n = e.array, r = e.itemSize, i = new n.constructor(t.length * r), o = 0, a = 0, s = 0, c = t.length; s < c; s++) {
  4536. o = t[s] * r;
  4537. for (var l = 0; l < r; l++) i[a++] = n[o++]
  4538. }
  4539. return new $n(i, r)
  4540. }
  4541. if (null === this.index) return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."), this;
  4542. var t = new pr,
  4543. n = this.index.array,
  4544. r = this.attributes;
  4545. for (var i in r) {
  4546. var o = e(r[i], n);
  4547. t.addAttribute(i, o)
  4548. }
  4549. var a = this.morphAttributes;
  4550. for (i in a) {
  4551. for (var s = [], c = a[i], l = 0, u = c.length; l < u; l++) {
  4552. o = e(c[l], n);
  4553. s.push(o)
  4554. }
  4555. t.morphAttributes[i] = s
  4556. }
  4557. for (var h = this.groups, d = (l = 0, h.length); l < d; l++) {
  4558. var p = h[l];
  4559. t.addGroup(p.start, p.count, p.materialIndex)
  4560. }
  4561. return t
  4562. },
  4563. toJSON: function() {
  4564. var e = {
  4565. metadata: {
  4566. version: 4.5,
  4567. type: "BufferGeometry",
  4568. generator: "BufferGeometry.toJSON"
  4569. }
  4570. };
  4571. if (e.uuid = this.uuid, e.type = this.type, "" !== this.name && (e.name = this.name), Object.keys(this.userData).length > 0 && (e.userData = this.userData), void 0 !== this.parameters) {
  4572. var t = this.parameters;
  4573. for (var n in t) void 0 !== t[n] && (e[n] = t[n]);
  4574. return e
  4575. }
  4576. e.data = {
  4577. attributes: {}
  4578. };
  4579. var r = this.index;
  4580. null !== r && (e.data.index = {
  4581. type: r.array.constructor.name,
  4582. array: Array.prototype.slice.call(r.array)
  4583. });
  4584. var i = this.attributes;
  4585. for (var n in i) {
  4586. var o = (d = i[n]).toJSON();
  4587. "" !== d.name && (o.name = d.name), e.data.attributes[n] = o
  4588. }
  4589. var a = {},
  4590. s = !1;
  4591. for (var n in this.morphAttributes) {
  4592. for (var c = this.morphAttributes[n], l = [], u = 0, h = c.length; u < h; u++) {
  4593. var d;
  4594. o = (d = c[u]).toJSON();
  4595. "" !== d.name && (o.name = d.name), l.push(o)
  4596. }
  4597. l.length > 0 && (a[n] = l, s = !0)
  4598. }
  4599. s && (e.data.morphAttributes = a);
  4600. var p = this.groups;
  4601. p.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(p)));
  4602. var f = this.boundingSphere;
  4603. return null !== f && (e.data.boundingSphere = {
  4604. center: f.center.toArray(),
  4605. radius: f.radius
  4606. }), e
  4607. },
  4608. clone: function() {
  4609. return (new pr).copy(this)
  4610. },
  4611. copy: function(e) {
  4612. var t, n, r;
  4613. this.index = null, this.attributes = {}, this.morphAttributes = {}, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.name = e.name;
  4614. var i = e.index;
  4615. null !== i && this.setIndex(i.clone());
  4616. var o = e.attributes;
  4617. for (t in o) {
  4618. var a = o[t];
  4619. this.addAttribute(t, a.clone())
  4620. }
  4621. var s = e.morphAttributes;
  4622. for (t in s) {
  4623. var c = [],
  4624. l = s[t];
  4625. for (n = 0, r = l.length; n < r; n++) c.push(l[n].clone());
  4626. this.morphAttributes[t] = c
  4627. }
  4628. var u = e.groups;
  4629. for (n = 0, r = u.length; n < r; n++) {
  4630. var h = u[n];
  4631. this.addGroup(h.start, h.count, h.materialIndex)
  4632. }
  4633. var d = e.boundingBox;
  4634. null !== d && (this.boundingBox = d.clone());
  4635. var p = e.boundingSphere;
  4636. return null !== p && (this.boundingSphere = p.clone()), this.drawRange.start = e.drawRange.start, this.drawRange.count = e.drawRange.count, this.userData = e.userData, this
  4637. },
  4638. dispose: function() {
  4639. this.dispatchEvent({
  4640. type: "dispose"
  4641. })
  4642. }
  4643. }), fr.prototype = Object.assign(Object.create(In.prototype), {
  4644. constructor: fr,
  4645. isMesh: !0,
  4646. setDrawMode: function(e) {
  4647. this.drawMode = e
  4648. },
  4649. copy: function(e) {
  4650. return In.prototype.copy.call(this, e), this.drawMode = e.drawMode, void 0 !== e.morphTargetInfluences && (this.morphTargetInfluences = e.morphTargetInfluences.slice()), void 0 !== e.morphTargetDictionary && (this.morphTargetDictionary = Object.assign({}, e.morphTargetDictionary)), this
  4651. },
  4652. updateMorphTargets: function() {
  4653. var e, t, n, r = this.geometry;
  4654. if (r.isBufferGeometry) {
  4655. var i = r.morphAttributes,
  4656. o = Object.keys(i);
  4657. if (o.length > 0) {
  4658. var a = i[o[0]];
  4659. if (void 0 !== a)
  4660. for (this.morphTargetInfluences = [], this.morphTargetDictionary = {}, e = 0, t = a.length; e < t; e++) n = a[e].name || String(e), this.morphTargetInfluences.push(0), this.morphTargetDictionary[n] = e
  4661. }
  4662. } else {
  4663. var s = r.morphTargets;
  4664. void 0 !== s && s.length > 0 && console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")
  4665. }
  4666. },
  4667. raycast: function() {
  4668. var e = new un,
  4669. t = new Bn,
  4670. n = new Nn,
  4671. r = new Wt,
  4672. i = new Wt,
  4673. o = new Wt,
  4674. a = new Wt,
  4675. s = new Wt,
  4676. c = new Wt,
  4677. l = new Wt,
  4678. u = new Wt,
  4679. h = new Wt,
  4680. d = new Ht,
  4681. p = new Ht,
  4682. f = new Ht,
  4683. m = new Wt,
  4684. v = new Wt;
  4685.  
  4686. function g(e, t, n, r, i, o, a, s) {
  4687. if (null === (t.side === b ? r.intersectTriangle(a, o, i, !0, s) : r.intersectTriangle(i, o, a, t.side !== x, s))) return null;
  4688. v.copy(s), v.applyMatrix4(e.matrixWorld);
  4689. var c = n.ray.origin.distanceTo(v);
  4690. return c < n.near || c > n.far ? null : {
  4691. distance: c,
  4692. point: v.clone(),
  4693. object: e
  4694. }
  4695. }
  4696.  
  4697. function y(e, t, n, v, y, b, x, w, _, M) {
  4698. r.fromBufferAttribute(y, w), i.fromBufferAttribute(y, _), o.fromBufferAttribute(y, M);
  4699. var E = e.morphTargetInfluences;
  4700. if (t.morphTargets && b && E) {
  4701. l.set(0, 0, 0), u.set(0, 0, 0), h.set(0, 0, 0);
  4702. for (var S = 0, T = b.length; S < T; S++) {
  4703. var L = E[S],
  4704. A = b[S];
  4705. 0 !== L && (a.fromBufferAttribute(A, w), s.fromBufferAttribute(A, _), c.fromBufferAttribute(A, M), l.addScaledVector(a.sub(r), L), u.addScaledVector(s.sub(i), L), h.addScaledVector(c.sub(o), L))
  4706. }
  4707. r.add(l), i.add(u), o.add(h)
  4708. }
  4709. var C = g(e, t, n, v, r, i, o, m);
  4710. if (C) {
  4711. x && (d.fromBufferAttribute(x, w), p.fromBufferAttribute(x, _), f.fromBufferAttribute(x, M), C.uv = zn.getUV(m, r, i, o, d, p, f, new Ht));
  4712. var P = new Yn(w, _, M);
  4713. zn.getNormal(r, i, o, P.normal), C.face = P
  4714. }
  4715. return C
  4716. }
  4717. return function(r, i) {
  4718. var o, a = this.geometry,
  4719. s = this.material,
  4720. c = this.matrixWorld;
  4721. if (void 0 !== s && (null === a.boundingSphere && a.computeBoundingSphere(), n.copy(a.boundingSphere), n.applyMatrix4(c), !1 !== r.ray.intersectsSphere(n) && (e.getInverse(c), t.copy(r.ray).applyMatrix4(e), null === a.boundingBox || !1 !== t.intersectsBox(a.boundingBox))))
  4722. if (a.isBufferGeometry) {
  4723. var l, u, h, v, b, x, w, _, M, E = a.index,
  4724. S = a.attributes.position,
  4725. T = a.morphAttributes.position,
  4726. L = a.attributes.uv,
  4727. A = a.groups,
  4728. C = a.drawRange;
  4729. if (null !== E)
  4730. if (Array.isArray(s))
  4731. for (v = 0, x = A.length; v < x; v++)
  4732. for (M = s[(_ = A[v]).materialIndex], b = Math.max(_.start, C.start), w = Math.min(_.start + _.count, C.start + C.count); b < w; b += 3) l = E.getX(b), u = E.getX(b + 1), h = E.getX(b + 2), (o = y(this, M, r, t, S, T, L, l, u, h)) && (o.faceIndex = Math.floor(b / 3), o.face.materialIndex = _.materialIndex, i.push(o));
  4733. else
  4734. for (v = Math.max(0, C.start), x = Math.min(E.count, C.start + C.count); v < x; v += 3) l = E.getX(v), u = E.getX(v + 1), h = E.getX(v + 2), (o = y(this, s, r, t, S, T, L, l, u, h)) && (o.faceIndex = Math.floor(v / 3), i.push(o));
  4735. else if (void 0 !== S)
  4736. if (Array.isArray(s))
  4737. for (v = 0, x = A.length; v < x; v++)
  4738. for (M = s[(_ = A[v]).materialIndex], b = Math.max(_.start, C.start), w = Math.min(_.start + _.count, C.start + C.count); b < w; b += 3)(o = y(this, M, r, t, S, T, L, l = b, u = b + 1, h = b + 2)) && (o.faceIndex = Math.floor(b / 3), o.face.materialIndex = _.materialIndex, i.push(o));
  4739. else
  4740. for (v = Math.max(0, C.start), x = Math.min(S.count, C.start + C.count); v < x; v += 3)(o = y(this, s, r, t, S, T, L, l = v, u = v + 1, h = v + 2)) && (o.faceIndex = Math.floor(v / 3), i.push(o))
  4741. } else if (a.isGeometry) {
  4742. var P, R, O, k, I = Array.isArray(s),
  4743. D = a.vertices,
  4744. j = a.faces,
  4745. N = a.faceVertexUvs[0];
  4746. N.length > 0 && (k = N);
  4747. for (var B = 0, z = j.length; B < z; B++) {
  4748. var U = j[B],
  4749. F = I ? s[U.materialIndex] : s;
  4750. if (void 0 !== F && (P = D[U.a], R = D[U.b], O = D[U.c], o = g(this, F, r, t, P, R, O, m))) {
  4751. if (k && k[B]) {
  4752. var G = k[B];
  4753. d.copy(G[0]), p.copy(G[1]), f.copy(G[2]), o.uv = zn.getUV(m, P, R, O, d, p, f, new Ht)
  4754. }
  4755. o.face = U, o.faceIndex = B, i.push(o)
  4756. }
  4757. }
  4758. }
  4759. }
  4760. }(),
  4761. clone: function() {
  4762. return new this.constructor(this.geometry, this.material).copy(this)
  4763. }
  4764. });
  4765. var mr = 0;
  4766.  
  4767. function vr() {
  4768. Object.defineProperty(this, "id", {
  4769. value: mr += 2
  4770. }), this.uuid = Gt.generateUUID(), this.name = "", this.type = "Geometry", this.vertices = [], this.colors = [], this.faces = [], this.faceVertexUvs = [
  4771. []
  4772. ], this.morphTargets = [], this.morphNormals = [], this.skinWeights = [], this.skinIndices = [], this.lineDistances = [], this.boundingBox = null, this.boundingSphere = null, this.elementsNeedUpdate = !1, this.verticesNeedUpdate = !1, this.uvsNeedUpdate = !1, this.normalsNeedUpdate = !1, this.colorsNeedUpdate = !1, this.lineDistancesNeedUpdate = !1, this.groupsNeedUpdate = !1
  4773. }
  4774.  
  4775. function gr(e, t, n, r, i, o) {
  4776. vr.call(this), this.type = "BoxGeometry", this.parameters = {
  4777. width: e,
  4778. height: t,
  4779. depth: n,
  4780. widthSegments: r,
  4781. heightSegments: i,
  4782. depthSegments: o
  4783. }, this.fromBufferGeometry(new yr(e, t, n, r, i, o)), this.mergeVertices()
  4784. }
  4785.  
  4786. function yr(e, t, n, r, i, o) {
  4787. pr.call(this), this.type = "BoxBufferGeometry", this.parameters = {
  4788. width: e,
  4789. height: t,
  4790. depth: n,
  4791. widthSegments: r,
  4792. heightSegments: i,
  4793. depthSegments: o
  4794. };
  4795. var a = this;
  4796. e = e || 1, t = t || 1, n = n || 1, r = Math.floor(r) || 1, i = Math.floor(i) || 1, o = Math.floor(o) || 1;
  4797. var s = [],
  4798. c = [],
  4799. l = [],
  4800. u = [],
  4801. h = 0,
  4802. d = 0;
  4803.  
  4804. function p(e, t, n, r, i, o, p, f, m, v, g) {
  4805. var y, b, x = o / m,
  4806. w = p / v,
  4807. _ = o / 2,
  4808. M = p / 2,
  4809. E = f / 2,
  4810. S = m + 1,
  4811. T = v + 1,
  4812. L = 0,
  4813. A = 0,
  4814. C = new Wt;
  4815. for (b = 0; b < T; b++) {
  4816. var P = b * w - M;
  4817. for (y = 0; y < S; y++) {
  4818. var R = y * x - _;
  4819. C[e] = R * r, C[t] = P * i, C[n] = E, c.push(C.x, C.y, C.z), C[e] = 0, C[t] = 0, C[n] = f > 0 ? 1 : -1, l.push(C.x, C.y, C.z), u.push(y / m), u.push(1 - b / v), L += 1
  4820. }
  4821. }
  4822. for (b = 0; b < v; b++)
  4823. for (y = 0; y < m; y++) {
  4824. var O = h + y + S * b,
  4825. k = h + y + S * (b + 1),
  4826. I = h + (y + 1) + S * (b + 1),
  4827. D = h + (y + 1) + S * b;
  4828. s.push(O, k, D), s.push(k, I, D), A += 6
  4829. }
  4830. a.addGroup(d, A, g), d += A, h += L
  4831. }
  4832. p("z", "y", "x", -1, -1, n, t, e, o, i, 0), p("z", "y", "x", 1, -1, n, t, -e, o, i, 1), p("x", "z", "y", 1, 1, e, n, t, r, o, 2), p("x", "z", "y", 1, -1, e, n, -t, r, o, 3), p("x", "y", "z", 1, -1, e, t, n, r, i, 4), p("x", "y", "z", -1, -1, e, t, -n, r, i, 5), this.setIndex(s), this.addAttribute("position", new ar(c, 3)), this.addAttribute("normal", new ar(l, 3)), this.addAttribute("uv", new ar(u, 2))
  4833. }
  4834.  
  4835. function br(e) {
  4836. var t = {};
  4837. for (var n in e)
  4838. for (var r in t[n] = {}, e[n]) {
  4839. var i = e[n][r];
  4840. i && (i.isColor || i.isMatrix3 || i.isMatrix4 || i.isVector2 || i.isVector3 || i.isVector4 || i.isTexture) ? t[n][r] = i.clone() : Array.isArray(i) ? t[n][r] = i.slice() : t[n][r] = i
  4841. }
  4842. return t
  4843. }
  4844.  
  4845. function xr(e) {
  4846. for (var t = {}, n = 0; n < e.length; n++) {
  4847. var r = br(e[n]);
  4848. for (var i in r) t[i] = r[i]
  4849. }
  4850. return t
  4851. }
  4852. vr.prototype = Object.assign(Object.create(r.prototype), {
  4853. constructor: vr,
  4854. isGeometry: !0,
  4855. applyMatrix: function(e) {
  4856. for (var t = (new qt).getNormalMatrix(e), n = 0, r = this.vertices.length; n < r; n++) {
  4857. this.vertices[n].applyMatrix4(e)
  4858. }
  4859. for (n = 0, r = this.faces.length; n < r; n++) {
  4860. var i = this.faces[n];
  4861. i.normal.applyMatrix3(t).normalize();
  4862. for (var o = 0, a = i.vertexNormals.length; o < a; o++) i.vertexNormals[o].applyMatrix3(t).normalize()
  4863. }
  4864. return null !== this.boundingBox && this.computeBoundingBox(), null !== this.boundingSphere && this.computeBoundingSphere(), this.verticesNeedUpdate = !0, this.normalsNeedUpdate = !0, this
  4865. },
  4866. rotateX: function() {
  4867. var e = new un;
  4868. return function(t) {
  4869. return e.makeRotationX(t), this.applyMatrix(e), this
  4870. }
  4871. }(),
  4872. rotateY: function() {
  4873. var e = new un;
  4874. return function(t) {
  4875. return e.makeRotationY(t), this.applyMatrix(e), this
  4876. }
  4877. }(),
  4878. rotateZ: function() {
  4879. var e = new un;
  4880. return function(t) {
  4881. return e.makeRotationZ(t), this.applyMatrix(e), this
  4882. }
  4883. }(),
  4884. translate: function() {
  4885. var e = new un;
  4886. return function(t, n, r) {
  4887. return e.makeTranslation(t, n, r), this.applyMatrix(e), this
  4888. }
  4889. }(),
  4890. scale: function() {
  4891. var e = new un;
  4892. return function(t, n, r) {
  4893. return e.makeScale(t, n, r), this.applyMatrix(e), this
  4894. }
  4895. }(),
  4896. lookAt: function() {
  4897. var e = new In;
  4898. return function(t) {
  4899. e.lookAt(t), e.updateMatrix(), this.applyMatrix(e.matrix)
  4900. }
  4901. }(),
  4902. fromBufferGeometry: function(e) {
  4903. var t = this,
  4904. n = null !== e.index ? e.index.array : void 0,
  4905. r = e.attributes,
  4906. i = r.position.array,
  4907. o = void 0 !== r.normal ? r.normal.array : void 0,
  4908. a = void 0 !== r.color ? r.color.array : void 0,
  4909. s = void 0 !== r.uv ? r.uv.array : void 0,
  4910. c = void 0 !== r.uv2 ? r.uv2.array : void 0;
  4911. void 0 !== c && (this.faceVertexUvs[1] = []);
  4912. for (var l = 0; l < i.length; l += 3) t.vertices.push((new Wt).fromArray(i, l)), void 0 !== a && t.colors.push((new Vn).fromArray(a, l));
  4913.  
  4914. function u(e, n, r, i) {
  4915. var l = void 0 === a ? [] : [t.colors[e].clone(), t.colors[n].clone(), t.colors[r].clone()],
  4916. u = new Yn(e, n, r, void 0 === o ? [] : [(new Wt).fromArray(o, 3 * e), (new Wt).fromArray(o, 3 * n), (new Wt).fromArray(o, 3 * r)], l, i);
  4917. t.faces.push(u), void 0 !== s && t.faceVertexUvs[0].push([(new Ht).fromArray(s, 2 * e), (new Ht).fromArray(s, 2 * n), (new Ht).fromArray(s, 2 * r)]), void 0 !== c && t.faceVertexUvs[1].push([(new Ht).fromArray(c, 2 * e), (new Ht).fromArray(c, 2 * n), (new Ht).fromArray(c, 2 * r)])
  4918. }
  4919. var h = e.groups;
  4920. if (h.length > 0)
  4921. for (l = 0; l < h.length; l++)
  4922. for (var d = h[l], p = d.start, f = p, m = p + d.count; f < m; f += 3) void 0 !== n ? u(n[f], n[f + 1], n[f + 2], d.materialIndex) : u(f, f + 1, f + 2, d.materialIndex);
  4923. else if (void 0 !== n)
  4924. for (l = 0; l < n.length; l += 3) u(n[l], n[l + 1], n[l + 2]);
  4925. else
  4926. for (l = 0; l < i.length / 3; l += 3) u(l, l + 1, l + 2);
  4927. return this.computeFaceNormals(), null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()), null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()), this
  4928. },
  4929. center: function() {
  4930. var e = new Wt;
  4931. return function() {
  4932. return this.computeBoundingBox(), this.boundingBox.getCenter(e).negate(), this.translate(e.x, e.y, e.z), this
  4933. }
  4934. }(),
  4935. normalize: function() {
  4936. this.computeBoundingSphere();
  4937. var e = this.boundingSphere.center,
  4938. t = this.boundingSphere.radius,
  4939. n = 0 === t ? 1 : 1 / t,
  4940. r = new un;
  4941. return r.set(n, 0, 0, -n * e.x, 0, n, 0, -n * e.y, 0, 0, n, -n * e.z, 0, 0, 0, 1), this.applyMatrix(r), this
  4942. },
  4943. computeFaceNormals: function() {
  4944. for (var e = new Wt, t = new Wt, n = 0, r = this.faces.length; n < r; n++) {
  4945. var i = this.faces[n],
  4946. o = this.vertices[i.a],
  4947. a = this.vertices[i.b],
  4948. s = this.vertices[i.c];
  4949. e.subVectors(s, a), t.subVectors(o, a), e.cross(t), e.normalize(), i.normal.copy(e)
  4950. }
  4951. },
  4952. computeVertexNormals: function(e) {
  4953. var t, n, r, i, o, a;
  4954. for (void 0 === e && (e = !0), a = new Array(this.vertices.length), t = 0, n = this.vertices.length; t < n; t++) a[t] = new Wt;
  4955. if (e) {
  4956. var s, c, l, u = new Wt,
  4957. h = new Wt;
  4958. for (r = 0, i = this.faces.length; r < i; r++) o = this.faces[r], s = this.vertices[o.a], c = this.vertices[o.b], l = this.vertices[o.c], u.subVectors(l, c), h.subVectors(s, c), u.cross(h), a[o.a].add(u), a[o.b].add(u), a[o.c].add(u)
  4959. } else
  4960. for (this.computeFaceNormals(), r = 0, i = this.faces.length; r < i; r++) a[(o = this.faces[r]).a].add(o.normal), a[o.b].add(o.normal), a[o.c].add(o.normal);
  4961. for (t = 0, n = this.vertices.length; t < n; t++) a[t].normalize();
  4962. for (r = 0, i = this.faces.length; r < i; r++) {
  4963. var d = (o = this.faces[r]).vertexNormals;
  4964. 3 === d.length ? (d[0].copy(a[o.a]), d[1].copy(a[o.b]), d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(), d[1] = a[o.b].clone(), d[2] = a[o.c].clone())
  4965. }
  4966. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  4967. },
  4968. computeFlatVertexNormals: function() {
  4969. var e, t, n;
  4970. for (this.computeFaceNormals(), e = 0, t = this.faces.length; e < t; e++) {
  4971. var r = (n = this.faces[e]).vertexNormals;
  4972. 3 === r.length ? (r[0].copy(n.normal), r[1].copy(n.normal), r[2].copy(n.normal)) : (r[0] = n.normal.clone(), r[1] = n.normal.clone(), r[2] = n.normal.clone())
  4973. }
  4974. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  4975. },
  4976. computeMorphNormals: function() {
  4977. var e, t, n, r, i;
  4978. for (n = 0, r = this.faces.length; n < r; n++)
  4979. for ((i = this.faces[n]).__originalFaceNormal ? i.__originalFaceNormal.copy(i.normal) : i.__originalFaceNormal = i.normal.clone(), i.__originalVertexNormals || (i.__originalVertexNormals = []), e = 0, t = i.vertexNormals.length; e < t; e++) i.__originalVertexNormals[e] ? i.__originalVertexNormals[e].copy(i.vertexNormals[e]) : i.__originalVertexNormals[e] = i.vertexNormals[e].clone();
  4980. var o = new vr;
  4981. for (o.faces = this.faces, e = 0, t = this.morphTargets.length; e < t; e++) {
  4982. if (!this.morphNormals[e]) {
  4983. this.morphNormals[e] = {}, this.morphNormals[e].faceNormals = [], this.morphNormals[e].vertexNormals = [];
  4984. var a = this.morphNormals[e].faceNormals,
  4985. s = this.morphNormals[e].vertexNormals;
  4986. for (n = 0, r = this.faces.length; n < r; n++) c = new Wt, l = {
  4987. a: new Wt,
  4988. b: new Wt,
  4989. c: new Wt
  4990. }, a.push(c), s.push(l)
  4991. }
  4992. var c, l, u = this.morphNormals[e];
  4993. for (o.vertices = this.morphTargets[e].vertices, o.computeFaceNormals(), o.computeVertexNormals(), n = 0, r = this.faces.length; n < r; n++) i = this.faces[n], c = u.faceNormals[n], l = u.vertexNormals[n], c.copy(i.normal), l.a.copy(i.vertexNormals[0]), l.b.copy(i.vertexNormals[1]), l.c.copy(i.vertexNormals[2])
  4994. }
  4995. for (n = 0, r = this.faces.length; n < r; n++)(i = this.faces[n]).normal = i.__originalFaceNormal, i.vertexNormals = i.__originalVertexNormals
  4996. },
  4997. computeBoundingBox: function() {
  4998. null === this.boundingBox && (this.boundingBox = new jn), this.boundingBox.setFromPoints(this.vertices)
  4999. },
  5000. computeBoundingSphere: function() {
  5001. null === this.boundingSphere && (this.boundingSphere = new Nn), this.boundingSphere.setFromPoints(this.vertices)
  5002. },
  5003. merge: function(e, t, n) {
  5004. if (e && e.isGeometry) {
  5005. var r, i = this.vertices.length,
  5006. o = this.vertices,
  5007. a = e.vertices,
  5008. s = this.faces,
  5009. c = e.faces,
  5010. l = this.faceVertexUvs[0],
  5011. u = e.faceVertexUvs[0],
  5012. h = this.colors,
  5013. d = e.colors;
  5014. void 0 === n && (n = 0), void 0 !== t && (r = (new qt).getNormalMatrix(t));
  5015. for (var p = 0, f = a.length; p < f; p++) {
  5016. var m = a[p].clone();
  5017. void 0 !== t && m.applyMatrix4(t), o.push(m)
  5018. }
  5019. for (p = 0, f = d.length; p < f; p++) h.push(d[p].clone());
  5020. for (p = 0, f = c.length; p < f; p++) {
  5021. var v, g, y, b = c[p],
  5022. x = b.vertexNormals,
  5023. w = b.vertexColors;
  5024. (v = new Yn(b.a + i, b.b + i, b.c + i)).normal.copy(b.normal), void 0 !== r && v.normal.applyMatrix3(r).normalize();
  5025. for (var _ = 0, M = x.length; _ < M; _++) g = x[_].clone(), void 0 !== r && g.applyMatrix3(r).normalize(), v.vertexNormals.push(g);
  5026. v.color.copy(b.color);
  5027. for (_ = 0, M = w.length; _ < M; _++) y = w[_], v.vertexColors.push(y.clone());
  5028. v.materialIndex = b.materialIndex + n, s.push(v)
  5029. }
  5030. for (p = 0, f = u.length; p < f; p++) {
  5031. var E = u[p],
  5032. S = [];
  5033. if (void 0 !== E) {
  5034. for (_ = 0, M = E.length; _ < M; _++) S.push(E[_].clone());
  5035. l.push(S)
  5036. }
  5037. }
  5038. } else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  5039. },
  5040. mergeMesh: function(e) {
  5041. e && e.isMesh ? (e.matrixAutoUpdate && e.updateMatrix(), this.merge(e.geometry, e.matrix)) : console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e)
  5042. },
  5043. mergeVertices: function() {
  5044. var e, t, n, r, i, o, a, s, c = {},
  5045. l = [],
  5046. u = [],
  5047. h = Math.pow(10, 4);
  5048. for (n = 0, r = this.vertices.length; n < r; n++) e = this.vertices[n], void 0 === c[t = Math.round(e.x * h) + "_" + Math.round(e.y * h) + "_" + Math.round(e.z * h)] ? (c[t] = n, l.push(this.vertices[n]), u[n] = l.length - 1) : u[n] = u[c[t]];
  5049. var d = [];
  5050. for (n = 0, r = this.faces.length; n < r; n++) {
  5051. (i = this.faces[n]).a = u[i.a], i.b = u[i.b], i.c = u[i.c], o = [i.a, i.b, i.c];
  5052. for (var p = 0; p < 3; p++)
  5053. if (o[p] === o[(p + 1) % 3]) {
  5054. d.push(n);
  5055. break
  5056. }
  5057. }
  5058. for (n = d.length - 1; n >= 0; n--) {
  5059. var f = d[n];
  5060. for (this.faces.splice(f, 1), a = 0, s = this.faceVertexUvs.length; a < s; a++) this.faceVertexUvs[a].splice(f, 1)
  5061. }
  5062. var m = this.vertices.length - l.length;
  5063. return this.vertices = l, m
  5064. },
  5065. setFromPoints: function(e) {
  5066. this.vertices = [];
  5067. for (var t = 0, n = e.length; t < n; t++) {
  5068. var r = e[t];
  5069. this.vertices.push(new Wt(r.x, r.y, r.z || 0))
  5070. }
  5071. return this
  5072. },
  5073. sortFacesByMaterialIndex: function() {
  5074. for (var e = this.faces, t = e.length, n = 0; n < t; n++) e[n]._id = n;
  5075. e.sort(function(e, t) {
  5076. return e.materialIndex - t.materialIndex
  5077. });
  5078. var r, i, o = this.faceVertexUvs[0],
  5079. a = this.faceVertexUvs[1];
  5080. o && o.length === t && (r = []), a && a.length === t && (i = []);
  5081. for (n = 0; n < t; n++) {
  5082. var s = e[n]._id;
  5083. r && r.push(o[s]), i && i.push(a[s])
  5084. }
  5085. r && (this.faceVertexUvs[0] = r), i && (this.faceVertexUvs[1] = i)
  5086. },
  5087. toJSON: function() {
  5088. var e = {
  5089. metadata: {
  5090. version: 4.5,
  5091. type: "Geometry",
  5092. generator: "Geometry.toJSON"
  5093. }
  5094. };
  5095. if (e.uuid = this.uuid, e.type = this.type, "" !== this.name && (e.name = this.name), void 0 !== this.parameters) {
  5096. var t = this.parameters;
  5097. for (var n in t) void 0 !== t[n] && (e[n] = t[n]);
  5098. return e
  5099. }
  5100. for (var r = [], i = 0; i < this.vertices.length; i++) {
  5101. var o = this.vertices[i];
  5102. r.push(o.x, o.y, o.z)
  5103. }
  5104. var a = [],
  5105. s = [],
  5106. c = {},
  5107. l = [],
  5108. u = {},
  5109. h = [],
  5110. d = {};
  5111. for (i = 0; i < this.faces.length; i++) {
  5112. var p = this.faces[i],
  5113. f = void 0 !== this.faceVertexUvs[0][i],
  5114. m = p.normal.length() > 0,
  5115. v = p.vertexNormals.length > 0,
  5116. g = 1 !== p.color.r || 1 !== p.color.g || 1 !== p.color.b,
  5117. y = p.vertexColors.length > 0,
  5118. b = 0;
  5119. if (b = M(b, 0, 0), b = M(b, 1, !0), b = M(b, 2, !1), b = M(b, 3, f), b = M(b, 4, m), b = M(b, 5, v), b = M(b, 6, g), b = M(b, 7, y), a.push(b), a.push(p.a, p.b, p.c), a.push(p.materialIndex), f) {
  5120. var x = this.faceVertexUvs[0][i];
  5121. a.push(T(x[0]), T(x[1]), T(x[2]))
  5122. }
  5123. if (m && a.push(E(p.normal)), v) {
  5124. var w = p.vertexNormals;
  5125. a.push(E(w[0]), E(w[1]), E(w[2]))
  5126. }
  5127. if (g && a.push(S(p.color)), y) {
  5128. var _ = p.vertexColors;
  5129. a.push(S(_[0]), S(_[1]), S(_[2]))
  5130. }
  5131. }
  5132.  
  5133. function M(e, t, n) {
  5134. return n ? e | 1 << t : e & ~(1 << t)
  5135. }
  5136.  
  5137. function E(e) {
  5138. var t = e.x.toString() + e.y.toString() + e.z.toString();
  5139. return void 0 !== c[t] ? c[t] : (c[t] = s.length / 3, s.push(e.x, e.y, e.z), c[t])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement