Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ! function(e) {
- var t = {};
- function n(r) {
- if (t[r]) return t[r].exports;
- var i = t[r] = {
- i: r,
- l: !1,
- exports: {}
- };
- return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports
- }
- n.m = e, n.c = t, n.d = function(e, t, r) {
- n.o(e, t) || Object.defineProperty(e, t, {
- enumerable: !0,
- get: r
- })
- }, n.r = function(e) {
- "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
- value: "Module"
- }), Object.defineProperty(e, "__esModule", {
- value: !0
- })
- }, n.t = function(e, t) {
- if (1 & t && (e = n(e)), 8 & t) return e;
- if (4 & t && "object" == typeof e && e && e.__esModule) return e;
- var r = Object.create(null);
- if (n.r(r), Object.defineProperty(r, "default", {
- enumerable: !0,
- value: e
- }), 2 & t && "string" != typeof e)
- for (var i in e) n.d(r, i, function(t) {
- return e[t]
- }.bind(null, i));
- return r
- }, n.n = function(e) {
- var t = e && e.__esModule ? function() {
- return e.default
- } : function() {
- return e
- };
- return n.d(t, "a", t), t
- }, n.o = function(e, t) {
- return Object.prototype.hasOwnProperty.call(e, t)
- }, n.p = "", n(n.s = 114)
- }([function(e, t, n) {
- "use strict";
- function r(e = {}, t = "") {
- const n = document.createElement(e.tag || "div");
- for (let t in e) o(n, t, e[t]);
- return e.canChange && function(e, t) {
- new Proxy(t, {
- set(t, n, r) {
- if ("tag" == n) return !1;
- t[n] = r, o(e, n, r)
- }
- })
- }(n, e), Array.isArray(t) || (t = [t]), t.forEach(e => {
- e && (e.tagName ? n.appendChild(e) : n.appendChild(document.createTextNode(e)))
- }), n
- }
- function i(e, t) {
- new Proxy(t, {
- set: (n, r, i) => (e[r] = i, t[r] = i, !0)
- })
- }
- function o(e, t, n) {
- if ("tag" != t)
- if ("onClick" === t) ! function(e, t) {
- const n = e.lastOnClick || null;
- n && e.removeEventListener("click", n), e.addEventListener("click", t), e.lastOnClick = t
- }(e, n);
- else if ("dataset" == t) {
- for (let t in n) e.dataset[t] = n[t];
- i(e.dataset, n)
- } else if ("styles" == t) {
- for (let t in n) e.style[t] = n[t];
- i(e.style, n)
- } else e.setAttribute(t, n)
- }
- n.d(t, "b", function() {
- return r
- }), n.d(t, "c", function() {
- return a
- }), n.d(t, "a", function() {
- return s
- });
- function a(e, t, n) {
- const {
- classList: r
- } = e;
- n && !r.contains(t) ? r.add(t) : !n && r.contains(t) && r.remove(t)
- }
- class s {
- constructor(e = {}) {
- this.dom = e.dom || this.build(e)
- }
- build(e) {
- return r()
- }
- render() {
- return this.dom
- }
- setMode(e) {
- return this.dom.dataset.mode = e, this
- }
- setClass(e, t) {
- const {
- classList: n
- } = this.dom;
- return t && !n.contains(e) ? n.add(e) : !t && n.contains(e) && n.remove(e), this
- }
- onClick(e) {
- return this.dom.addEventListener("click", e), this
- }
- }
- }, function(e, t) {
- class n {
- constructor() {
- this.list = {}
- }
- on(e, t) {
- this.list[e] || (this.list[e] = []), this.list[e].push(t)
- }
- off(e, t) {
- this.list[e] || (this.list[e] = []), this.list[e] = this.list[e].filter(e => e != t)
- }
- call(e, ...t) {
- if (!this.list[e]) return this.log("not found event", e);
- this.list[e].forEach(e => e(...t))
- }
- clear(e) {
- if (!this.list[e]) return this.log("not found", e);
- this.list[e] = []
- }
- delete() {
- for (let e in this.list) delete this.list[e]
- }
- log() {}
- }
- const r = new n;
- e.exports = {
- Event: n,
- events: r,
- dispatchEvent: function(e) {
- const t = {};
- e.on = (e, n) => {
- t[e] || (t[e] = []), t.push(n)
- }, e.off = (e, n) => {
- t[e] || (t[e] = []), t[e] = t[e].filter(e => e != n)
- }, e.call = (e, ...n) => {
- t[e] || (t[e] = []), t[e].forEach(e => e(...n))
- }
- }
- }
- }, function(e, t, n) {
- "use strict";
- function r() {}
- n.r(t), n.d(t, "ACESFilmicToneMapping", function() {
- return ue
- }), n.d(t, "AddEquation", function() {
- return O
- }), n.d(t, "AddOperation", function() {
- return ie
- }), n.d(t, "AdditiveBlending", function() {
- return A
- }), n.d(t, "AlphaFormat", function() {
- return Ue
- }), n.d(t, "AlwaysDepth", function() {
- return Z
- }), n.d(t, "AmbientLight", function() {
- return Dc
- }), n.d(t, "AmbientLightProbe", function() {
- return ll
- }), n.d(t, "AnimationClip", function() {
- return Vs
- }), n.d(t, "AnimationLoader", function() {
- return Js
- }), n.d(t, "AnimationMixer", function() {
- return jl
- }), n.d(t, "AnimationObjectGroup", function() {
- return Il
- }), n.d(t, "AnimationUtils", function() {
- return Rs
- }), n.d(t, "ArcCurve", function() {
- return oc
- }), n.d(t, "ArrayCamera", function() {
- return Ao
- }), n.d(t, "ArrowHelper", function() {
- return lu
- }), n.d(t, "Audio", function() {
- return pl
- }), n.d(t, "AudioAnalyser", function() {
- return ml
- }), n.d(t, "AudioContext", function() {
- return il
- }), n.d(t, "AudioListener", function() {
- return dl
- }), n.d(t, "AudioLoader", function() {
- return ol
- }), n.d(t, "AxesHelper", function() {
- return uu
- }), n.d(t, "AxisHelper", function() {
- return ju
- }), n.d(t, "BackSide", function() {
- return b
- }), n.d(t, "BasicDepthPacking", function() {
- return Bt
- }), n.d(t, "BasicShadowMap", function() {
- return m
- }), n.d(t, "BinaryTextureLoader", function() {
- return Fu
- }), n.d(t, "Bone", function() {
- return Ko
- }), n.d(t, "BooleanKeyframeTrack", function() {
- return Ns
- }), n.d(t, "BoundingBoxHelper", function() {
- return Nu
- }), n.d(t, "Box2", function() {
- return Vl
- }), n.d(t, "Box3", function() {
- return jn
- }), n.d(t, "Box3Helper", function() {
- return su
- }), n.d(t, "BoxBufferGeometry", function() {
- return yr
- }), n.d(t, "BoxGeometry", function() {
- return gr
- }), n.d(t, "BoxHelper", function() {
- return au
- }), n.d(t, "BufferAttribute", function() {
- return $n
- }), n.d(t, "BufferGeometry", function() {
- return pr
- }), n.d(t, "BufferGeometryLoader", function() {
- return Fc
- }), n.d(t, "ByteType", function() {
- return Ce
- }), n.d(t, "Cache", function() {
- return qs
- }), n.d(t, "Camera", function() {
- return Sr
- }), n.d(t, "CameraHelper", function() {
- return ou
- }), n.d(t, "CanvasRenderer", function() {
- return Hu
- }), n.d(t, "CanvasTexture", function() {
- return oa
- }), n.d(t, "CatmullRomCurve3", function() {
- return hc
- }), n.d(t, "CineonToneMapping", function() {
- return le
- }), n.d(t, "CircleBufferGeometry", function() {
- return ys
- }), n.d(t, "CircleGeometry", function() {
- return gs
- }), n.d(t, "ClampToEdgeWrapping", function() {
- return xe
- }), n.d(t, "Clock", function() {
- return hl
- }), n.d(t, "ClosedSplineCurve3", function() {
- return ku
- }), n.d(t, "Color", function() {
- return Vn
- }), n.d(t, "ColorKeyframeTrack", function() {
- return Bs
- }), n.d(t, "CompressedTexture", function() {
- return ia
- }), n.d(t, "CompressedTextureLoader", function() {
- return $s
- }), n.d(t, "ConeBufferGeometry", function() {
- return vs
- }), n.d(t, "ConeGeometry", function() {
- return ms
- }), n.d(t, "CubeCamera", function() {
- return Rr
- }), n.d(t, "CubeGeometry", function() {
- return gr
- }), n.d(t, "CubeReflectionMapping", function() {
- return de
- }), n.d(t, "CubeRefractionMapping", function() {
- return pe
- }), n.d(t, "CubeTexture", function() {
- return ei
- }), n.d(t, "CubeTextureLoader", function() {
- return tc
- }), n.d(t, "CubeUVReflectionMapping", function() {
- return ge
- }), n.d(t, "CubeUVRefractionMapping", function() {
- return ye
- }), n.d(t, "CubicBezierCurve", function() {
- return mc
- }), n.d(t, "CubicBezierCurve3", function() {
- return vc
- }), n.d(t, "CubicInterpolant", function() {
- return ks
- }), n.d(t, "CullFaceBack", function() {
- return u
- }), n.d(t, "CullFaceFront", function() {
- return h
- }), n.d(t, "CullFaceFrontBack", function() {
- return d
- }), n.d(t, "CullFaceNone", function() {
- return l
- }), n.d(t, "Curve", function() {
- return rc
- }), n.d(t, "CurvePath", function() {
- return Mc
- }), n.d(t, "CustomBlending", function() {
- return R
- }), n.d(t, "CylinderBufferGeometry", function() {
- return fs
- }), n.d(t, "CylinderGeometry", function() {
- return ps
- }), n.d(t, "Cylindrical", function() {
- return Hl
- }), n.d(t, "DataTexture", function() {
- return kr
- }), n.d(t, "DataTexture2DArray", function() {
- return ti
- }), n.d(t, "DataTexture3D", function() {
- return ni
- }), n.d(t, "DataTextureLoader", function() {
- return Qs
- }), n.d(t, "DefaultLoadingManager", function() {
- return Ys
- }), n.d(t, "DepthFormat", function() {
- return qe
- }), n.d(t, "DepthStencilFormat", function() {
- return Xe
- }), n.d(t, "DepthTexture", function() {
- return aa
- }), n.d(t, "DirectionalLight", function() {
- return Ic
- }), n.d(t, "DirectionalLightHelper", function() {
- return iu
- }), n.d(t, "DirectionalLightShadow", function() {
- return kc
- }), n.d(t, "DiscreteInterpolant", function() {
- return Ds
- }), n.d(t, "DodecahedronBufferGeometry", function() {
- return ba
- }), n.d(t, "DodecahedronGeometry", function() {
- return ya
- }), n.d(t, "DoubleSide", function() {
- return x
- }), n.d(t, "DstAlphaFactor", function() {
- return H
- }), n.d(t, "DstColorFactor", function() {
- return W
- }), n.d(t, "DynamicBufferAttribute", function() {
- return Mu
- }), n.d(t, "EdgesGeometry", function() {
- return ds
- }), n.d(t, "EdgesHelper", function() {
- return Bu
- }), n.d(t, "EllipseCurve", function() {
- return ic
- }), n.d(t, "EqualDepth", function() {
- return $
- }), n.d(t, "EquirectangularReflectionMapping", function() {
- return fe
- }), n.d(t, "EquirectangularRefractionMapping", function() {
- return me
- }), n.d(t, "Euler", function() {
- return hn
- }), n.d(t, "EventDispatcher", function() {
- return r
- }), n.d(t, "ExtrudeBufferGeometry", function() {
- return $a
- }), n.d(t, "ExtrudeGeometry", function() {
- return Ja
- }), n.d(t, "Face3", function() {
- return Yn
- }), n.d(t, "Face4", function() {
- return hu
- }), n.d(t, "FaceColors", function() {
- return E
- }), n.d(t, "FaceNormalsHelper", function() {
- return ru
- }), n.d(t, "FileLoader", function() {
- return Ks
- }), n.d(t, "FlatShading", function() {
- return w
- }), n.d(t, "Float32Attribute", function() {
- return Ru
- }), n.d(t, "Float32BufferAttribute", function() {
- return ar
- }), n.d(t, "Float64Attribute", function() {
- return Ou
- }), n.d(t, "Float64BufferAttribute", function() {
- return sr
- }), n.d(t, "FloatType", function() {
- return Ie
- }), n.d(t, "Fog", function() {
- return Go
- }), n.d(t, "FogExp2", function() {
- return Fo
- }), n.d(t, "Font", function() {
- return el
- }), n.d(t, "FontLoader", function() {
- return nl
- }), n.d(t, "FrontFaceDirectionCCW", function() {
- return f
- }), n.d(t, "FrontFaceDirectionCW", function() {
- return p
- }), n.d(t, "FrontSide", function() {
- return y
- }), n.d(t, "Frustum", function() {
- return Dr
- }), n.d(t, "GammaEncoding", function() {
- return Ot
- }), n.d(t, "Geometry", function() {
- return vr
- }), n.d(t, "GeometryUtils", function() {
- return Gu
- }), n.d(t, "GreaterDepth", function() {
- return ee
- }), n.d(t, "GreaterEqualDepth", function() {
- return Q
- }), n.d(t, "GridHelper", function() {
- return eu
- }), n.d(t, "Group", function() {
- return Lo
- }), n.d(t, "HalfFloatType", function() {
- return De
- }), n.d(t, "HemisphereLight", function() {
- return Lc
- }), n.d(t, "HemisphereLightHelper", function() {
- return $l
- }), n.d(t, "HemisphereLightProbe", function() {
- return cl
- }), n.d(t, "IcosahedronBufferGeometry", function() {
- return ga
- }), n.d(t, "IcosahedronGeometry", function() {
- return va
- }), n.d(t, "ImageBitmapLoader", function() {
- return $c
- }), n.d(t, "ImageLoader", function() {
- return ec
- }), n.d(t, "ImageUtils", function() {
- return rn
- }), n.d(t, "ImmediateRenderObject", function() {
- return ql
- }), n.d(t, "InstancedBufferAttribute", function() {
- return Uc
- }), n.d(t, "InstancedBufferGeometry", function() {
- return zc
- }), n.d(t, "InstancedInterleavedBuffer", function() {
- return Bl
- }), n.d(t, "Int16Attribute", function() {
- return Lu
- }), n.d(t, "Int16BufferAttribute", function() {
- return nr
- }), n.d(t, "Int32Attribute", function() {
- return Cu
- }), n.d(t, "Int32BufferAttribute", function() {
- return ir
- }), n.d(t, "Int8Attribute", function() {
- return Eu
- }), n.d(t, "Int8BufferAttribute", function() {
- return Qn
- }), n.d(t, "IntType", function() {
- return Oe
- }), n.d(t, "InterleavedBuffer", function() {
- return Ho
- }), n.d(t, "InterleavedBufferAttribute", function() {
- return Vo
- }), n.d(t, "Interpolant", function() {
- return Os
- }), n.d(t, "InterpolateDiscrete", function() {
- return wt
- }), n.d(t, "InterpolateLinear", function() {
- return _t
- }), n.d(t, "InterpolateSmooth", function() {
- return Mt
- }), n.d(t, "JSONLoader", function() {
- return Vu
- }), n.d(t, "KeyframeTrack", function() {
- return js
- }), n.d(t, "LOD", function() {
- return Xo
- }), n.d(t, "LatheBufferGeometry", function() {
- return cs
- }), n.d(t, "LatheGeometry", function() {
- return ss
- }), n.d(t, "Layers", function() {
- return dn
- }), n.d(t, "LensFlare", function() {
- return qu
- }), n.d(t, "LessDepth", function() {
- return K
- }), n.d(t, "LessEqualDepth", function() {
- return J
- }), n.d(t, "Light", function() {
- return Tc
- }), n.d(t, "LightProbe", function() {
- return sl
- }), n.d(t, "LightProbeHelper", function() {
- return Ql
- }), n.d(t, "LightShadow", function() {
- return Ac
- }), n.d(t, "Line", function() {
- return $o
- }), n.d(t, "Line3", function() {
- return Wl
- }), n.d(t, "LineBasicMaterial", function() {
- return Jo
- }), n.d(t, "LineCurve", function() {
- return gc
- }), n.d(t, "LineCurve3", function() {
- return yc
- }), n.d(t, "LineDashedMaterial", function() {
- return Cs
- }), n.d(t, "LineLoop", function() {
- return ea
- }), n.d(t, "LinePieces", function() {
- return pu
- }), n.d(t, "LineSegments", function() {
- return Qo
- }), n.d(t, "LineStrip", function() {
- return du
- }), n.d(t, "LinearEncoding", function() {
- return Pt
- }), n.d(t, "LinearFilter", function() {
- return Se
- }), n.d(t, "LinearInterpolant", function() {
- return Is
- }), n.d(t, "LinearMipMapLinearFilter", function() {
- return Le
- }), n.d(t, "LinearMipMapNearestFilter", function() {
- return Te
- }), n.d(t, "LinearToneMapping", function() {
- return ae
- }), n.d(t, "Loader", function() {
- return rl
- }), n.d(t, "LoaderUtils", function() {
- return Bc
- }), n.d(t, "LoadingManager", function() {
- return Xs
- }), n.d(t, "LogLuvEncoding", function() {
- return It
- }), n.d(t, "LoopOnce", function() {
- return yt
- }), n.d(t, "LoopPingPong", function() {
- return xt
- }), n.d(t, "LoopRepeat", function() {
- return bt
- }), n.d(t, "LuminanceAlphaFormat", function() {
- return Ve
- }), n.d(t, "LuminanceFormat", function() {
- return He
- }), n.d(t, "MOUSE", function() {
- return c
- }), n.d(t, "Material", function() {
- return Kn
- }), n.d(t, "MaterialLoader", function() {
- return Nc
- }), n.d(t, "Math", function() {
- return Gt
- }), n.d(t, "Matrix3", function() {
- return qt
- }), n.d(t, "Matrix4", function() {
- return un
- }), n.d(t, "MaxEquation", function() {
- return j
- }), n.d(t, "Mesh", function() {
- return fr
- }), n.d(t, "MeshBasicMaterial", function() {
- return Jn
- }), n.d(t, "MeshDepthMaterial", function() {
- return wo
- }), n.d(t, "MeshDistanceMaterial", function() {
- return _o
- }), n.d(t, "MeshFaceMaterial", function() {
- return fu
- }), n.d(t, "MeshLambertMaterial", function() {
- return Ls
- }), n.d(t, "MeshMatcapMaterial", function() {
- return As
- }), n.d(t, "MeshNormalMaterial", function() {
- return Ts
- }), n.d(t, "MeshPhongMaterial", function() {
- return Es
- }), n.d(t, "MeshPhysicalMaterial", function() {
- return Ms
- }), n.d(t, "MeshStandardMaterial", function() {
- return _s
- }), n.d(t, "MeshToonMaterial", function() {
- return Ss
- }), n.d(t, "MinEquation", function() {
- return D
- }), n.d(t, "MirroredRepeatWrapping", function() {
- return we
- }), n.d(t, "MixOperation", function() {
- return re
- }), n.d(t, "MultiMaterial", function() {
- return mu
- }), n.d(t, "MultiplyBlending", function() {
- return P
- }), n.d(t, "MultiplyOperation", function() {
- return ne
- }), n.d(t, "NearestFilter", function() {
- return _e
- }), n.d(t, "NearestMipMapLinearFilter", function() {
- return Ee
- }), n.d(t, "NearestMipMapNearestFilter", function() {
- return Me
- }), n.d(t, "NeverDepth", function() {
- return Y
- }), n.d(t, "NoBlending", function() {
- return T
- }), n.d(t, "NoColors", function() {
- return M
- }), n.d(t, "NoToneMapping", function() {
- return oe
- }), n.d(t, "NormalBlending", function() {
- return L
- }), n.d(t, "NotEqualDepth", function() {
- return te
- }), n.d(t, "NumberKeyframeTrack", function() {
- return zs
- }), n.d(t, "Object3D", function() {
- return In
- }), n.d(t, "ObjectLoader", function() {
- return Hc
- }), n.d(t, "ObjectSpaceNormalMap", function() {
- return Ft
- }), n.d(t, "OctahedronBufferGeometry", function() {
- return ma
- }), n.d(t, "OctahedronGeometry", function() {
- return fa
- }), n.d(t, "OneFactor", function() {
- return B
- }), n.d(t, "OneMinusDstAlphaFactor", function() {
- return V
- }), n.d(t, "OneMinusDstColorFactor", function() {
- return q
- }), n.d(t, "OneMinusSrcAlphaFactor", function() {
- return G
- }), n.d(t, "OneMinusSrcColorFactor", function() {
- return U
- }), n.d(t, "OrthographicCamera", function() {
- return Oc
- }), n.d(t, "PCFShadowMap", function() {
- return v
- }), n.d(t, "PCFSoftShadowMap", function() {
- return g
- }), n.d(t, "ParametricBufferGeometry", function() {
- return la
- }), n.d(t, "ParametricGeometry", function() {
- return ca
- }), n.d(t, "Particle", function() {
- return gu
- }), n.d(t, "ParticleBasicMaterial", function() {
- return xu
- }), n.d(t, "ParticleSystem", function() {
- return yu
- }), n.d(t, "ParticleSystemMaterial", function() {
- return wu
- }), n.d(t, "Path", function() {
- return Ec
- }), n.d(t, "PerspectiveCamera", function() {
- return Tr
- }), n.d(t, "Plane", function() {
- return Ir
- }), n.d(t, "PlaneBufferGeometry", function() {
- return Gr
- }), n.d(t, "PlaneGeometry", function() {
- return Fr
- }), n.d(t, "PlaneHelper", function() {
- return cu
- }), n.d(t, "PointCloud", function() {
- return vu
- }), n.d(t, "PointCloudMaterial", function() {
- return bu
- }), n.d(t, "PointLight", function() {
- return Rc
- }), n.d(t, "PointLightHelper", function() {
- return Kl
- }), n.d(t, "Points", function() {
- return na
- }), n.d(t, "PointsMaterial", function() {
- return ta
- }), n.d(t, "PolarGridHelper", function() {
- return tu
- }), n.d(t, "PolyhedronBufferGeometry", function() {
- return ha
- }), n.d(t, "PolyhedronGeometry", function() {
- return ua
- }), n.d(t, "PositionalAudio", function() {
- return fl
- }), n.d(t, "PositionalAudioHelper", function() {
- return nu
- }), n.d(t, "PropertyBinding", function() {
- return kl
- }), n.d(t, "PropertyMixer", function() {
- return vl
- }), n.d(t, "QuadraticBezierCurve", function() {
- return bc
- }), n.d(t, "QuadraticBezierCurve3", function() {
- return xc
- }), n.d(t, "Quaternion", function() {
- return Vt
- }), n.d(t, "QuaternionKeyframeTrack", function() {
- return Fs
- }), n.d(t, "QuaternionLinearInterpolant", function() {
- return Us
- }), n.d(t, "REVISION", function() {
- return s
- }), n.d(t, "RGBADepthPacking", function() {
- return zt
- }), n.d(t, "RGBAFormat", function() {
- return Ge
- }), n.d(t, "RGBA_ASTC_10x10_Format", function() {
- return mt
- }), n.d(t, "RGBA_ASTC_10x5_Format", function() {
- return dt
- }), n.d(t, "RGBA_ASTC_10x6_Format", function() {
- return pt
- }), n.d(t, "RGBA_ASTC_10x8_Format", function() {
- return ft
- }), n.d(t, "RGBA_ASTC_12x10_Format", function() {
- return vt
- }), n.d(t, "RGBA_ASTC_12x12_Format", function() {
- return gt
- }), n.d(t, "RGBA_ASTC_4x4_Format", function() {
- return it
- }), n.d(t, "RGBA_ASTC_5x4_Format", function() {
- return ot
- }), n.d(t, "RGBA_ASTC_5x5_Format", function() {
- return at
- }), n.d(t, "RGBA_ASTC_6x5_Format", function() {
- return st
- }), n.d(t, "RGBA_ASTC_6x6_Format", function() {
- return ct
- }), n.d(t, "RGBA_ASTC_8x5_Format", function() {
- return lt
- }), n.d(t, "RGBA_ASTC_8x6_Format", function() {
- return ut
- }), n.d(t, "RGBA_ASTC_8x8_Format", function() {
- return ht
- }), n.d(t, "RGBA_PVRTC_2BPPV1_Format", function() {
- return nt
- }), n.d(t, "RGBA_PVRTC_4BPPV1_Format", function() {
- return tt
- }), n.d(t, "RGBA_S3TC_DXT1_Format", function() {
- return Ke
- }), n.d(t, "RGBA_S3TC_DXT3_Format", function() {
- return Je
- }), n.d(t, "RGBA_S3TC_DXT5_Format", function() {
- return $e
- }), n.d(t, "RGBDEncoding", function() {
- return Nt
- }), n.d(t, "RGBEEncoding", function() {
- return kt
- }), n.d(t, "RGBEFormat", function() {
- return We
- }), n.d(t, "RGBFormat", function() {
- return Fe
- }), n.d(t, "RGBM16Encoding", function() {
- return jt
- }), n.d(t, "RGBM7Encoding", function() {
- return Dt
- }), n.d(t, "RGB_ETC1_Format", function() {
- return rt
- }), n.d(t, "RGB_PVRTC_2BPPV1_Format", function() {
- return et
- }), n.d(t, "RGB_PVRTC_4BPPV1_Format", function() {
- return Qe
- }), n.d(t, "RGB_S3TC_DXT1_Format", function() {
- return Ze
- }), n.d(t, "RawShaderMaterial", function() {
- return ws
- }), n.d(t, "Ray", function() {
- return Bn
- }), n.d(t, "Raycaster", function() {
- return zl
- }), n.d(t, "RectAreaLight", function() {
- return jc
- }), n.d(t, "RectAreaLightHelper", function() {
- return Jl
- }), n.d(t, "RedFormat", function() {
- return Ye
- }), n.d(t, "ReinhardToneMapping", function() {
- return se
- }), n.d(t, "RepeatWrapping", function() {
- return be
- }), n.d(t, "ReverseSubtractEquation", function() {
- return I
- }), n.d(t, "RingBufferGeometry", function() {
- return as
- }), n.d(t, "RingGeometry", function() {
- return os
- }), n.d(t, "Scene", function() {
- return Dn
- }), n.d(t, "SceneUtils", function() {
- return Wu
- }), n.d(t, "ShaderChunk", function() {
- return jr
- }), n.d(t, "ShaderLib", function() {
- return Br
- }), n.d(t, "ShaderMaterial", function() {
- return Er
- }), n.d(t, "ShadowMaterial", function() {
- return xs
- }), n.d(t, "Shape", function() {
- return Sc
- }), n.d(t, "ShapeBufferGeometry", function() {
- return us
- }), n.d(t, "ShapeGeometry", function() {
- return ls
- }), n.d(t, "ShapePath", function() {
- return Qc
- }), n.d(t, "ShapeUtils", function() {
- return Ya
- }), n.d(t, "ShortType", function() {
- return Pe
- }), n.d(t, "Skeleton", function() {
- return Zo
- }), n.d(t, "SkeletonHelper", function() {
- return Zl
- }), n.d(t, "SkinnedMesh", function() {
- return Yo
- }), n.d(t, "SmoothShading", function() {
- return _
- }), n.d(t, "Sphere", function() {
- return Nn
- }), n.d(t, "SphereBufferGeometry", function() {
- return is
- }), n.d(t, "SphereGeometry", function() {
- return rs
- }), n.d(t, "Spherical", function() {
- return Gl
- }), n.d(t, "SphericalHarmonics3", function() {
- return al
- }), n.d(t, "SphericalReflectionMapping", function() {
- return ve
- }), n.d(t, "Spline", function() {
- return Du
- }), n.d(t, "SplineCurve", function() {
- return wc
- }), n.d(t, "SplineCurve3", function() {
- return Iu
- }), n.d(t, "SpotLight", function() {
- return Pc
- }), n.d(t, "SpotLightHelper", function() {
- return Yl
- }), n.d(t, "SpotLightShadow", function() {
- return Cc
- }), n.d(t, "Sprite", function() {
- return qo
- }), n.d(t, "SpriteMaterial", function() {
- return Wo
- }), n.d(t, "SrcAlphaFactor", function() {
- return F
- }), n.d(t, "SrcAlphaSaturateFactor", function() {
- return X
- }), n.d(t, "SrcColorFactor", function() {
- return z
- }), n.d(t, "StereoCamera", function() {
- return ul
- }), n.d(t, "StringKeyframeTrack", function() {
- return Gs
- }), n.d(t, "SubtractEquation", function() {
- return k
- }), n.d(t, "SubtractiveBlending", function() {
- return C
- }), n.d(t, "TangentSpaceNormalMap", function() {
- return Ut
- }), n.d(t, "TetrahedronBufferGeometry", function() {
- return pa
- }), n.d(t, "TetrahedronGeometry", function() {
- return da
- }), n.d(t, "TextBufferGeometry", function() {
- return ns
- }), n.d(t, "TextGeometry", function() {
- return ts
- }), n.d(t, "Texture", function() {
- return an
- }), n.d(t, "TextureLoader", function() {
- return nc
- }), n.d(t, "TorusBufferGeometry", function() {
- return Sa
- }), n.d(t, "TorusGeometry", function() {
- return Ea
- }), n.d(t, "TorusKnotBufferGeometry", function() {
- return Ma
- }), n.d(t, "TorusKnotGeometry", function() {
- return _a
- }), n.d(t, "Triangle", function() {
- return zn
- }), n.d(t, "TriangleFanDrawMode", function() {
- return Ct
- }), n.d(t, "TriangleStripDrawMode", function() {
- return At
- }), n.d(t, "TrianglesDrawMode", function() {
- return Lt
- }), n.d(t, "TubeBufferGeometry", function() {
- return wa
- }), n.d(t, "TubeGeometry", function() {
- return xa
- }), n.d(t, "UVMapping", function() {
- return he
- }), n.d(t, "Uint16Attribute", function() {
- return Au
- }), n.d(t, "Uint16BufferAttribute", function() {
- return rr
- }), n.d(t, "Uint32Attribute", function() {
- return Pu
- }), n.d(t, "Uint32BufferAttribute", function() {
- return or
- }), n.d(t, "Uint8Attribute", function() {
- return Su
- }), n.d(t, "Uint8BufferAttribute", function() {
- return er
- }), n.d(t, "Uint8ClampedAttribute", function() {
- return Tu
- }), n.d(t, "Uint8ClampedBufferAttribute", function() {
- return tr
- }), n.d(t, "Uncharted2ToneMapping", function() {
- return ce
- }), n.d(t, "Uniform", function() {
- return Nl
- }), n.d(t, "UniformsLib", function() {
- return Nr
- }), n.d(t, "UniformsUtils", function() {
- return wr
- }), n.d(t, "UnsignedByteType", function() {
- return Ae
- }), n.d(t, "UnsignedInt248Type", function() {
- return ze
- }), n.d(t, "UnsignedIntType", function() {
- return ke
- }), n.d(t, "UnsignedShort4444Type", function() {
- return je
- }), n.d(t, "UnsignedShort5551Type", function() {
- return Ne
- }), n.d(t, "UnsignedShort565Type", function() {
- return Be
- }), n.d(t, "UnsignedShortType", function() {
- return Re
- }), n.d(t, "Vector2", function() {
- return Ht
- }), n.d(t, "Vector3", function() {
- return Wt
- }), n.d(t, "Vector4", function() {
- return sn
- }), n.d(t, "VectorKeyframeTrack", function() {
- return Hs
- }), n.d(t, "Vertex", function() {
- return _u
- }), n.d(t, "VertexColors", function() {
- return S
- }), n.d(t, "VertexNormalsHelper", function() {
- return Xl
- }), n.d(t, "VideoTexture", function() {
- return ra
- }), n.d(t, "WebGLMultisampleRenderTarget", function() {
- return ln
- }), n.d(t, "WebGLRenderTarget", function() {
- return cn
- }), n.d(t, "WebGLRenderTargetCube", function() {
- return Or
- }), n.d(t, "WebGLRenderer", function() {
- return Uo
- }), n.d(t, "WebGLUtils", function() {
- return To
- }), n.d(t, "WireframeGeometry", function() {
- return sa
- }), n.d(t, "WireframeHelper", function() {
- return zu
- }), n.d(t, "WrapAroundEnding", function() {
- return Tt
- }), n.d(t, "XHRLoader", function() {
- return Uu
- }), n.d(t, "ZeroCurvatureEnding", function() {
- return Et
- }), n.d(t, "ZeroFactor", function() {
- return N
- }), n.d(t, "ZeroSlopeEnding", function() {
- return St
- }), n.d(t, "sRGBEncoding", function() {
- return Rt
- }), void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)), void 0 === Number.isInteger && (Number.isInteger = function(e) {
- return "number" == typeof e && isFinite(e) && Math.floor(e) === e
- }), void 0 === Math.sign && (Math.sign = function(e) {
- return e < 0 ? -1 : e > 0 ? 1 : +e
- }), "name" in Function.prototype == !1 && Object.defineProperty(Function.prototype, "name", {
- get: function() {
- return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]
- }
- }), void 0 === Object.assign && (Object.assign = function(e) {
- if (null == e) throw new TypeError("Cannot convert undefined or null to object");
- for (var t = Object(e), n = 1; n < arguments.length; n++) {
- var r = arguments[n];
- if (null != r)
- for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (t[i] = r[i])
- }
- return t
- }), Object.assign(r.prototype, {
- addEventListener: function(e, t) {
- void 0 === this._listeners && (this._listeners = {});
- var n = this._listeners;
- void 0 === n[e] && (n[e] = []), -1 === n[e].indexOf(t) && n[e].push(t)
- },
- hasEventListener: function(e, t) {
- if (void 0 === this._listeners) return !1;
- var n = this._listeners;
- return void 0 !== n[e] && -1 !== n[e].indexOf(t)
- },
- removeEventListener: function(e, t) {
- if (void 0 !== this._listeners) {
- var n = this._listeners[e];
- if (void 0 !== n) {
- var r = n.indexOf(t); - 1 !== r && n.splice(r, 1)
- }
- }
- },
- dispatchEvent: function(e) {
- if (void 0 !== this._listeners) {
- var t = this._listeners[e.type];
- if (void 0 !== t) {
- e.target = this;
- for (var n = t.slice(0), r = 0, i = n.length; r < i; r++) n[r].call(this, e)
- }
- }
- }
- });
- var i, o, a, s = "106",
- c = {
- LEFT: 0,
- MIDDLE: 1,
- RIGHT: 2
- },
- l = 0,
- u = 1,
- h = 2,
- d = 3,
- p = 0,
- f = 1,
- m = 0,
- v = 1,
- g = 2,
- y = 0,
- b = 1,
- x = 2,
- w = 1,
- _ = 2,
- M = 0,
- E = 1,
- S = 2,
- T = 0,
- L = 1,
- A = 2,
- C = 3,
- P = 4,
- R = 5,
- O = 100,
- k = 101,
- I = 102,
- D = 103,
- j = 104,
- N = 200,
- B = 201,
- z = 202,
- U = 203,
- F = 204,
- G = 205,
- H = 206,
- V = 207,
- W = 208,
- q = 209,
- X = 210,
- Y = 0,
- Z = 1,
- K = 2,
- J = 3,
- $ = 4,
- Q = 5,
- ee = 6,
- te = 7,
- ne = 0,
- re = 1,
- ie = 2,
- oe = 0,
- ae = 1,
- se = 2,
- ce = 3,
- le = 4,
- ue = 5,
- he = 300,
- de = 301,
- pe = 302,
- fe = 303,
- me = 304,
- ve = 305,
- ge = 306,
- ye = 307,
- be = 1e3,
- xe = 1001,
- we = 1002,
- _e = 1003,
- Me = 1004,
- Ee = 1005,
- Se = 1006,
- Te = 1007,
- Le = 1008,
- Ae = 1009,
- Ce = 1010,
- Pe = 1011,
- Re = 1012,
- Oe = 1013,
- ke = 1014,
- Ie = 1015,
- De = 1016,
- je = 1017,
- Ne = 1018,
- Be = 1019,
- ze = 1020,
- Ue = 1021,
- Fe = 1022,
- Ge = 1023,
- He = 1024,
- Ve = 1025,
- We = Ge,
- qe = 1026,
- Xe = 1027,
- Ye = 1028,
- Ze = 33776,
- Ke = 33777,
- Je = 33778,
- $e = 33779,
- Qe = 35840,
- et = 35841,
- tt = 35842,
- nt = 35843,
- rt = 36196,
- it = 37808,
- ot = 37809,
- at = 37810,
- st = 37811,
- ct = 37812,
- lt = 37813,
- ut = 37814,
- ht = 37815,
- dt = 37816,
- pt = 37817,
- ft = 37818,
- mt = 37819,
- vt = 37820,
- gt = 37821,
- yt = 2200,
- bt = 2201,
- xt = 2202,
- wt = 2300,
- _t = 2301,
- Mt = 2302,
- Et = 2400,
- St = 2401,
- Tt = 2402,
- Lt = 0,
- At = 1,
- Ct = 2,
- Pt = 3e3,
- Rt = 3001,
- Ot = 3007,
- kt = 3002,
- It = 3003,
- Dt = 3004,
- jt = 3005,
- Nt = 3006,
- Bt = 3200,
- zt = 3201,
- Ut = 0,
- Ft = 1,
- Gt = {
- DEG2RAD: Math.PI / 180,
- RAD2DEG: 180 / Math.PI,
- generateUUID: function() {
- for (var e = [], t = 0; t < 256; t++) e[t] = (t < 16 ? "0" : "") + t.toString(16);
- return function() {
- var t = 4294967295 * Math.random() | 0,
- n = 4294967295 * Math.random() | 0,
- r = 4294967295 * Math.random() | 0,
- i = 4294967295 * Math.random() | 0;
- 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()
- }
- }(),
- clamp: function(e, t, n) {
- return Math.max(t, Math.min(n, e))
- },
- euclideanModulo: function(e, t) {
- return (e % t + t) % t
- },
- mapLinear: function(e, t, n, r, i) {
- return r + (e - t) * (i - r) / (n - t)
- },
- lerp: function(e, t, n) {
- return (1 - n) * e + n * t
- },
- smoothstep: function(e, t, n) {
- return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t)) * e * (3 - 2 * e)
- },
- smootherstep: function(e, t, n) {
- return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t)) * e * e * (e * (6 * e - 15) + 10)
- },
- randInt: function(e, t) {
- return e + Math.floor(Math.random() * (t - e + 1))
- },
- randFloat: function(e, t) {
- return e + Math.random() * (t - e)
- },
- randFloatSpread: function(e) {
- return e * (.5 - Math.random())
- },
- degToRad: function(e) {
- return e * Gt.DEG2RAD
- },
- radToDeg: function(e) {
- return e * Gt.RAD2DEG
- },
- isPowerOfTwo: function(e) {
- return 0 == (e & e - 1) && 0 !== e
- },
- ceilPowerOfTwo: function(e) {
- return Math.pow(2, Math.ceil(Math.log(e) / Math.LN2))
- },
- floorPowerOfTwo: function(e) {
- return Math.pow(2, Math.floor(Math.log(e) / Math.LN2))
- }
- };
- function Ht(e, t) {
- this.x = e || 0, this.y = t || 0
- }
- function Vt(e, t, n, r) {
- this._x = e || 0, this._y = t || 0, this._z = n || 0, this._w = void 0 !== r ? r : 1
- }
- function Wt(e, t, n) {
- this.x = e || 0, this.y = t || 0, this.z = n || 0
- }
- function qt() {
- 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.")
- }
- Object.defineProperties(Ht.prototype, {
- width: {
- get: function() {
- return this.x
- },
- set: function(e) {
- this.x = e
- }
- },
- height: {
- get: function() {
- return this.y
- },
- set: function(e) {
- this.y = e
- }
- }
- }), Object.assign(Ht.prototype, {
- isVector2: !0,
- set: function(e, t) {
- return this.x = e, this.y = t, this
- },
- setScalar: function(e) {
- return this.x = e, this.y = e, this
- },
- setX: function(e) {
- return this.x = e, this
- },
- setY: function(e) {
- return this.y = e, this
- },
- setComponent: function(e, t) {
- switch (e) {
- case 0:
- this.x = t;
- break;
- case 1:
- this.y = t;
- break;
- default:
- throw new Error("index is out of range: " + e)
- }
- return this
- },
- getComponent: function(e) {
- switch (e) {
- case 0:
- return this.x;
- case 1:
- return this.y;
- default:
- throw new Error("index is out of range: " + e)
- }
- },
- clone: function() {
- return new this.constructor(this.x, this.y)
- },
- copy: function(e) {
- return this.x = e.x, this.y = e.y, this
- },
- add: function(e, t) {
- 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)
- },
- addScalar: function(e) {
- return this.x += e, this.y += e, this
- },
- addVectors: function(e, t) {
- return this.x = e.x + t.x, this.y = e.y + t.y, this
- },
- addScaledVector: function(e, t) {
- return this.x += e.x * t, this.y += e.y * t, this
- },
- sub: function(e, t) {
- 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)
- },
- subScalar: function(e) {
- return this.x -= e, this.y -= e, this
- },
- subVectors: function(e, t) {
- return this.x = e.x - t.x, this.y = e.y - t.y, this
- },
- multiply: function(e) {
- return this.x *= e.x, this.y *= e.y, this
- },
- multiplyScalar: function(e) {
- return this.x *= e, this.y *= e, this
- },
- divide: function(e) {
- return this.x /= e.x, this.y /= e.y, this
- },
- divideScalar: function(e) {
- return this.multiplyScalar(1 / e)
- },
- applyMatrix3: function(e) {
- var t = this.x,
- n = this.y,
- r = e.elements;
- return this.x = r[0] * t + r[3] * n + r[6], this.y = r[1] * t + r[4] * n + r[7], this
- },
- min: function(e) {
- return this.x = Math.min(this.x, e.x), this.y = Math.min(this.y, e.y), this
- },
- max: function(e) {
- return this.x = Math.max(this.x, e.x), this.y = Math.max(this.y, e.y), this
- },
- clamp: function(e, t) {
- 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
- },
- clampScalar: function(e, t) {
- return this.x = Math.max(e, Math.min(t, this.x)), this.y = Math.max(e, Math.min(t, this.y)), this
- },
- clampLength: function(e, t) {
- var n = this.length();
- return this.divideScalar(n || 1).multiplyScalar(Math.max(e, Math.min(t, n)))
- },
- floor: function() {
- return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this
- },
- ceil: function() {
- return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this
- },
- round: function() {
- return this.x = Math.round(this.x), this.y = Math.round(this.y), this
- },
- roundToZero: function() {
- 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
- },
- negate: function() {
- return this.x = -this.x, this.y = -this.y, this
- },
- dot: function(e) {
- return this.x * e.x + this.y * e.y
- },
- cross: function(e) {
- return this.x * e.y - this.y * e.x
- },
- lengthSq: function() {
- return this.x * this.x + this.y * this.y
- },
- length: function() {
- return Math.sqrt(this.x * this.x + this.y * this.y)
- },
- manhattanLength: function() {
- return Math.abs(this.x) + Math.abs(this.y)
- },
- normalize: function() {
- return this.divideScalar(this.length() || 1)
- },
- angle: function() {
- var e = Math.atan2(this.y, this.x);
- return e < 0 && (e += 2 * Math.PI), e
- },
- distanceTo: function(e) {
- return Math.sqrt(this.distanceToSquared(e))
- },
- distanceToSquared: function(e) {
- var t = this.x - e.x,
- n = this.y - e.y;
- return t * t + n * n
- },
- manhattanDistanceTo: function(e) {
- return Math.abs(this.x - e.x) + Math.abs(this.y - e.y)
- },
- setLength: function(e) {
- return this.normalize().multiplyScalar(e)
- },
- lerp: function(e, t) {
- return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this
- },
- lerpVectors: function(e, t, n) {
- return this.subVectors(t, e).multiplyScalar(n).add(e)
- },
- equals: function(e) {
- return e.x === this.x && e.y === this.y
- },
- fromArray: function(e, t) {
- return void 0 === t && (t = 0), this.x = e[t], this.y = e[t + 1], this
- },
- toArray: function(e, t) {
- return void 0 === e && (e = []), void 0 === t && (t = 0), e[t] = this.x, e[t + 1] = this.y, e
- },
- fromBufferAttribute: function(e, t, n) {
- 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
- },
- rotateAround: function(e, t) {
- var n = Math.cos(t),
- r = Math.sin(t),
- i = this.x - e.x,
- o = this.y - e.y;
- return this.x = i * n - o * r + e.x, this.y = i * r + o * n + e.y, this
- }
- }), Object.assign(Vt, {
- slerp: function(e, t, n, r) {
- return n.copy(e).slerp(t, r)
- },
- slerpFlat: function(e, t, n, r, i, o, a) {
- var s = n[r + 0],
- c = n[r + 1],
- l = n[r + 2],
- u = n[r + 3],
- h = i[o + 0],
- d = i[o + 1],
- p = i[o + 2],
- f = i[o + 3];
- if (u !== f || s !== h || c !== d || l !== p) {
- var m = 1 - a,
- v = s * h + c * d + l * p + u * f,
- g = v >= 0 ? 1 : -1,
- y = 1 - v * v;
- if (y > Number.EPSILON) {
- var b = Math.sqrt(y),
- x = Math.atan2(b, v * g);
- m = Math.sin(m * x) / b, a = Math.sin(a * x) / b
- }
- var w = a * g;
- if (s = s * m + h * w, c = c * m + d * w, l = l * m + p * w, u = u * m + f * w, m === 1 - a) {
- var _ = 1 / Math.sqrt(s * s + c * c + l * l + u * u);
- s *= _, c *= _, l *= _, u *= _
- }
- }
- e[t] = s, e[t + 1] = c, e[t + 2] = l, e[t + 3] = u
- }
- }), Object.defineProperties(Vt.prototype, {
- x: {
- get: function() {
- return this._x
- },
- set: function(e) {
- this._x = e, this._onChangeCallback()
- }
- },
- y: {
- get: function() {
- return this._y
- },
- set: function(e) {
- this._y = e, this._onChangeCallback()
- }
- },
- z: {
- get: function() {
- return this._z
- },
- set: function(e) {
- this._z = e, this._onChangeCallback()
- }
- },
- w: {
- get: function() {
- return this._w
- },
- set: function(e) {
- this._w = e, this._onChangeCallback()
- }
- }
- }), Object.assign(Vt.prototype, {
- isQuaternion: !0,
- set: function(e, t, n, r) {
- return this._x = e, this._y = t, this._z = n, this._w = r, this._onChangeCallback(), this
- },
- clone: function() {
- return new this.constructor(this._x, this._y, this._z, this._w)
- },
- copy: function(e) {
- return this._x = e.x, this._y = e.y, this._z = e.z, this._w = e.w, this._onChangeCallback(), this
- },
- setFromEuler: function(e, t) {
- if (!e || !e.isEuler) throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");
- var n = e._x,
- r = e._y,
- i = e._z,
- o = e.order,
- a = Math.cos,
- s = Math.sin,
- c = a(n / 2),
- l = a(r / 2),
- u = a(i / 2),
- h = s(n / 2),
- d = s(r / 2),
- p = s(i / 2);
- 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
- },
- setFromAxisAngle: function(e, t) {
- var n = t / 2,
- r = Math.sin(n);
- return this._x = e.x * r, this._y = e.y * r, this._z = e.z * r, this._w = Math.cos(n), this._onChangeCallback(), this
- },
- setFromRotationMatrix: function(e) {
- var t, n = e.elements,
- r = n[0],
- i = n[4],
- o = n[8],
- a = n[1],
- s = n[5],
- c = n[9],
- l = n[2],
- u = n[6],
- h = n[10],
- d = r + s + h;
- 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
- },
- setFromUnitVectors: function(e, t) {
- var n = e.dot(t) + 1;
- 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()
- },
- angleTo: function(e) {
- return 2 * Math.acos(Math.abs(Gt.clamp(this.dot(e), -1, 1)))
- },
- rotateTowards: function(e, t) {
- var n = this.angleTo(e);
- if (0 === n) return this;
- var r = Math.min(1, t / n);
- return this.slerp(e, r), this
- },
- inverse: function() {
- return this.conjugate()
- },
- conjugate: function() {
- return this._x *= -1, this._y *= -1, this._z *= -1, this._onChangeCallback(), this
- },
- dot: function(e) {
- return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
- },
- lengthSq: function() {
- return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
- },
- length: function() {
- return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
- },
- normalize: function() {
- var e = this.length();
- 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
- },
- multiply: function(e, t) {
- 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)
- },
- premultiply: function(e) {
- return this.multiplyQuaternions(e, this)
- },
- multiplyQuaternions: function(e, t) {
- var n = e._x,
- r = e._y,
- i = e._z,
- o = e._w,
- a = t._x,
- s = t._y,
- c = t._z,
- l = t._w;
- 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
- },
- slerp: function(e, t) {
- if (0 === t) return this;
- if (1 === t) return this.copy(e);
- var n = this._x,
- r = this._y,
- i = this._z,
- o = this._w,
- a = o * e._w + n * e._x + r * e._y + i * e._z;
- 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;
- var s = 1 - a * a;
- if (s <= Number.EPSILON) {
- var c = 1 - t;
- 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
- }
- var l = Math.sqrt(s),
- u = Math.atan2(l, a),
- h = Math.sin((1 - t) * u) / l,
- d = Math.sin(t * u) / l;
- 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
- },
- equals: function(e) {
- return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
- },
- fromArray: function(e, t) {
- 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
- },
- toArray: function(e, t) {
- 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
- },
- _onChange: function(e) {
- return this._onChangeCallback = e, this
- },
- _onChangeCallback: function() {}
- }), Object.assign(Wt.prototype, {
- isVector3: !0,
- set: function(e, t, n) {
- return this.x = e, this.y = t, this.z = n, this
- },
- setScalar: function(e) {
- return this.x = e, this.y = e, this.z = e, this
- },
- setX: function(e) {
- return this.x = e, this
- },
- setY: function(e) {
- return this.y = e, this
- },
- setZ: function(e) {
- return this.z = e, this
- },
- setComponent: function(e, t) {
- switch (e) {
- case 0:
- this.x = t;
- break;
- case 1:
- this.y = t;
- break;
- case 2:
- this.z = t;
- break;
- default:
- throw new Error("index is out of range: " + e)
- }
- return this
- },
- getComponent: function(e) {
- switch (e) {
- case 0:
- return this.x;
- case 1:
- return this.y;
- case 2:
- return this.z;
- default:
- throw new Error("index is out of range: " + e)
- }
- },
- clone: function() {
- return new this.constructor(this.x, this.y, this.z)
- },
- copy: function(e) {
- return this.x = e.x, this.y = e.y, this.z = e.z, this
- },
- add: function(e, t) {
- 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)
- },
- addScalar: function(e) {
- return this.x += e, this.y += e, this.z += e, this
- },
- addVectors: function(e, t) {
- return this.x = e.x + t.x, this.y = e.y + t.y, this.z = e.z + t.z, this
- },
- addScaledVector: function(e, t) {
- return this.x += e.x * t, this.y += e.y * t, this.z += e.z * t, this
- },
- sub: function(e, t) {
- 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)
- },
- subScalar: function(e) {
- return this.x -= e, this.y -= e, this.z -= e, this
- },
- subVectors: function(e, t) {
- return this.x = e.x - t.x, this.y = e.y - t.y, this.z = e.z - t.z, this
- },
- multiply: function(e, t) {
- 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)
- },
- multiplyScalar: function(e) {
- return this.x *= e, this.y *= e, this.z *= e, this
- },
- multiplyVectors: function(e, t) {
- return this.x = e.x * t.x, this.y = e.y * t.y, this.z = e.z * t.z, this
- },
- applyEuler: (o = new Vt, function(e) {
- 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))
- }),
- applyAxisAngle: function() {
- var e = new Vt;
- return function(t, n) {
- return this.applyQuaternion(e.setFromAxisAngle(t, n))
- }
- }(),
- applyMatrix3: function(e) {
- var t = this.x,
- n = this.y,
- r = this.z,
- i = e.elements;
- 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
- },
- applyMatrix4: function(e) {
- var t = this.x,
- n = this.y,
- r = this.z,
- i = e.elements,
- o = 1 / (i[3] * t + i[7] * n + i[11] * r + i[15]);
- 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
- },
- applyQuaternion: function(e) {
- var t = this.x,
- n = this.y,
- r = this.z,
- i = e.x,
- o = e.y,
- a = e.z,
- s = e.w,
- c = s * t + o * r - a * n,
- l = s * n + a * t - i * r,
- u = s * r + i * n - o * t,
- h = -i * t - o * n - a * r;
- 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
- },
- project: function(e) {
- return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)
- },
- unproject: function(e) {
- return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)
- },
- transformDirection: function(e) {
- var t = this.x,
- n = this.y,
- r = this.z,
- i = e.elements;
- 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()
- },
- divide: function(e) {
- return this.x /= e.x, this.y /= e.y, this.z /= e.z, this
- },
- divideScalar: function(e) {
- return this.multiplyScalar(1 / e)
- },
- min: function(e) {
- 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
- },
- max: function(e) {
- 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
- },
- clamp: function(e, t) {
- 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
- },
- clampScalar: function(e, t) {
- 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
- },
- clampLength: function(e, t) {
- var n = this.length();
- return this.divideScalar(n || 1).multiplyScalar(Math.max(e, Math.min(t, n)))
- },
- floor: function() {
- return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this
- },
- ceil: function() {
- return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this
- },
- round: function() {
- return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this
- },
- roundToZero: function() {
- 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
- },
- negate: function() {
- return this.x = -this.x, this.y = -this.y, this.z = -this.z, this
- },
- dot: function(e) {
- return this.x * e.x + this.y * e.y + this.z * e.z
- },
- lengthSq: function() {
- return this.x * this.x + this.y * this.y + this.z * this.z
- },
- length: function() {
- return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
- },
- manhattanLength: function() {
- return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
- },
- normalize: function() {
- return this.divideScalar(this.length() || 1)
- },
- setLength: function(e) {
- return this.normalize().multiplyScalar(e)
- },
- lerp: function(e, t) {
- return this.x += (e.x - this.x) * t, this.y += (e.y - this.y) * t, this.z += (e.z - this.z) * t, this
- },
- lerpVectors: function(e, t, n) {
- return this.subVectors(t, e).multiplyScalar(n).add(e)
- },
- cross: function(e, t) {
- 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)
- },
- crossVectors: function(e, t) {
- var n = e.x,
- r = e.y,
- i = e.z,
- o = t.x,
- a = t.y,
- s = t.z;
- return this.x = r * s - i * a, this.y = i * o - n * s, this.z = n * a - r * o, this
- },
- projectOnVector: function(e) {
- var t = e.dot(this) / e.lengthSq();
- return this.copy(e).multiplyScalar(t)
- },
- projectOnPlane: (i = new Wt, function(e) {
- return i.copy(this).projectOnVector(e), this.sub(i)
- }),
- reflect: function() {
- var e = new Wt;
- return function(t) {
- return this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
- }
- }(),
- angleTo: function(e) {
- var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
- return Math.acos(Gt.clamp(t, -1, 1))
- },
- distanceTo: function(e) {
- return Math.sqrt(this.distanceToSquared(e))
- },
- distanceToSquared: function(e) {
- var t = this.x - e.x,
- n = this.y - e.y,
- r = this.z - e.z;
- return t * t + n * n + r * r
- },
- manhattanDistanceTo: function(e) {
- return Math.abs(this.x - e.x) + Math.abs(this.y - e.y) + Math.abs(this.z - e.z)
- },
- setFromSpherical: function(e) {
- return this.setFromSphericalCoords(e.radius, e.phi, e.theta)
- },
- setFromSphericalCoords: function(e, t, n) {
- var r = Math.sin(t) * e;
- return this.x = r * Math.sin(n), this.y = Math.cos(t) * e, this.z = r * Math.cos(n), this
- },
- setFromCylindrical: function(e) {
- return this.setFromCylindricalCoords(e.radius, e.theta, e.y)
- },
- setFromCylindricalCoords: function(e, t, n) {
- return this.x = e * Math.sin(t), this.y = n, this.z = e * Math.cos(t), this
- },
- setFromMatrixPosition: function(e) {
- var t = e.elements;
- return this.x = t[12], this.y = t[13], this.z = t[14], this
- },
- setFromMatrixScale: function(e) {
- var t = this.setFromMatrixColumn(e, 0).length(),
- n = this.setFromMatrixColumn(e, 1).length(),
- r = this.setFromMatrixColumn(e, 2).length();
- return this.x = t, this.y = n, this.z = r, this
- },
- setFromMatrixColumn: function(e, t) {
- return this.fromArray(e.elements, 4 * t)
- },
- equals: function(e) {
- return e.x === this.x && e.y === this.y && e.z === this.z
- },
- fromArray: function(e, t) {
- return void 0 === t && (t = 0), this.x = e[t], this.y = e[t + 1], this.z = e[t + 2], this
- },
- toArray: function(e, t) {
- 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
- },
- fromBufferAttribute: function(e, t, n) {
- 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
- }
- }), Object.assign(qt.prototype, {
- isMatrix3: !0,
- set: function(e, t, n, r, i, o, a, s, c) {
- var l = this.elements;
- 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
- },
- identity: function() {
- return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this
- },
- clone: function() {
- return (new this.constructor).fromArray(this.elements)
- },
- copy: function(e) {
- var t = this.elements,
- n = e.elements;
- 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
- },
- setFromMatrix4: function(e) {
- var t = e.elements;
- return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]), this
- },
- applyToBufferAttribute: function() {
- var e = new Wt;
- return function(t) {
- 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);
- return t
- }
- }(),
- multiply: function(e) {
- return this.multiplyMatrices(this, e)
- },
- premultiply: function(e) {
- return this.multiplyMatrices(e, this)
- },
- multiplyMatrices: function(e, t) {
- var n = e.elements,
- r = t.elements,
- i = this.elements,
- o = n[0],
- a = n[3],
- s = n[6],
- c = n[1],
- l = n[4],
- u = n[7],
- h = n[2],
- d = n[5],
- p = n[8],
- f = r[0],
- m = r[3],
- v = r[6],
- g = r[1],
- y = r[4],
- b = r[7],
- x = r[2],
- w = r[5],
- _ = r[8];
- 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
- },
- multiplyScalar: function(e) {
- var t = this.elements;
- 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
- },
- determinant: function() {
- var e = this.elements,
- t = e[0],
- n = e[1],
- r = e[2],
- i = e[3],
- o = e[4],
- a = e[5],
- s = e[6],
- c = e[7],
- l = e[8];
- return t * o * l - t * a * c - n * i * l + n * a * s + r * i * c - r * o * s
- },
- getInverse: function(e, t) {
- e && e.isMatrix4 && console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");
- var n = e.elements,
- r = this.elements,
- i = n[0],
- o = n[1],
- a = n[2],
- s = n[3],
- c = n[4],
- l = n[5],
- u = n[6],
- h = n[7],
- d = n[8],
- p = d * c - l * h,
- f = l * u - d * s,
- m = h * s - c * u,
- v = i * p + o * f + a * m;
- if (0 === v) {
- var g = "THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";
- if (!0 === t) throw new Error(g);
- return console.warn(g), this.identity()
- }
- var y = 1 / v;
- 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
- },
- transpose: function() {
- var e, t = this.elements;
- 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
- },
- getNormalMatrix: function(e) {
- return this.setFromMatrix4(e).getInverse(this).transpose()
- },
- transposeIntoArray: function(e) {
- var t = this.elements;
- 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
- },
- setUvTransform: function(e, t, n, r, i, o, a) {
- var s = Math.cos(i),
- c = Math.sin(i);
- 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)
- },
- scale: function(e, t) {
- var n = this.elements;
- return n[0] *= e, n[3] *= e, n[6] *= e, n[1] *= t, n[4] *= t, n[7] *= t, this
- },
- rotate: function(e) {
- var t = Math.cos(e),
- n = Math.sin(e),
- r = this.elements,
- i = r[0],
- o = r[3],
- a = r[6],
- s = r[1],
- c = r[4],
- l = r[7];
- 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
- },
- translate: function(e, t) {
- var n = this.elements;
- 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
- },
- equals: function(e) {
- for (var t = this.elements, n = e.elements, r = 0; r < 9; r++)
- if (t[r] !== n[r]) return !1;
- return !0
- },
- fromArray: function(e, t) {
- void 0 === t && (t = 0);
- for (var n = 0; n < 9; n++) this.elements[n] = e[n + t];
- return this
- },
- toArray: function(e, t) {
- void 0 === e && (e = []), void 0 === t && (t = 0);
- var n = this.elements;
- 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
- }
- });
- var Xt, Yt, Zt, Kt, Jt, $t, Qt, en, tn, nn, rn = {
- getDataURL: function(e) {
- var t;
- if ("undefined" == typeof HTMLCanvasElement) return e.src;
- if (e instanceof HTMLCanvasElement) t = e;
- else {
- void 0 === a && (a = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas")), a.width = e.width, a.height = e.height;
- var n = a.getContext("2d");
- e instanceof ImageData ? n.putImageData(e, 0, 0) : n.drawImage(e, 0, 0, e.width, e.height), t = a
- }
- return t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
- }
- },
- on = 0;
- function an(e, t, n, r, i, o, a, s, c, l) {
- Object.defineProperty(this, "id", {
- value: on++
- }), 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
- }
- function sn(e, t, n, r) {
- this.x = e || 0, this.y = t || 0, this.z = n || 0, this.w = void 0 !== r ? r : 1
- }
- function cn(e, t, n) {
- 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
- }
- function ln(e, t, n) {
- cn.call(this, e, t, n), this.samples = 4
- }
- function un() {
- 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.")
- }
- function hn(e, t, n, r) {
- this._x = e || 0, this._y = t || 0, this._z = n || 0, this._order = r || hn.DefaultOrder
- }
- function dn() {
- this.mask = 1
- }
- an.DEFAULT_IMAGE = void 0, an.DEFAULT_MAPPING = he, an.prototype = Object.assign(Object.create(r.prototype), {
- constructor: an,
- isTexture: !0,
- updateMatrix: function() {
- this.matrix.setUvTransform(this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y)
- },
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- 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
- },
- toJSON: function(e) {
- var t = void 0 === e || "string" == typeof e;
- if (!t && void 0 !== e.textures[this.uuid]) return e.textures[this.uuid];
- var n = {
- metadata: {
- version: 4.5,
- type: "Texture",
- generator: "Texture.toJSON"
- },
- uuid: this.uuid,
- name: this.name,
- mapping: this.mapping,
- repeat: [this.repeat.x, this.repeat.y],
- offset: [this.offset.x, this.offset.y],
- center: [this.center.x, this.center.y],
- rotation: this.rotation,
- wrap: [this.wrapS, this.wrapT],
- format: this.format,
- type: this.type,
- encoding: this.encoding,
- minFilter: this.minFilter,
- magFilter: this.magFilter,
- anisotropy: this.anisotropy,
- flipY: this.flipY,
- premultiplyAlpha: this.premultiplyAlpha,
- unpackAlignment: this.unpackAlignment
- };
- if (void 0 !== this.image) {
- var r = this.image;
- if (void 0 === r.uuid && (r.uuid = Gt.generateUUID()), !t && void 0 === e.images[r.uuid]) {
- var i;
- if (Array.isArray(r)) {
- i = [];
- for (var o = 0, a = r.length; o < a; o++) i.push(rn.getDataURL(r[o]))
- } else i = rn.getDataURL(r);
- e.images[r.uuid] = {
- uuid: r.uuid,
- url: i
- }
- }
- n.image = r.uuid
- }
- return t || (e.textures[this.uuid] = n), n
- },
- dispose: function() {
- this.dispatchEvent({
- type: "dispose"
- })
- },
- transformUv: function(e) {
- if (this.mapping !== he) return e;
- if (e.applyMatrix3(this.matrix), e.x < 0 || e.x > 1) switch (this.wrapS) {
- case be:
- e.x = e.x - Math.floor(e.x);
- break;
- case xe:
- e.x = e.x < 0 ? 0 : 1;
- break;
- case we:
- 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
- }
- if (e.y < 0 || e.y > 1) switch (this.wrapT) {
- case be:
- e.y = e.y - Math.floor(e.y);
- break;
- case xe:
- e.y = e.y < 0 ? 0 : 1;
- break;
- case we:
- 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
- }
- return this.flipY && (e.y = 1 - e.y), e
- }
- }), Object.defineProperty(an.prototype, "needsUpdate", {
- set: function(e) {
- !0 === e && this.version++
- }
- }), Object.defineProperties(sn.prototype, {
- width: {
- get: function() {
- return this.z
- },
- set: function(e) {
- this.z = e
- }
- },
- height: {
- get: function() {
- return this.w
- },
- set: function(e) {
- this.w = e
- }
- }
- }), Object.assign(sn.prototype, {
- isVector4: !0,
- set: function(e, t, n, r) {
- return this.x = e, this.y = t, this.z = n, this.w = r, this
- },
- setScalar: function(e) {
- return this.x = e, this.y = e, this.z = e, this.w = e, this
- },
- setX: function(e) {
- return this.x = e, this
- },
- setY: function(e) {
- return this.y = e, this
- },
- setZ: function(e) {
- return this.z = e, this
- },
- setW: function(e) {
- return this.w = e, this
- },
- setComponent: function(e, t) {
- switch (e) {
- case 0:
- this.x = t;
- break;
- case 1:
- this.y = t;
- break;
- case 2:
- this.z = t;
- break;
- case 3:
- this.w = t;
- break;
- default:
- throw new Error("index is out of range: " + e)
- }
- return this
- },
- getComponent: function(e) {
- switch (e) {
- case 0:
- return this.x;
- case 1:
- return this.y;
- case 2:
- return this.z;
- case 3:
- return this.w;
- default:
- throw new Error("index is out of range: " + e)
- }
- },
- clone: function() {
- return new this.constructor(this.x, this.y, this.z, this.w)
- },
- copy: function(e) {
- return this.x = e.x, this.y = e.y, this.z = e.z, this.w = void 0 !== e.w ? e.w : 1, this
- },
- add: function(e, t) {
- 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)
- },
- addScalar: function(e) {
- return this.x += e, this.y += e, this.z += e, this.w += e, this
- },
- addVectors: function(e, t) {
- 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
- },
- addScaledVector: function(e, t) {
- return this.x += e.x * t, this.y += e.y * t, this.z += e.z * t, this.w += e.w * t, this
- },
- sub: function(e, t) {
- 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)
- },
- subScalar: function(e) {
- return this.x -= e, this.y -= e, this.z -= e, this.w -= e, this
- },
- subVectors: function(e, t) {
- 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
- },
- multiplyScalar: function(e) {
- return this.x *= e, this.y *= e, this.z *= e, this.w *= e, this
- },
- applyMatrix4: function(e) {
- var t = this.x,
- n = this.y,
- r = this.z,
- i = this.w,
- o = e.elements;
- 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
- },
- divideScalar: function(e) {
- return this.multiplyScalar(1 / e)
- },
- setAxisAngleFromQuaternion: function(e) {
- this.w = 2 * Math.acos(e.w);
- var t = Math.sqrt(1 - e.w * e.w);
- 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
- },
- setAxisAngleFromRotationMatrix: function(e) {
- var t, n, r, i, o = e.elements,
- a = o[0],
- s = o[4],
- c = o[8],
- l = o[1],
- u = o[5],
- h = o[9],
- d = o[2],
- p = o[6],
- f = o[10];
- if (Math.abs(s - l) < .01 && Math.abs(c - d) < .01 && Math.abs(h - p) < .01) {
- 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;
- t = Math.PI;
- var m = (a + 1) / 2,
- v = (u + 1) / 2,
- g = (f + 1) / 2,
- y = (s + l) / 4,
- b = (c + d) / 4,
- x = (h + p) / 4;
- 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
- }
- var w = Math.sqrt((p - h) * (p - h) + (c - d) * (c - d) + (l - s) * (l - s));
- 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
- },
- min: function(e) {
- 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
- },
- max: function(e) {
- 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
- },
- clamp: function(e, t) {
- 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
- },
- clampScalar: function(e, t) {
- 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)
- },
- clampLength: function(e, t) {
- var n = this.length();
- return this.divideScalar(n || 1).multiplyScalar(Math.max(e, Math.min(t, n)))
- },
- floor: function() {
- 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
- },
- ceil: function() {
- 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
- },
- round: function() {
- 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
- },
- roundToZero: function() {
- 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
- },
- negate: function() {
- return this.x = -this.x, this.y = -this.y, this.z = -this.z, this.w = -this.w, this
- },
- dot: function(e) {
- return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
- },
- lengthSq: function() {
- return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
- },
- length: function() {
- return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
- },
- manhattanLength: function() {
- return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
- },
- normalize: function() {
- return this.divideScalar(this.length() || 1)
- },
- setLength: function(e) {
- return this.normalize().multiplyScalar(e)
- },
- lerp: function(e, t) {
- 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
- },
- lerpVectors: function(e, t, n) {
- return this.subVectors(t, e).multiplyScalar(n).add(e)
- },
- equals: function(e) {
- return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
- },
- fromArray: function(e, t) {
- 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
- },
- toArray: function(e, t) {
- 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
- },
- fromBufferAttribute: function(e, t, n) {
- 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
- }
- }), cn.prototype = Object.assign(Object.create(r.prototype), {
- constructor: cn,
- isWebGLRenderTarget: !0,
- setSize: function(e, t) {
- 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)
- },
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- 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
- },
- dispose: function() {
- this.dispatchEvent({
- type: "dispose"
- })
- }
- }), ln.prototype = Object.assign(Object.create(cn.prototype), {
- constructor: ln,
- isWebGLMultisampleRenderTarget: !0,
- copy: function(e) {
- return cn.prototype.copy.call(this, e), this.samples = e.samples, this
- }
- }), Object.assign(un.prototype, {
- isMatrix4: !0,
- set: function(e, t, n, r, i, o, a, s, c, l, u, h, d, p, f, m) {
- var v = this.elements;
- 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
- },
- identity: function() {
- return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
- },
- clone: function() {
- return (new un).fromArray(this.elements)
- },
- copy: function(e) {
- var t = this.elements,
- n = e.elements;
- 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
- },
- copyPosition: function(e) {
- var t = this.elements,
- n = e.elements;
- return t[12] = n[12], t[13] = n[13], t[14] = n[14], this
- },
- extractBasis: function(e, t, n) {
- return e.setFromMatrixColumn(this, 0), t.setFromMatrixColumn(this, 1), n.setFromMatrixColumn(this, 2), this
- },
- makeBasis: function(e, t, n) {
- 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
- },
- extractRotation: function() {
- var e = new Wt;
- return function(t) {
- var n = this.elements,
- r = t.elements,
- i = 1 / e.setFromMatrixColumn(t, 0).length(),
- o = 1 / e.setFromMatrixColumn(t, 1).length(),
- a = 1 / e.setFromMatrixColumn(t, 2).length();
- 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
- }
- }(),
- makeRotationFromEuler: function(e) {
- e && e.isEuler || console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
- var t = this.elements,
- n = e.x,
- r = e.y,
- i = e.z,
- o = Math.cos(n),
- a = Math.sin(n),
- s = Math.cos(r),
- c = Math.sin(r),
- l = Math.cos(i),
- u = Math.sin(i);
- if ("XYZ" === e.order) {
- var h = o * l,
- d = o * u,
- p = a * l,
- f = a * u;
- 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
- } else if ("YXZ" === e.order) {
- var m = s * l,
- v = s * u,
- g = c * l,
- y = c * u;
- 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
- } else if ("ZXY" === e.order) {
- m = s * l, v = s * u, g = c * l, y = c * u;
- 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
- } else if ("ZYX" === e.order) {
- h = o * l, d = o * u, p = a * l, f = a * u;
- 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
- } else if ("YZX" === e.order) {
- var b = o * s,
- x = o * c,
- w = a * s,
- _ = a * c;
- 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
- } else if ("XZY" === e.order) {
- b = o * s, x = o * c, w = a * s, _ = a * c;
- 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
- }
- return t[3] = 0, t[7] = 0, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this
- },
- makeRotationFromQuaternion: (en = new Wt(0, 0, 0), tn = new Wt(1, 1, 1), function(e) {
- return this.compose(en, e, tn)
- }),
- lookAt: (Jt = new Wt, $t = new Wt, Qt = new Wt, function(e, t, n) {
- var r = this.elements;
- 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
- }),
- multiply: function(e, t) {
- 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)
- },
- premultiply: function(e) {
- return this.multiplyMatrices(e, this)
- },
- multiplyMatrices: function(e, t) {
- var n = e.elements,
- r = t.elements,
- i = this.elements,
- o = n[0],
- a = n[4],
- s = n[8],
- c = n[12],
- l = n[1],
- u = n[5],
- h = n[9],
- d = n[13],
- p = n[2],
- f = n[6],
- m = n[10],
- v = n[14],
- g = n[3],
- y = n[7],
- b = n[11],
- x = n[15],
- w = r[0],
- _ = r[4],
- M = r[8],
- E = r[12],
- S = r[1],
- T = r[5],
- L = r[9],
- A = r[13],
- C = r[2],
- P = r[6],
- R = r[10],
- O = r[14],
- k = r[3],
- I = r[7],
- D = r[11],
- j = r[15];
- 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
- },
- multiplyScalar: function(e) {
- var t = this.elements;
- 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
- },
- applyToBufferAttribute: function() {
- var e = new Wt;
- return function(t) {
- 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);
- return t
- }
- }(),
- determinant: function() {
- var e = this.elements,
- t = e[0],
- n = e[4],
- r = e[8],
- i = e[12],
- o = e[1],
- a = e[5],
- s = e[9],
- c = e[13],
- l = e[2],
- u = e[6],
- h = e[10],
- d = e[14];
- 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)
- },
- transpose: function() {
- var e, t = this.elements;
- 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
- },
- setPosition: function(e, t, n) {
- var r = this.elements;
- 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
- },
- getInverse: function(e, t) {
- var n = this.elements,
- r = e.elements,
- i = r[0],
- o = r[1],
- a = r[2],
- s = r[3],
- c = r[4],
- l = r[5],
- u = r[6],
- h = r[7],
- d = r[8],
- p = r[9],
- f = r[10],
- m = r[11],
- v = r[12],
- g = r[13],
- y = r[14],
- b = r[15],
- x = p * y * h - g * f * h + g * u * m - l * y * m - p * u * b + l * f * b,
- w = v * f * h - d * y * h - v * u * m + c * y * m + d * u * b - c * f * b,
- _ = d * g * h - v * p * h + v * l * m - c * g * m - d * l * b + c * p * b,
- M = v * p * u - d * g * u - v * l * f + c * g * f + d * l * y - c * p * y,
- E = i * x + o * w + a * _ + s * M;
- if (0 === E) {
- var S = "THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";
- if (!0 === t) throw new Error(S);
- return console.warn(S), this.identity()
- }
- var T = 1 / E;
- 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
- },
- scale: function(e) {
- var t = this.elements,
- n = e.x,
- r = e.y,
- i = e.z;
- 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
- },
- getMaxScaleOnAxis: function() {
- var e = this.elements,
- t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2],
- n = e[4] * e[4] + e[5] * e[5] + e[6] * e[6],
- r = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
- return Math.sqrt(Math.max(t, n, r))
- },
- makeTranslation: function(e, t, n) {
- return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, n, 0, 0, 0, 1), this
- },
- makeRotationX: function(e) {
- var t = Math.cos(e),
- n = Math.sin(e);
- return this.set(1, 0, 0, 0, 0, t, -n, 0, 0, n, t, 0, 0, 0, 0, 1), this
- },
- makeRotationY: function(e) {
- var t = Math.cos(e),
- n = Math.sin(e);
- return this.set(t, 0, n, 0, 0, 1, 0, 0, -n, 0, t, 0, 0, 0, 0, 1), this
- },
- makeRotationZ: function(e) {
- var t = Math.cos(e),
- n = Math.sin(e);
- return this.set(t, -n, 0, 0, n, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
- },
- makeRotationAxis: function(e, t) {
- var n = Math.cos(t),
- r = Math.sin(t),
- i = 1 - n,
- o = e.x,
- a = e.y,
- s = e.z,
- c = i * o,
- l = i * a;
- 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
- },
- makeScale: function(e, t, n) {
- return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, n, 0, 0, 0, 0, 1), this
- },
- makeShear: function(e, t, n) {
- return this.set(1, t, n, 0, e, 1, n, 0, e, t, 1, 0, 0, 0, 0, 1), this
- },
- compose: function(e, t, n) {
- var r = this.elements,
- i = t._x,
- o = t._y,
- a = t._z,
- s = t._w,
- c = i + i,
- l = o + o,
- u = a + a,
- h = i * c,
- d = i * l,
- p = i * u,
- f = o * l,
- m = o * u,
- v = a * u,
- g = s * c,
- y = s * l,
- b = s * u,
- x = n.x,
- w = n.y,
- _ = n.z;
- 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
- },
- decompose: (Zt = new Wt, Kt = new un, function(e, t, n) {
- var r = this.elements,
- i = Zt.set(r[0], r[1], r[2]).length(),
- o = Zt.set(r[4], r[5], r[6]).length(),
- a = Zt.set(r[8], r[9], r[10]).length();
- this.determinant() < 0 && (i = -i), e.x = r[12], e.y = r[13], e.z = r[14], Kt.copy(this);
- var s = 1 / i,
- c = 1 / o,
- l = 1 / a;
- 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
- }),
- makePerspective: function(e, t, n, r, i, o) {
- void 0 === o && console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");
- var a = this.elements,
- s = 2 * i / (t - e),
- c = 2 * i / (n - r),
- l = (t + e) / (t - e),
- u = (n + r) / (n - r),
- h = -(o + i) / (o - i),
- d = -2 * o * i / (o - i);
- 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
- },
- makeOrthographic: function(e, t, n, r, i, o) {
- var a = this.elements,
- s = 1 / (t - e),
- c = 1 / (n - r),
- l = 1 / (o - i),
- u = (t + e) * s,
- h = (n + r) * c,
- d = (o + i) * l;
- 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
- },
- equals: function(e) {
- for (var t = this.elements, n = e.elements, r = 0; r < 16; r++)
- if (t[r] !== n[r]) return !1;
- return !0
- },
- fromArray: function(e, t) {
- void 0 === t && (t = 0);
- for (var n = 0; n < 16; n++) this.elements[n] = e[n + t];
- return this
- },
- toArray: function(e, t) {
- void 0 === e && (e = []), void 0 === t && (t = 0);
- var n = this.elements;
- 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
- }
- }), hn.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"], hn.DefaultOrder = "XYZ", Object.defineProperties(hn.prototype, {
- x: {
- get: function() {
- return this._x
- },
- set: function(e) {
- this._x = e, this._onChangeCallback()
- }
- },
- y: {
- get: function() {
- return this._y
- },
- set: function(e) {
- this._y = e, this._onChangeCallback()
- }
- },
- z: {
- get: function() {
- return this._z
- },
- set: function(e) {
- this._z = e, this._onChangeCallback()
- }
- },
- order: {
- get: function() {
- return this._order
- },
- set: function(e) {
- this._order = e, this._onChangeCallback()
- }
- }
- }), Object.assign(hn.prototype, {
- isEuler: !0,
- set: function(e, t, n, r) {
- return this._x = e, this._y = t, this._z = n, this._order = r || this._order, this._onChangeCallback(), this
- },
- clone: function() {
- return new this.constructor(this._x, this._y, this._z, this._order)
- },
- copy: function(e) {
- return this._x = e._x, this._y = e._y, this._z = e._z, this._order = e._order, this._onChangeCallback(), this
- },
- setFromRotationMatrix: function(e, t, n) {
- var r = Gt.clamp,
- i = e.elements,
- o = i[0],
- a = i[4],
- s = i[8],
- c = i[1],
- l = i[5],
- u = i[9],
- h = i[2],
- d = i[6],
- p = i[10];
- 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
- },
- setFromQuaternion: function() {
- var e = new un;
- return function(t, n, r) {
- return e.makeRotationFromQuaternion(t), this.setFromRotationMatrix(e, n, r)
- }
- }(),
- setFromVector3: function(e, t) {
- return this.set(e.x, e.y, e.z, t || this._order)
- },
- reorder: (nn = new Vt, function(e) {
- return nn.setFromEuler(this), this.setFromQuaternion(nn, e)
- }),
- equals: function(e) {
- return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
- },
- fromArray: function(e) {
- return this._x = e[0], this._y = e[1], this._z = e[2], void 0 !== e[3] && (this._order = e[3]), this._onChangeCallback(), this
- },
- toArray: function(e, t) {
- 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
- },
- toVector3: function(e) {
- return e ? e.set(this._x, this._y, this._z) : new Wt(this._x, this._y, this._z)
- },
- _onChange: function(e) {
- return this._onChangeCallback = e, this
- },
- _onChangeCallback: function() {}
- }), Object.assign(dn.prototype, {
- set: function(e) {
- this.mask = 1 << e | 0
- },
- enable: function(e) {
- this.mask |= 1 << e | 0
- },
- toggle: function(e) {
- this.mask ^= 1 << e | 0
- },
- disable: function(e) {
- this.mask &= ~(1 << e | 0)
- },
- test: function(e) {
- return 0 != (this.mask & e.mask)
- }
- });
- var pn, fn, mn, vn, gn, yn, bn, xn, wn, _n, Mn, En, Sn, Tn, Ln, An, Cn, Pn, Rn, On, kn = 0;
- function In() {
- Object.defineProperty(this, "id", {
- value: kn++
- }), this.uuid = Gt.generateUUID(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = In.DefaultUp.clone();
- var e = new Wt,
- t = new hn,
- n = new Vt,
- r = new Wt(1, 1, 1);
- t._onChange(function() {
- n.setFromEuler(t, !1)
- }), n._onChange(function() {
- t.setFromQuaternion(n, void 0, !1)
- }), Object.defineProperties(this, {
- position: {
- configurable: !0,
- enumerable: !0,
- value: e
- },
- rotation: {
- configurable: !0,
- enumerable: !0,
- value: t
- },
- quaternion: {
- configurable: !0,
- enumerable: !0,
- value: n
- },
- scale: {
- configurable: !0,
- enumerable: !0,
- value: r
- },
- modelViewMatrix: {
- value: new un
- },
- normalMatrix: {
- value: new qt
- }
- }), 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 = {}
- }
- function Dn() {
- 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", {
- detail: this
- }))
- }
- function jn(e, t) {
- 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)
- }
- function Nn(e, t) {
- this.center = void 0 !== e ? e : new Wt, this.radius = void 0 !== t ? t : 0
- }
- function Bn(e, t) {
- this.origin = void 0 !== e ? e : new Wt, this.direction = void 0 !== t ? t : new Wt
- }
- function zn(e, t, n) {
- this.a = void 0 !== e ? e : new Wt, this.b = void 0 !== t ? t : new Wt, this.c = void 0 !== n ? n : new Wt
- }
- In.DefaultUp = new Wt(0, 1, 0), In.DefaultMatrixAutoUpdate = !0, In.prototype = Object.assign(Object.create(r.prototype), {
- constructor: In,
- isObject3D: !0,
- onBeforeRender: function() {},
- onAfterRender: function() {},
- applyMatrix: function(e) {
- this.matrixAutoUpdate && this.updateMatrix(), this.matrix.premultiply(e), this.matrix.decompose(this.position, this.quaternion, this.scale)
- },
- applyQuaternion: function(e) {
- return this.quaternion.premultiply(e), this
- },
- setRotationFromAxisAngle: function(e, t) {
- this.quaternion.setFromAxisAngle(e, t)
- },
- setRotationFromEuler: function(e) {
- this.quaternion.setFromEuler(e, !0)
- },
- setRotationFromMatrix: function(e) {
- this.quaternion.setFromRotationMatrix(e)
- },
- setRotationFromQuaternion: function(e) {
- this.quaternion.copy(e)
- },
- rotateOnAxis: (gn = new Vt, function(e, t) {
- return gn.setFromAxisAngle(e, t), this.quaternion.multiply(gn), this
- }),
- rotateOnWorldAxis: function() {
- var e = new Vt;
- return function(t, n) {
- return e.setFromAxisAngle(t, n), this.quaternion.premultiply(e), this
- }
- }(),
- rotateX: function() {
- var e = new Wt(1, 0, 0);
- return function(t) {
- return this.rotateOnAxis(e, t)
- }
- }(),
- rotateY: function() {
- var e = new Wt(0, 1, 0);
- return function(t) {
- return this.rotateOnAxis(e, t)
- }
- }(),
- rotateZ: function() {
- var e = new Wt(0, 0, 1);
- return function(t) {
- return this.rotateOnAxis(e, t)
- }
- }(),
- translateOnAxis: function() {
- var e = new Wt;
- return function(t, n) {
- return e.copy(t).applyQuaternion(this.quaternion), this.position.add(e.multiplyScalar(n)), this
- }
- }(),
- translateX: function() {
- var e = new Wt(1, 0, 0);
- return function(t) {
- return this.translateOnAxis(e, t)
- }
- }(),
- translateY: function() {
- var e = new Wt(0, 1, 0);
- return function(t) {
- return this.translateOnAxis(e, t)
- }
- }(),
- translateZ: function() {
- var e = new Wt(0, 0, 1);
- return function(t) {
- return this.translateOnAxis(e, t)
- }
- }(),
- localToWorld: function(e) {
- return e.applyMatrix4(this.matrixWorld)
- },
- worldToLocal: (vn = new un, function(e) {
- return e.applyMatrix4(vn.getInverse(this.matrixWorld))
- }),
- lookAt: function() {
- var e = new Vt,
- t = new un,
- n = new Wt,
- r = new Wt;
- return function(i, o, a) {
- i.isVector3 ? n.copy(i) : n.set(i, o, a);
- var s = this.parent;
- 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()))
- }
- }(),
- add: function(e) {
- if (arguments.length > 1) {
- for (var t = 0; t < arguments.length; t++) this.add(arguments[t]);
- return this
- }
- 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({
- type: "added"
- })) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e), this)
- },
- remove: function(e) {
- if (arguments.length > 1) {
- for (var t = 0; t < arguments.length; t++) this.remove(arguments[t]);
- return this
- }
- var n = this.children.indexOf(e);
- return -1 !== n && (e.parent = null, this.children.splice(n, 1), e.dispatchEvent({
- type: "removed"
- })), this
- },
- attach: (mn = new un, function(e) {
- 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
- }),
- getObjectById: function(e) {
- return this.getObjectByProperty("id", e)
- },
- getObjectByName: function(e) {
- return this.getObjectByProperty("name", e)
- },
- getObjectByProperty: function(e, t) {
- if (this[e] === t) return this;
- for (var n = 0, r = this.children.length; n < r; n++) {
- var i = this.children[n].getObjectByProperty(e, t);
- if (void 0 !== i) return i
- }
- },
- getWorldPosition: function(e) {
- return void 0 === e && (console.warn("THREE.Object3D: .getWorldPosition() target is now required"), e = new Wt), this.updateMatrixWorld(!0), e.setFromMatrixPosition(this.matrixWorld)
- },
- getWorldQuaternion: (pn = new Wt, fn = new Wt, function(e) {
- 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
- }),
- getWorldScale: function() {
- var e = new Wt,
- t = new Vt;
- return function(n) {
- 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
- }
- }(),
- getWorldDirection: function(e) {
- void 0 === e && (console.warn("THREE.Object3D: .getWorldDirection() target is now required"), e = new Wt), this.updateMatrixWorld(!0);
- var t = this.matrixWorld.elements;
- return e.set(t[8], t[9], t[10]).normalize()
- },
- raycast: function() {},
- traverse: function(e) {
- e(this);
- for (var t = this.children, n = 0, r = t.length; n < r; n++) t[n].traverse(e)
- },
- traverseVisible: function(e) {
- if (!1 !== this.visible) {
- e(this);
- for (var t = this.children, n = 0, r = t.length; n < r; n++) t[n].traverseVisible(e)
- }
- },
- traverseAncestors: function(e) {
- var t = this.parent;
- null !== t && (e(t), t.traverseAncestors(e))
- },
- updateMatrix: function() {
- this.matrix.compose(this.position, this.quaternion, this.scale), this.matrixWorldNeedsUpdate = !0
- },
- updateMatrixWorld: function(e) {
- 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);
- for (var t = this.children, n = 0, r = t.length; n < r; n++) t[n].updateMatrixWorld(e)
- },
- updateWorldMatrix: function(e, t) {
- var n = this.parent;
- 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)
- for (var r = this.children, i = 0, o = r.length; i < o; i++) r[i].updateWorldMatrix(!1, !0)
- },
- toJSON: function(e) {
- var t = void 0 === e || "string" == typeof e,
- n = {};
- t && (e = {
- geometries: {},
- materials: {},
- textures: {},
- images: {},
- shapes: {}
- }, n.metadata = {
- version: 4.5,
- type: "Object",
- generator: "Object3D.toJSON"
- });
- var r = {};
- function i(t, n) {
- return void 0 === t[n.uuid] && (t[n.uuid] = n.toJSON(e)), n.uuid
- }
- 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) {
- r.geometry = i(e.geometries, this.geometry);
- var o = this.geometry.parameters;
- if (void 0 !== o && void 0 !== o.shapes) {
- var a = o.shapes;
- if (Array.isArray(a))
- for (var s = 0, c = a.length; s < c; s++) {
- var l = a[s];
- i(e.shapes, l)
- } else i(e.shapes, a)
- }
- }
- if (void 0 !== this.material)
- if (Array.isArray(this.material)) {
- var u = [];
- for (s = 0, c = this.material.length; s < c; s++) u.push(i(e.materials, this.material[s]));
- r.material = u
- } else r.material = i(e.materials, this.material);
- if (this.children.length > 0) {
- r.children = [];
- for (s = 0; s < this.children.length; s++) r.children.push(this.children[s].toJSON(e).object)
- }
- if (t) {
- var h = m(e.geometries),
- d = m(e.materials),
- p = m(e.textures),
- f = m(e.images);
- a = m(e.shapes);
- 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)
- }
- return n.object = r, n;
- function m(e) {
- var t = [];
- for (var n in e) {
- var r = e[n];
- delete r.metadata, t.push(r)
- }
- return t
- }
- },
- clone: function(e) {
- return (new this.constructor).copy(this, e)
- },
- copy: function(e, t) {
- 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)
- for (var n = 0; n < e.children.length; n++) {
- var r = e.children[n];
- this.add(r.clone())
- }
- return this
- }
- }), Dn.prototype = Object.assign(Object.create(In.prototype), {
- constructor: Dn,
- isScene: !0,
- copy: function(e, t) {
- 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
- },
- toJSON: function(e) {
- var t = In.prototype.toJSON.call(this, e);
- return null !== this.background && (t.object.background = this.background.toJSON(e)), null !== this.fog && (t.object.fog = this.fog.toJSON()), t
- },
- dispose: function() {
- this.dispatchEvent({
- type: "dispose"
- })
- }
- }), Object.assign(jn.prototype, {
- isBox3: !0,
- set: function(e, t) {
- return this.min.copy(e), this.max.copy(t), this
- },
- setFromArray: function(e) {
- 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) {
- var l = e[s],
- u = e[s + 1],
- h = e[s + 2];
- l < t && (t = l), u < n && (n = u), h < r && (r = h), l > i && (i = l), u > o && (o = u), h > a && (a = h)
- }
- return this.min.set(t, n, r), this.max.set(i, o, a), this
- },
- setFromBufferAttribute: function(e) {
- 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++) {
- var l = e.getX(s),
- u = e.getY(s),
- h = e.getZ(s);
- l < t && (t = l), u < n && (n = u), h < r && (r = h), l > i && (i = l), u > o && (o = u), h > a && (a = h)
- }
- return this.min.set(t, n, r), this.max.set(i, o, a), this
- },
- setFromPoints: function(e) {
- this.makeEmpty();
- for (var t = 0, n = e.length; t < n; t++) this.expandByPoint(e[t]);
- return this
- },
- setFromCenterAndSize: function() {
- var e = new Wt;
- return function(t, n) {
- var r = e.copy(n).multiplyScalar(.5);
- return this.min.copy(t).sub(r), this.max.copy(t).add(r), this
- }
- }(),
- setFromObject: function(e) {
- return this.makeEmpty(), this.expandByObject(e)
- },
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- return this.min.copy(e.min), this.max.copy(e.max), this
- },
- makeEmpty: function() {
- return this.min.x = this.min.y = this.min.z = 1 / 0, this.max.x = this.max.y = this.max.z = -1 / 0, this
- },
- isEmpty: function() {
- return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
- },
- getCenter: function(e) {
- 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)
- },
- getSize: function(e) {
- 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)
- },
- expandByPoint: function(e) {
- return this.min.min(e), this.max.max(e), this
- },
- expandByVector: function(e) {
- return this.min.sub(e), this.max.add(e), this
- },
- expandByScalar: function(e) {
- return this.min.addScalar(-e), this.max.addScalar(e), this
- },
- expandByObject: function() {
- var e, t, n, r = new Wt;
- function i(i) {
- var o = i.geometry;
- if (void 0 !== o)
- if (o.isGeometry) {
- var a = o.vertices;
- for (t = 0, n = a.length; t < n; t++) r.copy(a[t]), r.applyMatrix4(i.matrixWorld), e.expandByPoint(r)
- } else if (o.isBufferGeometry) {
- var s = o.attributes.position;
- if (void 0 !== s)
- for (t = 0, n = s.count; t < n; t++) r.fromBufferAttribute(s, t).applyMatrix4(i.matrixWorld), e.expandByPoint(r)
- }
- }
- return function(t) {
- return e = this, t.updateMatrixWorld(!0), t.traverse(i), this
- }
- }(),
- containsPoint: function(e) {
- 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)
- },
- containsBox: function(e) {
- 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
- },
- getParameter: function(e, t) {
- 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))
- },
- intersectsBox: function(e) {
- 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)
- },
- intersectsSphere: (bn = new Wt, function(e) {
- return this.clampPoint(e.center, bn), bn.distanceToSquared(e.center) <= e.radius * e.radius
- }),
- intersectsPlane: function(e) {
- var t, n;
- 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
- },
- intersectsTriangle: function() {
- var e = new Wt,
- t = new Wt,
- n = new Wt,
- r = new Wt,
- i = new Wt,
- o = new Wt,
- a = new Wt,
- s = new Wt,
- c = new Wt,
- l = new Wt;
- function u(r) {
- var i, o;
- for (i = 0, o = r.length - 3; i <= o; i += 3) {
- a.fromArray(r, i);
- var s = c.x * Math.abs(a.x) + c.y * Math.abs(a.y) + c.z * Math.abs(a.z),
- l = e.dot(a),
- u = t.dot(a),
- h = n.dot(a);
- if (Math.max(-Math.max(l, u, h), Math.min(l, u, h)) > s) return !1
- }
- return !0
- }
- return function(a) {
- if (this.isEmpty()) return !1;
- 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);
- 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];
- 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])))
- }
- }(),
- clampPoint: function(e, t) {
- return void 0 === t && (console.warn("THREE.Box3: .clampPoint() target is now required"), t = new Wt), t.copy(e).clamp(this.min, this.max)
- },
- distanceToPoint: function() {
- var e = new Wt;
- return function(t) {
- return e.copy(t).clamp(this.min, this.max).sub(t).length()
- }
- }(),
- getBoundingSphere: function() {
- var e = new Wt;
- return function(t) {
- 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
- }
- }(),
- intersect: function(e) {
- return this.min.max(e.min), this.max.min(e.max), this.isEmpty() && this.makeEmpty(), this
- },
- union: function(e) {
- return this.min.min(e.min), this.max.max(e.max), this
- },
- applyMatrix4: (yn = [new Wt, new Wt, new Wt, new Wt, new Wt, new Wt, new Wt, new Wt], function(e) {
- 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)
- }),
- translate: function(e) {
- return this.min.add(e), this.max.add(e), this
- },
- equals: function(e) {
- return e.min.equals(this.min) && e.max.equals(this.max)
- }
- }), Object.assign(Nn.prototype, {
- set: function(e, t) {
- return this.center.copy(e), this.radius = t, this
- },
- setFromPoints: (xn = new jn, function(e, t) {
- var n = this.center;
- void 0 !== t ? n.copy(t) : xn.setFromPoints(e).getCenter(n);
- for (var r = 0, i = 0, o = e.length; i < o; i++) r = Math.max(r, n.distanceToSquared(e[i]));
- return this.radius = Math.sqrt(r), this
- }),
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- return this.center.copy(e.center), this.radius = e.radius, this
- },
- empty: function() {
- return this.radius <= 0
- },
- containsPoint: function(e) {
- return e.distanceToSquared(this.center) <= this.radius * this.radius
- },
- distanceToPoint: function(e) {
- return e.distanceTo(this.center) - this.radius
- },
- intersectsSphere: function(e) {
- var t = this.radius + e.radius;
- return e.center.distanceToSquared(this.center) <= t * t
- },
- intersectsBox: function(e) {
- return e.intersectsSphere(this)
- },
- intersectsPlane: function(e) {
- return Math.abs(e.distanceToPoint(this.center)) <= this.radius
- },
- clampPoint: function(e, t) {
- var n = this.center.distanceToSquared(e);
- 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
- },
- getBoundingBox: function(e) {
- 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
- },
- applyMatrix4: function(e) {
- return this.center.applyMatrix4(e), this.radius = this.radius * e.getMaxScaleOnAxis(), this
- },
- translate: function(e) {
- return this.center.add(e), this
- },
- equals: function(e) {
- return e.center.equals(this.center) && e.radius === this.radius
- }
- }), Object.assign(Bn.prototype, {
- set: function(e, t) {
- return this.origin.copy(e), this.direction.copy(t), this
- },
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- return this.origin.copy(e.origin), this.direction.copy(e.direction), this
- },
- at: function(e, t) {
- 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)
- },
- lookAt: function(e) {
- return this.direction.copy(e).sub(this.origin).normalize(), this
- },
- recast: function() {
- var e = new Wt;
- return function(t) {
- return this.origin.copy(this.at(t, e)), this
- }
- }(),
- closestPointToPoint: function(e, t) {
- void 0 === t && (console.warn("THREE.Ray: .closestPointToPoint() target is now required"), t = new Wt), t.subVectors(e, this.origin);
- var n = t.dot(this.direction);
- return n < 0 ? t.copy(this.origin) : t.copy(this.direction).multiplyScalar(n).add(this.origin)
- },
- distanceToPoint: function(e) {
- return Math.sqrt(this.distanceSqToPoint(e))
- },
- distanceSqToPoint: function() {
- var e = new Wt;
- return function(t) {
- var n = e.subVectors(t, this.origin).dot(this.direction);
- return n < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(n).add(this.origin), e.distanceToSquared(t))
- }
- }(),
- distanceSqToSegment: (_n = new Wt, Mn = new Wt, En = new Wt, function(e, t, n, r) {
- _n.copy(e).add(t).multiplyScalar(.5), Mn.copy(t).sub(e).normalize(), En.copy(this.origin).sub(_n);
- var i, o, a, s, c = .5 * e.distanceTo(t),
- l = -this.direction.dot(Mn),
- u = En.dot(this.direction),
- h = -En.dot(Mn),
- d = En.lengthSq(),
- p = Math.abs(1 - l * l);
- if (p > 0)
- if (o = l * u - h, s = c * p, (i = l * h - u) >= 0)
- if (o >= -s)
- if (o <= s) {
- var f = 1 / p;
- a = (i *= f) * (i + l * (o *= f) + 2 * u) + o * (l * i + o + 2 * h) + d
- } else o = c, a = -(i = Math.max(0, -(l * o + u))) * i + o * (o + 2 * h) + d;
- else o = -c, a = -(i = Math.max(0, -(l * o + u))) * i + o * (o + 2 * h) + d;
- 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;
- else o = l > 0 ? -c : c, a = -(i = Math.max(0, -(l * o + u))) * i + o * (o + 2 * h) + d;
- return n && n.copy(this.direction).multiplyScalar(i).add(this.origin), r && r.copy(Mn).multiplyScalar(o).add(_n), a
- }),
- intersectSphere: function() {
- var e = new Wt;
- return function(t, n) {
- e.subVectors(t.center, this.origin);
- var r = e.dot(this.direction),
- i = e.dot(e) - r * r,
- o = t.radius * t.radius;
- if (i > o) return null;
- var a = Math.sqrt(o - i),
- s = r - a,
- c = r + a;
- return s < 0 && c < 0 ? null : s < 0 ? this.at(c, n) : this.at(s, n)
- }
- }(),
- intersectsSphere: function(e) {
- return this.distanceSqToPoint(e.center) <= e.radius * e.radius
- },
- distanceToPlane: function(e) {
- var t = e.normal.dot(this.direction);
- if (0 === t) return 0 === e.distanceToPoint(this.origin) ? 0 : null;
- var n = -(this.origin.dot(e.normal) + e.constant) / t;
- return n >= 0 ? n : null
- },
- intersectPlane: function(e, t) {
- var n = this.distanceToPlane(e);
- return null === n ? null : this.at(n, t)
- },
- intersectsPlane: function(e) {
- var t = e.distanceToPoint(this.origin);
- return 0 === t || e.normal.dot(this.direction) * t < 0
- },
- intersectBox: function(e, t) {
- var n, r, i, o, a, s, c = 1 / this.direction.x,
- l = 1 / this.direction.y,
- u = 1 / this.direction.z,
- h = this.origin;
- 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)))
- },
- intersectsBox: (wn = new Wt, function(e) {
- return null !== this.intersectBox(e, wn)
- }),
- intersectTriangle: function() {
- var e = new Wt,
- t = new Wt,
- n = new Wt,
- r = new Wt;
- return function(i, o, a, s, c) {
- t.subVectors(o, i), n.subVectors(a, i), r.crossVectors(t, n);
- var l, u = this.direction.dot(r);
- if (u > 0) {
- if (s) return null;
- l = 1
- } else {
- if (!(u < 0)) return null;
- l = -1, u = -u
- }
- e.subVectors(this.origin, i);
- var h = l * this.direction.dot(n.crossVectors(e, n));
- if (h < 0) return null;
- var d = l * this.direction.dot(t.cross(e));
- if (d < 0) return null;
- if (h + d > u) return null;
- var p = -l * e.dot(r);
- return p < 0 ? null : this.at(p / u, c)
- }
- }(),
- applyMatrix4: function(e) {
- return this.origin.applyMatrix4(e), this.direction.transformDirection(e), this
- },
- equals: function(e) {
- return e.origin.equals(this.origin) && e.direction.equals(this.direction)
- }
- }), Object.assign(zn, {
- getNormal: (Tn = new Wt, function(e, t, n, r) {
- 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);
- var i = r.lengthSq();
- return i > 0 ? r.multiplyScalar(1 / Math.sqrt(i)) : r.set(0, 0, 0)
- }),
- getBarycoord: function() {
- var e = new Wt,
- t = new Wt,
- n = new Wt;
- return function(r, i, o, a, s) {
- e.subVectors(a, i), t.subVectors(o, i), n.subVectors(r, i);
- var c = e.dot(e),
- l = e.dot(t),
- u = e.dot(n),
- h = t.dot(t),
- d = t.dot(n),
- p = c * h - l * l;
- if (void 0 === s && (console.warn("THREE.Triangle: .getBarycoord() target is now required"), s = new Wt), 0 === p) return s.set(-2, -1, -1);
- var f = 1 / p,
- m = (h * u - l * d) * f,
- v = (c * d - l * u) * f;
- return s.set(1 - m - v, v, m)
- }
- }(),
- containsPoint: function() {
- var e = new Wt;
- return function(t, n, r, i) {
- return zn.getBarycoord(t, n, r, i, e), e.x >= 0 && e.y >= 0 && e.x + e.y <= 1
- }
- }(),
- getUV: (Sn = new Wt, function(e, t, n, r, i, o, a, s) {
- 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
- }),
- isFrontFacing: function() {
- var e = new Wt,
- t = new Wt;
- return function(n, r, i, o) {
- return e.subVectors(i, r), t.subVectors(n, r), e.cross(t).dot(o) < 0
- }
- }()
- }), Object.assign(zn.prototype, {
- set: function(e, t, n) {
- return this.a.copy(e), this.b.copy(t), this.c.copy(n), this
- },
- setFromPointsAndIndices: function(e, t, n, r) {
- return this.a.copy(e[t]), this.b.copy(e[n]), this.c.copy(e[r]), this
- },
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this
- },
- getArea: function() {
- var e = new Wt,
- t = new Wt;
- return function() {
- return e.subVectors(this.c, this.b), t.subVectors(this.a, this.b), .5 * e.cross(t).length()
- }
- }(),
- getMidpoint: function(e) {
- 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)
- },
- getNormal: function(e) {
- return zn.getNormal(this.a, this.b, this.c, e)
- },
- getPlane: function(e) {
- return void 0 === e && (console.warn("THREE.Triangle: .getPlane() target is now required"), e = new Wt), e.setFromCoplanarPoints(this.a, this.b, this.c)
- },
- getBarycoord: function(e, t) {
- return zn.getBarycoord(e, this.a, this.b, this.c, t)
- },
- getUV: function(e, t, n, r, i) {
- return zn.getUV(e, this.a, this.b, this.c, t, n, r, i)
- },
- containsPoint: function(e) {
- return zn.containsPoint(e, this.a, this.b, this.c)
- },
- isFrontFacing: function(e) {
- return zn.isFrontFacing(this.a, this.b, this.c, e)
- },
- intersectsBox: function(e) {
- return e.intersectsTriangle(this)
- },
- closestPointToPoint: (Ln = new Wt, An = new Wt, Cn = new Wt, Pn = new Wt, Rn = new Wt, On = new Wt, function(e, t) {
- void 0 === t && (console.warn("THREE.Triangle: .closestPointToPoint() target is now required"), t = new Wt);
- var n, r, i = this.a,
- o = this.b,
- a = this.c;
- Ln.subVectors(o, i), An.subVectors(a, i), Pn.subVectors(e, i);
- var s = Ln.dot(Pn),
- c = An.dot(Pn);
- if (s <= 0 && c <= 0) return t.copy(i);
- Rn.subVectors(e, o);
- var l = Ln.dot(Rn),
- u = An.dot(Rn);
- if (l >= 0 && u <= l) return t.copy(o);
- var h = s * u - l * c;
- if (h <= 0 && s >= 0 && l <= 0) return n = s / (s - l), t.copy(i).addScaledVector(Ln, n);
- On.subVectors(e, a);
- var d = Ln.dot(On),
- p = An.dot(On);
- if (p >= 0 && d <= p) return t.copy(a);
- var f = d * c - s * p;
- if (f <= 0 && c >= 0 && p <= 0) return r = c / (c - p), t.copy(i).addScaledVector(An, r);
- var m = l * p - d * u;
- 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);
- var v = 1 / (m + f + h);
- return n = f * v, r = h * v, t.copy(i).addScaledVector(Ln, n).addScaledVector(An, r)
- }),
- equals: function(e) {
- return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
- }
- });
- var Un, Fn, Gn, Hn = {
- aliceblue: 15792383,
- antiquewhite: 16444375,
- aqua: 65535,
- aquamarine: 8388564,
- azure: 15794175,
- beige: 16119260,
- bisque: 16770244,
- black: 0,
- blanchedalmond: 16772045,
- blue: 255,
- blueviolet: 9055202,
- brown: 10824234,
- burlywood: 14596231,
- cadetblue: 6266528,
- chartreuse: 8388352,
- chocolate: 13789470,
- coral: 16744272,
- cornflowerblue: 6591981,
- cornsilk: 16775388,
- crimson: 14423100,
- cyan: 65535,
- darkblue: 139,
- darkcyan: 35723,
- darkgoldenrod: 12092939,
- darkgray: 11119017,
- darkgreen: 25600,
- darkgrey: 11119017,
- darkkhaki: 12433259,
- darkmagenta: 9109643,
- darkolivegreen: 5597999,
- darkorange: 16747520,
- darkorchid: 10040012,
- darkred: 9109504,
- darksalmon: 15308410,
- darkseagreen: 9419919,
- darkslateblue: 4734347,
- darkslategray: 3100495,
- darkslategrey: 3100495,
- darkturquoise: 52945,
- darkviolet: 9699539,
- deeppink: 16716947,
- deepskyblue: 49151,
- dimgray: 6908265,
- dimgrey: 6908265,
- dodgerblue: 2003199,
- firebrick: 11674146,
- floralwhite: 16775920,
- forestgreen: 2263842,
- fuchsia: 16711935,
- gainsboro: 14474460,
- ghostwhite: 16316671,
- gold: 16766720,
- goldenrod: 14329120,
- gray: 8421504,
- green: 32768,
- greenyellow: 11403055,
- grey: 8421504,
- honeydew: 15794160,
- hotpink: 16738740,
- indianred: 13458524,
- indigo: 4915330,
- ivory: 16777200,
- khaki: 15787660,
- lavender: 15132410,
- lavenderblush: 16773365,
- lawngreen: 8190976,
- lemonchiffon: 16775885,
- lightblue: 11393254,
- lightcoral: 15761536,
- lightcyan: 14745599,
- lightgoldenrodyellow: 16448210,
- lightgray: 13882323,
- lightgreen: 9498256,
- lightgrey: 13882323,
- lightpink: 16758465,
- lightsalmon: 16752762,
- lightseagreen: 2142890,
- lightskyblue: 8900346,
- lightslategray: 7833753,
- lightslategrey: 7833753,
- lightsteelblue: 11584734,
- lightyellow: 16777184,
- lime: 65280,
- limegreen: 3329330,
- linen: 16445670,
- magenta: 16711935,
- maroon: 8388608,
- mediumaquamarine: 6737322,
- mediumblue: 205,
- mediumorchid: 12211667,
- mediumpurple: 9662683,
- mediumseagreen: 3978097,
- mediumslateblue: 8087790,
- mediumspringgreen: 64154,
- mediumturquoise: 4772300,
- mediumvioletred: 13047173,
- midnightblue: 1644912,
- mintcream: 16121850,
- mistyrose: 16770273,
- moccasin: 16770229,
- navajowhite: 16768685,
- navy: 128,
- oldlace: 16643558,
- olive: 8421376,
- olivedrab: 7048739,
- orange: 16753920,
- orangered: 16729344,
- orchid: 14315734,
- palegoldenrod: 15657130,
- palegreen: 10025880,
- paleturquoise: 11529966,
- palevioletred: 14381203,
- papayawhip: 16773077,
- peachpuff: 16767673,
- peru: 13468991,
- pink: 16761035,
- plum: 14524637,
- powderblue: 11591910,
- purple: 8388736,
- rebeccapurple: 6697881,
- red: 16711680,
- rosybrown: 12357519,
- royalblue: 4286945,
- saddlebrown: 9127187,
- salmon: 16416882,
- sandybrown: 16032864,
- seagreen: 3050327,
- seashell: 16774638,
- sienna: 10506797,
- silver: 12632256,
- skyblue: 8900331,
- slateblue: 6970061,
- slategray: 7372944,
- slategrey: 7372944,
- snow: 16775930,
- springgreen: 65407,
- steelblue: 4620980,
- tan: 13808780,
- teal: 32896,
- thistle: 14204888,
- tomato: 16737095,
- turquoise: 4251856,
- violet: 15631086,
- wheat: 16113331,
- white: 16777215,
- whitesmoke: 16119285,
- yellow: 16776960,
- yellowgreen: 10145074
- };
- function Vn(e, t, n) {
- return void 0 === t && void 0 === n ? this.set(e) : this.setRGB(e, t, n)
- }
- function Wn(e, t, n) {
- 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
- }
- function qn(e) {
- return e < .04045 ? .0773993808 * e : Math.pow(.9478672986 * e + .0521327014, 2.4)
- }
- function Xn(e) {
- return e < .0031308 ? 12.92 * e : 1.055 * Math.pow(e, .41666) - .055
- }
- function Yn(e, t, n, r, i, o) {
- 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
- }
- Object.assign(Vn.prototype, {
- isColor: !0,
- r: 1,
- g: 1,
- b: 1,
- set: function(e) {
- return e && e.isColor ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e), this
- },
- setScalar: function(e) {
- return this.r = e, this.g = e, this.b = e, this
- },
- setHex: function(e) {
- return e = Math.floor(e), this.r = (e >> 16 & 255) / 255, this.g = (e >> 8 & 255) / 255, this.b = (255 & e) / 255, this
- },
- setRGB: function(e, t, n) {
- return this.r = e, this.g = t, this.b = n, this
- },
- setHSL: function(e, t, n) {
- 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;
- else {
- var r = n <= .5 ? n * (1 + t) : n + t - n * t,
- i = 2 * n - r;
- this.r = Wn(i, r, e + 1 / 3), this.g = Wn(i, r, e), this.b = Wn(i, r, e - 1 / 3)
- }
- return this
- },
- setStyle: function(e) {
- function t(t) {
- void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
- }
- var n;
- if (n = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
- var r, i = n[1],
- o = n[2];
- switch (i) {
- case "rgb":
- case "rgba":
- 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;
- 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;
- break;
- case "hsl":
- case "hsla":
- if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
- var a = parseFloat(r[1]) / 360,
- s = parseInt(r[2], 10) / 100,
- c = parseInt(r[3], 10) / 100;
- return t(r[5]), this.setHSL(a, s, c)
- }
- }
- } else if (n = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
- var l, u = (l = n[1]).length;
- 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;
- 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
- }
- e && e.length > 0 && (void 0 !== (l = Hn[e]) ? this.setHex(l) : console.warn("THREE.Color: Unknown color " + e));
- return this
- },
- clone: function() {
- return new this.constructor(this.r, this.g, this.b)
- },
- copy: function(e) {
- return this.r = e.r, this.g = e.g, this.b = e.b, this
- },
- copyGammaToLinear: function(e, t) {
- 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
- },
- copyLinearToGamma: function(e, t) {
- void 0 === t && (t = 2);
- var n = t > 0 ? 1 / t : 1;
- return this.r = Math.pow(e.r, n), this.g = Math.pow(e.g, n), this.b = Math.pow(e.b, n), this
- },
- convertGammaToLinear: function(e) {
- return this.copyGammaToLinear(this, e), this
- },
- convertLinearToGamma: function(e) {
- return this.copyLinearToGamma(this, e), this
- },
- copySRGBToLinear: function(e) {
- return this.r = qn(e.r), this.g = qn(e.g), this.b = qn(e.b), this
- },
- copyLinearToSRGB: function(e) {
- return this.r = Xn(e.r), this.g = Xn(e.g), this.b = Xn(e.b), this
- },
- convertSRGBToLinear: function() {
- return this.copySRGBToLinear(this), this
- },
- convertLinearToSRGB: function() {
- return this.copyLinearToSRGB(this), this
- },
- getHex: function() {
- return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
- },
- getHexString: function() {
- return ("000000" + this.getHex().toString(16)).slice(-6)
- },
- getHSL: function(e) {
- void 0 === e && (console.warn("THREE.Color: .getHSL() target is now required"), e = {
- h: 0,
- s: 0,
- l: 0
- });
- var t, n, r = this.r,
- i = this.g,
- o = this.b,
- a = Math.max(r, i, o),
- s = Math.min(r, i, o),
- c = (s + a) / 2;
- if (s === a) t = 0, n = 0;
- else {
- var l = a - s;
- switch (n = c <= .5 ? l / (a + s) : l / (2 - a - s), a) {
- case r:
- t = (i - o) / l + (i < o ? 6 : 0);
- break;
- case i:
- t = (o - r) / l + 2;
- break;
- case o:
- t = (r - i) / l + 4
- }
- t /= 6
- }
- return e.h = t, e.s = n, e.l = c, e
- },
- getStyle: function() {
- return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
- },
- offsetHSL: (Gn = {}, function(e, t, n) {
- return this.getHSL(Gn), Gn.h += e, Gn.s += t, Gn.l += n, this.setHSL(Gn.h, Gn.s, Gn.l), this
- }),
- add: function(e) {
- return this.r += e.r, this.g += e.g, this.b += e.b, this
- },
- addColors: function(e, t) {
- return this.r = e.r + t.r, this.g = e.g + t.g, this.b = e.b + t.b, this
- },
- addScalar: function(e) {
- return this.r += e, this.g += e, this.b += e, this
- },
- sub: function(e) {
- 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
- },
- multiply: function(e) {
- return this.r *= e.r, this.g *= e.g, this.b *= e.b, this
- },
- multiplyScalar: function(e) {
- return this.r *= e, this.g *= e, this.b *= e, this
- },
- lerp: function(e, t) {
- return this.r += (e.r - this.r) * t, this.g += (e.g - this.g) * t, this.b += (e.b - this.b) * t, this
- },
- lerpHSL: (Un = {
- h: 0,
- s: 0,
- l: 0
- }, Fn = {
- h: 0,
- s: 0,
- l: 0
- }, function(e, t) {
- this.getHSL(Un), e.getHSL(Fn);
- var n = Gt.lerp(Un.h, Fn.h, t),
- r = Gt.lerp(Un.s, Fn.s, t),
- i = Gt.lerp(Un.l, Fn.l, t);
- return this.setHSL(n, r, i), this
- }),
- equals: function(e) {
- return e.r === this.r && e.g === this.g && e.b === this.b
- },
- fromArray: function(e, t) {
- return void 0 === t && (t = 0), this.r = e[t], this.g = e[t + 1], this.b = e[t + 2], this
- },
- toArray: function(e, t) {
- 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
- },
- toJSON: function() {
- return this.getHex()
- }
- }), Object.assign(Yn.prototype, {
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- 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;
- for (var t = 0, n = e.vertexNormals.length; t < n; t++) this.vertexNormals[t] = e.vertexNormals[t].clone();
- for (t = 0, n = e.vertexColors.length; t < n; t++) this.vertexColors[t] = e.vertexColors[t].clone();
- return this
- }
- });
- var Zn = 0;
- function Kn() {
- Object.defineProperty(this, "id", {
- value: Zn++
- }), 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
- }
- function Jn(e) {
- 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)
- }
- function $n(e, t, n) {
- if (Array.isArray(e)) throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
- 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 = {
- offset: 0,
- count: -1
- }, this.version = 0
- }
- function Qn(e, t, n) {
- $n.call(this, new Int8Array(e), t, n)
- }
- function er(e, t, n) {
- $n.call(this, new Uint8Array(e), t, n)
- }
- function tr(e, t, n) {
- $n.call(this, new Uint8ClampedArray(e), t, n)
- }
- function nr(e, t, n) {
- $n.call(this, new Int16Array(e), t, n)
- }
- function rr(e, t, n) {
- $n.call(this, new Uint16Array(e), t, n)
- }
- function ir(e, t, n) {
- $n.call(this, new Int32Array(e), t, n)
- }
- function or(e, t, n) {
- $n.call(this, new Uint32Array(e), t, n)
- }
- function ar(e, t, n) {
- $n.call(this, new Float32Array(e), t, n)
- }
- function sr(e, t, n) {
- $n.call(this, new Float64Array(e), t, n)
- }
- function cr() {
- 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
- }
- function lr(e) {
- if (0 === e.length) return -1 / 0;
- for (var t = e[0], n = 1, r = e.length; n < r; ++n) e[n] > t && (t = e[n]);
- return t
- }
- Kn.prototype = Object.assign(Object.create(r.prototype), {
- constructor: Kn,
- isMaterial: !0,
- onBeforeCompile: function() {},
- setValues: function(e) {
- if (void 0 !== e)
- for (var t in e) {
- var n = e[t];
- if (void 0 !== n)
- if ("shading" !== t) {
- var r = this[t];
- 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.")
- } else console.warn("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead."), this.flatShading = n === w;
- else console.warn("THREE.Material: '" + t + "' parameter is undefined.")
- }
- },
- toJSON: function(e) {
- var t = void 0 === e || "string" == typeof e;
- t && (e = {
- textures: {},
- images: {}
- });
- var n = {
- metadata: {
- version: 4.5,
- type: "Material",
- generator: "Material.toJSON"
- }
- };
- function r(e) {
- var t = [];
- for (var n in e) {
- var r = e[n];
- delete r.metadata, t.push(r)
- }
- return t
- }
- 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) {
- var i = r(e.textures),
- o = r(e.images);
- i.length > 0 && (n.textures = i), o.length > 0 && (n.images = o)
- }
- return n
- },
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- 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;
- var t = e.clippingPlanes,
- n = null;
- if (null !== t) {
- var r = t.length;
- n = new Array(r);
- for (var i = 0; i !== r; ++i) n[i] = t[i].clone()
- }
- return this.clippingPlanes = n, this.shadowSide = e.shadowSide, this
- },
- dispose: function() {
- this.dispatchEvent({
- type: "dispose"
- })
- }
- }), Jn.prototype = Object.create(Kn.prototype), Jn.prototype.constructor = Jn, Jn.prototype.isMeshBasicMaterial = !0, Jn.prototype.copy = function(e) {
- 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
- }, Object.defineProperty($n.prototype, "needsUpdate", {
- set: function(e) {
- !0 === e && this.version++
- }
- }), Object.assign($n.prototype, {
- isBufferAttribute: !0,
- onUploadCallback: function() {},
- setArray: function(e) {
- if (Array.isArray(e)) throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
- return this.count = void 0 !== e ? e.length / this.itemSize : 0, this.array = e, this
- },
- setDynamic: function(e) {
- return this.dynamic = e, this
- },
- copy: function(e) {
- 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
- },
- copyAt: function(e, t, n) {
- e *= this.itemSize, n *= t.itemSize;
- for (var r = 0, i = this.itemSize; r < i; r++) this.array[e + r] = t.array[n + r];
- return this
- },
- copyArray: function(e) {
- return this.array.set(e), this
- },
- copyColorsArray: function(e) {
- for (var t = this.array, n = 0, r = 0, i = e.length; r < i; r++) {
- var o = e[r];
- 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
- }
- return this
- },
- copyVector2sArray: function(e) {
- for (var t = this.array, n = 0, r = 0, i = e.length; r < i; r++) {
- var o = e[r];
- void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r), o = new Ht), t[n++] = o.x, t[n++] = o.y
- }
- return this
- },
- copyVector3sArray: function(e) {
- for (var t = this.array, n = 0, r = 0, i = e.length; r < i; r++) {
- var o = e[r];
- 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
- }
- return this
- },
- copyVector4sArray: function(e) {
- for (var t = this.array, n = 0, r = 0, i = e.length; r < i; r++) {
- var o = e[r];
- 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
- }
- return this
- },
- set: function(e, t) {
- return void 0 === t && (t = 0), this.array.set(e, t), this
- },
- getX: function(e) {
- return this.array[e * this.itemSize]
- },
- setX: function(e, t) {
- return this.array[e * this.itemSize] = t, this
- },
- getY: function(e) {
- return this.array[e * this.itemSize + 1]
- },
- setY: function(e, t) {
- return this.array[e * this.itemSize + 1] = t, this
- },
- getZ: function(e) {
- return this.array[e * this.itemSize + 2]
- },
- setZ: function(e, t) {
- return this.array[e * this.itemSize + 2] = t, this
- },
- getW: function(e) {
- return this.array[e * this.itemSize + 3]
- },
- setW: function(e, t) {
- return this.array[e * this.itemSize + 3] = t, this
- },
- setXY: function(e, t, n) {
- return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = n, this
- },
- setXYZ: function(e, t, n, r) {
- return e *= this.itemSize, this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = r, this
- },
- setXYZW: function(e, t, n, r, i) {
- 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
- },
- onUpload: function(e) {
- return this.onUploadCallback = e, this
- },
- clone: function() {
- return new this.constructor(this.array, this.itemSize).copy(this)
- },
- toJSON: function() {
- return {
- itemSize: this.itemSize,
- type: this.array.constructor.name,
- array: Array.prototype.slice.call(this.array),
- normalized: this.normalized
- }
- }
- }), 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, {
- computeGroups: function(e) {
- for (var t, n = [], r = void 0, i = e.faces, o = 0; o < i.length; o++) {
- var a = i[o];
- a.materialIndex !== r && (r = a.materialIndex, void 0 !== t && (t.count = 3 * o - t.start, n.push(t)), t = {
- start: 3 * o,
- materialIndex: r
- })
- }
- void 0 !== t && (t.count = 3 * o - t.start, n.push(t)), this.groups = n
- },
- fromGeometry: function(e) {
- var t, n = e.faces,
- r = e.vertices,
- i = e.faceVertexUvs,
- o = i[0] && i[0].length > 0,
- a = i[1] && i[1].length > 0,
- s = e.morphTargets,
- c = s.length;
- if (c > 0) {
- t = [];
- for (var l = 0; l < c; l++) t[l] = {
- name: s[l].name,
- data: []
- };
- this.morphTargets.position = t
- }
- var u, h = e.morphNormals,
- d = h.length;
- if (d > 0) {
- u = [];
- for (l = 0; l < d; l++) u[l] = {
- name: h[l].name,
- data: []
- };
- this.morphTargets.normal = u
- }
- var p = e.skinIndices,
- f = e.skinWeights,
- m = p.length === r.length,
- v = f.length === r.length;
- r.length > 0 && 0 === n.length && console.error("THREE.DirectGeometry: Faceless geometries are not supported.");
- for (l = 0; l < n.length; l++) {
- var g = n[l];
- this.vertices.push(r[g.a], r[g.b], r[g.c]);
- var y = g.vertexNormals;
- if (3 === y.length) this.normals.push(y[0], y[1], y[2]);
- else {
- var b = g.normal;
- this.normals.push(b, b, b)
- }
- var x, w = g.vertexColors;
- if (3 === w.length) this.colors.push(w[0], w[1], w[2]);
- else {
- var _ = g.color;
- this.colors.push(_, _, _)
- }
- 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));
- 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));
- for (var M = 0; M < c; M++) {
- var E = s[M].vertices;
- t[M].data.push(E[g.a], E[g.b], E[g.c])
- }
- for (M = 0; M < d; M++) {
- var S = h[M].vertexNormals[l];
- u[M].data.push(S.a, S.b, S.c)
- }
- 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])
- }
- 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
- }
- });
- var ur, hr, dr = 1;
- function pr() {
- Object.defineProperty(this, "id", {
- value: dr += 2
- }), 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 = {
- start: 0,
- count: 1 / 0
- }, this.userData = {}
- }
- function fr(e, t) {
- In.call(this), this.type = "Mesh", this.geometry = void 0 !== e ? e : new pr, this.material = void 0 !== t ? t : new Jn({
- color: 16777215 * Math.random()
- }), this.drawMode = Lt, this.updateMorphTargets()
- }
- pr.prototype = Object.assign(Object.create(r.prototype), {
- constructor: pr,
- isBufferGeometry: !0,
- getIndex: function() {
- return this.index
- },
- setIndex: function(e) {
- Array.isArray(e) ? this.index = new(lr(e) > 65535 ? or : rr)(e, 1) : this.index = e
- },
- addAttribute: function(e, t) {
- 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])))
- },
- getAttribute: function(e) {
- return this.attributes[e]
- },
- removeAttribute: function(e) {
- return delete this.attributes[e], this
- },
- addGroup: function(e, t, n) {
- this.groups.push({
- start: e,
- count: t,
- materialIndex: void 0 !== n ? n : 0
- })
- },
- clearGroups: function() {
- this.groups = []
- },
- setDrawRange: function(e, t) {
- this.drawRange.start = e, this.drawRange.count = t
- },
- applyMatrix: function(e) {
- var t = this.attributes.position;
- void 0 !== t && (e.applyToBufferAttribute(t), t.needsUpdate = !0);
- var n = this.attributes.normal;
- void 0 !== n && ((new qt).getNormalMatrix(e).applyToBufferAttribute(n), n.needsUpdate = !0);
- var r = this.attributes.tangent;
- void 0 !== r && ((new qt).getNormalMatrix(e).applyToBufferAttribute(r), r.needsUpdate = !0);
- return null !== this.boundingBox && this.computeBoundingBox(), null !== this.boundingSphere && this.computeBoundingSphere(), this
- },
- rotateX: function() {
- var e = new un;
- return function(t) {
- return e.makeRotationX(t), this.applyMatrix(e), this
- }
- }(),
- rotateY: function() {
- var e = new un;
- return function(t) {
- return e.makeRotationY(t), this.applyMatrix(e), this
- }
- }(),
- rotateZ: function() {
- var e = new un;
- return function(t) {
- return e.makeRotationZ(t), this.applyMatrix(e), this
- }
- }(),
- translate: function() {
- var e = new un;
- return function(t, n, r) {
- return e.makeTranslation(t, n, r), this.applyMatrix(e), this
- }
- }(),
- scale: function() {
- var e = new un;
- return function(t, n, r) {
- return e.makeScale(t, n, r), this.applyMatrix(e), this
- }
- }(),
- lookAt: (hr = new In, function(e) {
- hr.lookAt(e), hr.updateMatrix(), this.applyMatrix(hr.matrix)
- }),
- center: (ur = new Wt, function() {
- return this.computeBoundingBox(), this.boundingBox.getCenter(ur).negate(), this.translate(ur.x, ur.y, ur.z), this
- }),
- setFromObject: function(e) {
- var t = e.geometry;
- if (e.isPoints || e.isLine) {
- var n = new ar(3 * t.vertices.length, 3),
- r = new ar(3 * t.colors.length, 3);
- if (this.addAttribute("position", n.copyVector3sArray(t.vertices)), this.addAttribute("color", r.copyColorsArray(t.colors)), t.lineDistances && t.lineDistances.length === t.vertices.length) {
- var i = new ar(t.lineDistances.length, 1);
- this.addAttribute("lineDistance", i.copyArray(t.lineDistances))
- }
- null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()), null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
- } else e.isMesh && t && t.isGeometry && this.fromGeometry(t);
- return this
- },
- setFromPoints: function(e) {
- for (var t = [], n = 0, r = e.length; n < r; n++) {
- var i = e[n];
- t.push(i.x, i.y, i.z || 0)
- }
- return this.addAttribute("position", new ar(t, 3)), this
- },
- updateFromObject: function(e) {
- var t, n = e.geometry;
- if (e.isMesh) {
- var r = n.__directGeometry;
- if (!0 === n.elementsNeedUpdate && (r = void 0, n.elementsNeedUpdate = !1), void 0 === r) return this.fromGeometry(n);
- 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
- }
- 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
- },
- fromGeometry: function(e) {
- return e.__directGeometry = (new cr).fromGeometry(e), this.fromDirectGeometry(e.__directGeometry)
- },
- fromDirectGeometry: function(e) {
- var t = new Float32Array(3 * e.vertices.length);
- if (this.addAttribute("position", new $n(t, 3).copyVector3sArray(e.vertices)), e.normals.length > 0) {
- var n = new Float32Array(3 * e.normals.length);
- this.addAttribute("normal", new $n(n, 3).copyVector3sArray(e.normals))
- }
- if (e.colors.length > 0) {
- var r = new Float32Array(3 * e.colors.length);
- this.addAttribute("color", new $n(r, 3).copyColorsArray(e.colors))
- }
- if (e.uvs.length > 0) {
- var i = new Float32Array(2 * e.uvs.length);
- this.addAttribute("uv", new $n(i, 2).copyVector2sArray(e.uvs))
- }
- if (e.uvs2.length > 0) {
- var o = new Float32Array(2 * e.uvs2.length);
- this.addAttribute("uv2", new $n(o, 2).copyVector2sArray(e.uvs2))
- }
- for (var a in this.groups = e.groups, e.morphTargets) {
- for (var s = [], c = e.morphTargets[a], l = 0, u = c.length; l < u; l++) {
- var h = c[l],
- d = new ar(3 * h.data.length, 3);
- d.name = h.name, s.push(d.copyVector3sArray(h.data))
- }
- this.morphAttributes[a] = s
- }
- if (e.skinIndices.length > 0) {
- var p = new ar(4 * e.skinIndices.length, 4);
- this.addAttribute("skinIndex", p.copyVector4sArray(e.skinIndices))
- }
- if (e.skinWeights.length > 0) {
- var f = new ar(4 * e.skinWeights.length, 4);
- this.addAttribute("skinWeight", f.copyVector4sArray(e.skinWeights))
- }
- return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()), null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()), this
- },
- computeBoundingBox: function() {
- var e = new jn;
- return function() {
- null === this.boundingBox && (this.boundingBox = new jn);
- var t = this.attributes.position,
- n = this.morphAttributes.position;
- if (void 0 !== t) {
- if (this.boundingBox.setFromBufferAttribute(t), n)
- for (var r = 0, i = n.length; r < i; r++) {
- var o = n[r];
- e.setFromBufferAttribute(o), this.boundingBox.expandByPoint(e.min), this.boundingBox.expandByPoint(e.max)
- }
- } else this.boundingBox.makeEmpty();
- (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)
- }
- }(),
- computeBoundingSphere: function() {
- var e = new jn,
- t = new jn,
- n = new Wt;
- return function() {
- null === this.boundingSphere && (this.boundingSphere = new Nn);
- var r = this.attributes.position,
- i = this.morphAttributes.position;
- if (r) {
- var o = this.boundingSphere.center;
- if (e.setFromBufferAttribute(r), i)
- for (var a = 0, s = i.length; a < s; a++) {
- var c = i[a];
- t.setFromBufferAttribute(c), e.expandByPoint(t.min), e.expandByPoint(t.max)
- }
- e.getCenter(o);
- var l = 0;
- for (a = 0, s = r.count; a < s; a++) n.fromBufferAttribute(r, a), l = Math.max(l, o.distanceToSquared(n));
- if (i)
- for (a = 0, s = i.length; a < s; a++)
- for (var u = 0, h = (c = i[a]).count; u < h; u++) n.fromBufferAttribute(c, u), l = Math.max(l, o.distanceToSquared(n));
- 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)
- }
- }
- }(),
- computeFaceNormals: function() {},
- computeVertexNormals: function() {
- var e = this.index,
- t = this.attributes;
- if (t.position) {
- var n = t.position.array;
- if (void 0 === t.normal) this.addAttribute("normal", new $n(new Float32Array(n.length), 3));
- else
- for (var r = t.normal.array, i = 0, o = r.length; i < o; i++) r[i] = 0;
- var a, s, c, l = t.normal.array,
- u = new Wt,
- h = new Wt,
- d = new Wt,
- p = new Wt,
- f = new Wt;
- if (e) {
- var m = e.array;
- 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
- } else
- 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;
- this.normalizeNormals(), t.normal.needsUpdate = !0
- }
- },
- merge: function(e, t) {
- if (e && e.isBufferGeometry) {
- void 0 === t && (t = 0, console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));
- var n = this.attributes;
- for (var r in n)
- if (void 0 !== e.attributes[r])
- 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];
- return this
- }
- console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
- },
- normalizeNormals: function() {
- var e = new Wt;
- return function() {
- 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)
- }
- }(),
- toNonIndexed: function() {
- function e(e, t) {
- 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++) {
- o = t[s] * r;
- for (var l = 0; l < r; l++) i[a++] = n[o++]
- }
- return new $n(i, r)
- }
- if (null === this.index) return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."), this;
- var t = new pr,
- n = this.index.array,
- r = this.attributes;
- for (var i in r) {
- var o = e(r[i], n);
- t.addAttribute(i, o)
- }
- var a = this.morphAttributes;
- for (i in a) {
- for (var s = [], c = a[i], l = 0, u = c.length; l < u; l++) {
- o = e(c[l], n);
- s.push(o)
- }
- t.morphAttributes[i] = s
- }
- for (var h = this.groups, d = (l = 0, h.length); l < d; l++) {
- var p = h[l];
- t.addGroup(p.start, p.count, p.materialIndex)
- }
- return t
- },
- toJSON: function() {
- var e = {
- metadata: {
- version: 4.5,
- type: "BufferGeometry",
- generator: "BufferGeometry.toJSON"
- }
- };
- 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) {
- var t = this.parameters;
- for (var n in t) void 0 !== t[n] && (e[n] = t[n]);
- return e
- }
- e.data = {
- attributes: {}
- };
- var r = this.index;
- null !== r && (e.data.index = {
- type: r.array.constructor.name,
- array: Array.prototype.slice.call(r.array)
- });
- var i = this.attributes;
- for (var n in i) {
- var o = (d = i[n]).toJSON();
- "" !== d.name && (o.name = d.name), e.data.attributes[n] = o
- }
- var a = {},
- s = !1;
- for (var n in this.morphAttributes) {
- for (var c = this.morphAttributes[n], l = [], u = 0, h = c.length; u < h; u++) {
- var d;
- o = (d = c[u]).toJSON();
- "" !== d.name && (o.name = d.name), l.push(o)
- }
- l.length > 0 && (a[n] = l, s = !0)
- }
- s && (e.data.morphAttributes = a);
- var p = this.groups;
- p.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(p)));
- var f = this.boundingSphere;
- return null !== f && (e.data.boundingSphere = {
- center: f.center.toArray(),
- radius: f.radius
- }), e
- },
- clone: function() {
- return (new pr).copy(this)
- },
- copy: function(e) {
- var t, n, r;
- this.index = null, this.attributes = {}, this.morphAttributes = {}, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.name = e.name;
- var i = e.index;
- null !== i && this.setIndex(i.clone());
- var o = e.attributes;
- for (t in o) {
- var a = o[t];
- this.addAttribute(t, a.clone())
- }
- var s = e.morphAttributes;
- for (t in s) {
- var c = [],
- l = s[t];
- for (n = 0, r = l.length; n < r; n++) c.push(l[n].clone());
- this.morphAttributes[t] = c
- }
- var u = e.groups;
- for (n = 0, r = u.length; n < r; n++) {
- var h = u[n];
- this.addGroup(h.start, h.count, h.materialIndex)
- }
- var d = e.boundingBox;
- null !== d && (this.boundingBox = d.clone());
- var p = e.boundingSphere;
- return null !== p && (this.boundingSphere = p.clone()), this.drawRange.start = e.drawRange.start, this.drawRange.count = e.drawRange.count, this.userData = e.userData, this
- },
- dispose: function() {
- this.dispatchEvent({
- type: "dispose"
- })
- }
- }), fr.prototype = Object.assign(Object.create(In.prototype), {
- constructor: fr,
- isMesh: !0,
- setDrawMode: function(e) {
- this.drawMode = e
- },
- copy: function(e) {
- 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
- },
- updateMorphTargets: function() {
- var e, t, n, r = this.geometry;
- if (r.isBufferGeometry) {
- var i = r.morphAttributes,
- o = Object.keys(i);
- if (o.length > 0) {
- var a = i[o[0]];
- if (void 0 !== a)
- 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
- }
- } else {
- var s = r.morphTargets;
- void 0 !== s && s.length > 0 && console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")
- }
- },
- raycast: function() {
- var e = new un,
- t = new Bn,
- n = new Nn,
- r = new Wt,
- i = new Wt,
- o = new Wt,
- a = new Wt,
- s = new Wt,
- c = new Wt,
- l = new Wt,
- u = new Wt,
- h = new Wt,
- d = new Ht,
- p = new Ht,
- f = new Ht,
- m = new Wt,
- v = new Wt;
- function g(e, t, n, r, i, o, a, s) {
- if (null === (t.side === b ? r.intersectTriangle(a, o, i, !0, s) : r.intersectTriangle(i, o, a, t.side !== x, s))) return null;
- v.copy(s), v.applyMatrix4(e.matrixWorld);
- var c = n.ray.origin.distanceTo(v);
- return c < n.near || c > n.far ? null : {
- distance: c,
- point: v.clone(),
- object: e
- }
- }
- function y(e, t, n, v, y, b, x, w, _, M) {
- r.fromBufferAttribute(y, w), i.fromBufferAttribute(y, _), o.fromBufferAttribute(y, M);
- var E = e.morphTargetInfluences;
- if (t.morphTargets && b && E) {
- l.set(0, 0, 0), u.set(0, 0, 0), h.set(0, 0, 0);
- for (var S = 0, T = b.length; S < T; S++) {
- var L = E[S],
- A = b[S];
- 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))
- }
- r.add(l), i.add(u), o.add(h)
- }
- var C = g(e, t, n, v, r, i, o, m);
- if (C) {
- 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));
- var P = new Yn(w, _, M);
- zn.getNormal(r, i, o, P.normal), C.face = P
- }
- return C
- }
- return function(r, i) {
- var o, a = this.geometry,
- s = this.material,
- c = this.matrixWorld;
- 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))))
- if (a.isBufferGeometry) {
- var l, u, h, v, b, x, w, _, M, E = a.index,
- S = a.attributes.position,
- T = a.morphAttributes.position,
- L = a.attributes.uv,
- A = a.groups,
- C = a.drawRange;
- if (null !== E)
- if (Array.isArray(s))
- for (v = 0, x = A.length; v < x; v++)
- 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));
- else
- 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));
- else if (void 0 !== S)
- if (Array.isArray(s))
- for (v = 0, x = A.length; v < x; v++)
- 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));
- else
- 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))
- } else if (a.isGeometry) {
- var P, R, O, k, I = Array.isArray(s),
- D = a.vertices,
- j = a.faces,
- N = a.faceVertexUvs[0];
- N.length > 0 && (k = N);
- for (var B = 0, z = j.length; B < z; B++) {
- var U = j[B],
- F = I ? s[U.materialIndex] : s;
- 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))) {
- if (k && k[B]) {
- var G = k[B];
- 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)
- }
- o.face = U, o.faceIndex = B, i.push(o)
- }
- }
- }
- }
- }(),
- clone: function() {
- return new this.constructor(this.geometry, this.material).copy(this)
- }
- });
- var mr = 0;
- function vr() {
- Object.defineProperty(this, "id", {
- value: mr += 2
- }), this.uuid = Gt.generateUUID(), this.name = "", this.type = "Geometry", this.vertices = [], this.colors = [], this.faces = [], this.faceVertexUvs = [
- []
- ], 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
- }
- function gr(e, t, n, r, i, o) {
- vr.call(this), this.type = "BoxGeometry", this.parameters = {
- width: e,
- height: t,
- depth: n,
- widthSegments: r,
- heightSegments: i,
- depthSegments: o
- }, this.fromBufferGeometry(new yr(e, t, n, r, i, o)), this.mergeVertices()
- }
- function yr(e, t, n, r, i, o) {
- pr.call(this), this.type = "BoxBufferGeometry", this.parameters = {
- width: e,
- height: t,
- depth: n,
- widthSegments: r,
- heightSegments: i,
- depthSegments: o
- };
- var a = this;
- e = e || 1, t = t || 1, n = n || 1, r = Math.floor(r) || 1, i = Math.floor(i) || 1, o = Math.floor(o) || 1;
- var s = [],
- c = [],
- l = [],
- u = [],
- h = 0,
- d = 0;
- function p(e, t, n, r, i, o, p, f, m, v, g) {
- var y, b, x = o / m,
- w = p / v,
- _ = o / 2,
- M = p / 2,
- E = f / 2,
- S = m + 1,
- T = v + 1,
- L = 0,
- A = 0,
- C = new Wt;
- for (b = 0; b < T; b++) {
- var P = b * w - M;
- for (y = 0; y < S; y++) {
- var R = y * x - _;
- 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
- }
- }
- for (b = 0; b < v; b++)
- for (y = 0; y < m; y++) {
- var O = h + y + S * b,
- k = h + y + S * (b + 1),
- I = h + (y + 1) + S * (b + 1),
- D = h + (y + 1) + S * b;
- s.push(O, k, D), s.push(k, I, D), A += 6
- }
- a.addGroup(d, A, g), d += A, h += L
- }
- 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))
- }
- function br(e) {
- var t = {};
- for (var n in e)
- for (var r in t[n] = {}, e[n]) {
- var i = e[n][r];
- 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
- }
- return t
- }
- function xr(e) {
- for (var t = {}, n = 0; n < e.length; n++) {
- var r = br(e[n]);
- for (var i in r) t[i] = r[i]
- }
- return t
- }
- vr.prototype = Object.assign(Object.create(r.prototype), {
- constructor: vr,
- isGeometry: !0,
- applyMatrix: function(e) {
- for (var t = (new qt).getNormalMatrix(e), n = 0, r = this.vertices.length; n < r; n++) {
- this.vertices[n].applyMatrix4(e)
- }
- for (n = 0, r = this.faces.length; n < r; n++) {
- var i = this.faces[n];
- i.normal.applyMatrix3(t).normalize();
- for (var o = 0, a = i.vertexNormals.length; o < a; o++) i.vertexNormals[o].applyMatrix3(t).normalize()
- }
- return null !== this.boundingBox && this.computeBoundingBox(), null !== this.boundingSphere && this.computeBoundingSphere(), this.verticesNeedUpdate = !0, this.normalsNeedUpdate = !0, this
- },
- rotateX: function() {
- var e = new un;
- return function(t) {
- return e.makeRotationX(t), this.applyMatrix(e), this
- }
- }(),
- rotateY: function() {
- var e = new un;
- return function(t) {
- return e.makeRotationY(t), this.applyMatrix(e), this
- }
- }(),
- rotateZ: function() {
- var e = new un;
- return function(t) {
- return e.makeRotationZ(t), this.applyMatrix(e), this
- }
- }(),
- translate: function() {
- var e = new un;
- return function(t, n, r) {
- return e.makeTranslation(t, n, r), this.applyMatrix(e), this
- }
- }(),
- scale: function() {
- var e = new un;
- return function(t, n, r) {
- return e.makeScale(t, n, r), this.applyMatrix(e), this
- }
- }(),
- lookAt: function() {
- var e = new In;
- return function(t) {
- e.lookAt(t), e.updateMatrix(), this.applyMatrix(e.matrix)
- }
- }(),
- fromBufferGeometry: function(e) {
- var t = this,
- n = null !== e.index ? e.index.array : void 0,
- r = e.attributes,
- i = r.position.array,
- o = void 0 !== r.normal ? r.normal.array : void 0,
- a = void 0 !== r.color ? r.color.array : void 0,
- s = void 0 !== r.uv ? r.uv.array : void 0,
- c = void 0 !== r.uv2 ? r.uv2.array : void 0;
- void 0 !== c && (this.faceVertexUvs[1] = []);
- 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));
- function u(e, n, r, i) {
- var l = void 0 === a ? [] : [t.colors[e].clone(), t.colors[n].clone(), t.colors[r].clone()],
- 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);
- 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)])
- }
- var h = e.groups;
- if (h.length > 0)
- for (l = 0; l < h.length; l++)
- 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);
- else if (void 0 !== n)
- for (l = 0; l < n.length; l += 3) u(n[l], n[l + 1], n[l + 2]);
- else
- for (l = 0; l < i.length / 3; l += 3) u(l, l + 1, l + 2);
- return this.computeFaceNormals(), null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()), null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()), this
- },
- center: function() {
- var e = new Wt;
- return function() {
- return this.computeBoundingBox(), this.boundingBox.getCenter(e).negate(), this.translate(e.x, e.y, e.z), this
- }
- }(),
- normalize: function() {
- this.computeBoundingSphere();
- var e = this.boundingSphere.center,
- t = this.boundingSphere.radius,
- n = 0 === t ? 1 : 1 / t,
- r = new un;
- 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
- },
- computeFaceNormals: function() {
- for (var e = new Wt, t = new Wt, n = 0, r = this.faces.length; n < r; n++) {
- var i = this.faces[n],
- o = this.vertices[i.a],
- a = this.vertices[i.b],
- s = this.vertices[i.c];
- e.subVectors(s, a), t.subVectors(o, a), e.cross(t), e.normalize(), i.normal.copy(e)
- }
- },
- computeVertexNormals: function(e) {
- var t, n, r, i, o, a;
- 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;
- if (e) {
- var s, c, l, u = new Wt,
- h = new Wt;
- 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)
- } else
- 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);
- for (t = 0, n = this.vertices.length; t < n; t++) a[t].normalize();
- for (r = 0, i = this.faces.length; r < i; r++) {
- var d = (o = this.faces[r]).vertexNormals;
- 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())
- }
- this.faces.length > 0 && (this.normalsNeedUpdate = !0)
- },
- computeFlatVertexNormals: function() {
- var e, t, n;
- for (this.computeFaceNormals(), e = 0, t = this.faces.length; e < t; e++) {
- var r = (n = this.faces[e]).vertexNormals;
- 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())
- }
- this.faces.length > 0 && (this.normalsNeedUpdate = !0)
- },
- computeMorphNormals: function() {
- var e, t, n, r, i;
- for (n = 0, r = this.faces.length; n < r; n++)
- 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();
- var o = new vr;
- for (o.faces = this.faces, e = 0, t = this.morphTargets.length; e < t; e++) {
- if (!this.morphNormals[e]) {
- this.morphNormals[e] = {}, this.morphNormals[e].faceNormals = [], this.morphNormals[e].vertexNormals = [];
- var a = this.morphNormals[e].faceNormals,
- s = this.morphNormals[e].vertexNormals;
- for (n = 0, r = this.faces.length; n < r; n++) c = new Wt, l = {
- a: new Wt,
- b: new Wt,
- c: new Wt
- }, a.push(c), s.push(l)
- }
- var c, l, u = this.morphNormals[e];
- 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])
- }
- for (n = 0, r = this.faces.length; n < r; n++)(i = this.faces[n]).normal = i.__originalFaceNormal, i.vertexNormals = i.__originalVertexNormals
- },
- computeBoundingBox: function() {
- null === this.boundingBox && (this.boundingBox = new jn), this.boundingBox.setFromPoints(this.vertices)
- },
- computeBoundingSphere: function() {
- null === this.boundingSphere && (this.boundingSphere = new Nn), this.boundingSphere.setFromPoints(this.vertices)
- },
- merge: function(e, t, n) {
- if (e && e.isGeometry) {
- var r, i = this.vertices.length,
- o = this.vertices,
- a = e.vertices,
- s = this.faces,
- c = e.faces,
- l = this.faceVertexUvs[0],
- u = e.faceVertexUvs[0],
- h = this.colors,
- d = e.colors;
- void 0 === n && (n = 0), void 0 !== t && (r = (new qt).getNormalMatrix(t));
- for (var p = 0, f = a.length; p < f; p++) {
- var m = a[p].clone();
- void 0 !== t && m.applyMatrix4(t), o.push(m)
- }
- for (p = 0, f = d.length; p < f; p++) h.push(d[p].clone());
- for (p = 0, f = c.length; p < f; p++) {
- var v, g, y, b = c[p],
- x = b.vertexNormals,
- w = b.vertexColors;
- (v = new Yn(b.a + i, b.b + i, b.c + i)).normal.copy(b.normal), void 0 !== r && v.normal.applyMatrix3(r).normalize();
- for (var _ = 0, M = x.length; _ < M; _++) g = x[_].clone(), void 0 !== r && g.applyMatrix3(r).normalize(), v.vertexNormals.push(g);
- v.color.copy(b.color);
- for (_ = 0, M = w.length; _ < M; _++) y = w[_], v.vertexColors.push(y.clone());
- v.materialIndex = b.materialIndex + n, s.push(v)
- }
- for (p = 0, f = u.length; p < f; p++) {
- var E = u[p],
- S = [];
- if (void 0 !== E) {
- for (_ = 0, M = E.length; _ < M; _++) S.push(E[_].clone());
- l.push(S)
- }
- }
- } else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
- },
- mergeMesh: function(e) {
- 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)
- },
- mergeVertices: function() {
- var e, t, n, r, i, o, a, s, c = {},
- l = [],
- u = [],
- h = Math.pow(10, 4);
- 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]];
- var d = [];
- for (n = 0, r = this.faces.length; n < r; n++) {
- (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];
- for (var p = 0; p < 3; p++)
- if (o[p] === o[(p + 1) % 3]) {
- d.push(n);
- break
- }
- }
- for (n = d.length - 1; n >= 0; n--) {
- var f = d[n];
- for (this.faces.splice(f, 1), a = 0, s = this.faceVertexUvs.length; a < s; a++) this.faceVertexUvs[a].splice(f, 1)
- }
- var m = this.vertices.length - l.length;
- return this.vertices = l, m
- },
- setFromPoints: function(e) {
- this.vertices = [];
- for (var t = 0, n = e.length; t < n; t++) {
- var r = e[t];
- this.vertices.push(new Wt(r.x, r.y, r.z || 0))
- }
- return this
- },
- sortFacesByMaterialIndex: function() {
- for (var e = this.faces, t = e.length, n = 0; n < t; n++) e[n]._id = n;
- e.sort(function(e, t) {
- return e.materialIndex - t.materialIndex
- });
- var r, i, o = this.faceVertexUvs[0],
- a = this.faceVertexUvs[1];
- o && o.length === t && (r = []), a && a.length === t && (i = []);
- for (n = 0; n < t; n++) {
- var s = e[n]._id;
- r && r.push(o[s]), i && i.push(a[s])
- }
- r && (this.faceVertexUvs[0] = r), i && (this.faceVertexUvs[1] = i)
- },
- toJSON: function() {
- var e = {
- metadata: {
- version: 4.5,
- type: "Geometry",
- generator: "Geometry.toJSON"
- }
- };
- if (e.uuid = this.uuid, e.type = this.type, "" !== this.name && (e.name = this.name), void 0 !== this.parameters) {
- var t = this.parameters;
- for (var n in t) void 0 !== t[n] && (e[n] = t[n]);
- return e
- }
- for (var r = [], i = 0; i < this.vertices.length; i++) {
- var o = this.vertices[i];
- r.push(o.x, o.y, o.z)
- }
- var a = [],
- s = [],
- c = {},
- l = [],
- u = {},
- h = [],
- d = {};
- for (i = 0; i < this.faces.length; i++) {
- var p = this.faces[i],
- f = void 0 !== this.faceVertexUvs[0][i],
- m = p.normal.length() > 0,
- v = p.vertexNormals.length > 0,
- g = 1 !== p.color.r || 1 !== p.color.g || 1 !== p.color.b,
- y = p.vertexColors.length > 0,
- b = 0;
- 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) {
- var x = this.faceVertexUvs[0][i];
- a.push(T(x[0]), T(x[1]), T(x[2]))
- }
- if (m && a.push(E(p.normal)), v) {
- var w = p.vertexNormals;
- a.push(E(w[0]), E(w[1]), E(w[2]))
- }
- if (g && a.push(S(p.color)), y) {
- var _ = p.vertexColors;
- a.push(S(_[0]), S(_[1]), S(_[2]))
- }
- }
- function M(e, t, n) {
- return n ? e | 1 << t : e & ~(1 << t)
- }
- function E(e) {
- var t = e.x.toString() + e.y.toString() + e.z.toString();
- 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