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B,OAAO,QAAS1vD,EAASqc,EAAS,CAEjC,OAAO8yC,GAASnvD,EAASqc,CAAO,CAEjC,CAWA,OAAO,MAAOrc,EAASqc,EAAS,CAE/B,OAAOgzC,GAAOrvD,EAASqc,CAAO,CAE/B,CAQA,OAAO,KAAMrc,EAAU,CAEtB,OAAOsvD,GAAMtvD,CAAQ,CAEtB,CAWA,OAAO,cAAeH,EAAOC,EAAQpB,EAAQtS,EAAO,CAEnD,OAAOmjE,GAAe1vD,EAAOC,EAAQpB,EAAQtS,CAAK,CAEnD,CAED,EAEK,OAAO,mBAAuB,KAElC,mBAAmB,cAAe,IAAI,YAAa,WAAY,CAAE,OAAQ,CACxE,SAAU,KACX,CAAE,CAAE,CAAE,EAIF,OAAO,OAAW,MAEjB,OAAO,UAEXe,EAAM,yDAA0D,EAIhE,OAAO,UAAY","names":["REVISION","MOUSE","TOUCH","CullFaceNone","CullFaceBack","CullFaceFront","CullFaceFrontBack","BasicShadowMap","PCFShadowMap","PCFSoftShadowMap","VSMShadowMap","FrontSide","BackSide","DoubleSide","NoBlending","NormalBlending","AdditiveBlending","SubtractiveBlending","MultiplyBlending","CustomBlending","AddEquation","SubtractEquation","ReverseSubtractEquation","MinEquation","MaxEquation","ZeroFactor","OneFactor","SrcColorFactor","OneMinusSrcColorFactor","SrcAlphaFactor","OneMinusSrcAlphaFactor","DstAlphaFactor","OneMinusDstAlphaFactor","DstColorFactor","OneMinusDstColorFactor","SrcAlphaSaturateFactor","ConstantColorFactor","OneMinusConstantColorFactor","ConstantAlphaFactor","OneMinusConstantAlphaFactor","NeverDepth","AlwaysDepth","LessDepth","LessEqualDepth","EqualDepth","GreaterEqualDepth","GreaterDepth","NotEqualDepth","MultiplyOperation","MixOperation","AddOperation","NoToneMapping","LinearToneMapping","ReinhardToneMapping","CineonToneMapping","ACESFilmicToneMapping","CustomToneMapping","AgXToneMapping","NeutralToneMapping","AttachedBindMode","DetachedBindMode","UVMapping","CubeReflectionMapping","CubeRefractionMapping","EquirectangularReflectionMapping","EquirectangularRefractionMapping","CubeUVReflectionMapping","RepeatWrapping","ClampToEdgeWrapping","MirroredRepeatWrapping","NearestFilter","NearestMipmapNearestFilter","NearestMipMapNearestFilter","NearestMipmapLinearFilter","NearestMipMapLinearFilter","LinearFilter","LinearMipmapNearestFilter","LinearMipMapNearestFilter","LinearMipmapLinearFilter","LinearMipMapLinearFilter","UnsignedByteType","ByteType","ShortType","UnsignedShortType","IntType","UnsignedIntType","FloatType","HalfFloatType","UnsignedShort4444Type","UnsignedShort5551Type","UnsignedInt248Type","UnsignedInt5999Type","UnsignedInt101111Type","AlphaFormat","RGBFormat","RGBAFormat","DepthFormat","DepthStencilFormat","RedFormat","RedIntegerFormat","RGFormat","RGIntegerFormat","RGBIntegerFormat","RGBAIntegerFormat","RGB_S3TC_DXT1_Format","RGBA_S3TC_DXT1_Format","RGBA_S3TC_DXT3_Format","RGBA_S3TC_DXT5_Format","RGB_PVRTC_4BPPV1_Format","RGB_PVRTC_2BPPV1_Format","RGBA_PVRTC_4BPPV1_Format","RGBA_PVRTC_2BPPV1_Format","RGB_ETC1_Format","RGB_ETC2_Format","RGBA_ETC2_EAC_Format","R11_EAC_Format","SIGNED_R11_EAC_Format","RG11_EAC_Format","SIGNED_RG11_EAC_Format","RGBA_ASTC_4x4_Format","RGBA_ASTC_5x4_Format","RGBA_ASTC_5x5_Format","RGBA_ASTC_6x5_Format","RGBA_ASTC_6x6_Format","RGBA_ASTC_8x5_Format","RGBA_ASTC_8x6_Format","RGBA_ASTC_8x8_Format","RGBA_ASTC_10x5_Format","RGBA_ASTC_10x6_Format","RGBA_ASTC_10x8_Format","RGBA_ASTC_10x10_Format","RGBA_ASTC_12x10_Format","RGBA_ASTC_12x12_Format","RGBA_BPTC_Format","RGB_BPTC_SIGNED_Format","RGB_BPTC_UNSIGNED_Format","RED_RGTC1_Format","SIGNED_RED_RGTC1_Format","RED_GREEN_RGTC2_Format","SIGNED_RED_GREEN_RGTC2_Format","LoopOnce","LoopRepeat","LoopPingPong","InterpolateDiscrete","InterpolateLinear","InterpolateSmooth","ZeroCurvatureEnding","ZeroSlopeEnding","WrapAroundEnding","NormalAnimationBlendMode","AdditiveAnimationBlendMode","TrianglesDrawMode","TriangleStripDrawMode","TriangleFanDrawMode","BasicDepthPacking","RGBADepthPacking","RGBDepthPacking","RGDepthPacking","TangentSpaceNormalMap","ObjectSpaceNormalMap","NoColorSpace","SRGBColorSpace","LinearSRGBColorSpace","LinearTransfer","SRGBTransfer","NoNormalPacking","NormalRGPacking","NormalGAPacking","ZeroStencilOp","KeepStencilOp","ReplaceStencilOp","IncrementStencilOp","DecrementStencilOp","IncrementWrapStencilOp","DecrementWrapStencilOp","InvertStencilOp","NeverStencilFunc","LessStencilFunc","EqualStencilFunc","LessEqualStencilFunc","GreaterStencilFunc","NotEqualStencilFunc","GreaterEqualStencilFunc","AlwaysStencilFunc","NeverCompare","LessCompare","EqualCompare","LessEqualCompare","GreaterCompare","NotEqualCompare","GreaterEqualCompare","AlwaysCompare","StaticDrawUsage","DynamicDrawUsage","StreamDrawUsage","StaticReadUsage","DynamicReadUsage","StreamReadUsage","StaticCopyUsage","DynamicCopyUsage","StreamCopyUsage","GLSL1","GLSL3","WebGLCoordinateSystem","WebGPUCoordinateSystem","TimestampQuery","InterpolationSamplingType","InterpolationSamplingMode","arrayNeedsUint32","array","i","TYPED_ARRAYS","getTypedArray","type","buffer","isTypedArray","createElementNS","name","createCanvasElement","canvas","_cache","_setConsoleFunction","setConsoleFunction","fn","getConsoleFunction","log","params","message","warn","error","warnOnce","probeAsync","gl","sync","interval","resolve","reject","probe","EventDispatcher","listener","listeners","listenerArray","index","event","l","_lut","_seed","DEG2RAD","RAD2DEG","generateUUID","d0","d1","d2","d3","clamp","value","min","max","euclideanModulo","n","m","mapLinear","x","a1","a2","b1","b2","inverseLerp","y","lerp","t","damp","lambda","dt","pingpong","length","smoothstep","smootherstep","randInt","low","high","randFloat","randFloatSpread","range","seededRandom","s","degToRad","degrees","radToDeg","radians","isPowerOfTwo","ceilPowerOfTwo","floorPowerOfTwo","setQuaternionFromProperEuler","q","a","b","c","order","cos","sin","c2","s2","c13","s13","c1_3","s1_3","c3_1","s3_1","denormalize","normalize","MathUtils","Vector2","_Vector2","scalar","v","e","minVal","maxVal","denominator","theta","dx","dy","alpha","v1","v2","offset","attribute","center","angle","Quaternion","z","w","dst","dstOffset","src0","srcOffset0","src1","srcOffset1","x0","y0","z0","w0","x1","y1","z1","w1","dot","f","quaternion","euler","update","c1","c3","s1","s3","axis","halfAngle","te","m11","m12","m13","m21","m22","m23","m31","m32","m33","trace","vFrom","vTo","r","step","qax","qay","qaz","qaw","qbx","qby","qbz","qbw","qb","qa","theta1","theta2","r1","r2","callback","Vector3","_Vector3","_quaternion$4","vx","vy","vz","qx","qy","qz","qw","tx","ty","tz","camera","ax","ay","az","bx","by","bz","planeNormal","_vector$c","normal","dz","radius","phi","sinPhiRadius","sx","sy","sz","u","Matrix3","_Matrix3","n11","n12","n13","n21","n22","n23","n31","n32","n33","me","xAxis","yAxis","zAxis","ae","be","a11","a12","a13","a21","a22","a23","a31","a32","a33","b11","b12","b13","b21","b22","b23","b31","b32","b33","d","g","h","t11","t12","t13","det","detInv","tmp","matrix4","rotation","cx","cy","_m3","matrix","LINEAR_REC709_TO_XYZ","XYZ_TO_LINEAR_REC709","createColorManagement","ColorManagement","color","sourceColorSpace","targetColorSpace","SRGBToLinear","LinearToSRGB","colorSpace","target","colorSpaces","targetMatrix","REC709_PRIMARIES","REC709_LUMINANCE_COEFFICIENTS","D65","_canvas","ImageUtils","image","context","imageData","data","_sourceId","Source","meta","isRootObject","output","url","serializeImage","_textureId","_tempVec3","Texture","_Texture","mapping","wrapS","wrapT","magFilter","minFilter","format","anisotropy","start","count","source","values","key","newValue","currentValue","uv","Vector4","_Vector4","xx","yy","zz","xy","xz","yz","RenderTarget","width","height","options","texture","current","depth","il","WebGLRenderTarget","DataArrayTexture","layerIndex","WebGLArrayRenderTarget","Data3DTexture","WebGL3DRenderTarget","Box3","_vector$b","points","size","halfSize","object","precise","box","point","vector","geometry","positionAttribute","_box$4","children","sphere","plane","triangle","_center","_extents","_v0$2","_v1$7","_v2$4","_f0","_f1","_f2","axes","satForAxes","_triangleNormal","_points","json","_testAxis","v0","extents","j","p0","p1","p2","_box$3","_v1$6","_v2$3","Sphere","optionalCenter","maxRadiusSq","radiusSum","deltaLengthSq","lengthSq","delta","_vector$a","_segCenter","_segDir","_diff","_edge1","_edge2","_normal$1","Ray","origin","direction","ray","directionDistance","optionalPointOnRay","optionalPointOnSegment","segExtent","a01","b0","s0","sqrDist","extDet","invDet","tca","radius2","thc","t0","t1","distToPoint","tmin","tmax","tymin","tymax","tzmin","tzmax","invdirx","invdiry","invdirz","backfaceCulling","DdN","sign","DdQxE2","DdE1xQ","QdN","Matrix4","_Matrix4","n14","n24","n34","n41","n42","n43","n44","scaleX","_v1$5","scaleY","scaleZ","af","bf","ce","cf","de","df","ac","ad","bc","bd","_zero","_one","eye","up","_z","_x","_y","a14","a24","a34","a41","a42","a43","a44","b14","b24","b34","b41","b42","b43","b44","t21","t22","t23","t14","scaleXSq","scaleYSq","scaleZSq","yx","zx","zy","position","scale","x2","y2","z2","wx","wy","wz","_m1$2","invSX","invSY","invSZ","left","right","top","bottom","near","far","coordinateSystem","reversedDepth","_matrix$2","_quaternion$3","Euler","_Euler","newOrder","Layers","layer","layers","_object3DId","_v1$4","_q1","_m1$1","_target","_position$3","_scale$2","_quaternion$2","_xAxis","_yAxis","_zAxis","_addedEvent","_removedEvent","_childaddedEvent","_childremovedEvent","Object3D","_Object3D","onRotationChange","onQuaternionChange","distance","parent","id","result","force","updateParents","updateChildren","info","serialize","library","element","parameters","shapes","shape","uuids","animation","geometries","extractFromCache","materials","textures","images","skeletons","animations","nodes","cache","recursive","child","_v0$1","_v1$3","_v2$2","_v3$2","_vab","_vac","_vbc","_vap","_vbp","_vcp","_v40","_v41","_v42","Triangle","_Triangle","targetLengthSq","dot00","dot01","dot02","dot11","dot12","denom","invDenom","p3","v3","attr","i1","i2","i3","barycoord","i0","p","d4","vc","d5","d6","vb","va","_colorKeywords","_hslA","_hslB","hue2rgb","Color","hex","style","handleAlpha","string","components","_color","hue","saturation","lightness","color1","color2","_materialId","Material","srcPlanes","dstPlanes","MeshBasicMaterial","_tables","_generateTables","floatView","uint32View","baseTable","shiftTable","mantissaTable","exponentTable","offsetTable","toHalfFloat","val","fromHalfFloat","DataUtils","_vector$9","_vector2$1","_id$2","BufferAttribute","itemSize","normalized","index1","index2","component","Int8BufferAttribute","Uint8BufferAttribute","Uint8ClampedBufferAttribute","Int16BufferAttribute","Uint16BufferAttribute","Int32BufferAttribute","Uint32BufferAttribute","Float16BufferAttribute","Float32BufferAttribute","_id$1","_m1","_obj","_offset","_box$2","_boxMorphTargets","_vector$8","BufferGeometry","_BufferGeometry","indirect","indirectOffset","materialIndex","normalMatrix","tangent","morphAttributesPosition","morphAttribute","morphTargetsRelative","jl","attributes","normalAttribute","uvAttribute","tangentAttribute","tan1","tan2","vA","vB","vC","uvA","uvB","uvC","sdir","tdir","handleTriangle","groups","group","tmp2","n2","handleVertex","pA","pB","pC","nA","nB","nC","cb","ab","normals","convertBufferAttribute","indices","array2","geometry2","newAttribute","morphAttributes","morphArray","hasMorphAttributes","attributeArray","boundingSphere","boundingBox","_inverseMatrix$3","_ray$3","_sphere$6","_sphereHitAt","_vA$1","_vB$1","_vC$1","_tempA","_morphA","_intersectionPoint","_intersectionPointWorld","Mesh","material","keys","ml","morphPosition","morphInfluences","influence","raycaster","intersects","matrixWorld","rayLocalSpace","intersection","uv1","drawRange","groupMaterial","end","checkGeometryIntersection","checkIntersection$1","intersect","face","BoxGeometry","_BoxGeometry","widthSegments","heightSegments","depthSegments","scope","vertices","uvs","numberOfVertices","groupStart","buildPlane","udir","vdir","gridX","gridY","segmentWidth","segmentHeight","widthHalf","heightHalf","depthHalf","gridX1","gridY1","vertexCounter","groupCount","iy","ix","cloneUniforms","src","property","mergeUniforms","uniforms","merged","cloneUniformsGroups","getUnlitUniformColorSpace","renderer","currentRenderTarget","UniformsUtils","default_vertex","default_fragment","ShaderMaterial","extensions","Camera","_v3$1","_minTarget","_maxTarget","PerspectiveCamera","fov","aspect","focalLength","vExtentSlope","minTarget","maxTarget","fullWidth","fullHeight","view","skew","CubeCamera","renderTarget","cameraPX","cameraNX","cameraPY","cameraNY","cameraPZ","cameraNZ","cameras","scene","activeMipmapLevel","currentActiveCubeFace","currentActiveMipmapLevel","currentXrEnabled","generateMipmaps","CubeTexture","WebGLCubeRenderTarget","shader","mesh","currentMinFilter","stencil","Group","_moveEvent","WebXRController","inputSource","hand","inputjoint","frame","referenceSpace","inputPose","gripPose","handPose","targetRay","grip","jointPose","joint","indexTip","thumbTip","distanceToPinch","threshold","FogExp2","_FogExp2","density","Fog","_Fog","Scene","InterleavedBuffer","stride","interleavedBuffer","ib","_vector$7","InterleavedBufferAttribute","_InterleavedBufferAttribute","SpriteMaterial","_geometry","_intersectPoint","_worldScale","_mvPosition","_alignedPosition","_rotatedPosition","_viewWorldMatrix","_vA","_vB","_vC","_uvA","_uvB","_uvC","Sprite","float32Array","transformVertex","vertexPosition","mvPosition","_v1$2","_v2$1","LOD","levels","level","hysteresis","removedElements","levelDistance","_basePosition","_skinIndex","_skinWeight","_vector3","_matrix4","_vertex","_sphere$5","_inverseMatrix$2","_ray$2","SkinnedMesh","skeleton","bindMatrix","skinWeight","weight","boneIndex","Bone","DataTexture","_offsetMatrix","_identityMatrix","Skeleton","_Skeleton","bones","boneInverses","inverse","bone","boneMatrices","boneTexture","uuid","boneInverse","InstancedBufferAttribute","meshPerAttribute","_instanceLocalMatrix","_instanceWorldMatrix","_instanceIntersects","_box3","_identity","_mesh$1","_sphere$4","InstancedMesh","objectInfluences","len","dataIndex","raycastTimes","instanceId","morphInfluencesSum","morphBaseInfluence","_vector1","_vector2","_normalMatrix","Plane","constant","inverseNormalLength","line","startSign","endSign","optionalNormalMatrix","referencePoint","_sphere$3","_defaultSpriteCenter","_vector$6","Frustum","p4","p5","planes","frustum","me0","me1","me2","me3","me4","me5","me6","me7","me8","me9","me10","me11","me12","me13","me14","me15","sprite","negRadius","_projScreenMatrix$1","_frustum$1","FrustumArray","_FrustumArray","cameraArray","ascIdSort","sortOpaque","sortTransparent","MultiDrawRenderList","pool","list","item","_matrix$1","_whiteColor","_frustum","_frustumArray","_box$1","_sphere$2","_vector$5","_forward$1","_temp","_renderList","_mesh","_batchIntersects","copyAttributeData","targetOffset","vertexCount","copyArrayContents","BatchedMesh","maxInstanceCount","maxVertexCount","maxIndexCount","matricesArray","matricesTexture","indirectArray","indirectTexture","colorsArray","colorsTexture","reference","attributeName","srcAttribute","dstArray","dstAttribute","indexArray","batchGeometry","instanceInfo","geometryId","geometryInfoList","func","drawId","reservedVertexCount","reservedIndexCount","geometryInfo","hasIndex","dstIndex","srcIndex","vertexStart","indexStart","nextVertexStart","nextIndexStart","elementDelta","iv","visible","availableInstanceIds","multiDrawCounts","multiDrawStarts","validRanges","oldGeometry","bytesPerElement","perObjectFrustumCulled","multiDrawCount","culled","customSort","shadowCamera","depthMaterial","LineBasicMaterial","_vStart","_vEnd","_inverseMatrix$1","_ray$1","_sphere$1","_intersectPointOnRay","_intersectPointOnSegment","Line","lineDistances","localThreshold","localThresholdSq","checkIntersection","thresholdSq","_start","_end","LineSegments","LineLoop","PointsMaterial","_inverseMatrix","_ray","_sphere","_position$2","Points","testPoint","rayPointDistanceSq","intersectPoint","VideoTexture","video","updateVideo","VideoFrameTexture","FramebufferTexture","CompressedTexture","mipmaps","CompressedArrayTexture","CompressedCubeTexture","CanvasTexture","DepthTexture","CubeDepthTexture","ExternalTexture","sourceTexture","CapsuleGeometry","_CapsuleGeometry","capSegments","radialSegments","halfHeight","capArcLength","cylinderPartLength","totalArcLength","numVerticalSegments","verticesPerRow","vertex","currentArcLength","profileY","profileRadius","normalYComponent","segmentProgress","uOffset","sinTheta","cosTheta","prevIndexRow","i4","CircleGeometry","_CircleGeometry","segments","thetaStart","thetaLength","segment","CylinderGeometry","_CylinderGeometry","radiusTop","radiusBottom","openEnded","generateTorso","generateCap","slope","indexRow","centerIndexStart","centerIndexEnd","ConeGeometry","_ConeGeometry","PolyhedronGeometry","_PolyhedronGeometry","detail","vertexBuffer","uvBuffer","subdivide","applyRadius","generateUVs","getVertexByIndex","subdivideFace","cols","aj","bj","rows","k","pushVertex","azimuth","inclination","correctUVs","correctSeam","centroid","azi","correctUV","DodecahedronGeometry","_DodecahedronGeometry","_v0","_v1$1","_normal","_triangle","EdgesGeometry","thresholdAngle","precision","thresholdDot","indexAttr","positionAttr","indexCount","indexArr","vertKeys","hashes","edgeData","jNext","vecHash0","vecHash1","hash","reverseHash","index0","Curve","optionalTarget","divisions","lengths","last","sum","arcLengths","targetArcLength","comparison","lengthBefore","segmentLength","segmentFraction","t2","pt1","pt2","closed","tangents","binormals","vec","mat","EllipseCurve","aX","aY","xRadius","yRadius","aStartAngle","aEndAngle","aClockwise","aRotation","twoPi","deltaAngle","samePoints","ArcCurve","aRadius","CubicPoly","c0","init","x3","tension","dt0","dt1","dt2","t3","px","py","pz","CatmullRomCurve3","curveType","intPoint","pow","CatmullRom","QuadraticBezierP0","QuadraticBezierP1","QuadraticBezierP2","QuadraticBezier","CubicBezierP0","CubicBezierP1","CubicBezierP2","CubicBezierP3","CubicBezier","CubicBezierCurve","CubicBezierCurve3","LineCurve","LineCurve3","QuadraticBezierCurve","QuadraticBezierCurve3","SplineCurve","Curves","CurvePath","curve","startPoint","endPoint","lineType","curveLengths","diff","lens","sums","curves","resolution","pts","Path","aCPx","aCPy","aCP1x","aCP1y","aCP2x","aCP2y","npts","firstPoint","lastPoint","Shape","holesPts","hole","earcut","holeIndices","dim","hasHoles","outerLen","outerNode","linkedList","triangles","minX","minY","invSize","eliminateHoles","maxX","maxY","earcutLinked","clockwise","signedArea","insertNode","equals","removeNode","filterPoints","again","area","ear","pass","indexCurve","stop","prev","next","isEarHashed","isEar","cureLocalIntersections","splitEarcut","pointInTriangleExceptFirst","minZ","zOrder","maxZ","locallyInside","isValidDiagonal","splitPolygon","queue","getLeftmost","compareXYSlope","eliminateHole","aSlope","bSlope","bridge","findHoleBridge","bridgeReverse","hx","hy","mx","my","tanMin","pointInTriangle","tan","sectorContainsSector","sortLinked","numMerges","inSize","tail","pSize","qSize","leftmost","intersectsPolygon","middleInside","q1","q2","o1","o2","o3","o4","onSegment","num","inside","createNode","an","bp","Earcut","ShapeUtils","_ShapeUtils","contour","holes","faces","removeDupEndPts","addContour","holeIndex","ExtrudeGeometry","_ExtrudeGeometry","verticesArray","uvArray","addShape","placeholder","curveSegments","steps","bevelEnabled","bevelThickness","bevelSize","bevelOffset","bevelSegments","extrudePath","uvgen","WorldUVGenerator","extrudePts","extrudeByPath","splineTube","binormal","position2","isClosed","shapePoints","hl","ahole","mergeOverlappingPoints","THRESHOLD_SQ","prevPos","currentIndex","currentPos","distSq","scalingFactorSqrt","thresholdSqScaled","numHoles","scalePt2","pt","vlen","getBevelVec","inPt","inPrev","inNext","v_trans_x","v_trans_y","shrink_by","v_prev_x","v_prev_y","v_next_x","v_next_y","v_prev_lensq","collinear0","v_prev_len","v_next_len","ptPrevShift_x","ptPrevShift_y","ptNextShift_x","ptNextShift_y","sf","v_trans_lensq","direction_eq","contourMovements","holesMovements","oneHoleMovements","verticesMovements","contractedContourVertices","expandedHoleVertices","bs","vert","oneHoleVertices","flen","buildLidFaces","buildSideFaces","f3","layeroffset","sidewalls","sl","slen1","slen2","f4","addVertex","nextIndex","addUV","vector2","toJSON$1","geometryShapes","indexA","indexB","indexC","a_x","a_y","b_x","b_y","c_x","c_y","indexD","a_z","b_z","c_z","d_x","d_y","d_z","IcosahedronGeometry","_IcosahedronGeometry","LatheGeometry","_LatheGeometry","phiStart","phiLength","initNormals","inverseSegments","curNormal","prevNormal","base","OctahedronGeometry","_OctahedronGeometry","PlaneGeometry","_PlaneGeometry","width_half","height_half","segment_width","segment_height","RingGeometry","_RingGeometry","innerRadius","outerRadius","thetaSegments","phiSegments","radiusStep","thetaSegmentLevel","ShapeGeometry","_ShapeGeometry","indexOffset","shapeVertices","shapeHoles","shapeHole","toJSON","SphereGeometry","_SphereGeometry","thetaEnd","grid","verticesRow","TetrahedronGeometry","_TetrahedronGeometry","TorusGeometry","_TorusGeometry","tube","tubularSegments","arc","TorusKnotGeometry","_TorusKnotGeometry","P1","P2","B","T","N","calculatePositionOnCurve","cu","su","quOverP","cs","TubeGeometry","_TubeGeometry","path","frames","P","generateBufferData","generateSegment","generateIndices","WireframeGeometry","edges","o","ol","isUniqueEdge","hash1","hash2","Geometries","ShadowMaterial","RawShaderMaterial","MeshStandardMaterial","MeshPhysicalMaterial","reflectivity","MeshPhongMaterial","MeshToonMaterial","MeshNormalMaterial","MeshLambertMaterial","MeshDepthMaterial","MeshDistanceMaterial","MeshMatcapMaterial","LineDashedMaterial","convertArray","getKeyframeOrder","times","compareTime","sortedArray","nValues","srcOffset","flattenJSON","jsonKeys","valuePropertyName","subclip","sourceClip","startFrame","endFrame","fps","clip","tracks","track","valueSize","minStartTime","makeClipAdditive","targetClip","referenceFrame","referenceClip","numTracks","referenceTime","referenceTrack","referenceTrackType","targetTrack","referenceOffset","referenceValueSize","targetValueSize","lastIndex","referenceValue","startIndex","endIndex","interpolant","numTimes","valueStart","valueEnd","AnimationUtils","Interpolant","parameterPositions","sampleValues","sampleSize","resultBuffer","pp","validate_interval","seek","linear_scan","forward_scan","giveUpAt","t1global","mid","CubicInterpolant","iPrev","iNext","tPrev","tNext","halfDt","o0","oP","oN","wP","wN","ppp","sP","sN","LinearInterpolant","offset1","offset0","weight1","weight0","DiscreteInterpolant","KeyframeTrack","interpolation","trackType","factoryMethod","timeOffset","timeScale","startTime","endTime","nKeys","from","to","valid","prevTime","currTime","smoothInterpolation","writeIndex","keep","time","timeNext","offsetP","offsetN","readOffset","writeOffset","TypedKeyframeTrack","BooleanKeyframeTrack","ColorKeyframeTrack","NumberKeyframeTrack","QuaternionLinearInterpolant","QuaternionKeyframeTrack","StringKeyframeTrack","VectorKeyframeTrack","AnimationClip","duration","blendMode","jsonTracks","frameTime","parseKeyframeTrack","clipTracks","morphTargetSequence","noLoop","numMorphTargets","objectOrClipArray","clipArray","morphTargets","animationToMorphTargets","pattern","morphTarget","parts","animationMorphTargets","clips","addNonemptyTrack","trackName","animationKeys","propertyName","destTracks","clipName","hierarchyTracks","morphTargetNames","morphTargetName","animationKey","boneName","getTrackTypeForValueTypeName","typeName","Cache","file","LoadingManager","onLoad","onProgress","onError","isLoading","itemsLoaded","itemsTotal","urlModifier","handlers","transform","regex","loader","DefaultLoadingManager","Loader","manager","crossOrigin","resourcePath","requestHeader","loading","HttpError","response","FileLoader","cached","req","mimeType","responseType","callbacks","reader","contentLength","total","lengthComputable","loaded","stream","controller","readData","done","text","exec","label","decoder","err","AnimationLoader","CompressedTextureLoader","loadTexture","texDatas","_loading","ImageLoader","arr","onImageLoad","removeEventListeners","onImageError","CubeTextureLoader","urls","DataTextureLoader","texData","TextureLoader","Light","intensity","HemisphereLight","skyColor","groundColor","_projScreenMatrix","_lightPositionWorld","_lookTarget","LightShadow","light","shadowMatrix","viewportIndex","SpotLightShadow","SpotLight","penumbra","decay","power","PointLightShadow","PointLight","OrthographicCamera","scaleW","scaleH","DirectionalLightShadow","DirectionalLight","AmbientLight","RectAreaLight","SphericalHarmonics3","coefficients","coeff","sh","shBasis","LightProbe","MaterialLoader","_MaterialLoader","getTexture","uniform","normalScale","materialLib","LoaderUtils","InstancedBufferGeometry","BufferGeometryLoader","interleavedBufferMap","arrayBufferMap","getInterleavedBuffer","getArrayBuffer","arrayBuffer","typedArray","bufferAttribute","bufferAttributeConstr","ObjectLoader","metadata","hasImages","bufferGeometryLoader","loadImage","deserializeImage","imageArray","currentUrl","deserializedImage","parseConstant","TEXTURE_MAPPING","TEXTURE_WRAPPING","TEXTURE_FILTER","getGeometry","getMaterial","instanceMatrix","instanceColor","objectAnimations","_errorMap","ImageBitmapLoader","imageBitmap","fetchOptions","promise","res","blob","_context","AudioContext","AudioLoader","bufferCopy","audioBuffer","handleError","_eyeRight","_eyeLeft","_projectionMatrix","StereoCamera","eyeSepHalf","eyeSepOnProjection","ymax","xmin","xmax","ArrayCamera","Clock","autoStart","newTime","_position$1","_quaternion$1","_scale$1","_forward","_up","AudioListener","Audio","audioNode","mediaElement","mediaStream","delay","filter","_position","_quaternion","_scale","_orientation","PositionalAudio","coneInnerAngle","coneOuterAngle","coneOuterGain","panner","AudioAnalyser","audio","fftSize","PropertyMixer","binding","mixFunction","mixFunctionAdditive","setIdentity","accuIndex","currentWeight","mix","weightAdditive","originalValueOffset","targetIndex","workOffset","_RESERVED_CHARS_RE","_reservedRe","_wordChar","_wordCharOrDot","_directoryRe","_nodeRe","_objectRe","_propertyRe","_trackRe","_supportedObjectNames","Composite","targetGroup","optionalParsedPath","parsedPath","PropertyBinding","firstValidIndex","bindings","_PropertyBinding","rootNode","root","matches","results","lastDot","objectName","nodeName","searchNodeSubtree","childNode","subTreeNode","dest","targetArray","sourceArray","targetObject","propertyIndex","objectIndex","nodeProperty","versioning","bindingType","AnimationObjectGroup","objects","indicesByUUID","paths","parsedPaths","nBindings","knownObject","nObjects","nCachedObjects","firstActiveIndex","lastCachedObject","bindingsForPath","lastCached","lastCachedIndex","firstActiveObject","firstActive","lastObject","indicesByPath","lastBindingsIndex","lastBindings","lastBindingsPath","AnimationAction","mixer","localRoot","nTracks","interpolants","interpolantSettings","mode","repetitions","fadeOutAction","warp","fadeInDuration","fadeOutDuration","startEndRatio","endStartRatio","fadeInAction","weightInterpolant","action","startTimeScale","endTimeScale","now","timeScaleInterpolant","deltaTime","timeDirection","timeRunning","clipTime","propertyMixers","interpolantValue","loop","loopCount","pingPong","handle_stop","loopDelta","pending","atStart","atEnd","settings","weightNow","weightThen","_controlInterpolantsResultBuffer","AnimationMixer","prototypeAction","rootUuid","bindingsByRoot","bindingsByName","clipUuid","actionsForClip","actions","actionsByClip","knownActions","lastInactiveAction","cacheIndex","knownActionsForClip","lastKnownAction","byClipCacheIndex","actionByRoot","prevIndex","lastActiveIndex","firstInactiveAction","firstInactiveIndex","lastActiveAction","bindingByName","propBinding","lastInactiveBinding","firstInactiveBinding","lastActiveBinding","lastActiveInterpolant","optionalRoot","clipObject","existingAction","newAction","nActions","actionsToRemove","RenderTarget3D","Uniform","_Uniform","_id","UniformsGroup","uniformsSource","InstancedInterleavedBuffer","GLBufferAttribute","elementSize","_matrix","Raycaster","coords","ascSort","propagate","Timer","document","handleVisibilityChange","timescale","timestamp","Spherical","other","Cylindrical","Matrix2","_Matrix2","_vector$4","Box2","_startP","_startEnd","_d1","_d2","_r","_c1","_c2","Line3","clampToLine","startEnd2","EPSILON","_vector$3","SpotLightHelper","positions","coneLength","coneWidth","_vector$2","_boneMatrix","_matrixWorldInv","SkeletonHelper","getBoneList","colors","colorAttribute","boneList","PointLightHelper","sphereSize","_vector$1","_color1","_color2","HemisphereLightHelper","GridHelper","PolarGridHelper","sectors","rings","_v1","_v2","_v3","DirectionalLightHelper","_vector","_camera","CameraHelper","pointMap","addLine","addPoint","colorFrustum","colorCone","colorUp","colorTarget","colorCross","cone","cross","nearZ","farZ","setPoint","_box","BoxHelper","Box3Helper","PlaneHelper","positions2","_axis","_lineGeometry","_coneGeometry","ArrowHelper","dir","headLength","headWidth","AxesHelper","xAxisColor","yAxisColor","zAxisColor","ShapePath","isCCW","toShapesNoHoles","inSubpaths","tmpPath","tmpShape","isPointInsidePolygon","inPolygon","polyLen","edgeLowPt","edgeHighPt","edgeDx","edgeDy","perpEdge","isClockWise","subPaths","solid","holesFirst","betterShapeHoles","newShapes","newShapeHoles","mainIdx","tmpPoints","ambiguous","toChange","sIdx","sLen","sho","hIdx","ho","hole_unassigned","s2Idx","tmpHoles","Controls","domElement","contain","imageAspect","cover","fill","getByteLength","typeByteLength","getTextureTypeByteLength","TextureUtils"],"sources":["../esm/npm/three@0.182.0/node_modules/three/build/three.core.js"],"sourcesContent":["/**\n * @license\n * Copyright 2010-2025 Three.js Authors\n * SPDX-License-Identifier: MIT\n */\nconst REVISION = '182';\n\n/**\n * Represents mouse buttons and interaction types in context of controls.\n *\n * @type {ConstantsMouse}\n * @constant\n */\nconst MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };\n\n/**\n * Represents touch interaction types in context of controls.\n *\n * @type {ConstantsTouch}\n * @constant\n */\nconst TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };\n\n/**\n * Disables face culling.\n *\n * @type {number}\n * @constant\n */\nconst CullFaceNone = 0;\n\n/**\n * Culls back faces.\n *\n * @type {number}\n * @constant\n */\nconst CullFaceBack = 1;\n\n/**\n * Culls front faces.\n *\n * @type {number}\n * @constant\n */\nconst CullFaceFront = 2;\n\n/**\n * Culls both front and back faces.\n *\n * @type {number}\n * @constant\n */\nconst CullFaceFrontBack = 3;\n\n/**\n * Gives unfiltered shadow maps - fastest, but lowest quality.\n *\n * @type {number}\n * @constant\n */\nconst BasicShadowMap = 0;\n\n/**\n * Filters shadow maps using the Percentage-Closer Filtering (PCF) algorithm.\n *\n * @type {number}\n * @constant\n */\nconst PCFShadowMap = 1;\n\n/**\n * Filters shadow maps using the Percentage-Closer Filtering (PCF) algorithm with\n * better soft shadows especially when using low-resolution shadow maps.\n *\n * @type {number}\n * @constant\n */\nconst PCFSoftShadowMap = 2;\n\n/**\n * Filters shadow maps using the Variance Shadow Map (VSM) algorithm.\n * When using VSMShadowMap all shadow receivers will also cast shadows.\n *\n * @type {number}\n * @constant\n */\nconst VSMShadowMap = 3;\n\n/**\n * Only front faces are rendered.\n *\n * @type {number}\n * @constant\n */\nconst FrontSide = 0;\n\n/**\n * Only back faces are rendered.\n *\n * @type {number}\n * @constant\n */\nconst BackSide = 1;\n\n/**\n * Both front and back faces are rendered.\n *\n * @type {number}\n * @constant\n */\nconst DoubleSide = 2;\n\n/**\n * No blending is performed which effectively disables\n * alpha transparency.\n *\n * @type {number}\n * @constant\n */\nconst NoBlending = 0;\n\n/**\n * The default blending.\n *\n * @type {number}\n * @constant\n */\nconst NormalBlending = 1;\n\n/**\n * Represents additive blending.\n *\n * @type {number}\n * @constant\n */\nconst AdditiveBlending = 2;\n\n/**\n * Represents subtractive blending.\n *\n * @type {number}\n * @constant\n */\nconst SubtractiveBlending = 3;\n\n/**\n * Represents multiply blending.\n *\n * @type {number}\n * @constant\n */\nconst MultiplyBlending = 4;\n\n/**\n * Represents custom blending.\n *\n * @type {number}\n * @constant\n */\nconst CustomBlending = 5;\n\n/**\n * A `source + destination` blending equation.\n *\n * @type {number}\n * @constant\n */\nconst AddEquation = 100;\n\n/**\n * A `source - destination` blending equation.\n *\n * @type {number}\n * @constant\n */\nconst SubtractEquation = 101;\n\n/**\n * A `destination - source` blending equation.\n *\n * @type {number}\n * @constant\n */\nconst ReverseSubtractEquation = 102;\n\n/**\n * A blend equation that uses the minimum of source and destination.\n *\n * @type {number}\n * @constant\n */\nconst MinEquation = 103;\n\n/**\n * A blend equation that uses the maximum of source and destination.\n *\n * @type {number}\n * @constant\n */\nconst MaxEquation = 104;\n\n/**\n * Multiplies all colors by `0`.\n *\n * @type {number}\n * @constant\n */\nconst ZeroFactor = 200;\n\n/**\n * Multiplies all colors by `1`.\n *\n * @type {number}\n * @constant\n */\nconst OneFactor = 201;\n\n/**\n * Multiplies all colors by the source colors.\n *\n * @type {number}\n * @constant\n */\nconst SrcColorFactor = 202;\n\n/**\n * Multiplies all colors by `1` minus each source color.\n *\n * @type {number}\n * @constant\n */\nconst OneMinusSrcColorFactor = 203;\n\n/**\n * Multiplies all colors by the source alpha value.\n *\n * @type {number}\n * @constant\n */\nconst SrcAlphaFactor = 204;\n\n/**\n * Multiplies all colors by 1 minus the source alpha value.\n *\n * @type {number}\n * @constant\n */\nconst OneMinusSrcAlphaFactor = 205;\n\n/**\n * Multiplies all colors by the destination alpha value.\n *\n * @type {number}\n * @constant\n */\nconst DstAlphaFactor = 206;\n\n/**\n * Multiplies all colors by `1` minus the destination alpha value.\n *\n * @type {number}\n * @constant\n */\nconst OneMinusDstAlphaFactor = 207;\n\n/**\n * Multiplies all colors by the destination color.\n *\n * @type {number}\n * @constant\n */\nconst DstColorFactor = 208;\n\n/**\n * Multiplies all colors by `1` minus each destination color.\n *\n * @type {number}\n * @constant\n */\nconst OneMinusDstColorFactor = 209;\n\n/**\n * Multiplies the RGB colors by the smaller of either the source alpha\n * value or the value of `1` minus the destination alpha value. The alpha\n * value is multiplied by `1`.\n *\n * @type {number}\n * @constant\n */\nconst SrcAlphaSaturateFactor = 210;\n\n/**\n * Multiplies all colors by a constant color.\n *\n * @type {number}\n * @constant\n */\nconst ConstantColorFactor = 211;\n\n/**\n * Multiplies all colors by `1` minus a constant color.\n *\n * @type {number}\n * @constant\n */\nconst OneMinusConstantColorFactor = 212;\n\n/**\n * Multiplies all colors by a constant alpha value.\n *\n * @type {number}\n * @constant\n */\nconst ConstantAlphaFactor = 213;\n\n/**\n * Multiplies all colors by 1 minus a constant alpha value.\n *\n * @type {number}\n * @constant\n */\nconst OneMinusConstantAlphaFactor = 214;\n\n/**\n * Never pass.\n *\n * @type {number}\n * @constant\n */\nconst NeverDepth = 0;\n\n/**\n * Always pass.\n *\n * @type {number}\n * @constant\n */\nconst AlwaysDepth = 1;\n\n/**\n * Pass if the incoming value is less than the depth buffer value.\n *\n * @type {number}\n * @constant\n */\nconst LessDepth = 2;\n\n/**\n * Pass if the incoming value is less than or equal to the depth buffer value.\n *\n * @type {number}\n * @constant\n */\nconst LessEqualDepth = 3;\n\n/**\n * Pass if the incoming value equals the depth buffer value.\n *\n * @type {number}\n * @constant\n */\nconst EqualDepth = 4;\n\n/**\n * Pass if the incoming value is greater than or equal to the depth buffer value.\n *\n * @type {number}\n * @constant\n */\nconst GreaterEqualDepth = 5;\n\n/**\n * Pass if the incoming value is greater than the depth buffer value.\n *\n * @type {number}\n * @constant\n */\nconst GreaterDepth = 6;\n\n/**\n * Pass if the incoming value is not equal to the depth buffer value.\n *\n * @type {number}\n * @constant\n */\nconst NotEqualDepth = 7;\n\n/**\n * Multiplies the environment map color with the surface color.\n *\n * @type {number}\n * @constant\n */\nconst MultiplyOperation = 0;\n\n/**\n * Uses reflectivity to blend between the two colors.\n *\n * @type {number}\n * @constant\n */\nconst MixOperation = 1;\n\n/**\n * Adds the two colors.\n *\n * @type {number}\n * @constant\n */\nconst AddOperation = 2;\n\n/**\n * No tone mapping is applied.\n *\n * @type {number}\n * @constant\n */\nconst NoToneMapping = 0;\n\n/**\n * Linear tone mapping.\n *\n * @type {number}\n * @constant\n */\nconst LinearToneMapping = 1;\n\n/**\n * Reinhard tone mapping.\n *\n * @type {number}\n * @constant\n */\nconst ReinhardToneMapping = 2;\n\n/**\n * Cineon tone mapping.\n *\n * @type {number}\n * @constant\n */\nconst CineonToneMapping = 3;\n\n/**\n * ACES Filmic tone mapping.\n *\n * @type {number}\n * @constant\n */\nconst ACESFilmicToneMapping = 4;\n\n/**\n * Custom tone mapping.\n *\n * Expects a custom implementation by modifying shader code of the material's fragment shader.\n *\n * @type {number}\n * @constant\n */\nconst CustomToneMapping = 5;\n\n/**\n * AgX tone mapping.\n *\n * @type {number}\n * @constant\n */\nconst AgXToneMapping = 6;\n\n/**\n * Neutral tone mapping.\n *\n * Implementation based on the Khronos 3D Commerce Group standard tone mapping.\n *\n * @type {number}\n * @constant\n */\nconst NeutralToneMapping = 7;\n\n/**\n * The skinned mesh shares the same world space as the skeleton.\n *\n * @type {string}\n * @constant\n */\nconst AttachedBindMode = 'attached';\n\n/**\n * The skinned mesh does not share the same world space as the skeleton.\n * This is useful when a skeleton is shared across multiple skinned meshes.\n *\n * @type {string}\n * @constant\n */\nconst DetachedBindMode = 'detached';\n\n/**\n * Maps textures using the geometry's UV coordinates.\n *\n * @type {number}\n * @constant\n */\nconst UVMapping = 300;\n\n/**\n * Reflection mapping for cube textures.\n *\n * @type {number}\n * @constant\n */\nconst CubeReflectionMapping = 301;\n\n/**\n * Refraction mapping for cube textures.\n *\n * @type {number}\n * @constant\n */\nconst CubeRefractionMapping = 302;\n\n/**\n * Reflection mapping for equirectangular textures.\n *\n * @type {number}\n * @constant\n */\nconst EquirectangularReflectionMapping = 303;\n\n/**\n * Refraction mapping for equirectangular textures.\n *\n * @type {number}\n * @constant\n */\nconst EquirectangularRefractionMapping = 304;\n\n/**\n * Reflection mapping for PMREM textures.\n *\n * @type {number}\n * @constant\n */\nconst CubeUVReflectionMapping = 306;\n\n/**\n * The texture will simply repeat to infinity.\n *\n * @type {number}\n * @constant\n */\nconst RepeatWrapping = 1000;\n\n/**\n * The last pixel of the texture stretches to the edge of the mesh.\n *\n * @type {number}\n * @constant\n */\nconst ClampToEdgeWrapping = 1001;\n\n/**\n * The texture will repeats to infinity, mirroring on each repeat.\n *\n * @type {number}\n * @constant\n */\nconst MirroredRepeatWrapping = 1002;\n\n/**\n * Returns the value of the texture element that is nearest (in Manhattan distance)\n * to the specified texture coordinates.\n *\n * @type {number}\n * @constant\n */\nconst NearestFilter = 1003;\n\n/**\n * Chooses the mipmap that most closely matches the size of the pixel being textured\n * and uses the `NearestFilter` criterion (the texel nearest to the center of the pixel)\n * to produce a texture value.\n *\n * @type {number}\n * @constant\n */\nconst NearestMipmapNearestFilter = 1004;\nconst NearestMipMapNearestFilter = 1004; // legacy\n\n/**\n * Chooses the two mipmaps that most closely match the size of the pixel being textured and\n * uses the `NearestFilter` criterion to produce a texture value from each mipmap.\n * The final texture value is a weighted average of those two values.\n *\n * @type {number}\n * @constant\n */\nconst NearestMipmapLinearFilter = 1005;\nconst NearestMipMapLinearFilter = 1005; // legacy\n\n/**\n * Returns the weighted average of the four texture elements that are closest to the specified\n * texture coordinates, and can include items wrapped or repeated from other parts of a texture,\n * depending on the values of `wrapS` and `wrapT`, and on the exact mapping.\n *\n * @type {number}\n * @constant\n */\nconst LinearFilter = 1006;\n\n/**\n * Chooses the mipmap that most closely matches the size of the pixel being textured and uses\n * the `LinearFilter` criterion (a weighted average of the four texels that are closest to the\n * center of the pixel) to produce a texture value.\n *\n * @type {number}\n * @constant\n */\nconst LinearMipmapNearestFilter = 1007;\nconst LinearMipMapNearestFilter = 1007; // legacy\n\n/**\n * Chooses the two mipmaps that most closely match the size of the pixel being textured and uses\n * the `LinearFilter` criterion to produce a texture value from each mipmap. The final texture value\n * is a weighted average of those two values.\n *\n * @type {number}\n * @constant\n */\nconst LinearMipmapLinearFilter = 1008;\nconst LinearMipMapLinearFilter = 1008; // legacy\n\n/**\n * An unsigned byte data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst UnsignedByteType = 1009;\n\n/**\n * A byte data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst ByteType = 1010;\n\n/**\n * A short data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst ShortType = 1011;\n\n/**\n * An unsigned short data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst UnsignedShortType = 1012;\n\n/**\n * An int data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst IntType = 1013;\n\n/**\n * An unsigned int data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst UnsignedIntType = 1014;\n\n/**\n * A float data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst FloatType = 1015;\n\n/**\n * A half float data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst HalfFloatType = 1016;\n\n/**\n * An unsigned short 4_4_4_4 (packed) data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst UnsignedShort4444Type = 1017;\n\n/**\n * An unsigned short 5_5_5_1 (packed) data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst UnsignedShort5551Type = 1018;\n\n/**\n * An unsigned int 24_8 data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst UnsignedInt248Type = 1020;\n\n/**\n * An unsigned int 5_9_9_9 (packed) data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst UnsignedInt5999Type = 35902;\n\n/**\n * An unsigned int 10_11_11 (packed) data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst UnsignedInt101111Type = 35899;\n\n/**\n * Discards the red, green and blue components and reads just the alpha component.\n *\n * @type {number}\n * @constant\n */\nconst AlphaFormat = 1021;\n\n/**\n * Discards the alpha component and reads the red, green and blue component.\n *\n * @type {number}\n * @constant\n */\nconst RGBFormat = 1022;\n\n/**\n * Reads the red, green, blue and alpha components.\n *\n * @type {number}\n * @constant\n */\nconst RGBAFormat = 1023;\n\n/**\n * Reads each element as a single depth value, converts it to floating point, and clamps to the range `[0,1]`.\n *\n * @type {number}\n * @constant\n */\nconst DepthFormat = 1026;\n\n/**\n * Reads each element is a pair of depth and stencil values. The depth component of the pair is interpreted as\n * in `DepthFormat`. The stencil component is interpreted based on the depth + stencil internal format.\n *\n * @type {number}\n * @constant\n */\nconst DepthStencilFormat = 1027;\n\n/**\n * Discards the green, blue and alpha components and reads just the red component.\n *\n * @type {number}\n * @constant\n */\nconst RedFormat = 1028;\n\n/**\n * Discards the green, blue and alpha components and reads just the red component. The texels are read as integers instead of floating point.\n *\n * @type {number}\n * @constant\n */\nconst RedIntegerFormat = 1029;\n\n/**\n * Discards the alpha, and blue components and reads the red, and green components.\n *\n * @type {number}\n * @constant\n */\nconst RGFormat = 1030;\n\n/**\n * Discards the alpha, and blue components and reads the red, and green components. The texels are read as integers instead of floating point.\n *\n * @type {number}\n * @constant\n */\nconst RGIntegerFormat = 1031;\n\n/**\n * Discards the alpha component and reads the red, green and blue component. The texels are read as integers instead of floating point.\n *\n * @type {number}\n * @constant\n */\nconst RGBIntegerFormat = 1032;\n\n/**\n * Reads the red, green, blue and alpha components. The texels are read as integers instead of floating point.\n *\n * @type {number}\n * @constant\n */\nconst RGBAIntegerFormat = 1033;\n\n/**\n * A DXT1-compressed image in an RGB image format.\n *\n * @type {number}\n * @constant\n */\nconst RGB_S3TC_DXT1_Format = 33776;\n\n/**\n * A DXT1-compressed image in an RGB image format with a simple on/off alpha value.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_S3TC_DXT1_Format = 33777;\n\n/**\n * A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_S3TC_DXT3_Format = 33778;\n\n/**\n * A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3\n * compression in how the alpha compression is done.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_S3TC_DXT5_Format = 33779;\n\n/**\n * PVRTC RGB compression in 4-bit mode. One block for each 4×4 pixels.\n *\n * @type {number}\n * @constant\n */\nconst RGB_PVRTC_4BPPV1_Format = 35840;\n\n/**\n * PVRTC RGB compression in 2-bit mode. One block for each 8×4 pixels.\n *\n * @type {number}\n * @constant\n */\nconst RGB_PVRTC_2BPPV1_Format = 35841;\n\n/**\n * PVRTC RGBA compression in 4-bit mode. One block for each 4×4 pixels.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_PVRTC_4BPPV1_Format = 35842;\n\n/**\n * PVRTC RGBA compression in 2-bit mode. One block for each 8×4 pixels.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_PVRTC_2BPPV1_Format = 35843;\n\n/**\n * ETC1 RGB format.\n *\n * @type {number}\n * @constant\n */\nconst RGB_ETC1_Format = 36196;\n\n/**\n * ETC2 RGB format.\n *\n * @type {number}\n * @constant\n */\nconst RGB_ETC2_Format = 37492;\n\n/**\n * ETC2 RGBA format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ETC2_EAC_Format = 37496;\n\n/**\n * EAC R11 UNORM format.\n *\n * @type {number}\n * @constant\n */\nconst R11_EAC_Format = 37488; // 0x9270\n\n/**\n * EAC R11 SNORM format.\n *\n * @type {number}\n * @constant\n */\nconst SIGNED_R11_EAC_Format = 37489; // 0x9271\n\n/**\n * EAC RG11 UNORM format.\n *\n * @type {number}\n * @constant\n */\nconst RG11_EAC_Format = 37490; // 0x9272\n\n/**\n * EAC RG11 SNORM format.\n *\n * @type {number}\n * @constant\n */\nconst SIGNED_RG11_EAC_Format = 37491; // 0x9273\n\n/**\n * ASTC RGBA 4x4 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_4x4_Format = 37808;\n\n/**\n * ASTC RGBA 5x4 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_5x4_Format = 37809;\n\n/**\n * ASTC RGBA 5x5 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_5x5_Format = 37810;\n\n/**\n * ASTC RGBA 6x5 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_6x5_Format = 37811;\n\n/**\n * ASTC RGBA 6x6 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_6x6_Format = 37812;\n\n/**\n * ASTC RGBA 8x5 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_8x5_Format = 37813;\n\n/**\n * ASTC RGBA 8x6 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_8x6_Format = 37814;\n\n/**\n * ASTC RGBA 8x8 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_8x8_Format = 37815;\n\n/**\n * ASTC RGBA 10x5 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_10x5_Format = 37816;\n\n/**\n * ASTC RGBA 10x6 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_10x6_Format = 37817;\n\n/**\n * ASTC RGBA 10x8 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_10x8_Format = 37818;\n\n/**\n * ASTC RGBA 10x10 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_10x10_Format = 37819;\n\n/**\n * ASTC RGBA 12x10 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_12x10_Format = 37820;\n\n/**\n * ASTC RGBA 12x12 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_12x12_Format = 37821;\n\n/**\n * BPTC RGBA format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_BPTC_Format = 36492;\n\n/**\n * BPTC Signed RGB format.\n *\n * @type {number}\n * @constant\n */\nconst RGB_BPTC_SIGNED_Format = 36494;\n\n/**\n * BPTC Unsigned RGB format.\n *\n * @type {number}\n * @constant\n */\nconst RGB_BPTC_UNSIGNED_Format = 36495;\n\n/**\n * RGTC1 Red format.\n *\n * @type {number}\n * @constant\n */\nconst RED_RGTC1_Format = 36283;\n\n/**\n * RGTC1 Signed Red format.\n *\n * @type {number}\n * @constant\n */\nconst SIGNED_RED_RGTC1_Format = 36284;\n\n/**\n * RGTC2 Red Green format.\n *\n * @type {number}\n * @constant\n */\nconst RED_GREEN_RGTC2_Format = 36285;\n\n/**\n * RGTC2 Signed Red Green format.\n *\n * @type {number}\n * @constant\n */\nconst SIGNED_RED_GREEN_RGTC2_Format = 36286;\n\n/**\n * Animations are played once.\n *\n * @type {number}\n * @constant\n */\nconst LoopOnce = 2200;\n\n/**\n * Animations are played with a chosen number of repetitions, each time jumping from\n * the end of the clip directly to its beginning.\n *\n * @type {number}\n * @constant\n */\nconst LoopRepeat = 2201;\n\n/**\n * Animations are played with a chosen number of repetitions, alternately playing forward\n * and backward.\n *\n * @type {number}\n * @constant\n */\nconst LoopPingPong = 2202;\n\n/**\n * Discrete interpolation mode for keyframe tracks.\n *\n * @type {number}\n * @constant\n */\nconst InterpolateDiscrete = 2300;\n\n/**\n * Linear interpolation mode for keyframe tracks.\n *\n * @type {number}\n * @constant\n */\nconst InterpolateLinear = 2301;\n\n/**\n * Smooth interpolation mode for keyframe tracks.\n *\n * @type {number}\n * @constant\n */\nconst InterpolateSmooth = 2302;\n\n/**\n * Zero curvature ending for animations.\n *\n * @type {number}\n * @constant\n */\nconst ZeroCurvatureEnding = 2400;\n\n/**\n * Zero slope ending for animations.\n *\n * @type {number}\n * @constant\n */\nconst ZeroSlopeEnding = 2401;\n\n/**\n * Wrap around ending for animations.\n *\n * @type {number}\n * @constant\n */\nconst WrapAroundEnding = 2402;\n\n/**\n * Default animation blend mode.\n *\n * @type {number}\n * @constant\n */\nconst NormalAnimationBlendMode = 2500;\n\n/**\n * Additive animation blend mode. Can be used to layer motions on top of\n * each other to build complex performances from smaller re-usable assets.\n *\n * @type {number}\n * @constant\n */\nconst AdditiveAnimationBlendMode = 2501;\n\n/**\n * For every three vertices draw a single triangle.\n *\n * @type {number}\n * @constant\n */\nconst TrianglesDrawMode = 0;\n\n/**\n * For each vertex draw a triangle from the last three vertices.\n *\n * @type {number}\n * @constant\n */\nconst TriangleStripDrawMode = 1;\n\n/**\n * For each vertex draw a triangle from the first vertex and the last two vertices.\n *\n * @type {number}\n * @constant\n */\nconst TriangleFanDrawMode = 2;\n\n/**\n * The depth value is inverted (1.0 - z) for visualization purposes.\n *\n * @type {number}\n * @constant\n */\nconst BasicDepthPacking = 3200;\n\n/**\n * The depth value is packed into 32 bit RGBA.\n *\n * @type {number}\n * @constant\n */\nconst RGBADepthPacking = 3201;\n\n/**\n * The depth value is packed into 24 bit RGB.\n *\n * @type {number}\n * @constant\n */\nconst RGBDepthPacking = 3202;\n\n/**\n * The depth value is packed into 16 bit RG.\n *\n * @type {number}\n * @constant\n */\nconst RGDepthPacking = 3203;\n\n/**\n * Normal information is relative to the underlying surface.\n *\n * @type {number}\n * @constant\n */\nconst TangentSpaceNormalMap = 0;\n\n/**\n * Normal information is relative to the object orientation.\n *\n * @type {number}\n * @constant\n */\nconst ObjectSpaceNormalMap = 1;\n\n// Color space string identifiers, matching CSS Color Module Level 4 and WebGPU names where available.\n\n/**\n * No color space.\n *\n * @type {string}\n * @constant\n */\nconst NoColorSpace = '';\n\n/**\n * sRGB color space.\n *\n * @type {string}\n * @constant\n */\nconst SRGBColorSpace = 'srgb';\n\n/**\n * sRGB-linear color space.\n *\n * @type {string}\n * @constant\n */\nconst LinearSRGBColorSpace = 'srgb-linear';\n\n/**\n * Linear transfer function.\n *\n * @type {string}\n * @constant\n */\nconst LinearTransfer = 'linear';\n\n/**\n * sRGB transfer function.\n *\n * @type {string}\n * @constant\n */\nconst SRGBTransfer = 'srgb';\n\n/**\n * No normal map packing.\n *\n * @type {string}\n * @constant\n */\nconst NoNormalPacking = '';\n\n/**\n * Normal RG packing.\n *\n * @type {string}\n * @constant\n */\nconst NormalRGPacking = 'rg';\n\n/**\n * Normal GA packing.\n *\n * @type {string}\n * @constant\n */\nconst NormalGAPacking = 'ga';\n\n/**\n * Sets the stencil buffer value to `0`.\n *\n * @type {number}\n * @constant\n */\nconst ZeroStencilOp = 0;\n\n/**\n * Keeps the current value.\n *\n * @type {number}\n * @constant\n */\nconst KeepStencilOp = 7680;\n\n/**\n * Sets the stencil buffer value to the specified reference value.\n *\n * @type {number}\n * @constant\n */\nconst ReplaceStencilOp = 7681;\n\n/**\n * Increments the current stencil buffer value. Clamps to the maximum representable unsigned value.\n *\n * @type {number}\n * @constant\n */\nconst IncrementStencilOp = 7682;\n\n/**\n * Decrements the current stencil buffer value. Clamps to `0`.\n *\n * @type {number}\n * @constant\n */\nconst DecrementStencilOp = 7683;\n\n/**\n * Increments the current stencil buffer value. Wraps stencil buffer value to zero when incrementing\n * the maximum representable unsigned value.\n *\n * @type {number}\n * @constant\n */\nconst IncrementWrapStencilOp = 34055;\n\n/**\n * Decrements the current stencil buffer value. Wraps stencil buffer value to the maximum representable\n * unsigned value when decrementing a stencil buffer value of `0`.\n *\n * @type {number}\n * @constant\n */\nconst DecrementWrapStencilOp = 34056;\n\n/**\n * Inverts the current stencil buffer value bitwise.\n *\n * @type {number}\n * @constant\n */\nconst InvertStencilOp = 5386;\n\n/**\n * Will never return true.\n *\n * @type {number}\n * @constant\n */\nconst NeverStencilFunc = 512;\n\n/**\n * Will return true if the stencil reference value is less than the current stencil value.\n *\n * @type {number}\n * @constant\n */\nconst LessStencilFunc = 513;\n\n/**\n * Will return true if the stencil reference value is equal to the current stencil value.\n *\n * @type {number}\n * @constant\n */\nconst EqualStencilFunc = 514;\n\n/**\n * Will return true if the stencil reference value is less than or equal to the current stencil value.\n *\n * @type {number}\n * @constant\n */\nconst LessEqualStencilFunc = 515;\n\n/**\n * Will return true if the stencil reference value is greater than the current stencil value.\n *\n * @type {number}\n * @constant\n */\nconst GreaterStencilFunc = 516;\n\n/**\n * Will return true if the stencil reference value is not equal to the current stencil value.\n *\n * @type {number}\n * @constant\n */\nconst NotEqualStencilFunc = 517;\n\n/**\n * Will return true if the stencil reference value is greater than or equal to the current stencil value.\n *\n * @type {number}\n * @constant\n */\nconst GreaterEqualStencilFunc = 518;\n\n/**\n * Will always return true.\n *\n * @type {number}\n * @constant\n */\nconst AlwaysStencilFunc = 519;\n\n/**\n * Never pass.\n *\n * @type {number}\n * @constant\n */\nconst NeverCompare = 512;\n\n/**\n * Pass if the incoming value is less than the texture value.\n *\n * @type {number}\n * @constant\n */\nconst LessCompare = 513;\n\n/**\n * Pass if the incoming value equals the texture value.\n *\n * @type {number}\n * @constant\n */\nconst EqualCompare = 514;\n\n/**\n * Pass if the incoming value is less than or equal to the texture value.\n *\n * @type {number}\n * @constant\n */\nconst LessEqualCompare = 515;\n\n/**\n * Pass if the incoming value is greater than the texture value.\n *\n * @type {number}\n * @constant\n */\nconst GreaterCompare = 516;\n\n/**\n * Pass if the incoming value is not equal to the texture value.\n *\n * @type {number}\n * @constant\n */\nconst NotEqualCompare = 517;\n\n/**\n * Pass if the incoming value is greater than or equal to the texture value.\n *\n * @type {number}\n * @constant\n */\nconst GreaterEqualCompare = 518;\n\n/**\n * Always pass.\n *\n * @type {number}\n * @constant\n */\nconst AlwaysCompare = 519;\n\n/**\n * The contents are intended to be specified once by the application, and used many\n * times as the source for drawing and image specification commands.\n *\n * @type {number}\n * @constant\n */\nconst StaticDrawUsage = 35044;\n\n/**\n * The contents are intended to be respecified repeatedly by the application, and\n * used many times as the source for drawing and image specification commands.\n *\n * @type {number}\n * @constant\n */\nconst DynamicDrawUsage = 35048;\n\n/**\n * The contents are intended to be specified once by the application, and used at most\n * a few times as the source for drawing and image specification commands.\n *\n * @type {number}\n * @constant\n */\nconst StreamDrawUsage = 35040;\n\n/**\n * The contents are intended to be specified once by reading data from the 3D API, and queried\n * many times by the application.\n *\n * @type {number}\n * @constant\n */\nconst StaticReadUsage = 35045;\n\n/**\n * The contents are intended to be respecified repeatedly by reading data from the 3D API, and queried\n * many times by the application.\n *\n * @type {number}\n * @constant\n */\nconst DynamicReadUsage = 35049;\n\n/**\n * The contents are intended to be specified once by reading data from the 3D API, and queried at most\n * a few times by the application\n *\n * @type {number}\n * @constant\n */\nconst StreamReadUsage = 35041;\n\n/**\n * The contents are intended to be specified once by reading data from the 3D API, and used many times as\n * the source for WebGL drawing and image specification commands.\n *\n * @type {number}\n * @constant\n */\nconst StaticCopyUsage = 35046;\n\n/**\n * The contents are intended to be respecified repeatedly by reading data from the 3D API, and used many times\n * as the source for WebGL drawing and image specification commands.\n *\n * @type {number}\n * @constant\n */\nconst DynamicCopyUsage = 35050;\n\n/**\n * The contents are intended to be specified once by reading data from the 3D API, and used at most a few times\n * as the source for WebGL drawing and image specification commands.\n *\n * @type {number}\n * @constant\n */\nconst StreamCopyUsage = 35042;\n\n/**\n * GLSL 1 shader code.\n *\n * @type {string}\n * @constant\n */\nconst GLSL1 = '100';\n\n/**\n * GLSL 3 shader code.\n *\n * @type {string}\n * @constant\n */\nconst GLSL3 = '300 es';\n\n/**\n * WebGL coordinate system.\n *\n * @type {number}\n * @constant\n */\nconst WebGLCoordinateSystem = 2000;\n\n/**\n * WebGPU coordinate system.\n *\n * @type {number}\n * @constant\n */\nconst WebGPUCoordinateSystem = 2001;\n\n/**\n * Represents the different timestamp query types.\n *\n * @type {ConstantsTimestampQuery}\n * @constant\n */\nconst TimestampQuery = {\n\tCOMPUTE: 'compute',\n\tRENDER: 'render'\n};\n\n/**\n * Represents mouse buttons and interaction types in context of controls.\n *\n * @type {ConstantsInterpolationSamplingType}\n * @constant\n */\nconst InterpolationSamplingType = {\n\tPERSPECTIVE: 'perspective',\n\tLINEAR: 'linear',\n\tFLAT: 'flat'\n};\n\n/**\n * Represents the different interpolation sampling modes.\n *\n * @type {ConstantsInterpolationSamplingMode}\n * @constant\n */\nconst InterpolationSamplingMode = {\n\tNORMAL: 'normal',\n\tCENTROID: 'centroid',\n\tSAMPLE: 'sample',\n\tFIRST: 'first',\n\tEITHER: 'either'\n};\n\n/**\n * This type represents mouse buttons and interaction types in context of controls.\n *\n * @typedef {Object} ConstantsMouse\n * @property {number} MIDDLE - The left mouse button.\n * @property {number} LEFT - The middle mouse button.\n * @property {number} RIGHT - The right mouse button.\n * @property {number} ROTATE - A rotate interaction.\n * @property {number} DOLLY - A dolly interaction.\n * @property {number} PAN - A pan interaction.\n **/\n\n/**\n * This type represents touch interaction types in context of controls.\n *\n * @typedef {Object} ConstantsTouch\n * @property {number} ROTATE - A rotate interaction.\n * @property {number} PAN - A pan interaction.\n * @property {number} DOLLY_PAN - The dolly-pan interaction.\n * @property {number} DOLLY_ROTATE - A dolly-rotate interaction.\n **/\n\n/**\n * This type represents the different timestamp query types.\n *\n * @typedef {Object} ConstantsTimestampQuery\n * @property {string} COMPUTE - A `compute` timestamp query.\n * @property {string} RENDER - A `render` timestamp query.\n **/\n\n/**\n * Represents the different interpolation sampling types.\n *\n * @typedef {Object} ConstantsInterpolationSamplingType\n * @property {string} PERSPECTIVE - Perspective-correct interpolation.\n * @property {string} LINEAR - Linear interpolation.\n * @property {string} FLAT - Flat interpolation.\n */\n\n/**\n * Represents the different interpolation sampling modes.\n *\n * @typedef {Object} ConstantsInterpolationSamplingMode\n * @property {string} NORMAL - Normal sampling mode.\n * @property {string} CENTROID - Centroid sampling mode.\n * @property {string} SAMPLE - Sample-specific sampling mode.\n * @property {string} FIRST - Flat interpolation using the first vertex.\n * @property {string} EITHER - Flat interpolation using either vertex.\n */\n\nfunction arrayNeedsUint32( array ) {\n\n\t// assumes larger values usually on last\n\n\tfor ( let i = array.length - 1; i \u003e= 0; -- i ) {\n\n\t\tif ( array[ i ] \u003e= 65535 ) return true; // account for PRIMITIVE_RESTART_FIXED_INDEX, #24565\n\n\t}\n\n\treturn false;\n\n}\n\nconst TYPED_ARRAYS = {\n\tInt8Array: Int8Array,\n\tUint8Array: Uint8Array,\n\tUint8ClampedArray: Uint8ClampedArray,\n\tInt16Array: Int16Array,\n\tUint16Array: Uint16Array,\n\tInt32Array: Int32Array,\n\tUint32Array: Uint32Array,\n\tFloat32Array: Float32Array,\n\tFloat64Array: Float64Array\n};\n\nfunction getTypedArray( type, buffer ) {\n\n\treturn new TYPED_ARRAYS[ type ]( buffer );\n\n}\n\n/**\n * Returns `true` if the given object is a typed array.\n *\n * @param {any} array - The object to check.\n * @return {boolean} Whether the given object is a typed array.\n */\nfunction isTypedArray( array ) {\n\n\treturn ArrayBuffer.isView( array ) \u0026\u0026 ! ( array instanceof DataView );\n\n}\n\nfunction createElementNS( name ) {\n\n\treturn document.createElementNS( 'http://www.w3.org/1999/xhtml', name );\n\n}\n\nfunction createCanvasElement() {\n\n\tconst canvas = createElementNS( 'canvas' );\n\tcanvas.style.display = 'block';\n\treturn canvas;\n\n}\n\nconst _cache = {};\n\nlet _setConsoleFunction = null;\n\nfunction setConsoleFunction( fn ) {\n\n\t_setConsoleFunction = fn;\n\n}\n\nfunction getConsoleFunction() {\n\n\treturn _setConsoleFunction;\n\n}\n\nfunction log( ...params ) {\n\n\tconst message = 'THREE.' + params.shift();\n\n\tif ( _setConsoleFunction ) {\n\n\t\t_setConsoleFunction( 'log', message, ...params );\n\n\t} else {\n\n\t\tconsole.log( message, ...params );\n\n\t}\n\n}\n\nfunction warn( ...params ) {\n\n\tconst message = 'THREE.' + params.shift();\n\n\tif ( _setConsoleFunction ) {\n\n\t\t_setConsoleFunction( 'warn', message, ...params );\n\n\t} else {\n\n\t\tconsole.warn( message, ...params );\n\n\t}\n\n}\n\nfunction error( ...params ) {\n\n\tconst message = 'THREE.' + params.shift();\n\n\tif ( _setConsoleFunction ) {\n\n\t\t_setConsoleFunction( 'error', message, ...params );\n\n\t} else {\n\n\t\tconsole.error( message, ...params );\n\n\t}\n\n}\n\nfunction warnOnce( ...params ) {\n\n\tconst message = params.join( ' ' );\n\n\tif ( message in _cache ) return;\n\n\t_cache[ message ] = true;\n\n\twarn( ...params );\n\n}\n\nfunction probeAsync( gl, sync, interval ) {\n\n\treturn new Promise( function ( resolve, reject ) {\n\n\t\tfunction probe() {\n\n\t\t\tswitch ( gl.clientWaitSync( sync, gl.SYNC_FLUSH_COMMANDS_BIT, 0 ) ) {\n\n\t\t\t\tcase gl.WAIT_FAILED:\n\t\t\t\t\treject();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase gl.TIMEOUT_EXPIRED:\n\t\t\t\t\tsetTimeout( probe, interval );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tresolve();\n\n\t\t\t}\n\n\t\t}\n\n\t\tsetTimeout( probe, interval );\n\n\t} );\n\n}\n\n/**\n * This modules allows to dispatch event objects on custom JavaScript objects.\n *\n * Main repository: [eventdispatcher.js](https://github.com/mrdoob/eventdispatcher.js/)\n *\n * Code Example:\n * ```js\n * class Car extends EventDispatcher {\n * \tstart() {\n *\t\tthis.dispatchEvent( { type: 'start', message: 'vroom vroom!' } );\n *\t}\n *};\n *\n * // Using events with the custom object\n * const car = new Car();\n * car.addEventListener( 'start', function ( event ) {\n * \talert( event.message );\n * } );\n *\n * car.start();\n * ```\n */\nclass EventDispatcher {\n\n\t/**\n\t * Adds the given event listener to the given event type.\n\t *\n\t * @param {string} type - The type of event to listen to.\n\t * @param {Function} listener - The function that gets called when the event is fired.\n\t */\n\taddEventListener( type, listener ) {\n\n\t\tif ( this._listeners === undefined ) this._listeners = {};\n\n\t\tconst listeners = this._listeners;\n\n\t\tif ( listeners[ type ] === undefined ) {\n\n\t\t\tlisteners[ type ] = [];\n\n\t\t}\n\n\t\tif ( listeners[ type ].indexOf( listener ) === -1 ) {\n\n\t\t\tlisteners[ type ].push( listener );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns `true` if the given event listener has been added to the given event type.\n\t *\n\t * @param {string} type - The type of event.\n\t * @param {Function} listener - The listener to check.\n\t * @return {boolean} Whether the given event listener has been added to the given event type.\n\t */\n\thasEventListener( type, listener ) {\n\n\t\tconst listeners = this._listeners;\n\n\t\tif ( listeners === undefined ) return false;\n\n\t\treturn listeners[ type ] !== undefined \u0026\u0026 listeners[ type ].indexOf( listener ) !== -1;\n\n\t}\n\n\t/**\n\t * Removes the given event listener from the given event type.\n\t *\n\t * @param {string} type - The type of event.\n\t * @param {Function} listener - The listener to remove.\n\t */\n\tremoveEventListener( type, listener ) {\n\n\t\tconst listeners = this._listeners;\n\n\t\tif ( listeners === undefined ) return;\n\n\t\tconst listenerArray = listeners[ type ];\n\n\t\tif ( listenerArray !== undefined ) {\n\n\t\t\tconst index = listenerArray.indexOf( listener );\n\n\t\t\tif ( index !== -1 ) {\n\n\t\t\t\tlistenerArray.splice( index, 1 );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Dispatches an event object.\n\t *\n\t * @param {Object} event - The event that gets fired.\n\t */\n\tdispatchEvent( event ) {\n\n\t\tconst listeners = this._listeners;\n\n\t\tif ( listeners === undefined ) return;\n\n\t\tconst listenerArray = listeners[ event.type ];\n\n\t\tif ( listenerArray !== undefined ) {\n\n\t\t\tevent.target = this;\n\n\t\t\t// Make a copy, in case listeners are removed while iterating.\n\t\t\tconst array = listenerArray.slice( 0 );\n\n\t\t\tfor ( let i = 0, l = array.length; i \u003c l; i ++ ) {\n\n\t\t\t\tarray[ i ].call( this, event );\n\n\t\t\t}\n\n\t\t\tevent.target = null;\n\n\t\t}\n\n\t}\n\n}\n\nconst _lut = [ '00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c', '0d', '0e', '0f', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '1a', '1b', '1c', '1d', '1e', '1f', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '2a', '2b', '2c', '2d', '2e', '2f', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '3a', '3b', '3c', '3d', '3e', '3f', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '4a', '4b', '4c', '4d', '4e', '4f', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '5a', '5b', '5c', '5d', '5e', '5f', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '6a', '6b', '6c', '6d', '6e', '6f', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '7a', '7b', '7c', '7d', '7e', '7f', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '8a', '8b', '8c', '8d', '8e', '8f', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '9a', '9b', '9c', '9d', '9e', '9f', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'aa', 'ab', 'ac', 'ad', 'ae', 'af', 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8', 'b9', 'ba', 'bb', 'bc', 'bd', 'be', 'bf', 'c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'ca', 'cb', 'cc', 'cd', 'ce', 'cf', 'd0', 'd1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8', 'd9', 'da', 'db', 'dc', 'dd', 'de', 'df', 'e0', 'e1', 'e2', 'e3', 'e4', 'e5', 'e6', 'e7', 'e8', 'e9', 'ea', 'eb', 'ec', 'ed', 'ee', 'ef', 'f0', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'fa', 'fb', 'fc', 'fd', 'fe', 'ff' ];\n\nlet _seed = 1234567;\n\n\nconst DEG2RAD = Math.PI / 180;\nconst RAD2DEG = 180 / Math.PI;\n\n/**\n * Generate a [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)\n * (universally unique identifier).\n *\n * @return {string} The UUID.\n */\nfunction generateUUID() {\n\n\t// http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\n\n\tconst d0 = Math.random() * 0xffffffff | 0;\n\tconst d1 = Math.random() * 0xffffffff | 0;\n\tconst d2 = Math.random() * 0xffffffff | 0;\n\tconst d3 = Math.random() * 0xffffffff | 0;\n\tconst uuid = _lut[ d0 \u0026 0xff ] + _lut[ d0 \u003e\u003e 8 \u0026 0xff ] + _lut[ d0 \u003e\u003e 16 \u0026 0xff ] + _lut[ d0 \u003e\u003e 24 \u0026 0xff ] + '-' +\n\t\t\t_lut[ d1 \u0026 0xff ] + _lut[ d1 \u003e\u003e 8 \u0026 0xff ] + '-' + _lut[ d1 \u003e\u003e 16 \u0026 0x0f | 0x40 ] + _lut[ d1 \u003e\u003e 24 \u0026 0xff ] + '-' +\n\t\t\t_lut[ d2 \u0026 0x3f | 0x80 ] + _lut[ d2 \u003e\u003e 8 \u0026 0xff ] + '-' + _lut[ d2 \u003e\u003e 16 \u0026 0xff ] + _lut[ d2 \u003e\u003e 24 \u0026 0xff ] +\n\t\t\t_lut[ d3 \u0026 0xff ] + _lut[ d3 \u003e\u003e 8 \u0026 0xff ] + _lut[ d3 \u003e\u003e 16 \u0026 0xff ] + _lut[ d3 \u003e\u003e 24 \u0026 0xff ];\n\n\t// .toLowerCase() here flattens concatenated strings to save heap memory space.\n\treturn uuid.toLowerCase();\n\n}\n\n/**\n * Clamps the given value between min and max.\n *\n * @param {number} value - The value to clamp.\n * @param {number} min - The min value.\n * @param {number} max - The max value.\n * @return {number} The clamped value.\n */\nfunction clamp( value, min, max ) {\n\n\treturn Math.max( min, Math.min( max, value ) );\n\n}\n\n/**\n * Computes the Euclidean modulo of the given parameters that\n * is `( ( n % m ) + m ) % m`.\n *\n * @param {number} n - The first parameter.\n * @param {number} m - The second parameter.\n * @return {number} The Euclidean modulo.\n */\nfunction euclideanModulo( n, m ) {\n\n\t// https://en.wikipedia.org/wiki/Modulo_operation\n\n\treturn ( ( n % m ) + m ) % m;\n\n}\n\n/**\n * Performs a linear mapping from range `\u003ca1, a2\u003e` to range `\u003cb1, b2\u003e`\n * for the given value.\n *\n * @param {number} x - The value to be mapped.\n * @param {number} a1 - Minimum value for range A.\n * @param {number} a2 - Maximum value for range A.\n * @param {number} b1 - Minimum value for range B.\n * @param {number} b2 - Maximum value for range B.\n * @return {number} The mapped value.\n */\nfunction mapLinear( x, a1, a2, b1, b2 ) {\n\n\treturn b1 + ( x - a1 ) * ( b2 - b1 ) / ( a2 - a1 );\n\n}\n\n/**\n * Returns the percentage in the closed interval `[0, 1]` of the given value\n * between the start and end point.\n *\n * @param {number} x - The start point\n * @param {number} y - The end point.\n * @param {number} value - A value between start and end.\n * @return {number} The interpolation factor.\n */\nfunction inverseLerp( x, y, value ) {\n\n\t// https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/\n\n\tif ( x !== y ) {\n\n\t\treturn ( value - x ) / ( y - x );\n\n\t} else {\n\n\t\treturn 0;\n\n\t}\n\n}\n\n/**\n * Returns a value linearly interpolated from two known points based on the given interval -\n * `t = 0` will return `x` and `t = 1` will return `y`.\n *\n * @param {number} x - The start point\n * @param {number} y - The end point.\n * @param {number} t - The interpolation factor in the closed interval `[0, 1]`.\n * @return {number} The interpolated value.\n */\nfunction lerp( x, y, t ) {\n\n\treturn ( 1 - t ) * x + t * y;\n\n}\n\n/**\n * Smoothly interpolate a number from `x` to `y` in  a spring-like manner using a delta\n * time to maintain frame rate independent movement. For details, see\n * [Frame rate independent damping using lerp](http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/).\n *\n * @param {number} x - The current point.\n * @param {number} y - The target point.\n * @param {number} lambda - A higher lambda value will make the movement more sudden,\n * and a lower value will make the movement more gradual.\n * @param {number} dt - Delta time in seconds.\n * @return {number} The interpolated value.\n */\nfunction damp( x, y, lambda, dt ) {\n\n\treturn lerp( x, y, 1 - Math.exp( - lambda * dt ) );\n\n}\n\n/**\n * Returns a value that alternates between `0` and the given `length` parameter.\n *\n * @param {number} x - The value to pingpong.\n * @param {number} [length=1] - The positive value the function will pingpong to.\n * @return {number} The alternated value.\n */\nfunction pingpong( x, length = 1 ) {\n\n\t// https://www.desmos.com/calculator/vcsjnyz7x4\n\n\treturn length - Math.abs( euclideanModulo( x, length * 2 ) - length );\n\n}\n\n/**\n * Returns a value in the range `[0,1]` that represents the percentage that `x` has\n * moved between `min` and `max`, but smoothed or slowed down the closer `x` is to\n * the `min` and `max`.\n *\n * See [Smoothstep](http://en.wikipedia.org/wiki/Smoothstep) for more details.\n *\n * @param {number} x - The value to evaluate based on its position between min and max.\n * @param {number} min - The min value. Any x value below min will be `0`.\n * @param {number} max - The max value. Any x value above max will be `1`.\n * @return {number} The alternated value.\n */\nfunction smoothstep( x, min, max ) {\n\n\tif ( x \u003c= min ) return 0;\n\tif ( x \u003e= max ) return 1;\n\n\tx = ( x - min ) / ( max - min );\n\n\treturn x * x * ( 3 - 2 * x );\n\n}\n\n/**\n * A [variation on smoothstep](https://en.wikipedia.org/wiki/Smoothstep#Variations)\n * that has zero 1st and 2nd order derivatives at x=0 and x=1.\n *\n * @param {number} x - The value to evaluate based on its position between min and max.\n * @param {number} min - The min value. Any x value below min will be `0`.\n * @param {number} max - The max value. Any x value above max will be `1`.\n * @return {number} The alternated value.\n */\nfunction smootherstep( x, min, max ) {\n\n\tif ( x \u003c= min ) return 0;\n\tif ( x \u003e= max ) return 1;\n\n\tx = ( x - min ) / ( max - min );\n\n\treturn x * x * x * ( x * ( x * 6 - 15 ) + 10 );\n\n}\n\n/**\n * Returns a random integer from `\u003clow, high\u003e` interval.\n *\n * @param {number} low - The lower value boundary.\n * @param {number} high - The upper value boundary\n * @return {number} A random integer.\n */\nfunction randInt( low, high ) {\n\n\treturn low + Math.floor( Math.random() * ( high - low + 1 ) );\n\n}\n\n/**\n * Returns a random float from `\u003clow, high\u003e` interval.\n *\n * @param {number} low - The lower value boundary.\n * @param {number} high - The upper value boundary\n * @return {number} A random float.\n */\nfunction randFloat( low, high ) {\n\n\treturn low + Math.random() * ( high - low );\n\n}\n\n/**\n * Returns a random integer from `\u003c-range/2, range/2\u003e` interval.\n *\n * @param {number} range - Defines the value range.\n * @return {number} A random float.\n */\nfunction randFloatSpread( range ) {\n\n\treturn range * ( 0.5 - Math.random() );\n\n}\n\n/**\n * Returns a deterministic pseudo-random float in the interval `[0, 1]`.\n *\n * @param {number} [s] - The integer seed.\n * @return {number} A random float.\n */\nfunction seededRandom( s ) {\n\n\tif ( s !== undefined ) _seed = s;\n\n\t// Mulberry32 generator\n\n\tlet t = _seed += 0x6D2B79F5;\n\n\tt = Math.imul( t ^ t \u003e\u003e\u003e 15, t | 1 );\n\n\tt ^= t + Math.imul( t ^ t \u003e\u003e\u003e 7, t | 61 );\n\n\treturn ( ( t ^ t \u003e\u003e\u003e 14 ) \u003e\u003e\u003e 0 ) / 4294967296;\n\n}\n\n/**\n * Converts degrees to radians.\n *\n * @param {number} degrees - A value in degrees.\n * @return {number} The converted value in radians.\n */\nfunction degToRad( degrees ) {\n\n\treturn degrees * DEG2RAD;\n\n}\n\n/**\n * Converts radians to degrees.\n *\n * @param {number} radians - A value in radians.\n * @return {number} The converted value in degrees.\n */\nfunction radToDeg( radians ) {\n\n\treturn radians * RAD2DEG;\n\n}\n\n/**\n * Returns `true` if the given number is a power of two.\n *\n * @param {number} value - The value to check.\n * @return {boolean} Whether the given number is a power of two or not.\n */\nfunction isPowerOfTwo( value ) {\n\n\treturn ( value \u0026 ( value - 1 ) ) === 0 \u0026\u0026 value !== 0;\n\n}\n\n/**\n * Returns the smallest power of two that is greater than or equal to the given number.\n *\n * @param {number} value - The value to find a POT for.\n * @return {number} The smallest power of two that is greater than or equal to the given number.\n */\nfunction ceilPowerOfTwo( value ) {\n\n\treturn Math.pow( 2, Math.ceil( Math.log( value ) / Math.LN2 ) );\n\n}\n\n/**\n * Returns the largest power of two that is less than or equal to the given number.\n *\n * @param {number} value - The value to find a POT for.\n * @return {number} The largest power of two that is less than or equal to the given number.\n */\nfunction floorPowerOfTwo( value ) {\n\n\treturn Math.pow( 2, Math.floor( Math.log( value ) / Math.LN2 ) );\n\n}\n\n/**\n * Sets the given quaternion from the [Intrinsic Proper Euler Angles](https://en.wikipedia.org/wiki/Euler_angles)\n * defined by the given angles and order.\n *\n * Rotations are applied to the axes in the order specified by order:\n * rotation by angle `a` is applied first, then by angle `b`, then by angle `c`.\n *\n * @param {Quaternion} q - The quaternion to set.\n * @param {number} a - The rotation applied to the first axis, in radians.\n * @param {number} b - The rotation applied to the second axis, in radians.\n * @param {number} c - The rotation applied to the third axis, in radians.\n * @param {('XYX'|'XZX'|'YXY'|'YZY'|'ZXZ'|'ZYZ')} order - A string specifying the axes order.\n */\nfunction setQuaternionFromProperEuler( q, a, b, c, order ) {\n\n\tconst cos = Math.cos;\n\tconst sin = Math.sin;\n\n\tconst c2 = cos( b / 2 );\n\tconst s2 = sin( b / 2 );\n\n\tconst c13 = cos( ( a + c ) / 2 );\n\tconst s13 = sin( ( a + c ) / 2 );\n\n\tconst c1_3 = cos( ( a - c ) / 2 );\n\tconst s1_3 = sin( ( a - c ) / 2 );\n\n\tconst c3_1 = cos( ( c - a ) / 2 );\n\tconst s3_1 = sin( ( c - a ) / 2 );\n\n\tswitch ( order ) {\n\n\t\tcase 'XYX':\n\t\t\tq.set( c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'YZY':\n\t\t\tq.set( s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'ZXZ':\n\t\t\tq.set( s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'XZX':\n\t\t\tq.set( c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'YXY':\n\t\t\tq.set( s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'ZYZ':\n\t\t\tq.set( s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13 );\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\twarn( 'MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order );\n\n\t}\n\n}\n\n/**\n * Denormalizes the given value according to the given typed array.\n *\n * @param {number} value - The value to denormalize.\n * @param {TypedArray} array - The typed array that defines the data type of the value.\n * @return {number} The denormalize (float) value in the range `[0,1]`.\n */\nfunction denormalize( value, array ) {\n\n\tswitch ( array.constructor ) {\n\n\t\tcase Float32Array:\n\n\t\t\treturn value;\n\n\t\tcase Uint32Array:\n\n\t\t\treturn value / 4294967295.0;\n\n\t\tcase Uint16Array:\n\n\t\t\treturn value / 65535.0;\n\n\t\tcase Uint8Array:\n\n\t\t\treturn value / 255.0;\n\n\t\tcase Int32Array:\n\n\t\t\treturn Math.max( value / 2147483647.0, -1 );\n\n\t\tcase Int16Array:\n\n\t\t\treturn Math.max( value / 32767.0, -1 );\n\n\t\tcase Int8Array:\n\n\t\t\treturn Math.max( value / 127.0, -1 );\n\n\t\tdefault:\n\n\t\t\tthrow new Error( 'Invalid component type.' );\n\n\t}\n\n}\n\n/**\n * Normalizes the given value according to the given typed array.\n *\n * @param {number} value - The float value in the range `[0,1]` to normalize.\n * @param {TypedArray} array - The typed array that defines the data type of the value.\n * @return {number} The normalize value.\n */\nfunction normalize( value, array ) {\n\n\tswitch ( array.constructor ) {\n\n\t\tcase Float32Array:\n\n\t\t\treturn value;\n\n\t\tcase Uint32Array:\n\n\t\t\treturn Math.round( value * 4294967295.0 );\n\n\t\tcase Uint16Array:\n\n\t\t\treturn Math.round( value * 65535.0 );\n\n\t\tcase Uint8Array:\n\n\t\t\treturn Math.round( value * 255.0 );\n\n\t\tcase Int32Array:\n\n\t\t\treturn Math.round( value * 2147483647.0 );\n\n\t\tcase Int16Array:\n\n\t\t\treturn Math.round( value * 32767.0 );\n\n\t\tcase Int8Array:\n\n\t\t\treturn Math.round( value * 127.0 );\n\n\t\tdefault:\n\n\t\t\tthrow new Error( 'Invalid component type.' );\n\n\t}\n\n}\n\n/**\n * @class\n * @classdesc A collection of math utility functions.\n * @hideconstructor\n */\nconst MathUtils = {\n\tDEG2RAD: DEG2RAD,\n\tRAD2DEG: RAD2DEG,\n\t/**\n\t * Generate a [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)\n\t * (universally unique identifier).\n\t *\n\t * @static\n\t * @method\n\t * @return {string} The UUID.\n\t */\n\tgenerateUUID: generateUUID,\n\t/**\n\t * Clamps the given value between min and max.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} value - The value to clamp.\n\t * @param {number} min - The min value.\n\t * @param {number} max - The max value.\n\t * @return {number} The clamped value.\n\t */\n\tclamp: clamp,\n\t/**\n\t * Computes the Euclidean modulo of the given parameters that\n\t * is `( ( n % m ) + m ) % m`.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} n - The first parameter.\n\t * @param {number} m - The second parameter.\n\t * @return {number} The Euclidean modulo.\n\t */\n\teuclideanModulo: euclideanModulo,\n\t/**\n\t * Performs a linear mapping from range `\u003ca1, a2\u003e` to range `\u003cb1, b2\u003e`\n\t * for the given value.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The value to be mapped.\n\t * @param {number} a1 - Minimum value for range A.\n\t * @param {number} a2 - Maximum value for range A.\n\t * @param {number} b1 - Minimum value for range B.\n\t * @param {number} b2 - Maximum value for range B.\n\t * @return {number} The mapped value.\n\t */\n\tmapLinear: mapLinear,\n\t/**\n\t * Returns the percentage in the closed interval `[0, 1]` of the given value\n\t * between the start and end point.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The start point\n\t * @param {number} y - The end point.\n\t * @param {number} value - A value between start and end.\n\t * @return {number} The interpolation factor.\n\t */\n\tinverseLerp: inverseLerp,\n\t/**\n\t * Returns a value linearly interpolated from two known points based on the given interval -\n\t * `t = 0` will return `x` and `t = 1` will return `y`.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The start point\n\t * @param {number} y - The end point.\n\t * @param {number} t - The interpolation factor in the closed interval `[0, 1]`.\n\t * @return {number} The interpolated value.\n\t */\n\tlerp: lerp,\n\t/**\n\t * Smoothly interpolate a number from `x` to `y` in  a spring-like manner using a delta\n\t * time to maintain frame rate independent movement. For details, see\n\t * [Frame rate independent damping using lerp](http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/).\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The current point.\n\t * @param {number} y - The target point.\n\t * @param {number} lambda - A higher lambda value will make the movement more sudden,\n\t * and a lower value will make the movement more gradual.\n\t * @param {number} dt - Delta time in seconds.\n\t * @return {number} The interpolated value.\n\t */\n\tdamp: damp,\n\t/**\n\t * Returns a value that alternates between `0` and the given `length` parameter.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The value to pingpong.\n\t * @param {number} [length=1] - The positive value the function will pingpong to.\n\t * @return {number} The alternated value.\n\t */\n\tpingpong: pingpong,\n\t/**\n\t * Returns a value in the range `[0,1]` that represents the percentage that `x` has\n\t * moved between `min` and `max`, but smoothed or slowed down the closer `x` is to\n\t * the `min` and `max`.\n\t *\n\t * See [Smoothstep](http://en.wikipedia.org/wiki/Smoothstep) for more details.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The value to evaluate based on its position between min and max.\n\t * @param {number} min - The min value. Any x value below min will be `0`.\n\t * @param {number} max - The max value. Any x value above max will be `1`.\n\t * @return {number} The alternated value.\n\t */\n\tsmoothstep: smoothstep,\n\t/**\n\t * A [variation on smoothstep](https://en.wikipedia.org/wiki/Smoothstep#Variations)\n\t * that has zero 1st and 2nd order derivatives at x=0 and x=1.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The value to evaluate based on its position between min and max.\n\t * @param {number} min - The min value. Any x value below min will be `0`.\n\t * @param {number} max - The max value. Any x value above max will be `1`.\n\t * @return {number} The alternated value.\n\t */\n\tsmootherstep: smootherstep,\n\t/**\n\t * Returns a random integer from `\u003clow, high\u003e` interval.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} low - The lower value boundary.\n\t * @param {number} high - The upper value boundary\n\t * @return {number} A random integer.\n\t */\n\trandInt: randInt,\n\t/**\n\t * Returns a random float from `\u003clow, high\u003e` interval.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} low - The lower value boundary.\n\t * @param {number} high - The upper value boundary\n\t * @return {number} A random float.\n\t */\n\trandFloat: randFloat,\n\t/**\n\t * Returns a random integer from `\u003c-range/2, range/2\u003e` interval.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} range - Defines the value range.\n\t * @return {number} A random float.\n\t */\n\trandFloatSpread: randFloatSpread,\n\t/**\n\t * Returns a deterministic pseudo-random float in the interval `[0, 1]`.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} [s] - The integer seed.\n\t * @return {number} A random float.\n\t */\n\tseededRandom: seededRandom,\n\t/**\n\t * Converts degrees to radians.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} degrees - A value in degrees.\n\t * @return {number} The converted value in radians.\n\t */\n\tdegToRad: degToRad,\n\t/**\n\t * Converts radians to degrees.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} radians - A value in radians.\n\t * @return {number} The converted value in degrees.\n\t */\n\tradToDeg: radToDeg,\n\t/**\n\t * Returns `true` if the given number is a power of two.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} value - The value to check.\n\t * @return {boolean} Whether the given number is a power of two or not.\n\t */\n\tisPowerOfTwo: isPowerOfTwo,\n\t/**\n\t * Returns the smallest power of two that is greater than or equal to the given number.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} value - The value to find a POT for.\n\t * @return {number} The smallest power of two that is greater than or equal to the given number.\n\t */\n\tceilPowerOfTwo: ceilPowerOfTwo,\n\t/**\n\t * Returns the largest power of two that is less than or equal to the given number.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} value - The value to find a POT for.\n\t * @return {number} The largest power of two that is less than or equal to the given number.\n\t */\n\tfloorPowerOfTwo: floorPowerOfTwo,\n\t/**\n\t * Sets the given quaternion from the [Intrinsic Proper Euler Angles](https://en.wikipedia.org/wiki/Euler_angles)\n\t * defined by the given angles and order.\n\t *\n\t * Rotations are applied to the axes in the order specified by order:\n\t * rotation by angle `a` is applied first, then by angle `b`, then by angle `c`.\n\t *\n\t * @static\n\t * @method\n\t * @param {Quaternion} q - The quaternion to set.\n\t * @param {number} a - The rotation applied to the first axis, in radians.\n\t * @param {number} b - The rotation applied to the second axis, in radians.\n\t * @param {number} c - The rotation applied to the third axis, in radians.\n\t * @param {('XYX'|'XZX'|'YXY'|'YZY'|'ZXZ'|'ZYZ')} order - A string specifying the axes order.\n\t */\n\tsetQuaternionFromProperEuler: setQuaternionFromProperEuler,\n\t/**\n\t * Normalizes the given value according to the given typed array.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} value - The float value in the range `[0,1]` to normalize.\n\t * @param {TypedArray} array - The typed array that defines the data type of the value.\n\t * @return {number} The normalize value.\n\t */\n\tnormalize: normalize,\n\t/**\n\t * Denormalizes the given value according to the given typed array.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} value - The value to denormalize.\n\t * @param {TypedArray} array - The typed array that defines the data type of the value.\n\t * @return {number} The denormalize (float) value in the range `[0,1]`.\n\t */\n\tdenormalize: denormalize\n};\n\n/**\n * Class representing a 2D vector. A 2D vector is an ordered pair of numbers\n * (labeled x and y), which can be used to represent a number of things, such as:\n *\n * - A point in 2D space (i.e. a position on a plane).\n * - A direction and length across a plane. In three.js the length will\n * always be the Euclidean distance(straight-line distance) from `(0, 0)` to `(x, y)`\n * and the direction is also measured from `(0, 0)` towards `(x, y)`.\n * - Any arbitrary ordered pair of numbers.\n *\n * There are other things a 2D vector can be used to represent, such as\n * momentum vectors, complex numbers and so on, however these are the most\n * common uses in three.js.\n *\n * Iterating through a vector instance will yield its components `(x, y)` in\n * the corresponding order.\n * ```js\n * const a = new THREE.Vector2( 0, 1 );\n *\n * //no arguments; will be initialised to (0, 0)\n * const b = new THREE.Vector2( );\n *\n * const d = a.distanceTo( b );\n * ```\n */\nclass Vector2 {\n\n\t/**\n\t * Constructs a new 2D vector.\n\t *\n\t * @param {number} [x=0] - The x value of this vector.\n\t * @param {number} [y=0] - The y value of this vector.\n\t */\n\tconstructor( x = 0, y = 0 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tVector2.prototype.isVector2 = true;\n\n\t\t/**\n\t\t * The x value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.x = x;\n\n\t\t/**\n\t\t * The y value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.y = y;\n\n\t}\n\n\t/**\n\t * Alias for {@link Vector2#x}.\n\t *\n\t * @type {number}\n\t */\n\tget width() {\n\n\t\treturn this.x;\n\n\t}\n\n\tset width( value ) {\n\n\t\tthis.x = value;\n\n\t}\n\n\t/**\n\t * Alias for {@link Vector2#y}.\n\t *\n\t * @type {number}\n\t */\n\tget height() {\n\n\t\treturn this.y;\n\n\t}\n\n\tset height( value ) {\n\n\t\tthis.y = value;\n\n\t}\n\n\t/**\n\t * Sets the vector components.\n\t *\n\t * @param {number} x - The value of the x component.\n\t * @param {number} y - The value of the y component.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tset( x, y ) {\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components to the same value.\n\t *\n\t * @param {number} scalar - The value to set for all vector components.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tsetScalar( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's x component to the given value\n\t *\n\t * @param {number} x - The value to set.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tsetX( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's y component to the given value\n\t *\n\t * @param {number} y - The value to set.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tsetY( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Allows to set a vector component with an index.\n\t *\n\t * @param {number} index - The component index. `0` equals to x, `1` equals to y.\n\t * @param {number} value - The value to set.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tsetComponent( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the value of the vector component which matches the given index.\n\t *\n\t * @param {number} index - The component index. `0` equals to x, `1` equals to y.\n\t * @return {number} A vector component value.\n\t */\n\tgetComponent( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns a new vector with copied values from this instance.\n\t *\n\t * @return {Vector2} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor( this.x, this.y );\n\n\t}\n\n\t/**\n\t * Copies the values of the given vector to this instance.\n\t *\n\t * @param {Vector2} v - The vector to copy.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tcopy( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vector to this instance.\n\t *\n\t * @param {Vector2} v - The vector to add.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tadd( v ) {\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given scalar value to all components of this instance.\n\t *\n\t * @param {number} s - The scalar to add.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\taddScalar( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vectors and stores the result in this instance.\n\t *\n\t * @param {Vector2} a - The first vector.\n\t * @param {Vector2} b - The second vector.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\taddVectors( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vector scaled by the given factor to this instance.\n\t *\n\t * @param {Vector2} v - The vector.\n\t * @param {number} s - The factor that scales `v`.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\taddScaledVector( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given vector from this instance.\n\t *\n\t * @param {Vector2} v - The vector to subtract.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tsub( v ) {\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given scalar value from all components of this instance.\n\t *\n\t * @param {number} s - The scalar to subtract.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tsubScalar( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given vectors and stores the result in this instance.\n\t *\n\t * @param {Vector2} a - The first vector.\n\t * @param {Vector2} b - The second vector.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tsubVectors( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given vector with this instance.\n\t *\n\t * @param {Vector2} v - The vector to multiply.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tmultiply( v ) {\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given scalar value with all components of this instance.\n\t *\n\t * @param {number} scalar - The scalar to multiply.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tmultiplyScalar( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Divides this instance by the given vector.\n\t *\n\t * @param {Vector2} v - The vector to divide.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tdivide( v ) {\n\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Divides this vector by the given scalar.\n\t *\n\t * @param {number} scalar - The scalar to divide.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tdivideScalar( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t}\n\n\t/**\n\t * Multiplies this vector (with an implicit 1 as the 3rd component) by\n\t * the given 3x3 matrix.\n\t *\n\t * @param {Matrix3} m - The matrix to apply.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tapplyMatrix3( m ) {\n\n\t\tconst x = this.x, y = this.y;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ];\n\t\tthis.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x or y value is greater than the given vector's x or y\n\t * value, replace that value with the corresponding min value.\n\t *\n\t * @param {Vector2} v - The vector.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tmin( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x or y value is less than the given vector's x or y\n\t * value, replace that value with the corresponding max value.\n\t *\n\t * @param {Vector2} v - The vector.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tmax( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x or y value is greater than the max vector's x or y\n\t * value, it is replaced by the corresponding value.\n\t * If this vector's x or y value is less than the min vector's x or y value,\n\t * it is replaced by the corresponding value.\n\t *\n\t * @param {Vector2} min - The minimum x and y values.\n\t * @param {Vector2} max - The maximum x and y values in the desired range.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tclamp( min, max ) {\n\n\t\t// assumes min \u003c max, componentwise\n\n\t\tthis.x = clamp( this.x, min.x, max.x );\n\t\tthis.y = clamp( this.y, min.y, max.y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x or y values are greater than the max value, they are\n\t * replaced by the max value.\n\t * If this vector's x or y values are less than the min value, they are\n\t * replaced by the min value.\n\t *\n\t * @param {number} minVal - The minimum value the components will be clamped to.\n\t * @param {number} maxVal - The maximum value the components will be clamped to.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tclampScalar( minVal, maxVal ) {\n\n\t\tthis.x = clamp( this.x, minVal, maxVal );\n\t\tthis.y = clamp( this.y, minVal, maxVal );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's length is greater than the max value, it is replaced by\n\t * the max value.\n\t * If this vector's length is less than the min value, it is replaced by the\n\t * min value.\n\t *\n\t * @param {number} min - The minimum value the vector length will be clamped to.\n\t * @param {number} max - The maximum value the vector length will be clamped to.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tclampLength( min, max ) {\n\n\t\tconst length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( clamp( length, min, max ) );\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded down to the nearest integer value.\n\t *\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tfloor() {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded up to the nearest integer value.\n\t *\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tceil() {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded to the nearest integer value\n\t *\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tround() {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded towards zero (up if negative,\n\t * down if positive) to an integer value.\n\t *\n\t * @return {Vector2} A reference to this vector.\n\t */\n\troundToZero() {\n\n\t\tthis.x = Math.trunc( this.x );\n\t\tthis.y = Math.trunc( this.y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Inverts this vector - i.e. sets x = -x and y = -y.\n\t *\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tnegate() {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Calculates the dot product of the given vector with this instance.\n\t *\n\t * @param {Vector2} v - The vector to compute the dot product with.\n\t * @return {number} The result of the dot product.\n\t */\n\tdot( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y;\n\n\t}\n\n\t/**\n\t * Calculates the cross product of the given vector with this instance.\n\t *\n\t * @param {Vector2} v - The vector to compute the cross product with.\n\t * @return {number} The result of the cross product.\n\t */\n\tcross( v ) {\n\n\t\treturn this.x * v.y - this.y * v.x;\n\n\t}\n\n\t/**\n\t * Computes the square of the Euclidean length (straight-line length) from\n\t * (0, 0) to (x, y). If you are comparing the lengths of vectors, you should\n\t * compare the length squared instead as it is slightly more efficient to calculate.\n\t *\n\t * @return {number} The square length of this vector.\n\t */\n\tlengthSq() {\n\n\t\treturn this.x * this.x + this.y * this.y;\n\n\t}\n\n\t/**\n\t * Computes the  Euclidean length (straight-line length) from (0, 0) to (x, y).\n\t *\n\t * @return {number} The length of this vector.\n\t */\n\tlength() {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y );\n\n\t}\n\n\t/**\n\t * Computes the Manhattan length of this vector.\n\t *\n\t * @return {number} The length of this vector.\n\t */\n\tmanhattanLength() {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y );\n\n\t}\n\n\t/**\n\t * Converts this vector to a unit vector - that is, sets it equal to a vector\n\t * with the same direction as this one, but with a vector length of `1`.\n\t *\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tnormalize() {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t}\n\n\t/**\n\t * Computes the angle in radians of this vector with respect to the positive x-axis.\n\t *\n\t * @return {number} The angle in radians.\n\t */\n\tangle() {\n\n\t\tconst angle = Math.atan2( - this.y, - this.x ) + Math.PI;\n\n\t\treturn angle;\n\n\t}\n\n\t/**\n\t * Returns the angle between the given vector and this instance in radians.\n\t *\n\t * @param {Vector2} v - The vector to compute the angle with.\n\t * @return {number} The angle in radians.\n\t */\n\tangleTo( v ) {\n\n\t\tconst denominator = Math.sqrt( this.lengthSq() * v.lengthSq() );\n\n\t\tif ( denominator === 0 ) return Math.PI / 2;\n\n\t\tconst theta = this.dot( v ) / denominator;\n\n\t\t// clamp, to handle numerical problems\n\n\t\treturn Math.acos( clamp( theta, -1, 1 ) );\n\n\t}\n\n\t/**\n\t * Computes the distance from the given vector to this instance.\n\t *\n\t * @param {Vector2} v - The vector to compute the distance to.\n\t * @return {number} The distance.\n\t */\n\tdistanceTo( v ) {\n\n\t\treturn Math.sqrt( this.distanceToSquared( v ) );\n\n\t}\n\n\t/**\n\t * Computes the squared distance from the given vector to this instance.\n\t * If you are just comparing the distance with another distance, you should compare\n\t * the distance squared instead as it is slightly more efficient to calculate.\n\t *\n\t * @param {Vector2} v - The vector to compute the squared distance to.\n\t * @return {number} The squared distance.\n\t */\n\tdistanceToSquared( v ) {\n\n\t\tconst dx = this.x - v.x, dy = this.y - v.y;\n\t\treturn dx * dx + dy * dy;\n\n\t}\n\n\t/**\n\t * Computes the Manhattan distance from the given vector to this instance.\n\t *\n\t * @param {Vector2} v - The vector to compute the Manhattan distance to.\n\t * @return {number} The Manhattan distance.\n\t */\n\tmanhattanDistanceTo( v ) {\n\n\t\treturn Math.abs( this.x - v.x ) + Math.abs( this.y - v.y );\n\n\t}\n\n\t/**\n\t * Sets this vector to a vector with the same direction as this one, but\n\t * with the specified length.\n\t *\n\t * @param {number} length - The new length of this vector.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tsetLength( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t}\n\n\t/**\n\t * Linearly interpolates between the given vector and this instance, where\n\t * alpha is the percent distance along the line - alpha = 0 will be this\n\t * vector, and alpha = 1 will be the given one.\n\t *\n\t * @param {Vector2} v - The vector to interpolate towards.\n\t * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tlerp( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Linearly interpolates between the given vectors, where alpha is the percent\n\t * distance along the line - alpha = 0 will be first vector, and alpha = 1 will\n\t * be the second one. The result is stored in this instance.\n\t *\n\t * @param {Vector2} v1 - The first vector.\n\t * @param {Vector2} v2 - The second vector.\n\t * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tlerpVectors( v1, v2, alpha ) {\n\n\t\tthis.x = v1.x + ( v2.x - v1.x ) * alpha;\n\t\tthis.y = v1.y + ( v2.y - v1.y ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this vector is equal with the given one.\n\t *\n\t * @param {Vector2} v - The vector to test for equality.\n\t * @return {boolean} Whether this vector is equal with the given one.\n\t */\n\tequals( v ) {\n\n\t\treturn ( ( v.x === this.x ) \u0026\u0026 ( v.y === this.y ) );\n\n\t}\n\n\t/**\n\t * Sets this vector's x value to be `array[ offset ]` and y\n\t * value to be `array[ offset + 1 ]`.\n\t *\n\t * @param {Array\u003cnumber\u003e} array - An array holding the vector component values.\n\t * @param {number} [offset=0] - The offset into the array.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Writes the components of this vector to the given array. If no array is provided,\n\t * the method returns a new instance.\n\t *\n\t * @param {Array\u003cnumber\u003e} [array=[]] - The target array holding the vector components.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Array\u003cnumber\u003e} The vector components.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\n\t\treturn array;\n\n\t}\n\n\t/**\n\t * Sets the components of this vector from the given buffer attribute.\n\t *\n\t * @param {BufferAttribute} attribute - The buffer attribute holding vector data.\n\t * @param {number} index - The index into the attribute.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Rotates this vector around the given center by the given angle.\n\t *\n\t * @param {Vector2} center - The point around which to rotate.\n\t * @param {number} angle - The angle to rotate, in radians.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\trotateAround( center, angle ) {\n\n\t\tconst c = Math.cos( angle ), s = Math.sin( angle );\n\n\t\tconst x = this.x - center.x;\n\t\tconst y = this.y - center.y;\n\n\t\tthis.x = x * c - y * s + center.x;\n\t\tthis.y = x * s + y * c + center.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets each component of this vector to a pseudo-random value between `0` and\n\t * `1`, excluding `1`.\n\t *\n\t * @return {Vector2} A reference to this vector.\n\t */\n\trandom() {\n\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\n\t\treturn this;\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.x;\n\t\tyield this.y;\n\n\t}\n\n}\n\n/**\n * Class for representing a Quaternion. Quaternions are used in three.js to represent rotations.\n *\n * Iterating through a vector instance will yield its components `(x, y, z, w)` in\n * the corresponding order.\n *\n * Note that three.js expects Quaternions to be normalized.\n * ```js\n * const quaternion = new THREE.Quaternion();\n * quaternion.setFromAxisAngle( new THREE.Vector3( 0, 1, 0 ), Math.PI / 2 );\n *\n * const vector = new THREE.Vector3( 1, 0, 0 );\n * vector.applyQuaternion( quaternion );\n * ```\n */\nclass Quaternion {\n\n\t/**\n\t * Constructs a new quaternion.\n\t *\n\t * @param {number} [x=0] - The x value of this quaternion.\n\t * @param {number} [y=0] - The y value of this quaternion.\n\t * @param {number} [z=0] - The z value of this quaternion.\n\t * @param {number} [w=1] - The w value of this quaternion.\n\t */\n\tconstructor( x = 0, y = 0, z = 0, w = 1 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isQuaternion = true;\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\n\t}\n\n\t/**\n\t * Interpolates between two quaternions via SLERP. This implementation assumes the\n\t * quaternion data are managed in flat arrays.\n\t *\n\t * @param {Array\u003cnumber\u003e} dst - The destination array.\n\t * @param {number} dstOffset - An offset into the destination array.\n\t * @param {Array\u003cnumber\u003e} src0 - The source array of the first quaternion.\n\t * @param {number} srcOffset0 - An offset into the first source array.\n\t * @param {Array\u003cnumber\u003e} src1 -  The source array of the second quaternion.\n\t * @param {number} srcOffset1 - An offset into the second source array.\n\t * @param {number} t - The interpolation factor in the range `[0,1]`.\n\t * @see {@link Quaternion#slerp}\n\t */\n\tstatic slerpFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) {\n\n\t\tlet x0 = src0[ srcOffset0 + 0 ],\n\t\t\ty0 = src0[ srcOffset0 + 1 ],\n\t\t\tz0 = src0[ srcOffset0 + 2 ],\n\t\t\tw0 = src0[ srcOffset0 + 3 ];\n\n\t\tlet x1 = src1[ srcOffset1 + 0 ],\n\t\t\ty1 = src1[ srcOffset1 + 1 ],\n\t\t\tz1 = src1[ srcOffset1 + 2 ],\n\t\t\tw1 = src1[ srcOffset1 + 3 ];\n\n\t\tif ( t \u003c= 0 ) {\n\n\t\t\tdst[ dstOffset + 0 ] = x0;\n\t\t\tdst[ dstOffset + 1 ] = y0;\n\t\t\tdst[ dstOffset + 2 ] = z0;\n\t\t\tdst[ dstOffset + 3 ] = w0;\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( t \u003e= 1 ) {\n\n\t\t\tdst[ dstOffset + 0 ] = x1;\n\t\t\tdst[ dstOffset + 1 ] = y1;\n\t\t\tdst[ dstOffset + 2 ] = z1;\n\t\t\tdst[ dstOffset + 3 ] = w1;\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1 ) {\n\n\t\t\tlet dot = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1;\n\n\t\t\tif ( dot \u003c 0 ) {\n\n\t\t\t\tx1 = - x1;\n\t\t\t\ty1 = - y1;\n\t\t\t\tz1 = - z1;\n\t\t\t\tw1 = - w1;\n\n\t\t\t\tdot = - dot;\n\n\t\t\t}\n\n\t\t\tlet s = 1 - t;\n\n\t\t\tif ( dot \u003c 0.9995 ) {\n\n\t\t\t\t// slerp\n\n\t\t\t\tconst theta = Math.acos( dot );\n\t\t\t\tconst sin = Math.sin( theta );\n\n\t\t\t\ts = Math.sin( s * theta ) / sin;\n\t\t\t\tt = Math.sin( t * theta ) / sin;\n\n\t\t\t\tx0 = x0 * s + x1 * t;\n\t\t\t\ty0 = y0 * s + y1 * t;\n\t\t\t\tz0 = z0 * s + z1 * t;\n\t\t\t\tw0 = w0 * s + w1 * t;\n\n\t\t\t} else {\n\n\t\t\t\t// for small angles, lerp then normalize\n\n\t\t\t\tx0 = x0 * s + x1 * t;\n\t\t\t\ty0 = y0 * s + y1 * t;\n\t\t\t\tz0 = z0 * s + z1 * t;\n\t\t\t\tw0 = w0 * s + w1 * t;\n\n\t\t\t\tconst f = 1 / Math.sqrt( x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0 );\n\n\t\t\t\tx0 *= f;\n\t\t\t\ty0 *= f;\n\t\t\t\tz0 *= f;\n\t\t\t\tw0 *= f;\n\n\t\t\t}\n\n\t\t}\n\n\t\tdst[ dstOffset ] = x0;\n\t\tdst[ dstOffset + 1 ] = y0;\n\t\tdst[ dstOffset + 2 ] = z0;\n\t\tdst[ dstOffset + 3 ] = w0;\n\n\t}\n\n\t/**\n\t * Multiplies two quaternions. This implementation assumes the quaternion data are managed\n\t * in flat arrays.\n\t *\n\t * @param {Array\u003cnumber\u003e} dst - The destination array.\n\t * @param {number} dstOffset - An offset into the destination array.\n\t * @param {Array\u003cnumber\u003e} src0 - The source array of the first quaternion.\n\t * @param {number} srcOffset0 - An offset into the first source array.\n\t * @param {Array\u003cnumber\u003e} src1 -  The source array of the second quaternion.\n\t * @param {number} srcOffset1 - An offset into the second source array.\n\t * @return {Array\u003cnumber\u003e} The destination array.\n\t * @see {@link Quaternion#multiplyQuaternions}.\n\t */\n\tstatic multiplyQuaternionsFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1 ) {\n\n\t\tconst x0 = src0[ srcOffset0 ];\n\t\tconst y0 = src0[ srcOffset0 + 1 ];\n\t\tconst z0 = src0[ srcOffset0 + 2 ];\n\t\tconst w0 = src0[ srcOffset0 + 3 ];\n\n\t\tconst x1 = src1[ srcOffset1 ];\n\t\tconst y1 = src1[ srcOffset1 + 1 ];\n\t\tconst z1 = src1[ srcOffset1 + 2 ];\n\t\tconst w1 = src1[ srcOffset1 + 3 ];\n\n\t\tdst[ dstOffset ] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1;\n\t\tdst[ dstOffset + 1 ] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1;\n\t\tdst[ dstOffset + 2 ] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1;\n\t\tdst[ dstOffset + 3 ] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1;\n\n\t\treturn dst;\n\n\t}\n\n\t/**\n\t * The x value of this quaternion.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget x() {\n\n\t\treturn this._x;\n\n\t}\n\n\tset x( value ) {\n\n\t\tthis._x = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\t/**\n\t * The y value of this quaternion.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget y() {\n\n\t\treturn this._y;\n\n\t}\n\n\tset y( value ) {\n\n\t\tthis._y = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\t/**\n\t * The z value of this quaternion.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget z() {\n\n\t\treturn this._z;\n\n\t}\n\n\tset z( value ) {\n\n\t\tthis._z = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\t/**\n\t * The w value of this quaternion.\n\t *\n\t * @type {number}\n\t * @default 1\n\t */\n\tget w() {\n\n\t\treturn this._w;\n\n\t}\n\n\tset w( value ) {\n\n\t\tthis._w = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\t/**\n\t * Sets the quaternion components.\n\t *\n\t * @param {number} x - The x value of this quaternion.\n\t * @param {number} y - The y value of this quaternion.\n\t * @param {number} z - The z value of this quaternion.\n\t * @param {number} w - The w value of this quaternion.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tset( x, y, z, w ) {\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new quaternion with copied values from this instance.\n\t *\n\t * @return {Quaternion} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor( this._x, this._y, this._z, this._w );\n\n\t}\n\n\t/**\n\t * Copies the values of the given quaternion to this instance.\n\t *\n\t * @param {Quaternion} quaternion - The quaternion to copy.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tcopy( quaternion ) {\n\n\t\tthis._x = quaternion.x;\n\t\tthis._y = quaternion.y;\n\t\tthis._z = quaternion.z;\n\t\tthis._w = quaternion.w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this quaternion from the rotation specified by the given\n\t * Euler angles.\n\t *\n\t * @param {Euler} euler - The Euler angles.\n\t * @param {boolean} [update=true] - Whether the internal `onChange` callback should be executed or not.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tsetFromEuler( euler, update = true ) {\n\n\t\tconst x = euler._x, y = euler._y, z = euler._z, order = euler._order;\n\n\t\t// http://www.mathworks.com/matlabcentral/fileexchange/\n\t\t// \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n\t\t//\tcontent/SpinCalc.m\n\n\t\tconst cos = Math.cos;\n\t\tconst sin = Math.sin;\n\n\t\tconst c1 = cos( x / 2 );\n\t\tconst c2 = cos( y / 2 );\n\t\tconst c3 = cos( z / 2 );\n\n\t\tconst s1 = sin( x / 2 );\n\t\tconst s2 = sin( y / 2 );\n\t\tconst s3 = sin( z / 2 );\n\n\t\tswitch ( order ) {\n\n\t\t\tcase 'XYZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\twarn( 'Quaternion: .setFromEuler() encountered an unknown order: ' + order );\n\n\t\t}\n\n\t\tif ( update === true ) this._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this quaternion from the given axis and angle.\n\t *\n\t * @param {Vector3} axis - The normalized axis.\n\t * @param {number} angle - The angle in radians.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tsetFromAxisAngle( axis, angle ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm\n\n\t\tconst halfAngle = angle / 2, s = Math.sin( halfAngle );\n\n\t\tthis._x = axis.x * s;\n\t\tthis._y = axis.y * s;\n\t\tthis._z = axis.z * s;\n\t\tthis._w = Math.cos( halfAngle );\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this quaternion from the given rotation matrix.\n\t *\n\t * @param {Matrix4} m - A 4x4 matrix of which the upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled).\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tsetFromRotationMatrix( m ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tconst te = m.elements,\n\n\t\t\tm11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ],\n\t\t\tm21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ],\n\t\t\tm31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ],\n\n\t\t\ttrace = m11 + m22 + m33;\n\n\t\tif ( trace \u003e 0 ) {\n\n\t\t\tconst s = 0.5 / Math.sqrt( trace + 1.0 );\n\n\t\t\tthis._w = 0.25 / s;\n\t\t\tthis._x = ( m32 - m23 ) * s;\n\t\t\tthis._y = ( m13 - m31 ) * s;\n\t\t\tthis._z = ( m21 - m12 ) * s;\n\n\t\t} else if ( m11 \u003e m22 \u0026\u0026 m11 \u003e m33 ) {\n\n\t\t\tconst s = 2.0 * Math.sqrt( 1.0 + m11 - m22 - m33 );\n\n\t\t\tthis._w = ( m32 - m23 ) / s;\n\t\t\tthis._x = 0.25 * s;\n\t\t\tthis._y = ( m12 + m21 ) / s;\n\t\t\tthis._z = ( m13 + m31 ) / s;\n\n\t\t} else if ( m22 \u003e m33 ) {\n\n\t\t\tconst s = 2.0 * Math.sqrt( 1.0 + m22 - m11 - m33 );\n\n\t\t\tthis._w = ( m13 - m31 ) / s;\n\t\t\tthis._x = ( m12 + m21 ) / s;\n\t\t\tthis._y = 0.25 * s;\n\t\t\tthis._z = ( m23 + m32 ) / s;\n\n\t\t} else {\n\n\t\t\tconst s = 2.0 * Math.sqrt( 1.0 + m33 - m11 - m22 );\n\n\t\t\tthis._w = ( m21 - m12 ) / s;\n\t\t\tthis._x = ( m13 + m31 ) / s;\n\t\t\tthis._y = ( m23 + m32 ) / s;\n\t\t\tthis._z = 0.25 * s;\n\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this quaternion to the rotation required to rotate the direction vector\n\t * `vFrom` to the direction vector `vTo`.\n\t *\n\t * @param {Vector3} vFrom - The first (normalized) direction vector.\n\t * @param {Vector3} vTo - The second (normalized) direction vector.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tsetFromUnitVectors( vFrom, vTo ) {\n\n\t\t// assumes direction vectors vFrom and vTo are normalized\n\n\t\tlet r = vFrom.dot( vTo ) + 1;\n\n\t\tif ( r \u003c 1e-8 ) { // the epsilon value has been discussed in #31286\n\n\t\t\t// vFrom and vTo point in opposite directions\n\n\t\t\tr = 0;\n\n\t\t\tif ( Math.abs( vFrom.x ) \u003e Math.abs( vFrom.z ) ) {\n\n\t\t\t\tthis._x = - vFrom.y;\n\t\t\t\tthis._y = vFrom.x;\n\t\t\t\tthis._z = 0;\n\t\t\t\tthis._w = r;\n\n\t\t\t} else {\n\n\t\t\t\tthis._x = 0;\n\t\t\t\tthis._y = - vFrom.z;\n\t\t\t\tthis._z = vFrom.y;\n\t\t\t\tthis._w = r;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3\n\n\t\t\tthis._x = vFrom.y * vTo.z - vFrom.z * vTo.y;\n\t\t\tthis._y = vFrom.z * vTo.x - vFrom.x * vTo.z;\n\t\t\tthis._z = vFrom.x * vTo.y - vFrom.y * vTo.x;\n\t\t\tthis._w = r;\n\n\t\t}\n\n\t\treturn this.normalize();\n\n\t}\n\n\t/**\n\t * Returns the angle between this quaternion and the given one in radians.\n\t *\n\t * @param {Quaternion} q - The quaternion to compute the angle with.\n\t * @return {number} The angle in radians.\n\t */\n\tangleTo( q ) {\n\n\t\treturn 2 * Math.acos( Math.abs( clamp( this.dot( q ), -1, 1 ) ) );\n\n\t}\n\n\t/**\n\t * Rotates this quaternion by a given angular step to the given quaternion.\n\t * The method ensures that the final quaternion will not overshoot `q`.\n\t *\n\t * @param {Quaternion} q - The target quaternion.\n\t * @param {number} step - The angular step in radians.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\trotateTowards( q, step ) {\n\n\t\tconst angle = this.angleTo( q );\n\n\t\tif ( angle === 0 ) return this;\n\n\t\tconst t = Math.min( 1, step / angle );\n\n\t\tthis.slerp( q, t );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this quaternion to the identity quaternion; that is, to the\n\t * quaternion that represents \"no rotation\".\n\t *\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tidentity() {\n\n\t\treturn this.set( 0, 0, 0, 1 );\n\n\t}\n\n\t/**\n\t * Inverts this quaternion via {@link Quaternion#conjugate}. The\n\t * quaternion is assumed to have unit length.\n\t *\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tinvert() {\n\n\t\treturn this.conjugate();\n\n\t}\n\n\t/**\n\t * Returns the rotational conjugate of this quaternion. The conjugate of a\n\t * quaternion represents the same rotation in the opposite direction about\n\t * the rotational axis.\n\t *\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tconjugate() {\n\n\t\tthis._x *= -1;\n\t\tthis._y *= -1;\n\t\tthis._z *= -1;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Calculates the dot product of this quaternion and the given one.\n\t *\n\t * @param {Quaternion} v - The quaternion to compute the dot product with.\n\t * @return {number} The result of the dot product.\n\t */\n\tdot( v ) {\n\n\t\treturn this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w;\n\n\t}\n\n\t/**\n\t * Computes the squared Euclidean length (straight-line length) of this quaternion,\n\t * considered as a 4 dimensional vector. This can be useful if you are comparing the\n\t * lengths of two quaternions, as this is a slightly more efficient calculation than\n\t * {@link Quaternion#length}.\n\t *\n\t * @return {number} The squared Euclidean length.\n\t */\n\tlengthSq() {\n\n\t\treturn this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n\n\t}\n\n\t/**\n\t * Computes the Euclidean length (straight-line length) of this quaternion,\n\t * considered as a 4 dimensional vector.\n\t *\n\t * @return {number} The Euclidean length.\n\t */\n\tlength() {\n\n\t\treturn Math.sqrt( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w );\n\n\t}\n\n\t/**\n\t * Normalizes this quaternion - that is, calculated the quaternion that performs\n\t * the same rotation as this one, but has a length equal to `1`.\n\t *\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tnormalize() {\n\n\t\tlet l = this.length();\n\n\t\tif ( l === 0 ) {\n\n\t\t\tthis._x = 0;\n\t\t\tthis._y = 0;\n\t\t\tthis._z = 0;\n\t\t\tthis._w = 1;\n\n\t\t} else {\n\n\t\t\tl = 1 / l;\n\n\t\t\tthis._x = this._x * l;\n\t\t\tthis._y = this._y * l;\n\t\t\tthis._z = this._z * l;\n\t\t\tthis._w = this._w * l;\n\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies this quaternion by the given one.\n\t *\n\t * @param {Quaternion} q - The quaternion.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tmultiply( q ) {\n\n\t\treturn this.multiplyQuaternions( this, q );\n\n\t}\n\n\t/**\n\t * Pre-multiplies this quaternion by the given one.\n\t *\n\t * @param {Quaternion} q - The quaternion.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tpremultiply( q ) {\n\n\t\treturn this.multiplyQuaternions( q, this );\n\n\t}\n\n\t/**\n\t * Multiplies the given quaternions and stores the result in this instance.\n\t *\n\t * @param {Quaternion} a - The first quaternion.\n\t * @param {Quaternion} b - The second quaternion.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tmultiplyQuaternions( a, b ) {\n\n\t\t// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm\n\n\t\tconst qax = a._x, qay = a._y, qaz = a._z, qaw = a._w;\n\t\tconst qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w;\n\n\t\tthis._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;\n\t\tthis._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;\n\t\tthis._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;\n\t\tthis._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Performs a spherical linear interpolation between quaternions.\n\t *\n\t * @param {Quaternion} qb - The target quaternion.\n\t * @param {number} t - The interpolation factor in the closed interval `[0, 1]`.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tslerp( qb, t ) {\n\n\t\tif ( t \u003c= 0 ) return this;\n\n\t\tif ( t \u003e= 1 ) return this.copy( qb ); // copy calls _onChangeCallback()\n\n\t\tlet x = qb._x, y = qb._y, z = qb._z, w = qb._w;\n\n\t\tlet dot = this.dot( qb );\n\n\t\tif ( dot \u003c 0 ) {\n\n\t\t\tx = - x;\n\t\t\ty = - y;\n\t\t\tz = - z;\n\t\t\tw = - w;\n\n\t\t\tdot = - dot;\n\n\t\t}\n\n\t\tlet s = 1 - t;\n\n\t\tif ( dot \u003c 0.9995 ) {\n\n\t\t\t// slerp\n\n\t\t\tconst theta = Math.acos( dot );\n\t\t\tconst sin = Math.sin( theta );\n\n\t\t\ts = Math.sin( s * theta ) / sin;\n\t\t\tt = Math.sin( t * theta ) / sin;\n\n\t\t\tthis._x = this._x * s + x * t;\n\t\t\tthis._y = this._y * s + y * t;\n\t\t\tthis._z = this._z * s + z * t;\n\t\t\tthis._w = this._w * s + w * t;\n\n\t\t\tthis._onChangeCallback();\n\n\t\t} else {\n\n\t\t\t// for small angles, lerp then normalize\n\n\t\t\tthis._x = this._x * s + x * t;\n\t\t\tthis._y = this._y * s + y * t;\n\t\t\tthis._z = this._z * s + z * t;\n\t\t\tthis._w = this._w * s + w * t;\n\n\t\t\tthis.normalize(); // normalize calls _onChangeCallback()\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Performs a spherical linear interpolation between the given quaternions\n\t * and stores the result in this quaternion.\n\t *\n\t * @param {Quaternion} qa - The source quaternion.\n\t * @param {Quaternion} qb - The target quaternion.\n\t * @param {number} t - The interpolation factor in the closed interval `[0, 1]`.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tslerpQuaternions( qa, qb, t ) {\n\n\t\treturn this.copy( qa ).slerp( qb, t );\n\n\t}\n\n\t/**\n\t * Sets this quaternion to a uniformly random, normalized quaternion.\n\t *\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\trandom() {\n\n\t\t// Ken Shoemake\n\t\t// Uniform random rotations\n\t\t// D. Kirk, editor, Graphics Gems III, pages 124-132. Academic Press, New York, 1992.\n\n\t\tconst theta1 = 2 * Math.PI * Math.random();\n\t\tconst theta2 = 2 * Math.PI * Math.random();\n\n\t\tconst x0 = Math.random();\n\t\tconst r1 = Math.sqrt( 1 - x0 );\n\t\tconst r2 = Math.sqrt( x0 );\n\n\t\treturn this.set(\n\t\t\tr1 * Math.sin( theta1 ),\n\t\t\tr1 * Math.cos( theta1 ),\n\t\t\tr2 * Math.sin( theta2 ),\n\t\t\tr2 * Math.cos( theta2 ),\n\t\t);\n\n\t}\n\n\t/**\n\t * Returns `true` if this quaternion is equal with the given one.\n\t *\n\t * @param {Quaternion} quaternion - The quaternion to test for equality.\n\t * @return {boolean} Whether this quaternion is equal with the given one.\n\t */\n\tequals( quaternion ) {\n\n\t\treturn ( quaternion._x === this._x ) \u0026\u0026 ( quaternion._y === this._y ) \u0026\u0026 ( quaternion._z === this._z ) \u0026\u0026 ( quaternion._w === this._w );\n\n\t}\n\n\t/**\n\t * Sets this quaternion's components from the given array.\n\t *\n\t * @param {Array\u003cnumber\u003e} array - An array holding the quaternion component values.\n\t * @param {number} [offset=0] - The offset into the array.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis._x = array[ offset ];\n\t\tthis._y = array[ offset + 1 ];\n\t\tthis._z = array[ offset + 2 ];\n\t\tthis._w = array[ offset + 3 ];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Writes the components of this quaternion to the given array. If no array is provided,\n\t * the method returns a new instance.\n\t *\n\t * @param {Array\u003cnumber\u003e} [array=[]] - The target array holding the quaternion components.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Array\u003cnumber\u003e} The quaternion components.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this._x;\n\t\tarray[ offset + 1 ] = this._y;\n\t\tarray[ offset + 2 ] = this._z;\n\t\tarray[ offset + 3 ] = this._w;\n\n\t\treturn array;\n\n\t}\n\n\t/**\n\t * Sets the components of this quaternion from the given buffer attribute.\n\t *\n\t * @param {BufferAttribute} attribute - The buffer attribute holding quaternion data.\n\t * @param {number} index - The index into the attribute.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis._x = attribute.getX( index );\n\t\tthis._y = attribute.getY( index );\n\t\tthis._z = attribute.getZ( index );\n\t\tthis._w = attribute.getW( index );\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * This methods defines the serialization result of this class. Returns the\n\t * numerical elements of this quaternion in an array of format `[x, y, z, w]`.\n\t *\n\t * @return {Array\u003cnumber\u003e} The serialized quaternion.\n\t */\n\ttoJSON() {\n\n\t\treturn this.toArray();\n\n\t}\n\n\t_onChange( callback ) {\n\n\t\tthis._onChangeCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._w;\n\n\t}\n\n}\n\n/**\n * Class representing a 3D vector. A 3D vector is an ordered triplet of numbers\n * (labeled x, y and z), which can be used to represent a number of things, such as:\n *\n * - A point in 3D space.\n * - A direction and length in 3D space. In three.js the length will\n * always be the Euclidean distance(straight-line distance) from `(0, 0, 0)` to `(x, y, z)`\n * and the direction is also measured from `(0, 0, 0)` towards `(x, y, z)`.\n * - Any arbitrary ordered triplet of numbers.\n *\n * There are other things a 3D vector can be used to represent, such as\n * momentum vectors and so on, however these are the most\n * common uses in three.js.\n *\n * Iterating through a vector instance will yield its components `(x, y, z)` in\n * the corresponding order.\n * ```js\n * const a = new THREE.Vector3( 0, 1, 0 );\n *\n * //no arguments; will be initialised to (0, 0, 0)\n * const b = new THREE.Vector3( );\n *\n * const d = a.distanceTo( b );\n * ```\n */\nclass Vector3 {\n\n\t/**\n\t * Constructs a new 3D vector.\n\t *\n\t * @param {number} [x=0] - The x value of this vector.\n\t * @param {number} [y=0] - The y value of this vector.\n\t * @param {number} [z=0] - The z value of this vector.\n\t */\n\tconstructor( x = 0, y = 0, z = 0 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tVector3.prototype.isVector3 = true;\n\n\t\t/**\n\t\t * The x value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.x = x;\n\n\t\t/**\n\t\t * The y value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.y = y;\n\n\t\t/**\n\t\t * The z value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.z = z;\n\n\t}\n\n\t/**\n\t * Sets the vector components.\n\t *\n\t * @param {number} x - The value of the x component.\n\t * @param {number} y - The value of the y component.\n\t * @param {number} z - The value of the z component.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tset( x, y, z ) {\n\n\t\tif ( z === undefined ) z = this.z; // sprite.scale.set(x,y)\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components to the same value.\n\t *\n\t * @param {number} scalar - The value to set for all vector components.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetScalar( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's x component to the given value\n\t *\n\t * @param {number} x - The value to set.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetX( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's y component to the given value\n\t *\n\t * @param {number} y - The value to set.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetY( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's z component to the given value\n\t *\n\t * @param {number} z - The value to set.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetZ( z ) {\n\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Allows to set a vector component with an index.\n\t *\n\t * @param {number} index - The component index. `0` equals to x, `1` equals to y, `2` equals to z.\n\t * @param {number} value - The value to set.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetComponent( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tcase 2: this.z = value; break;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the value of the vector component which matches the given index.\n\t *\n\t * @param {number} index - The component index. `0` equals to x, `1` equals to y, `2` equals to z.\n\t * @return {number} A vector component value.\n\t */\n\tgetComponent( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tcase 2: return this.z;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns a new vector with copied values from this instance.\n\t *\n\t * @return {Vector3} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor( this.x, this.y, this.z );\n\n\t}\n\n\t/**\n\t * Copies the values of the given vector to this instance.\n\t *\n\t * @param {Vector3} v - The vector to copy.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tcopy( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vector to this instance.\n\t *\n\t * @param {Vector3} v - The vector to add.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tadd( v ) {\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given scalar value to all components of this instance.\n\t *\n\t * @param {number} s - The scalar to add.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\taddScalar( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vectors and stores the result in this instance.\n\t *\n\t * @param {Vector3} a - The first vector.\n\t * @param {Vector3} b - The second vector.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\taddVectors( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vector scaled by the given factor to this instance.\n\t *\n\t * @param {Vector3|Vector4} v - The vector.\n\t * @param {number} s - The factor that scales `v`.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\taddScaledVector( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given vector from this instance.\n\t *\n\t * @param {Vector3} v - The vector to subtract.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsub( v ) {\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given scalar value from all components of this instance.\n\t *\n\t * @param {number} s - The scalar to subtract.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsubScalar( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given vectors and stores the result in this instance.\n\t *\n\t * @param {Vector3} a - The first vector.\n\t * @param {Vector3} b - The second vector.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsubVectors( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given vector with this instance.\n\t *\n\t * @param {Vector3} v - The vector to multiply.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tmultiply( v ) {\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given scalar value with all components of this instance.\n\t *\n\t * @param {number} scalar - The scalar to multiply.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tmultiplyScalar( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given vectors and stores the result in this instance.\n\t *\n\t * @param {Vector3} a - The first vector.\n\t * @param {Vector3} b - The second vector.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tmultiplyVectors( a, b ) {\n\n\t\tthis.x = a.x * b.x;\n\t\tthis.y = a.y * b.y;\n\t\tthis.z = a.z * b.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Applies the given Euler rotation to this vector.\n\t *\n\t * @param {Euler} euler - The Euler angles.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tapplyEuler( euler ) {\n\n\t\treturn this.applyQuaternion( _quaternion$4.setFromEuler( euler ) );\n\n\t}\n\n\t/**\n\t * Applies a rotation specified by an axis and an angle to this vector.\n\t *\n\t * @param {Vector3} axis - A normalized vector representing the rotation axis.\n\t * @param {number} angle - The angle in radians.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tapplyAxisAngle( axis, angle ) {\n\n\t\treturn this.applyQuaternion( _quaternion$4.setFromAxisAngle( axis, angle ) );\n\n\t}\n\n\t/**\n\t * Multiplies this vector with the given 3x3 matrix.\n\t *\n\t * @param {Matrix3} m - The 3x3 matrix.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tapplyMatrix3( m ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ] * z;\n\t\tthis.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ] * z;\n\t\tthis.z = e[ 2 ] * x + e[ 5 ] * y + e[ 8 ] * z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies this vector by the given normal matrix and normalizes\n\t * the result.\n\t *\n\t * @param {Matrix3} m - The normal matrix.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tapplyNormalMatrix( m ) {\n\n\t\treturn this.applyMatrix3( m ).normalize();\n\n\t}\n\n\t/**\n\t * Multiplies this vector (with an implicit 1 in the 4th dimension) by m, and\n\t * divides by perspective.\n\t *\n\t * @param {Matrix4} m - The matrix to apply.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tapplyMatrix4( m ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z;\n\t\tconst e = m.elements;\n\n\t\tconst w = 1 / ( e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] );\n\n\t\tthis.x = ( e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] ) * w;\n\t\tthis.y = ( e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] ) * w;\n\t\tthis.z = ( e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] ) * w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Applies the given Quaternion to this vector.\n\t *\n\t * @param {Quaternion} q - The Quaternion.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tapplyQuaternion( q ) {\n\n\t\t// quaternion q is assumed to have unit length\n\n\t\tconst vx = this.x, vy = this.y, vz = this.z;\n\t\tconst qx = q.x, qy = q.y, qz = q.z, qw = q.w;\n\n\t\t// t = 2 * cross( q.xyz, v );\n\t\tconst tx = 2 * ( qy * vz - qz * vy );\n\t\tconst ty = 2 * ( qz * vx - qx * vz );\n\t\tconst tz = 2 * ( qx * vy - qy * vx );\n\n\t\t// v + q.w * t + cross( q.xyz, t );\n\t\tthis.x = vx + qw * tx + qy * tz - qz * ty;\n\t\tthis.y = vy + qw * ty + qz * tx - qx * tz;\n\t\tthis.z = vz + qw * tz + qx * ty - qy * tx;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Projects this vector from world space into the camera's normalized\n\t * device coordinate (NDC) space.\n\t *\n\t * @param {Camera} camera - The camera.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tproject( camera ) {\n\n\t\treturn this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix );\n\n\t}\n\n\t/**\n\t * Unprojects this vector from the camera's normalized device coordinate (NDC)\n\t * space into world space.\n\t *\n\t * @param {Camera} camera - The camera.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tunproject( camera ) {\n\n\t\treturn this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld );\n\n\t}\n\n\t/**\n\t * Transforms the direction of this vector by a matrix (the upper left 3 x 3\n\t * subset of the given 4x4 matrix and then normalizes the result.\n\t *\n\t * @param {Matrix4} m - The matrix.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\ttransformDirection( m ) {\n\n\t\t// input: THREE.Matrix4 affine matrix\n\t\t// vector interpreted as a direction\n\n\t\tconst x = this.x, y = this.y, z = this.z;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z;\n\t\tthis.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z;\n\t\tthis.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z;\n\n\t\treturn this.normalize();\n\n\t}\n\n\t/**\n\t * Divides this instance by the given vector.\n\t *\n\t * @param {Vector3} v - The vector to divide.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tdivide( v ) {\n\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\tthis.z /= v.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Divides this vector by the given scalar.\n\t *\n\t * @param {number} scalar - The scalar to divide.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tdivideScalar( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t}\n\n\t/**\n\t * If this vector's x, y or z value is greater than the given vector's x, y or z\n\t * value, replace that value with the corresponding min value.\n\t *\n\t * @param {Vector3} v - The vector.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tmin( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\t\tthis.z = Math.min( this.z, v.z );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y or z value is less than the given vector's x, y or z\n\t * value, replace that value with the corresponding max value.\n\t *\n\t * @param {Vector3} v - The vector.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tmax( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\t\tthis.z = Math.max( this.z, v.z );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y or z value is greater than the max vector's x, y or z\n\t * value, it is replaced by the corresponding value.\n\t * If this vector's x, y or z value is less than the min vector's x, y or z value,\n\t * it is replaced by the corresponding value.\n\t *\n\t * @param {Vector3} min - The minimum x, y and z values.\n\t * @param {Vector3} max - The maximum x, y and z values in the desired range.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tclamp( min, max ) {\n\n\t\t// assumes min \u003c max, componentwise\n\n\t\tthis.x = clamp( this.x, min.x, max.x );\n\t\tthis.y = clamp( this.y, min.y, max.y );\n\t\tthis.z = clamp( this.z, min.z, max.z );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y or z values are greater than the max value, they are\n\t * replaced by the max value.\n\t * If this vector's x, y or z values are less than the min value, they are\n\t * replaced by the min value.\n\t *\n\t * @param {number} minVal - The minimum value the components will be clamped to.\n\t * @param {number} maxVal - The maximum value the components will be clamped to.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tclampScalar( minVal, maxVal ) {\n\n\t\tthis.x = clamp( this.x, minVal, maxVal );\n\t\tthis.y = clamp( this.y, minVal, maxVal );\n\t\tthis.z = clamp( this.z, minVal, maxVal );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's length is greater than the max value, it is replaced by\n\t * the max value.\n\t * If this vector's length is less than the min value, it is replaced by the\n\t * min value.\n\t *\n\t * @param {number} min - The minimum value the vector length will be clamped to.\n\t * @param {number} max - The maximum value the vector length will be clamped to.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tclampLength( min, max ) {\n\n\t\tconst length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( clamp( length, min, max ) );\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded down to the nearest integer value.\n\t *\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tfloor() {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\t\tthis.z = Math.floor( this.z );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded up to the nearest integer value.\n\t *\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tceil() {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\t\tthis.z = Math.ceil( this.z );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded to the nearest integer value\n\t *\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tround() {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\t\tthis.z = Math.round( this.z );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded towards zero (up if negative,\n\t * down if positive) to an integer value.\n\t *\n\t * @return {Vector3} A reference to this vector.\n\t */\n\troundToZero() {\n\n\t\tthis.x = Math.trunc( this.x );\n\t\tthis.y = Math.trunc( this.y );\n\t\tthis.z = Math.trunc( this.z );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Inverts this vector - i.e. sets x = -x, y = -y and z = -z.\n\t *\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tnegate() {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\t\tthis.z = - this.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Calculates the dot product of the given vector with this instance.\n\t *\n\t * @param {Vector3} v - The vector to compute the dot product with.\n\t * @return {number} The result of the dot product.\n\t */\n\tdot( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\n\n\t}\n\n\t/**\n\t * Computes the square of the Euclidean length (straight-line length) from\n\t * (0, 0, 0) to (x, y, z). If you are comparing the lengths of vectors, you should\n\t * compare the length squared instead as it is slightly more efficient to calculate.\n\t *\n\t * @return {number} The square length of this vector.\n\t */\n\tlengthSq() {\n\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z;\n\n\t}\n\n\t/**\n\t * Computes the  Euclidean length (straight-line length) from (0, 0, 0) to (x, y, z).\n\t *\n\t * @return {number} The length of this vector.\n\t */\n\tlength() {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z );\n\n\t}\n\n\t/**\n\t * Computes the Manhattan length of this vector.\n\t *\n\t * @return {number} The length of this vector.\n\t */\n\tmanhattanLength() {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z );\n\n\t}\n\n\t/**\n\t * Converts this vector to a unit vector - that is, sets it equal to a vector\n\t * with the same direction as this one, but with a vector length of `1`.\n\t *\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tnormalize() {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t}\n\n\t/**\n\t * Sets this vector to a vector with the same direction as this one, but\n\t * with the specified length.\n\t *\n\t * @param {number} length - The new length of this vector.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetLength( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t}\n\n\t/**\n\t * Linearly interpolates between the given vector and this instance, where\n\t * alpha is the percent distance along the line - alpha = 0 will be this\n\t * vector, and alpha = 1 will be the given one.\n\t *\n\t * @param {Vector3} v - The vector to interpolate towards.\n\t * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tlerp( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\t\tthis.z += ( v.z - this.z ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Linearly interpolates between the given vectors, where alpha is the percent\n\t * distance along the line - alpha = 0 will be first vector, and alpha = 1 will\n\t * be the second one. The result is stored in this instance.\n\t *\n\t * @param {Vector3} v1 - The first vector.\n\t * @param {Vector3} v2 - The second vector.\n\t * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tlerpVectors( v1, v2, alpha ) {\n\n\t\tthis.x = v1.x + ( v2.x - v1.x ) * alpha;\n\t\tthis.y = v1.y + ( v2.y - v1.y ) * alpha;\n\t\tthis.z = v1.z + ( v2.z - v1.z ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Calculates the cross product of the given vector with this instance.\n\t *\n\t * @param {Vector3} v - The vector to compute the cross product with.\n\t * @return {Vector3} The result of the cross product.\n\t */\n\tcross( v ) {\n\n\t\treturn this.crossVectors( this, v );\n\n\t}\n\n\t/**\n\t * Calculates the cross product of the given vectors and stores the result\n\t * in this instance.\n\t *\n\t * @param {Vector3} a - The first vector.\n\t * @param {Vector3} b - The second vector.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tcrossVectors( a, b ) {\n\n\t\tconst ax = a.x, ay = a.y, az = a.z;\n\t\tconst bx = b.x, by = b.y, bz = b.z;\n\n\t\tthis.x = ay * bz - az * by;\n\t\tthis.y = az * bx - ax * bz;\n\t\tthis.z = ax * by - ay * bx;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Projects this vector onto the given one.\n\t *\n\t * @param {Vector3} v - The vector to project to.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tprojectOnVector( v ) {\n\n\t\tconst denominator = v.lengthSq();\n\n\t\tif ( denominator === 0 ) return this.set( 0, 0, 0 );\n\n\t\tconst scalar = v.dot( this ) / denominator;\n\n\t\treturn this.copy( v ).multiplyScalar( scalar );\n\n\t}\n\n\t/**\n\t * Projects this vector onto a plane by subtracting this\n\t * vector projected onto the plane's normal from this vector.\n\t *\n\t * @param {Vector3} planeNormal - The plane normal.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tprojectOnPlane( planeNormal ) {\n\n\t\t_vector$c.copy( this ).projectOnVector( planeNormal );\n\n\t\treturn this.sub( _vector$c );\n\n\t}\n\n\t/**\n\t * Reflects this vector off a plane orthogonal to the given normal vector.\n\t *\n\t * @param {Vector3} normal - The (normalized) normal vector.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\treflect( normal ) {\n\n\t\treturn this.sub( _vector$c.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) );\n\n\t}\n\t/**\n\t * Returns the angle between the given vector and this instance in radians.\n\t *\n\t * @param {Vector3} v - The vector to compute the angle with.\n\t * @return {number} The angle in radians.\n\t */\n\tangleTo( v ) {\n\n\t\tconst denominator = Math.sqrt( this.lengthSq() * v.lengthSq() );\n\n\t\tif ( denominator === 0 ) return Math.PI / 2;\n\n\t\tconst theta = this.dot( v ) / denominator;\n\n\t\t// clamp, to handle numerical problems\n\n\t\treturn Math.acos( clamp( theta, -1, 1 ) );\n\n\t}\n\n\t/**\n\t * Computes the distance from the given vector to this instance.\n\t *\n\t * @param {Vector3} v - The vector to compute the distance to.\n\t * @return {number} The distance.\n\t */\n\tdistanceTo( v ) {\n\n\t\treturn Math.sqrt( this.distanceToSquared( v ) );\n\n\t}\n\n\t/**\n\t * Computes the squared distance from the given vector to this instance.\n\t * If you are just comparing the distance with another distance, you should compare\n\t * the distance squared instead as it is slightly more efficient to calculate.\n\t *\n\t * @param {Vector3} v - The vector to compute the squared distance to.\n\t * @return {number} The squared distance.\n\t */\n\tdistanceToSquared( v ) {\n\n\t\tconst dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z;\n\n\t\treturn dx * dx + dy * dy + dz * dz;\n\n\t}\n\n\t/**\n\t * Computes the Manhattan distance from the given vector to this instance.\n\t *\n\t * @param {Vector3} v - The vector to compute the Manhattan distance to.\n\t * @return {number} The Manhattan distance.\n\t */\n\tmanhattanDistanceTo( v ) {\n\n\t\treturn Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z );\n\n\t}\n\n\t/**\n\t * Sets the vector components from the given spherical coordinates.\n\t *\n\t * @param {Spherical} s - The spherical coordinates.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromSpherical( s ) {\n\n\t\treturn this.setFromSphericalCoords( s.radius, s.phi, s.theta );\n\n\t}\n\n\t/**\n\t * Sets the vector components from the given spherical coordinates.\n\t *\n\t * @param {number} radius - The radius.\n\t * @param {number} phi - The phi angle in radians.\n\t * @param {number} theta - The theta angle in radians.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromSphericalCoords( radius, phi, theta ) {\n\n\t\tconst sinPhiRadius = Math.sin( phi ) * radius;\n\n\t\tthis.x = sinPhiRadius * Math.sin( theta );\n\t\tthis.y = Math.cos( phi ) * radius;\n\t\tthis.z = sinPhiRadius * Math.cos( theta );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components from the given cylindrical coordinates.\n\t *\n\t * @param {Cylindrical} c - The cylindrical coordinates.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromCylindrical( c ) {\n\n\t\treturn this.setFromCylindricalCoords( c.radius, c.theta, c.y );\n\n\t}\n\n\t/**\n\t * Sets the vector components from the given cylindrical coordinates.\n\t *\n\t * @param {number} radius - The radius.\n\t * @param {number} theta - The theta angle in radians.\n\t * @param {number} y - The y value.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromCylindricalCoords( radius, theta, y ) {\n\n\t\tthis.x = radius * Math.sin( theta );\n\t\tthis.y = y;\n\t\tthis.z = radius * Math.cos( theta );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components to the position elements of the\n\t * given transformation matrix.\n\t *\n\t * @param {Matrix4} m - The 4x4 matrix.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromMatrixPosition( m ) {\n\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 12 ];\n\t\tthis.y = e[ 13 ];\n\t\tthis.z = e[ 14 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components to the scale elements of the\n\t * given transformation matrix.\n\t *\n\t * @param {Matrix4} m - The 4x4 matrix.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromMatrixScale( m ) {\n\n\t\tconst sx = this.setFromMatrixColumn( m, 0 ).length();\n\t\tconst sy = this.setFromMatrixColumn( m, 1 ).length();\n\t\tconst sz = this.setFromMatrixColumn( m, 2 ).length();\n\n\t\tthis.x = sx;\n\t\tthis.y = sy;\n\t\tthis.z = sz;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components from the specified matrix column.\n\t *\n\t * @param {Matrix4} m - The 4x4 matrix.\n\t * @param {number} index - The column index.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromMatrixColumn( m, index ) {\n\n\t\treturn this.fromArray( m.elements, index * 4 );\n\n\t}\n\n\t/**\n\t * Sets the vector components from the specified matrix column.\n\t *\n\t * @param {Matrix3} m - The 3x3 matrix.\n\t * @param {number} index - The column index.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromMatrix3Column( m, index ) {\n\n\t\treturn this.fromArray( m.elements, index * 3 );\n\n\t}\n\n\t/**\n\t * Sets the vector components from the given Euler angles.\n\t *\n\t * @param {Euler} e - The Euler angles to set.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromEuler( e ) {\n\n\t\tthis.x = e._x;\n\t\tthis.y = e._y;\n\t\tthis.z = e._z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components from the RGB components of the\n\t * given color.\n\t *\n\t * @param {Color} c - The color to set.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromColor( c ) {\n\n\t\tthis.x = c.r;\n\t\tthis.y = c.g;\n\t\tthis.z = c.b;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this vector is equal with the given one.\n\t *\n\t * @param {Vector3} v - The vector to test for equality.\n\t * @return {boolean} Whether this vector is equal with the given one.\n\t */\n\tequals( v ) {\n\n\t\treturn ( ( v.x === this.x ) \u0026\u0026 ( v.y === this.y ) \u0026\u0026 ( v.z === this.z ) );\n\n\t}\n\n\t/**\n\t * Sets this vector's x value to be `array[ offset ]`, y value to be `array[ offset + 1 ]`\n\t * and z value to be `array[ offset + 2 ]`.\n\t *\n\t * @param {Array\u003cnumber\u003e} array - An array holding the vector component values.\n\t * @param {number} [offset=0] - The offset into the array.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\t\tthis.z = array[ offset + 2 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Writes the components of this vector to the given array. If no array is provided,\n\t * the method returns a new instance.\n\t *\n\t * @param {Array\u003cnumber\u003e} [array=[]] - The target array holding the vector components.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Array\u003cnumber\u003e} The vector components.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\t\tarray[ offset + 2 ] = this.z;\n\n\t\treturn array;\n\n\t}\n\n\t/**\n\t * Sets the components of this vector from the given buffer attribute.\n\t *\n\t * @param {BufferAttribute} attribute - The buffer attribute holding vector data.\n\t * @param {number} index - The index into the attribute.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\t\tthis.z = attribute.getZ( index );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets each component of this vector to a pseudo-random value between `0` and\n\t * `1`, excluding `1`.\n\t *\n\t * @return {Vector3} A reference to this vector.\n\t */\n\trandom() {\n\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this vector to a uniformly random point on a unit sphere.\n\t *\n\t * @return {Vector3} A reference to this vector.\n\t */\n\trandomDirection() {\n\n\t\t// https://mathworld.wolfram.com/SpherePointPicking.html\n\n\t\tconst theta = Math.random() * Math.PI * 2;\n\t\tconst u = Math.random() * 2 - 1;\n\t\tconst c = Math.sqrt( 1 - u * u );\n\n\t\tthis.x = c * Math.cos( theta );\n\t\tthis.y = u;\n\t\tthis.z = c * Math.sin( theta );\n\n\t\treturn this;\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\n\t}\n\n}\n\nconst _vector$c = /*@__PURE__*/ new Vector3();\nconst _quaternion$4 = /*@__PURE__*/ new Quaternion();\n\n/**\n * Represents a 3x3 matrix.\n *\n * A Note on Row-Major and Column-Major Ordering:\n *\n * The constructor and {@link Matrix3#set} method take arguments in\n * [row-major](https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order)\n * order, while internally they are stored in the {@link Matrix3#elements} array in column-major order.\n * This means that calling:\n * ```js\n * const m = new THREE.Matrix();\n * m.set( 11, 12, 13,\n *        21, 22, 23,\n *        31, 32, 33 );\n * ```\n * will result in the elements array containing:\n * ```js\n * m.elements = [ 11, 21, 31,\n *                12, 22, 32,\n *                13, 23, 33 ];\n * ```\n * and internally all calculations are performed using column-major ordering.\n * However, as the actual ordering makes no difference mathematically and\n * most people are used to thinking about matrices in row-major order, the\n * three.js documentation shows matrices in row-major order. Just bear in\n * mind that if you are reading the source code, you'll have to take the\n * transpose of any matrices outlined here to make sense of the calculations.\n */\nclass Matrix3 {\n\n\t/**\n\t * Constructs a new 3x3 matrix. The arguments are supposed to be\n\t * in row-major order. If no arguments are provided, the constructor\n\t * initializes the matrix as an identity matrix.\n\t *\n\t * @param {number} [n11] - 1-1 matrix element.\n\t * @param {number} [n12] - 1-2 matrix element.\n\t * @param {number} [n13] - 1-3 matrix element.\n\t * @param {number} [n21] - 2-1 matrix element.\n\t * @param {number} [n22] - 2-2 matrix element.\n\t * @param {number} [n23] - 2-3 matrix element.\n\t * @param {number} [n31] - 3-1 matrix element.\n\t * @param {number} [n32] - 3-2 matrix element.\n\t * @param {number} [n33] - 3-3 matrix element.\n\t */\n\tconstructor( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tMatrix3.prototype.isMatrix3 = true;\n\n\t\t/**\n\t\t * A column-major list of matrix values.\n\t\t *\n\t\t * @type {Array\u003cnumber\u003e}\n\t\t */\n\t\tthis.elements = [\n\n\t\t\t1, 0, 0,\n\t\t\t0, 1, 0,\n\t\t\t0, 0, 1\n\n\t\t];\n\n\t\tif ( n11 !== undefined ) {\n\n\t\t\tthis.set( n11, n12, n13, n21, n22, n23, n31, n32, n33 );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Sets the elements of the matrix.The arguments are supposed to be\n\t * in row-major order.\n\t *\n\t * @param {number} [n11] - 1-1 matrix element.\n\t * @param {number} [n12] - 1-2 matrix element.\n\t * @param {number} [n13] - 1-3 matrix element.\n\t * @param {number} [n21] - 2-1 matrix element.\n\t * @param {number} [n22] - 2-2 matrix element.\n\t * @param {number} [n23] - 2-3 matrix element.\n\t * @param {number} [n31] - 3-1 matrix element.\n\t * @param {number} [n32] - 3-2 matrix element.\n\t * @param {number} [n33] - 3-3 matrix element.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tset( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] = n11; te[ 1 ] = n21; te[ 2 ] = n31;\n\t\tte[ 3 ] = n12; te[ 4 ] = n22; te[ 5 ] = n32;\n\t\tte[ 6 ] = n13; te[ 7 ] = n23; te[ 8 ] = n33;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix to the 3x3 identity matrix.\n\t *\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tidentity() {\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0,\n\t\t\t0, 1, 0,\n\t\t\t0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the values of the given matrix to this instance.\n\t *\n\t * @param {Matrix3} m - The matrix to copy.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tcopy( m ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tte[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ];\n\t\tte[ 3 ] = me[ 3 ]; te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ];\n\t\tte[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; te[ 8 ] = me[ 8 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Extracts the basis of this matrix into the three axis vectors provided.\n\t *\n\t * @param {Vector3} xAxis - The basis's x axis.\n\t * @param {Vector3} yAxis - The basis's y axis.\n\t * @param {Vector3} zAxis - The basis's z axis.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\textractBasis( xAxis, yAxis, zAxis ) {\n\n\t\txAxis.setFromMatrix3Column( this, 0 );\n\t\tyAxis.setFromMatrix3Column( this, 1 );\n\t\tzAxis.setFromMatrix3Column( this, 2 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Set this matrix to the upper 3x3 matrix of the given 4x4 matrix.\n\t *\n\t * @param {Matrix4} m - The 4x4 matrix.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tsetFromMatrix4( m ) {\n\n\t\tconst me = m.elements;\n\n\t\tthis.set(\n\n\t\t\tme[ 0 ], me[ 4 ], me[ 8 ],\n\t\t\tme[ 1 ], me[ 5 ], me[ 9 ],\n\t\t\tme[ 2 ], me[ 6 ], me[ 10 ]\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Post-multiplies this matrix by the given 3x3 matrix.\n\t *\n\t * @param {Matrix3} m - The matrix to multiply with.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tmultiply( m ) {\n\n\t\treturn this.multiplyMatrices( this, m );\n\n\t}\n\n\t/**\n\t * Pre-multiplies this matrix by the given 3x3 matrix.\n\t *\n\t * @param {Matrix3} m - The matrix to multiply with.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tpremultiply( m ) {\n\n\t\treturn this.multiplyMatrices( m, this );\n\n\t}\n\n\t/**\n\t * Multiples the given 3x3 matrices and stores the result\n\t * in this matrix.\n\t *\n\t * @param {Matrix3} a - The first matrix.\n\t * @param {Matrix3} b - The second matrix.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tmultiplyMatrices( a, b ) {\n\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\n\t\tconst a11 = ae[ 0 ], a12 = ae[ 3 ], a13 = ae[ 6 ];\n\t\tconst a21 = ae[ 1 ], a22 = ae[ 4 ], a23 = ae[ 7 ];\n\t\tconst a31 = ae[ 2 ], a32 = ae[ 5 ], a33 = ae[ 8 ];\n\n\t\tconst b11 = be[ 0 ], b12 = be[ 3 ], b13 = be[ 6 ];\n\t\tconst b21 = be[ 1 ], b22 = be[ 4 ], b23 = be[ 7 ];\n\t\tconst b31 = be[ 2 ], b32 = be[ 5 ], b33 = be[ 8 ];\n\n\t\tte[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31;\n\t\tte[ 3 ] = a11 * b12 + a12 * b22 + a13 * b32;\n\t\tte[ 6 ] = a11 * b13 + a12 * b23 + a13 * b33;\n\n\t\tte[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31;\n\t\tte[ 4 ] = a21 * b12 + a22 * b22 + a23 * b32;\n\t\tte[ 7 ] = a21 * b13 + a22 * b23 + a23 * b33;\n\n\t\tte[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31;\n\t\tte[ 5 ] = a31 * b12 + a32 * b22 + a33 * b32;\n\t\tte[ 8 ] = a31 * b13 + a32 * b23 + a33 * b33;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies every component of the matrix by the given scalar.\n\t *\n\t * @param {number} s - The scalar.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tmultiplyScalar( s ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] *= s; te[ 3 ] *= s; te[ 6 ] *= s;\n\t\tte[ 1 ] *= s; te[ 4 ] *= s; te[ 7 ] *= s;\n\t\tte[ 2 ] *= s; te[ 5 ] *= s; te[ 8 ] *= s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes and returns the determinant of this matrix.\n\t *\n\t * @return {number} The determinant.\n\t */\n\tdeterminant() {\n\n\t\tconst te = this.elements;\n\n\t\tconst a = te[ 0 ], b = te[ 1 ], c = te[ 2 ],\n\t\t\td = te[ 3 ], e = te[ 4 ], f = te[ 5 ],\n\t\t\tg = te[ 6 ], h = te[ 7 ], i = te[ 8 ];\n\n\t\treturn a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g;\n\n\t}\n\n\t/**\n\t * Inverts this matrix, using the [analytic method](https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution).\n\t * You can not invert with a determinant of zero. If you attempt this, the method produces\n\t * a zero matrix instead.\n\t *\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tinvert() {\n\n\t\tconst te = this.elements,\n\n\t\t\tn11 = te[ 0 ], n21 = te[ 1 ], n31 = te[ 2 ],\n\t\t\tn12 = te[ 3 ], n22 = te[ 4 ], n32 = te[ 5 ],\n\t\t\tn13 = te[ 6 ], n23 = te[ 7 ], n33 = te[ 8 ],\n\n\t\t\tt11 = n33 * n22 - n32 * n23,\n\t\t\tt12 = n32 * n13 - n33 * n12,\n\t\t\tt13 = n23 * n12 - n22 * n13,\n\n\t\t\tdet = n11 * t11 + n21 * t12 + n31 * t13;\n\n\t\tif ( det === 0 ) return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0 );\n\n\t\tconst detInv = 1 / det;\n\n\t\tte[ 0 ] = t11 * detInv;\n\t\tte[ 1 ] = ( n31 * n23 - n33 * n21 ) * detInv;\n\t\tte[ 2 ] = ( n32 * n21 - n31 * n22 ) * detInv;\n\n\t\tte[ 3 ] = t12 * detInv;\n\t\tte[ 4 ] = ( n33 * n11 - n31 * n13 ) * detInv;\n\t\tte[ 5 ] = ( n31 * n12 - n32 * n11 ) * detInv;\n\n\t\tte[ 6 ] = t13 * detInv;\n\t\tte[ 7 ] = ( n21 * n13 - n23 * n11 ) * detInv;\n\t\tte[ 8 ] = ( n22 * n11 - n21 * n12 ) * detInv;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Transposes this matrix in place.\n\t *\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\ttranspose() {\n\n\t\tlet tmp;\n\t\tconst m = this.elements;\n\n\t\ttmp = m[ 1 ]; m[ 1 ] = m[ 3 ]; m[ 3 ] = tmp;\n\t\ttmp = m[ 2 ]; m[ 2 ] = m[ 6 ]; m[ 6 ] = tmp;\n\t\ttmp = m[ 5 ]; m[ 5 ] = m[ 7 ]; m[ 7 ] = tmp;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes the normal matrix which is the inverse transpose of the upper\n\t * left 3x3 portion of the given 4x4 matrix.\n\t *\n\t * @param {Matrix4} matrix4 - The 4x4 matrix.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tgetNormalMatrix( matrix4 ) {\n\n\t\treturn this.setFromMatrix4( matrix4 ).invert().transpose();\n\n\t}\n\n\t/**\n\t * Transposes this matrix into the supplied array, and returns itself unchanged.\n\t *\n\t * @param {Array\u003cnumber\u003e} r - An array to store the transposed matrix elements.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\ttransposeIntoArray( r ) {\n\n\t\tconst m = this.elements;\n\n\t\tr[ 0 ] = m[ 0 ];\n\t\tr[ 1 ] = m[ 3 ];\n\t\tr[ 2 ] = m[ 6 ];\n\t\tr[ 3 ] = m[ 1 ];\n\t\tr[ 4 ] = m[ 4 ];\n\t\tr[ 5 ] = m[ 7 ];\n\t\tr[ 6 ] = m[ 2 ];\n\t\tr[ 7 ] = m[ 5 ];\n\t\tr[ 8 ] = m[ 8 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the UV transform matrix from offset, repeat, rotation, and center.\n\t *\n\t * @param {number} tx - Offset x.\n\t * @param {number} ty - Offset y.\n\t * @param {number} sx - Repeat x.\n\t * @param {number} sy - Repeat y.\n\t * @param {number} rotation - Rotation, in radians. Positive values rotate counterclockwise.\n\t * @param {number} cx - Center x of rotation.\n\t * @param {number} cy - Center y of rotation\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tsetUvTransform( tx, ty, sx, sy, rotation, cx, cy ) {\n\n\t\tconst c = Math.cos( rotation );\n\t\tconst s = Math.sin( rotation );\n\n\t\tthis.set(\n\t\t\tsx * c, sx * s, - sx * ( c * cx + s * cy ) + cx + tx,\n\t\t\t- sy * s, sy * c, - sy * ( - s * cx + c * cy ) + cy + ty,\n\t\t\t0, 0, 1\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Scales this matrix with the given scalar values.\n\t *\n\t * @param {number} sx - The amount to scale in the X axis.\n\t * @param {number} sy - The amount to scale in the Y axis.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tscale( sx, sy ) {\n\n\t\tthis.premultiply( _m3.makeScale( sx, sy ) );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Rotates this matrix by the given angle.\n\t *\n\t * @param {number} theta - The rotation in radians.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\trotate( theta ) {\n\n\t\tthis.premultiply( _m3.makeRotation( - theta ) );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Translates this matrix by the given scalar values.\n\t *\n\t * @param {number} tx - The amount to translate in the X axis.\n\t * @param {number} ty - The amount to translate in the Y axis.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\ttranslate( tx, ty ) {\n\n\t\tthis.premultiply( _m3.makeTranslation( tx, ty ) );\n\n\t\treturn this;\n\n\t}\n\n\t// for 2D Transforms\n\n\t/**\n\t * Sets this matrix as a 2D translation transform.\n\t *\n\t * @param {number|Vector2} x - The amount to translate in the X axis or alternatively a translation vector.\n\t * @param {number} y - The amount to translate in the Y axis.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tmakeTranslation( x, y ) {\n\n\t\tif ( x.isVector2 ) {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, x.x,\n\t\t\t\t0, 1, x.y,\n\t\t\t\t0, 0, 1\n\n\t\t\t);\n\n\t\t} else {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, x,\n\t\t\t\t0, 1, y,\n\t\t\t\t0, 0, 1\n\n\t\t\t);\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix as a 2D rotational transformation.\n\t *\n\t * @param {number} theta - The rotation in radians.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tmakeRotation( theta ) {\n\n\t\t// counterclockwise\n\n\t\tconst c = Math.cos( theta );\n\t\tconst s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\tc, - s, 0,\n\t\t\ts, c, 0,\n\t\t\t0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix as a 2D scale transform.\n\t *\n\t * @param {number} x - The amount to scale in the X axis.\n\t * @param {number} y - The amount to scale in the Y axis.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tmakeScale( x, y ) {\n\n\t\tthis.set(\n\n\t\t\tx, 0, 0,\n\t\t\t0, y, 0,\n\t\t\t0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this matrix is equal with the given one.\n\t *\n\t * @param {Matrix3} matrix - The matrix to test for equality.\n\t * @return {boolean} Whether this matrix is equal with the given one.\n\t */\n\tequals( matrix ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor ( let i = 0; i \u003c 9; i ++ ) {\n\n\t\t\tif ( te[ i ] !== me[ i ] ) return false;\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\t/**\n\t * Sets the elements of the matrix from the given array.\n\t *\n\t * @param {Array\u003cnumber\u003e} array - The matrix elements in column-major order.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tfor ( let i = 0; i \u003c 9; i ++ ) {\n\n\t\t\tthis.elements[ i ] = array[ i + offset ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Writes the elements of this matrix to the given array. If no array is provided,\n\t * the method returns a new instance.\n\t *\n\t * @param {Array\u003cnumber\u003e} [array=[]] - The target array holding the matrix elements in column-major order.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Array\u003cnumber\u003e} The matrix elements in column-major order.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tconst te = this.elements;\n\n\t\tarray[ offset ] = te[ 0 ];\n\t\tarray[ offset + 1 ] = te[ 1 ];\n\t\tarray[ offset + 2 ] = te[ 2 ];\n\n\t\tarray[ offset + 3 ] = te[ 3 ];\n\t\tarray[ offset + 4 ] = te[ 4 ];\n\t\tarray[ offset + 5 ] = te[ 5 ];\n\n\t\tarray[ offset + 6 ] = te[ 6 ];\n\t\tarray[ offset + 7 ] = te[ 7 ];\n\t\tarray[ offset + 8 ] = te[ 8 ];\n\n\t\treturn array;\n\n\t}\n\n\t/**\n\t * Returns a matrix with copied values from this instance.\n\t *\n\t * @return {Matrix3} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().fromArray( this.elements );\n\n\t}\n\n}\n\nconst _m3 = /*@__PURE__*/ new Matrix3();\n\nconst LINEAR_REC709_TO_XYZ = /*@__PURE__*/ new Matrix3().set(\n\t0.4123908, 0.3575843, 0.1804808,\n\t0.2126390, 0.7151687, 0.0721923,\n\t0.0193308, 0.1191948, 0.9505322\n);\n\nconst XYZ_TO_LINEAR_REC709 = /*@__PURE__*/ new Matrix3().set(\n\t3.2409699, -1.5373832, -0.4986108,\n\t-0.9692436, 1.8759675, 0.0415551,\n\t0.0556301, -0.203977, 1.0569715\n);\n\nfunction createColorManagement() {\n\n\tconst ColorManagement = {\n\n\t\tenabled: true,\n\n\t\tworkingColorSpace: LinearSRGBColorSpace,\n\n\t\t/**\n\t\t * Implementations of supported color spaces.\n\t\t *\n\t\t * Required:\n\t\t *\t- primaries: chromaticity coordinates [ rx ry gx gy bx by ]\n\t\t *\t- whitePoint: reference white [ x y ]\n\t\t *\t- transfer: transfer function (pre-defined)\n\t\t *\t- toXYZ: Matrix3 RGB to XYZ transform\n\t\t *\t- fromXYZ: Matrix3 XYZ to RGB transform\n\t\t *\t- luminanceCoefficients: RGB luminance coefficients\n\t\t *\n\t\t * Optional:\n\t\t *  - outputColorSpaceConfig: { drawingBufferColorSpace: ColorSpace, toneMappingMode: 'extended' | 'standard' }\n\t\t *  - workingColorSpaceConfig: { unpackColorSpace: ColorSpace }\n\t\t *\n\t\t * Reference:\n\t\t * - https://www.russellcottrell.com/photo/matrixCalculator.htm\n\t\t */\n\t\tspaces: {},\n\n\t\tconvert: function ( color, sourceColorSpace, targetColorSpace ) {\n\n\t\t\tif ( this.enabled === false || sourceColorSpace === targetColorSpace || ! sourceColorSpace || ! targetColorSpace ) {\n\n\t\t\t\treturn color;\n\n\t\t\t}\n\n\t\t\tif ( this.spaces[ sourceColorSpace ].transfer === SRGBTransfer ) {\n\n\t\t\t\tcolor.r = SRGBToLinear( color.r );\n\t\t\t\tcolor.g = SRGBToLinear( color.g );\n\t\t\t\tcolor.b = SRGBToLinear( color.b );\n\n\t\t\t}\n\n\t\t\tif ( this.spaces[ sourceColorSpace ].primaries !== this.spaces[ targetColorSpace ].primaries ) {\n\n\t\t\t\tcolor.applyMatrix3( this.spaces[ sourceColorSpace ].toXYZ );\n\t\t\t\tcolor.applyMatrix3( this.spaces[ targetColorSpace ].fromXYZ );\n\n\t\t\t}\n\n\t\t\tif ( this.spaces[ targetColorSpace ].transfer === SRGBTransfer ) {\n\n\t\t\t\tcolor.r = LinearToSRGB( color.r );\n\t\t\t\tcolor.g = LinearToSRGB( color.g );\n\t\t\t\tcolor.b = LinearToSRGB( color.b );\n\n\t\t\t}\n\n\t\t\treturn color;\n\n\t\t},\n\n\t\tworkingToColorSpace: function ( color, targetColorSpace ) {\n\n\t\t\treturn this.convert( color, this.workingColorSpace, targetColorSpace );\n\n\t\t},\n\n\t\tcolorSpaceToWorking: function ( color, sourceColorSpace ) {\n\n\t\t\treturn this.convert( color, sourceColorSpace, this.workingColorSpace );\n\n\t\t},\n\n\t\tgetPrimaries: function ( colorSpace ) {\n\n\t\t\treturn this.spaces[ colorSpace ].primaries;\n\n\t\t},\n\n\t\tgetTransfer: function ( colorSpace ) {\n\n\t\t\tif ( colorSpace === NoColorSpace ) return LinearTransfer;\n\n\t\t\treturn this.spaces[ colorSpace ].transfer;\n\n\t\t},\n\n\t\tgetToneMappingMode: function ( colorSpace ) {\n\n\t\t\treturn this.spaces[ colorSpace ].outputColorSpaceConfig.toneMappingMode || 'standard';\n\n\t\t},\n\n\t\tgetLuminanceCoefficients: function ( target, colorSpace = this.workingColorSpace ) {\n\n\t\t\treturn target.fromArray( this.spaces[ colorSpace ].luminanceCoefficients );\n\n\t\t},\n\n\t\tdefine: function ( colorSpaces ) {\n\n\t\t\tObject.assign( this.spaces, colorSpaces );\n\n\t\t},\n\n\t\t// Internal APIs\n\n\t\t_getMatrix: function ( targetMatrix, sourceColorSpace, targetColorSpace ) {\n\n\t\t\treturn targetMatrix\n\t\t\t\t.copy( this.spaces[ sourceColorSpace ].toXYZ )\n\t\t\t\t.multiply( this.spaces[ targetColorSpace ].fromXYZ );\n\n\t\t},\n\n\t\t_getDrawingBufferColorSpace: function ( colorSpace ) {\n\n\t\t\treturn this.spaces[ colorSpace ].outputColorSpaceConfig.drawingBufferColorSpace;\n\n\t\t},\n\n\t\t_getUnpackColorSpace: function ( colorSpace = this.workingColorSpace ) {\n\n\t\t\treturn this.spaces[ colorSpace ].workingColorSpaceConfig.unpackColorSpace;\n\n\t\t},\n\n\t\t// Deprecated\n\n\t\tfromWorkingColorSpace: function ( color, targetColorSpace ) {\n\n\t\t\twarnOnce( 'ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().' ); // @deprecated, r177\n\n\t\t\treturn ColorManagement.workingToColorSpace( color, targetColorSpace );\n\n\t\t},\n\n\t\ttoWorkingColorSpace: function ( color, sourceColorSpace ) {\n\n\t\t\twarnOnce( 'ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().' ); // @deprecated, r177\n\n\t\t\treturn ColorManagement.colorSpaceToWorking( color, sourceColorSpace );\n\n\t\t},\n\n\t};\n\n\t/******************************************************************************\n\t * sRGB definitions\n\t */\n\n\tconst REC709_PRIMARIES = [ 0.640, 0.330, 0.300, 0.600, 0.150, 0.060 ];\n\tconst REC709_LUMINANCE_COEFFICIENTS = [ 0.2126, 0.7152, 0.0722 ];\n\tconst D65 = [ 0.3127, 0.3290 ];\n\n\tColorManagement.define( {\n\n\t\t[ LinearSRGBColorSpace ]: {\n\t\t\tprimaries: REC709_PRIMARIES,\n\t\t\twhitePoint: D65,\n\t\t\ttransfer: LinearTransfer,\n\t\t\ttoXYZ: LINEAR_REC709_TO_XYZ,\n\t\t\tfromXYZ: XYZ_TO_LINEAR_REC709,\n\t\t\tluminanceCoefficients: REC709_LUMINANCE_COEFFICIENTS,\n\t\t\tworkingColorSpaceConfig: { unpackColorSpace: SRGBColorSpace },\n\t\t\toutputColorSpaceConfig: { drawingBufferColorSpace: SRGBColorSpace }\n\t\t},\n\n\t\t[ SRGBColorSpace ]: {\n\t\t\tprimaries: REC709_PRIMARIES,\n\t\t\twhitePoint: D65,\n\t\t\ttransfer: SRGBTransfer,\n\t\t\ttoXYZ: LINEAR_REC709_TO_XYZ,\n\t\t\tfromXYZ: XYZ_TO_LINEAR_REC709,\n\t\t\tluminanceCoefficients: REC709_LUMINANCE_COEFFICIENTS,\n\t\t\toutputColorSpaceConfig: { drawingBufferColorSpace: SRGBColorSpace }\n\t\t},\n\n\t} );\n\n\treturn ColorManagement;\n\n}\n\nconst ColorManagement = /*@__PURE__*/ createColorManagement();\n\nfunction SRGBToLinear( c ) {\n\n\treturn ( c \u003c 0.04045 ) ? c * 0.0773993808 : Math.pow( c * 0.9478672986 + 0.0521327014, 2.4 );\n\n}\n\nfunction LinearToSRGB( c ) {\n\n\treturn ( c \u003c 0.0031308 ) ? c * 12.92 : 1.055 * ( Math.pow( c, 0.41666 ) ) - 0.055;\n\n}\n\nlet _canvas;\n\n/**\n * A class containing utility functions for images.\n *\n * @hideconstructor\n */\nclass ImageUtils {\n\n\t/**\n\t * Returns a data URI containing a representation of the given image.\n\t *\n\t * @param {(HTMLImageElement|HTMLCanvasElement)} image - The image object.\n\t * @param {string} [type='image/png'] - Indicates the image format.\n\t * @return {string} The data URI.\n\t */\n\tstatic getDataURL( image, type = 'image/png' ) {\n\n\t\tif ( /^data:/i.test( image.src ) ) {\n\n\t\t\treturn image.src;\n\n\t\t}\n\n\t\tif ( typeof HTMLCanvasElement === 'undefined' ) {\n\n\t\t\treturn image.src;\n\n\t\t}\n\n\t\tlet canvas;\n\n\t\tif ( image instanceof HTMLCanvasElement ) {\n\n\t\t\tcanvas = image;\n\n\t\t} else {\n\n\t\t\tif ( _canvas === undefined ) _canvas = createElementNS( 'canvas' );\n\n\t\t\t_canvas.width = image.width;\n\t\t\t_canvas.height = image.height;\n\n\t\t\tconst context = _canvas.getContext( '2d' );\n\n\t\t\tif ( image instanceof ImageData ) {\n\n\t\t\t\tcontext.putImageData( image, 0, 0 );\n\n\t\t\t} else {\n\n\t\t\t\tcontext.drawImage( image, 0, 0, image.width, image.height );\n\n\t\t\t}\n\n\t\t\tcanvas = _canvas;\n\n\t\t}\n\n\t\treturn canvas.toDataURL( type );\n\n\t}\n\n\t/**\n\t * Converts the given sRGB image data to linear color space.\n\t *\n\t * @param {(HTMLImageElement|HTMLCanvasElement|ImageBitmap|Object)} image - The image object.\n\t * @return {HTMLCanvasElement|Object} The converted image.\n\t */\n\tstatic sRGBToLinear( image ) {\n\n\t\tif ( ( typeof HTMLImageElement !== 'undefined' \u0026\u0026 image instanceof HTMLImageElement ) ||\n\t\t\t( typeof HTMLCanvasElement !== 'undefined' \u0026\u0026 image instanceof HTMLCanvasElement ) ||\n\t\t\t( typeof ImageBitmap !== 'undefined' \u0026\u0026 image instanceof ImageBitmap ) ) {\n\n\t\t\tconst canvas = createElementNS( 'canvas' );\n\n\t\t\tcanvas.width = image.width;\n\t\t\tcanvas.height = image.height;\n\n\t\t\tconst context = canvas.getContext( '2d' );\n\t\t\tcontext.drawImage( image, 0, 0, image.width, image.height );\n\n\t\t\tconst imageData = context.getImageData( 0, 0, image.width, image.height );\n\t\t\tconst data = imageData.data;\n\n\t\t\tfor ( let i = 0; i \u003c data.length; i ++ ) {\n\n\t\t\t\tdata[ i ] = SRGBToLinear( data[ i ] / 255 ) * 255;\n\n\t\t\t}\n\n\t\t\tcontext.putImageData( imageData, 0, 0 );\n\n\t\t\treturn canvas;\n\n\t\t} else if ( image.data ) {\n\n\t\t\tconst data = image.data.slice( 0 );\n\n\t\t\tfor ( let i = 0; i \u003c data.length; i ++ ) {\n\n\t\t\t\tif ( data instanceof Uint8Array || data instanceof Uint8ClampedArray ) {\n\n\t\t\t\t\tdata[ i ] = Math.floor( SRGBToLinear( data[ i ] / 255 ) * 255 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// assuming float\n\n\t\t\t\t\tdata[ i ] = SRGBToLinear( data[ i ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tdata: data,\n\t\t\t\twidth: image.width,\n\t\t\t\theight: image.height\n\t\t\t};\n\n\t\t} else {\n\n\t\t\twarn( 'ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.' );\n\t\t\treturn image;\n\n\t\t}\n\n\t}\n\n}\n\nlet _sourceId = 0;\n\n/**\n * Represents the data source of a texture.\n *\n * The main purpose of this class is to decouple the data definition from the texture\n * definition so the same data can be used with multiple texture instances.\n */\nclass Source {\n\n\t/**\n\t * Constructs a new video texture.\n\t *\n\t * @param {any} [data=null] - The data definition of a texture.\n\t */\n\tconstructor( data = null ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSource = true;\n\n\t\t/**\n\t\t * The ID of the source.\n\t\t *\n\t\t * @name Source#id\n\t\t * @type {number}\n\t\t * @readonly\n\t\t */\n\t\tObject.defineProperty( this, 'id', { value: _sourceId ++ } );\n\n\t\t/**\n\t\t * The UUID of the source.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.uuid = generateUUID();\n\n\t\t/**\n\t\t * The data definition of a texture.\n\t\t *\n\t\t * @type {any}\n\t\t */\n\t\tthis.data = data;\n\n\t\t/**\n\t\t * This property is only relevant when {@link Source#needsUpdate} is set to `true` and\n\t\t * provides more control on how texture data should be processed. When `dataReady` is set\n\t\t * to `false`, the engine performs the memory allocation (if necessary) but does not transfer\n\t\t * the data into the GPU memory.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.dataReady = true;\n\n\t\t/**\n\t\t * This starts at `0` and counts how many times {@link Source#needsUpdate} is set to `true`.\n\t\t *\n\t\t * @type {number}\n\t\t * @readonly\n\t\t * @default 0\n\t\t */\n\t\tthis.version = 0;\n\n\t}\n\n\t/**\n\t * Returns the dimensions of the source into the given target vector.\n\t *\n\t * @param {(Vector2|Vector3)} target - The target object the result is written into.\n\t * @return {(Vector2|Vector3)} The dimensions of the source.\n\t */\n\tgetSize( target ) {\n\n\t\tconst data = this.data;\n\n\t\tif ( ( typeof HTMLVideoElement !== 'undefined' ) \u0026\u0026 ( data instanceof HTMLVideoElement ) ) {\n\n\t\t\ttarget.set( data.videoWidth, data.videoHeight, 0 );\n\n\t\t} else if ( ( typeof VideoFrame !== 'undefined' ) \u0026\u0026 ( data instanceof VideoFrame ) ) {\n\n\t\t\ttarget.set( data.displayHeight, data.displayWidth, 0 );\n\n\t\t} else if ( data !== null ) {\n\n\t\t\ttarget.set( data.width, data.height, data.depth || 0 );\n\n\t\t} else {\n\n\t\t\ttarget.set( 0, 0, 0 );\n\n\t\t}\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * When the property is set to `true`, the engine allocates the memory\n\t * for the texture (if necessary) and triggers the actual texture upload\n\t * to the GPU next time the source is used.\n\t *\n\t * @type {boolean}\n\t * @default false\n\t * @param {boolean} value\n\t */\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\t/**\n\t * Serializes the source into JSON.\n\t *\n\t * @param {?(Object|string)} meta - An optional value holding meta information about the serialization.\n\t * @return {Object} A JSON object representing the serialized source.\n\t * @see {@link ObjectLoader#parse}\n\t */\n\ttoJSON( meta ) {\n\n\t\tconst isRootObject = ( meta === undefined || typeof meta === 'string' );\n\n\t\tif ( ! isRootObject \u0026\u0026 meta.images[ this.uuid ] !== undefined ) {\n\n\t\t\treturn meta.images[ this.uuid ];\n\n\t\t}\n\n\t\tconst output = {\n\t\t\tuuid: this.uuid,\n\t\t\turl: ''\n\t\t};\n\n\t\tconst data = this.data;\n\n\t\tif ( data !== null ) {\n\n\t\t\tlet url;\n\n\t\t\tif ( Array.isArray( data ) ) {\n\n\t\t\t\t// cube texture\n\n\t\t\t\turl = [];\n\n\t\t\t\tfor ( let i = 0, l = data.length; i \u003c l; i ++ ) {\n\n\t\t\t\t\tif ( data[ i ].isDataTexture ) {\n\n\t\t\t\t\t\turl.push( serializeImage( data[ i ].image ) );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\turl.push( serializeImage( data[ i ] ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// texture\n\n\t\t\t\turl = serializeImage( data );\n\n\t\t\t}\n\n\t\t\toutput.url = url;\n\n\t\t}\n\n\t\tif ( ! isRootObject ) {\n\n\t\t\tmeta.images[ this.uuid ] = output;\n\n\t\t}\n\n\t\treturn output;\n\n\t}\n\n}\n\nfunction serializeImage( image ) {\n\n\tif ( ( typeof HTMLImageElement !== 'undefined' \u0026\u0026 image instanceof HTMLImageElement ) ||\n\t\t( typeof HTMLCanvasElement !== 'undefined' \u0026\u0026 image instanceof HTMLCanvasElement ) ||\n\t\t( typeof ImageBitmap !== 'undefined' \u0026\u0026 image instanceof ImageBitmap ) ) {\n\n\t\t// default images\n\n\t\treturn ImageUtils.getDataURL( image );\n\n\t} else {\n\n\t\tif ( image.data ) {\n\n\t\t\t// images of DataTexture\n\n\t\t\treturn {\n\t\t\t\tdata: Array.from( image.data ),\n\t\t\t\twidth: image.width,\n\t\t\t\theight: image.height,\n\t\t\t\ttype: image.data.constructor.name\n\t\t\t};\n\n\t\t} else {\n\n\t\t\twarn( 'Texture: Unable to serialize Texture.' );\n\t\t\treturn {};\n\n\t\t}\n\n\t}\n\n}\n\nlet _textureId = 0;\n\nconst _tempVec3 = /*@__PURE__*/ new Vector3();\n\n/**\n * Base class for all textures.\n *\n * Note: After the initial use of a texture, its dimensions, format, and type\n * cannot be changed. Instead, call {@link Texture#dispose} on the texture and instantiate a new one.\n *\n * @augments EventDispatcher\n */\nclass Texture extends EventDispatcher {\n\n\t/**\n\t * Constructs a new texture.\n\t *\n\t * @param {?Object} [image=Texture.DEFAULT_IMAGE] - The image holding the texture data.\n\t * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.\n\t * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n\t * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n\t * @param {number} [magFilter=LinearFilter] - The mag filter value.\n\t * @param {number} [minFilter=LinearMipmapLinearFilter] - The min filter value.\n\t * @param {number} [format=RGBAFormat] - The texture format.\n\t * @param {number} [type=UnsignedByteType] - The texture type.\n\t * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n\t * @param {string} [colorSpace=NoColorSpace] - The color space.\n\t */\n\tconstructor( image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = Texture.DEFAULT_ANISOTROPY, colorSpace = NoColorSpace ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isTexture = true;\n\n\t\t/**\n\t\t * The ID of the texture.\n\t\t *\n\t\t * @name Texture#id\n\t\t * @type {number}\n\t\t * @readonly\n\t\t */\n\t\tObject.defineProperty( this, 'id', { value: _textureId ++ } );\n\n\t\t/**\n\t\t * The UUID of the material.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.uuid = generateUUID();\n\n\t\t/**\n\t\t * The name of the material.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\n\t\t/**\n\t\t * The data definition of a texture. A reference to the data source can be\n\t\t * shared across textures. This is often useful in context of spritesheets\n\t\t * where multiple textures render the same data but with different texture\n\t\t * transformations.\n\t\t *\n\t\t * @type {Source}\n\t\t */\n\t\tthis.source = new Source( image );\n\n\t\t/**\n\t\t * An array holding user-defined mipmaps.\n\t\t *\n\t\t * @type {Array\u003cObject\u003e}\n\t\t */\n\t\tthis.mipmaps = [];\n\n\t\t/**\n\t\t * How the texture is applied to the object. The value `UVMapping`\n\t\t * is the default, where texture or uv coordinates are used to apply the map.\n\t\t *\n\t\t * @type {(UVMapping|CubeReflectionMapping|CubeRefractionMapping|EquirectangularReflectionMapping|EquirectangularRefractionMapping|CubeUVReflectionMapping)}\n\t\t * @default UVMapping\n\t\t*/\n\t\tthis.mapping = mapping;\n\n\t\t/**\n\t\t * Lets you select the uv attribute to map the texture to. `0` for `uv`,\n\t\t * `1` for `uv1`, `2` for `uv2` and `3` for `uv3`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.channel = 0;\n\n\t\t/**\n\t\t * This defines how the texture is wrapped horizontally and corresponds to\n\t\t * *U* in UV mapping.\n\t\t *\n\t\t * @type {(RepeatWrapping|ClampToEdgeWrapping|MirroredRepeatWrapping)}\n\t\t * @default ClampToEdgeWrapping\n\t\t */\n\t\tthis.wrapS = wrapS;\n\n\t\t/**\n\t\t * This defines how the texture is wrapped horizontally and corresponds to\n\t\t * *V* in UV mapping.\n\t\t *\n\t\t * @type {(RepeatWrapping|ClampToEdgeWrapping|MirroredRepeatWrapping)}\n\t\t * @default ClampToEdgeWrapping\n\t\t */\n\t\tthis.wrapT = wrapT;\n\n\t\t/**\n\t\t * How the texture is sampled when a texel covers more than one pixel.\n\t\t *\n\t\t * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)}\n\t\t * @default LinearFilter\n\t\t */\n\t\tthis.magFilter = magFilter;\n\n\t\t/**\n\t\t * How the texture is sampled when a texel covers less than one pixel.\n\t\t *\n\t\t * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)}\n\t\t * @default LinearMipmapLinearFilter\n\t\t */\n\t\tthis.minFilter = minFilter;\n\n\t\t/**\n\t\t * The number of samples taken along the axis through the pixel that has the\n\t\t * highest density of texels. By default, this value is `1`. A higher value\n\t\t * gives a less blurry result than a basic mipmap, at the cost of more\n\t\t * texture samples being used.\n\t\t *\n\t\t * @type {number}\n\t\t * @default Texture.DEFAULT_ANISOTROPY\n\t\t */\n\t\tthis.anisotropy = anisotropy;\n\n\t\t/**\n\t\t * The format of the texture.\n\t\t *\n\t\t * @type {number}\n\t\t * @default RGBAFormat\n\t\t */\n\t\tthis.format = format;\n\n\t\t/**\n\t\t * The default internal format is derived from {@link Texture#format} and {@link Texture#type} and\n\t\t * defines how the texture data is going to be stored on the GPU.\n\t\t *\n\t\t * This property allows to overwrite the default format.\n\t\t *\n\t\t * @type {?string}\n\t\t * @default null\n\t\t */\n\t\tthis.internalFormat = null;\n\n\t\t/**\n\t\t * The data type of the texture.\n\t\t *\n\t\t * @type {number}\n\t\t * @default UnsignedByteType\n\t\t */\n\t\tthis.type = type;\n\n\t\t/**\n\t\t * How much a single repetition of the texture is offset from the beginning,\n\t\t * in each direction U and V. Typical range is `0.0` to `1.0`.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (0,0)\n\t\t */\n\t\tthis.offset = new Vector2( 0, 0 );\n\n\t\t/**\n\t\t * How many times the texture is repeated across the surface, in each\n\t\t * direction U and V. If repeat is set greater than `1` in either direction,\n\t\t * the corresponding wrap parameter should also be set to `RepeatWrapping`\n\t\t * or `MirroredRepeatWrapping` to achieve the desired tiling effect.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (1,1)\n\t\t */\n\t\tthis.repeat = new Vector2( 1, 1 );\n\n\t\t/**\n\t\t * The point around which rotation occurs. A value of `(0.5, 0.5)` corresponds\n\t\t * to the center of the texture. Default is `(0, 0)`, the lower left.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (0,0)\n\t\t */\n\t\tthis.center = new Vector2( 0, 0 );\n\n\t\t/**\n\t\t * How much the texture is rotated around the center point, in radians.\n\t\t * Positive values are counter-clockwise.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.rotation = 0;\n\n\t\t/**\n\t\t * Whether to update the texture's uv-transformation {@link Texture#matrix}\n\t\t * from the properties {@link Texture#offset}, {@link Texture#repeat},\n\t\t * {@link Texture#rotation}, and {@link Texture#center}.\n\t\t *\n\t\t * Set this to `false` if you are specifying the uv-transform matrix directly.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.matrixAutoUpdate = true;\n\n\t\t/**\n\t\t * The uv-transformation matrix of the texture.\n\t\t *\n\t\t * @type {Matrix3}\n\t\t */\n\t\tthis.matrix = new Matrix3();\n\n\t\t/**\n\t\t * Whether to generate mipmaps (if possible) for a texture.\n\t\t *\n\t\t * Set this to `false` if you are creating mipmaps manually.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.generateMipmaps = true;\n\n\t\t/**\n\t\t * If set to `true`, the alpha channel, if present, is multiplied into the\n\t\t * color channels when the texture is uploaded to the GPU.\n\t\t *\n\t\t * Note that this property has no effect when using `ImageBitmap`. You need to\n\t\t * configure premultiply alpha on bitmap creation instead.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.premultiplyAlpha = false;\n\n\t\t/**\n\t\t * If set to `true`, the texture is flipped along the vertical axis when\n\t\t * uploaded to the GPU.\n\t\t *\n\t\t * Note that this property has no effect when using `ImageBitmap`. You need to\n\t\t * configure the flip on bitmap creation instead.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.flipY = true;\n\n\t\t/**\n\t\t * Specifies the alignment requirements for the start of each pixel row in memory.\n\t\t * The allowable values are `1` (byte-alignment), `2` (rows aligned to even-numbered bytes),\n\t\t * `4` (word-alignment), and `8` (rows start on double-word boundaries).\n\t\t *\n\t\t * @type {number}\n\t\t * @default 4\n\t\t */\n\t\tthis.unpackAlignment = 4;\t// valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)\n\n\t\t/**\n\t\t * Textures containing color data should be annotated with `SRGBColorSpace` or `LinearSRGBColorSpace`.\n\t\t *\n\t\t * @type {string}\n\t\t * @default NoColorSpace\n\t\t */\n\t\tthis.colorSpace = colorSpace;\n\n\t\t/**\n\t\t * An object that can be used to store custom data about the texture. It\n\t\t * should not hold references to functions as these will not be cloned.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.userData = {};\n\n\t\t/**\n\t\t * This can be used to only update a subregion or specific rows of the texture (for example, just the\n\t\t * first 3 rows). Use the `addUpdateRange()` function to add ranges to this array.\n\t\t *\n\t\t * @type {Array\u003cObject\u003e}\n\t\t */\n\t\tthis.updateRanges = [];\n\n\t\t/**\n\t\t * This starts at `0` and counts how many times {@link Texture#needsUpdate} is set to `true`.\n\t\t *\n\t\t * @type {number}\n\t\t * @readonly\n\t\t * @default 0\n\t\t */\n\t\tthis.version = 0;\n\n\t\t/**\n\t\t * A callback function, called when the texture is updated (e.g., when\n\t\t * {@link Texture#needsUpdate} has been set to true and then the texture is used).\n\t\t *\n\t\t * @type {?Function}\n\t\t * @default null\n\t\t */\n\t\tthis.onUpdate = null;\n\n\t\t/**\n\t\t * An optional back reference to the textures render target.\n\t\t *\n\t\t * @type {?(RenderTarget|WebGLRenderTarget)}\n\t\t * @default null\n\t\t */\n\t\tthis.renderTarget = null;\n\n\t\t/**\n\t\t * Indicates whether a texture belongs to a render target or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default false\n\t\t */\n\t\tthis.isRenderTargetTexture = false;\n\n\t\t/**\n\t\t * Indicates if a texture should be handled like a texture array.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default false\n\t\t */\n\t\tthis.isArrayTexture = image \u0026\u0026 image.depth \u0026\u0026 image.depth \u003e 1 ? true : false;\n\n\t\t/**\n\t\t * Indicates whether this texture should be processed by `PMREMGenerator` or not\n\t\t * (only relevant for render target textures).\n\t\t *\n\t\t * @type {number}\n\t\t * @readonly\n\t\t * @default 0\n\t\t */\n\t\tthis.pmremVersion = 0;\n\n\t}\n\n\t/**\n\t * The width of the texture in pixels.\n\t */\n\tget width() {\n\n\t\treturn this.source.getSize( _tempVec3 ).x;\n\n\t}\n\n\t/**\n\t * The height of the texture in pixels.\n\t */\n\tget height() {\n\n\t\treturn this.source.getSize( _tempVec3 ).y;\n\n\t}\n\n\t/**\n\t * The depth of the texture in pixels.\n\t */\n\tget depth() {\n\n\t\treturn this.source.getSize( _tempVec3 ).z;\n\n\t}\n\n\t/**\n\t * The image object holding the texture data.\n\t *\n\t * @type {?Object}\n\t */\n\tget image() {\n\n\t\treturn this.source.data;\n\n\t}\n\n\tset image( value = null ) {\n\n\t\tthis.source.data = value;\n\n\t}\n\n\t/**\n\t * Updates the texture transformation matrix from the from the properties {@link Texture#offset},\n\t * {@link Texture#repeat}, {@link Texture#rotation}, and {@link Texture#center}.\n\t */\n\tupdateMatrix() {\n\n\t\tthis.matrix.setUvTransform( this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y );\n\n\t}\n\n\t/**\n\t * Adds a range of data in the data texture to be updated on the GPU.\n\t *\n\t * @param {number} start - Position at which to start update.\n\t * @param {number} count - The number of components to update.\n\t */\n\taddUpdateRange( start, count ) {\n\n\t\tthis.updateRanges.push( { start, count } );\n\n\t}\n\n\t/**\n\t * Clears the update ranges.\n\t */\n\tclearUpdateRanges() {\n\n\t\tthis.updateRanges.length = 0;\n\n\t}\n\n\t/**\n\t * Returns a new texture with copied values from this instance.\n\t *\n\t * @return {Texture} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Copies the values of the given texture to this instance.\n\t *\n\t * @param {Texture} source - The texture to copy.\n\t * @return {Texture} A reference to this instance.\n\t */\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\n\t\tthis.source = source.source;\n\t\tthis.mipmaps = source.mipmaps.slice( 0 );\n\n\t\tthis.mapping = source.mapping;\n\t\tthis.channel = source.channel;\n\n\t\tthis.wrapS = source.wrapS;\n\t\tthis.wrapT = source.wrapT;\n\n\t\tthis.magFilter = source.magFilter;\n\t\tthis.minFilter = source.minFilter;\n\n\t\tthis.anisotropy = source.anisotropy;\n\n\t\tthis.format = source.format;\n\t\tthis.internalFormat = source.internalFormat;\n\t\tthis.type = source.type;\n\n\t\tthis.offset.copy( source.offset );\n\t\tthis.repeat.copy( source.repeat );\n\t\tthis.center.copy( source.center );\n\t\tthis.rotation = source.rotation;\n\n\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\t\tthis.matrix.copy( source.matrix );\n\n\t\tthis.generateMipmaps = source.generateMipmaps;\n\t\tthis.premultiplyAlpha = source.premultiplyAlpha;\n\t\tthis.flipY = source.flipY;\n\t\tthis.unpackAlignment = source.unpackAlignment;\n\t\tthis.colorSpace = source.colorSpace;\n\n\t\tthis.renderTarget = source.renderTarget;\n\t\tthis.isRenderTargetTexture = source.isRenderTargetTexture;\n\t\tthis.isArrayTexture = source.isArrayTexture;\n\n\t\tthis.userData = JSON.parse( JSON.stringify( source.userData ) );\n\n\t\tthis.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this texture's properties based on `values`.\n\t * @param {Object} values - A container with texture parameters.\n\t */\n\tsetValues( values ) {\n\n\t\tfor ( const key in values ) {\n\n\t\t\tconst newValue = values[ key ];\n\n\t\t\tif ( newValue === undefined ) {\n\n\t\t\t\twarn( `Texture.setValues(): parameter '${ key }' has value of undefined.` );\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tconst currentValue = this[ key ];\n\n\t\t\tif ( currentValue === undefined ) {\n\n\t\t\t\twarn( `Texture.setValues(): property '${ key }' does not exist.` );\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tif ( ( currentValue \u0026\u0026 newValue ) \u0026\u0026 ( currentValue.isVector2 \u0026\u0026 newValue.isVector2 ) ) {\n\n\t\t\t\tcurrentValue.copy( newValue );\n\n\t\t\t} else if ( ( currentValue \u0026\u0026 newValue ) \u0026\u0026 ( currentValue.isVector3 \u0026\u0026 newValue.isVector3 ) ) {\n\n\t\t\t\tcurrentValue.copy( newValue );\n\n\t\t\t} else if ( ( currentValue \u0026\u0026 newValue ) \u0026\u0026 ( currentValue.isMatrix3 \u0026\u0026 newValue.isMatrix3 ) ) {\n\n\t\t\t\tcurrentValue.copy( newValue );\n\n\t\t\t} else {\n\n\t\t\t\tthis[ key ] = newValue;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Serializes the texture into JSON.\n\t *\n\t * @param {?(Object|string)} meta - An optional value holding meta information about the serialization.\n\t * @return {Object} A JSON object representing the serialized texture.\n\t * @see {@link ObjectLoader#parse}\n\t */\n\ttoJSON( meta ) {\n\n\t\tconst isRootObject = ( meta === undefined || typeof meta === 'string' );\n\n\t\tif ( ! isRootObject \u0026\u0026 meta.textures[ this.uuid ] !== undefined ) {\n\n\t\t\treturn meta.textures[ this.uuid ];\n\n\t\t}\n\n\t\tconst output = {\n\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.7,\n\t\t\t\ttype: 'Texture',\n\t\t\t\tgenerator: 'Texture.toJSON'\n\t\t\t},\n\n\t\t\tuuid: this.uuid,\n\t\t\tname: this.name,\n\n\t\t\timage: this.source.toJSON( meta ).uuid,\n\n\t\t\tmapping: this.mapping,\n\t\t\tchannel: this.channel,\n\n\t\t\trepeat: [ this.repeat.x, this.repeat.y ],\n\t\t\toffset: [ this.offset.x, this.offset.y ],\n\t\t\tcenter: [ this.center.x, this.center.y ],\n\t\t\trotation: this.rotation,\n\n\t\t\twrap: [ this.wrapS, this.wrapT ],\n\n\t\t\tformat: this.format,\n\t\t\tinternalFormat: this.internalFormat,\n\t\t\ttype: this.type,\n\t\t\tcolorSpace: this.colorSpace,\n\n\t\t\tminFilter: this.minFilter,\n\t\t\tmagFilter: this.magFilter,\n\t\t\tanisotropy: this.anisotropy,\n\n\t\t\tflipY: this.flipY,\n\n\t\t\tgenerateMipmaps: this.generateMipmaps,\n\t\t\tpremultiplyAlpha: this.premultiplyAlpha,\n\t\t\tunpackAlignment: this.unpackAlignment\n\n\t\t};\n\n\t\tif ( Object.keys( this.userData ).length \u003e 0 ) output.userData = this.userData;\n\n\t\tif ( ! isRootObject ) {\n\n\t\t\tmeta.textures[ this.uuid ] = output;\n\n\t\t}\n\n\t\treturn output;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t *\n\t * @fires Texture#dispose\n\t */\n\tdispose() {\n\n\t\t/**\n\t\t * Fires when the texture has been disposed of.\n\t\t *\n\t\t * @event Texture#dispose\n\t\t * @type {Object}\n\t\t */\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n\t/**\n\t * Transforms the given uv vector with the textures uv transformation matrix.\n\t *\n\t * @param {Vector2} uv - The uv vector.\n\t * @return {Vector2} The transformed uv vector.\n\t */\n\ttransformUv( uv ) {\n\n\t\tif ( this.mapping !== UVMapping ) return uv;\n\n\t\tuv.applyMatrix3( this.matrix );\n\n\t\tif ( uv.x \u003c 0 || uv.x \u003e 1 ) {\n\n\t\t\tswitch ( this.wrapS ) {\n\n\t\t\t\tcase RepeatWrapping:\n\n\t\t\t\t\tuv.x = uv.x - Math.floor( uv.x );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ClampToEdgeWrapping:\n\n\t\t\t\t\tuv.x = uv.x \u003c 0 ? 0 : 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MirroredRepeatWrapping:\n\n\t\t\t\t\tif ( Math.abs( Math.floor( uv.x ) % 2 ) === 1 ) {\n\n\t\t\t\t\t\tuv.x = Math.ceil( uv.x ) - uv.x;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tuv.x = uv.x - Math.floor( uv.x );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( uv.y \u003c 0 || uv.y \u003e 1 ) {\n\n\t\t\tswitch ( this.wrapT ) {\n\n\t\t\t\tcase RepeatWrapping:\n\n\t\t\t\t\tuv.y = uv.y - Math.floor( uv.y );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ClampToEdgeWrapping:\n\n\t\t\t\t\tuv.y = uv.y \u003c 0 ? 0 : 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MirroredRepeatWrapping:\n\n\t\t\t\t\tif ( Math.abs( Math.floor( uv.y ) % 2 ) === 1 ) {\n\n\t\t\t\t\t\tuv.y = Math.ceil( uv.y ) - uv.y;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tuv.y = uv.y - Math.floor( uv.y );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.flipY ) {\n\n\t\t\tuv.y = 1 - uv.y;\n\n\t\t}\n\n\t\treturn uv;\n\n\t}\n\n\t/**\n\t * Setting this property to `true` indicates the engine the texture\n\t * must be updated in the next render. This triggers a texture upload\n\t * to the GPU and ensures correct texture parameter configuration.\n\t *\n\t * @type {boolean}\n\t * @default false\n\t * @param {boolean} value\n\t */\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) {\n\n\t\t\tthis.version ++;\n\t\t\tthis.source.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Setting this property to `true` indicates the engine the PMREM\n\t * must be regenerated.\n\t *\n\t * @type {boolean}\n\t * @default false\n\t * @param {boolean} value\n\t */\n\tset needsPMREMUpdate( value ) {\n\n\t\tif ( value === true ) {\n\n\t\t\tthis.pmremVersion ++;\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * The default image for all textures.\n *\n * @static\n * @type {?Image}\n * @default null\n */\nTexture.DEFAULT_IMAGE = null;\n\n/**\n * The default mapping for all textures.\n *\n * @static\n * @type {number}\n * @default UVMapping\n */\nTexture.DEFAULT_MAPPING = UVMapping;\n\n/**\n * The default anisotropy value for all textures.\n *\n * @static\n * @type {number}\n * @default 1\n */\nTexture.DEFAULT_ANISOTROPY = 1;\n\n/**\n * Class representing a 4D vector. A 4D vector is an ordered quadruplet of numbers\n * (labeled x, y, z and w), which can be used to represent a number of things, such as:\n *\n * - A point in 4D space.\n * - A direction and length in 4D space. In three.js the length will\n * always be the Euclidean distance(straight-line distance) from `(0, 0, 0, 0)` to `(x, y, z, w)`\n * and the direction is also measured from `(0, 0, 0, 0)` towards `(x, y, z, w)`.\n * - Any arbitrary ordered quadruplet of numbers.\n *\n * There are other things a 4D vector can be used to represent, however these\n * are the most common uses in *three.js*.\n *\n * Iterating through a vector instance will yield its components `(x, y, z, w)` in\n * the corresponding order.\n * ```js\n * const a = new THREE.Vector4( 0, 1, 0, 0 );\n *\n * //no arguments; will be initialised to (0, 0, 0, 1)\n * const b = new THREE.Vector4( );\n *\n * const d = a.dot( b );\n * ```\n */\nclass Vector4 {\n\n\t/**\n\t * Constructs a new 4D vector.\n\t *\n\t * @param {number} [x=0] - The x value of this vector.\n\t * @param {number} [y=0] - The y value of this vector.\n\t * @param {number} [z=0] - The z value of this vector.\n\t * @param {number} [w=1] - The w value of this vector.\n\t */\n\tconstructor( x = 0, y = 0, z = 0, w = 1 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tVector4.prototype.isVector4 = true;\n\n\t\t/**\n\t\t * The x value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.x = x;\n\n\t\t/**\n\t\t * The y value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.y = y;\n\n\t\t/**\n\t\t * The z value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.z = z;\n\n\t\t/**\n\t\t * The w value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.w = w;\n\n\t}\n\n\t/**\n\t * Alias for {@link Vector4#z}.\n\t *\n\t * @type {number}\n\t */\n\tget width() {\n\n\t\treturn this.z;\n\n\t}\n\n\tset width( value ) {\n\n\t\tthis.z = value;\n\n\t}\n\n\t/**\n\t * Alias for {@link Vector4#w}.\n\t *\n\t * @type {number}\n\t */\n\tget height() {\n\n\t\treturn this.w;\n\n\t}\n\n\tset height( value ) {\n\n\t\tthis.w = value;\n\n\t}\n\n\t/**\n\t * Sets the vector components.\n\t *\n\t * @param {number} x - The value of the x component.\n\t * @param {number} y - The value of the y component.\n\t * @param {number} z - The value of the z component.\n\t * @param {number} w - The value of the w component.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tset( x, y, z, w ) {\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components to the same value.\n\t *\n\t * @param {number} scalar - The value to set for all vector components.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetScalar( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\tthis.w = scalar;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's x component to the given value\n\t *\n\t * @param {number} x - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetX( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's y component to the given value\n\t *\n\t * @param {number} y - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetY( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's z component to the given value\n\t *\n\t * @param {number} z - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetZ( z ) {\n\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's w component to the given value\n\t *\n\t * @param {number} w - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetW( w ) {\n\n\t\tthis.w = w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Allows to set a vector component with an index.\n\t *\n\t * @param {number} index - The component index. `0` equals to x, `1` equals to y,\n\t * `2` equals to z, `3` equals to w.\n\t * @param {number} value - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetComponent( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tcase 2: this.z = value; break;\n\t\t\tcase 3: this.w = value; break;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the value of the vector component which matches the given index.\n\t *\n\t * @param {number} index - The component index. `0` equals to x, `1` equals to y,\n\t * `2` equals to z, `3` equals to w.\n\t * @return {number} A vector component value.\n\t */\n\tgetComponent( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tcase 2: return this.z;\n\t\t\tcase 3: return this.w;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns a new vector with copied values from this instance.\n\t *\n\t * @return {Vector4} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor( this.x, this.y, this.z, this.w );\n\n\t}\n\n\t/**\n\t * Copies the values of the given vector to this instance.\n\t *\n\t * @param {Vector3|Vector4} v - The vector to copy.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tcopy( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\tthis.w = ( v.w !== undefined ) ? v.w : 1;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vector to this instance.\n\t *\n\t * @param {Vector4} v - The vector to add.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tadd( v ) {\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\tthis.w += v.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given scalar value to all components of this instance.\n\t *\n\t * @param {number} s - The scalar to add.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\taddScalar( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\tthis.w += s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vectors and stores the result in this instance.\n\t *\n\t * @param {Vector4} a - The first vector.\n\t * @param {Vector4} b - The second vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\taddVectors( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\tthis.w = a.w + b.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vector scaled by the given factor to this instance.\n\t *\n\t * @param {Vector4} v - The vector.\n\t * @param {number} s - The factor that scales `v`.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\taddScaledVector( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\tthis.w += v.w * s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given vector from this instance.\n\t *\n\t * @param {Vector4} v - The vector to subtract.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsub( v ) {\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\tthis.w -= v.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given scalar value from all components of this instance.\n\t *\n\t * @param {number} s - The scalar to subtract.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsubScalar( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\tthis.w -= s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given vectors and stores the result in this instance.\n\t *\n\t * @param {Vector4} a - The first vector.\n\t * @param {Vector4} b - The second vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsubVectors( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\tthis.w = a.w - b.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given vector with this instance.\n\t *\n\t * @param {Vector4} v - The vector to multiply.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tmultiply( v ) {\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\tthis.w *= v.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given scalar value with all components of this instance.\n\t *\n\t * @param {number} scalar - The scalar to multiply.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tmultiplyScalar( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\tthis.w *= scalar;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies this vector with the given 4x4 matrix.\n\t *\n\t * @param {Matrix4} m - The 4x4 matrix.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tapplyMatrix4( m ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z, w = this.w;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] * w;\n\t\tthis.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] * w;\n\t\tthis.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] * w;\n\t\tthis.w = e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] * w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Divides this instance by the given vector.\n\t *\n\t * @param {Vector4} v - The vector to divide.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tdivide( v ) {\n\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\tthis.z /= v.z;\n\t\tthis.w /= v.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Divides this vector by the given scalar.\n\t *\n\t * @param {number} scalar - The scalar to divide.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tdivideScalar( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t}\n\n\t/**\n\t * Sets the x, y and z components of this\n\t * vector to the quaternion's axis and w to the angle.\n\t *\n\t * @param {Quaternion} q - The Quaternion to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetAxisAngleFromQuaternion( q ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n\n\t\t// q is assumed to be normalized\n\n\t\tthis.w = 2 * Math.acos( q.w );\n\n\t\tconst s = Math.sqrt( 1 - q.w * q.w );\n\n\t\tif ( s \u003c 0.0001 ) {\n\n\t\t\tthis.x = 1;\n\t\t\tthis.y = 0;\n\t\t\tthis.z = 0;\n\n\t\t} else {\n\n\t\t\tthis.x = q.x / s;\n\t\t\tthis.y = q.y / s;\n\t\t\tthis.z = q.z / s;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the x, y and z components of this\n\t * vector to the axis of rotation and w to the angle.\n\t *\n\t * @param {Matrix4} m - A 4x4 matrix of which the upper left 3x3 matrix is a pure rotation matrix.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetAxisAngleFromRotationMatrix( m ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tlet angle, x, y, z; // variables for result\n\t\tconst epsilon = 0.01,\t\t// margin to allow for rounding errors\n\t\t\tepsilon2 = 0.1,\t\t// margin to distinguish between 0 and 180 degrees\n\n\t\t\tte = m.elements,\n\n\t\t\tm11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ],\n\t\t\tm21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ],\n\t\t\tm31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ];\n\n\t\tif ( ( Math.abs( m12 - m21 ) \u003c epsilon ) \u0026\u0026\n\t\t     ( Math.abs( m13 - m31 ) \u003c epsilon ) \u0026\u0026\n\t\t     ( Math.abs( m23 - m32 ) \u003c epsilon ) ) {\n\n\t\t\t// singularity found\n\t\t\t// first check for identity matrix which must have +1 for all terms\n\t\t\t// in leading diagonal and zero in other terms\n\n\t\t\tif ( ( Math.abs( m12 + m21 ) \u003c epsilon2 ) \u0026\u0026\n\t\t\t     ( Math.abs( m13 + m31 ) \u003c epsilon2 ) \u0026\u0026\n\t\t\t     ( Math.abs( m23 + m32 ) \u003c epsilon2 ) \u0026\u0026\n\t\t\t     ( Math.abs( m11 + m22 + m33 - 3 ) \u003c epsilon2 ) ) {\n\n\t\t\t\t// this singularity is identity matrix so angle = 0\n\n\t\t\t\tthis.set( 1, 0, 0, 0 );\n\n\t\t\t\treturn this; // zero angle, arbitrary axis\n\n\t\t\t}\n\n\t\t\t// otherwise this singularity is angle = 180\n\n\t\t\tangle = Math.PI;\n\n\t\t\tconst xx = ( m11 + 1 ) / 2;\n\t\t\tconst yy = ( m22 + 1 ) / 2;\n\t\t\tconst zz = ( m33 + 1 ) / 2;\n\t\t\tconst xy = ( m12 + m21 ) / 4;\n\t\t\tconst xz = ( m13 + m31 ) / 4;\n\t\t\tconst yz = ( m23 + m32 ) / 4;\n\n\t\t\tif ( ( xx \u003e yy ) \u0026\u0026 ( xx \u003e zz ) ) {\n\n\t\t\t\t// m11 is the largest diagonal term\n\n\t\t\t\tif ( xx \u003c epsilon ) {\n\n\t\t\t\t\tx = 0;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0.707106781;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tx = Math.sqrt( xx );\n\t\t\t\t\ty = xy / x;\n\t\t\t\t\tz = xz / x;\n\n\t\t\t\t}\n\n\t\t\t} else if ( yy \u003e zz ) {\n\n\t\t\t\t// m22 is the largest diagonal term\n\n\t\t\t\tif ( yy \u003c epsilon ) {\n\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0;\n\t\t\t\t\tz = 0.707106781;\n\n\t\t\t\t} else {\n\n\t\t\t\t\ty = Math.sqrt( yy );\n\t\t\t\t\tx = xy / y;\n\t\t\t\t\tz = yz / y;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// m33 is the largest diagonal term so base result on this\n\n\t\t\t\tif ( zz \u003c epsilon ) {\n\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tz = Math.sqrt( zz );\n\t\t\t\t\tx = xz / z;\n\t\t\t\t\ty = yz / z;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.set( x, y, z, angle );\n\n\t\t\treturn this; // return 180 deg rotation\n\n\t\t}\n\n\t\t// as we have reached here there are no singularities so we can handle normally\n\n\t\tlet s = Math.sqrt( ( m32 - m23 ) * ( m32 - m23 ) +\n\t\t\t( m13 - m31 ) * ( m13 - m31 ) +\n\t\t\t( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize\n\n\t\tif ( Math.abs( s ) \u003c 0.001 ) s = 1;\n\n\t\t// prevent divide by zero, should not happen if matrix is orthogonal and should be\n\t\t// caught by singularity test above, but I've left it in just in case\n\n\t\tthis.x = ( m32 - m23 ) / s;\n\t\tthis.y = ( m13 - m31 ) / s;\n\t\tthis.z = ( m21 - m12 ) / s;\n\t\tthis.w = Math.acos( ( m11 + m22 + m33 - 1 ) / 2 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components to the position elements of the\n\t * given transformation matrix.\n\t *\n\t * @param {Matrix4} m - The 4x4 matrix.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetFromMatrixPosition( m ) {\n\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 12 ];\n\t\tthis.y = e[ 13 ];\n\t\tthis.z = e[ 14 ];\n\t\tthis.w = e[ 15 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y, z or w value is greater than the given vector's x, y, z or w\n\t * value, replace that value with the corresponding min value.\n\t *\n\t * @param {Vector4} v - The vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tmin( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\t\tthis.z = Math.min( this.z, v.z );\n\t\tthis.w = Math.min( this.w, v.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y, z or w value is less than the given vector's x, y, z or w\n\t * value, replace that value with the corresponding max value.\n\t *\n\t * @param {Vector4} v - The vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tmax( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\t\tthis.z = Math.max( this.z, v.z );\n\t\tthis.w = Math.max( this.w, v.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y, z or w value is greater than the max vector's x, y, z or w\n\t * value, it is replaced by the corresponding value.\n\t * If this vector's x, y, z or w value is less than the min vector's x, y, z or w value,\n\t * it is replaced by the corresponding value.\n\t *\n\t * @param {Vector4} min - The minimum x, y and z values.\n\t * @param {Vector4} max - The maximum x, y and z values in the desired range.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tclamp( min, max ) {\n\n\t\t// assumes min \u003c max, componentwise\n\n\t\tthis.x = clamp( this.x, min.x, max.x );\n\t\tthis.y = clamp( this.y, min.y, max.y );\n\t\tthis.z = clamp( this.z, min.z, max.z );\n\t\tthis.w = clamp( this.w, min.w, max.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y, z or w values are greater than the max value, they are\n\t * replaced by the max value.\n\t * If this vector's x, y, z or w values are less than the min value, they are\n\t * replaced by the min value.\n\t *\n\t * @param {number} minVal - The minimum value the components will be clamped to.\n\t * @param {number} maxVal - The maximum value the components will be clamped to.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tclampScalar( minVal, maxVal ) {\n\n\t\tthis.x = clamp( this.x, minVal, maxVal );\n\t\tthis.y = clamp( this.y, minVal, maxVal );\n\t\tthis.z = clamp( this.z, minVal, maxVal );\n\t\tthis.w = clamp( this.w, minVal, maxVal );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's length is greater than the max value, it is replaced by\n\t * the max value.\n\t * If this vector's length is less than the min value, it is replaced by the\n\t * min value.\n\t *\n\t * @param {number} min - The minimum value the vector length will be clamped to.\n\t * @param {number} max - The maximum value the vector length will be clamped to.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tclampLength( min, max ) {\n\n\t\tconst length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( clamp( length, min, max ) );\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded down to the nearest integer value.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tfloor() {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\t\tthis.z = Math.floor( this.z );\n\t\tthis.w = Math.floor( this.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded up to the nearest integer value.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tceil() {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\t\tthis.z = Math.ceil( this.z );\n\t\tthis.w = Math.ceil( this.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded to the nearest integer value\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tround() {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\t\tthis.z = Math.round( this.z );\n\t\tthis.w = Math.round( this.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded towards zero (up if negative,\n\t * down if positive) to an integer value.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\troundToZero() {\n\n\t\tthis.x = Math.trunc( this.x );\n\t\tthis.y = Math.trunc( this.y );\n\t\tthis.z = Math.trunc( this.z );\n\t\tthis.w = Math.trunc( this.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Inverts this vector - i.e. sets x = -x, y = -y, z = -z, w = -w.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tnegate() {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\t\tthis.z = - this.z;\n\t\tthis.w = - this.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Calculates the dot product of the given vector with this instance.\n\t *\n\t * @param {Vector4} v - The vector to compute the dot product with.\n\t * @return {number} The result of the dot product.\n\t */\n\tdot( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n\n\t}\n\n\t/**\n\t * Computes the square of the Euclidean length (straight-line length) from\n\t * (0, 0, 0, 0) to (x, y, z, w). If you are comparing the lengths of vectors, you should\n\t * compare the length squared instead as it is slightly more efficient to calculate.\n\t *\n\t * @return {number} The square length of this vector.\n\t */\n\tlengthSq() {\n\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n\n\t}\n\n\t/**\n\t * Computes the  Euclidean length (straight-line length) from (0, 0, 0, 0) to (x, y, z, w).\n\t *\n\t * @return {number} The length of this vector.\n\t */\n\tlength() {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w );\n\n\t}\n\n\t/**\n\t * Computes the Manhattan length of this vector.\n\t *\n\t * @return {number} The length of this vector.\n\t */\n\tmanhattanLength() {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w );\n\n\t}\n\n\t/**\n\t * Converts this vector to a unit vector - that is, sets it equal to a vector\n\t * with the same direction as this one, but with a vector length of `1`.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tnormalize() {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t}\n\n\t/**\n\t * Sets this vector to a vector with the same direction as this one, but\n\t * with the specified length.\n\t *\n\t * @param {number} length - The new length of this vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetLength( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t}\n\n\t/**\n\t * Linearly interpolates between the given vector and this instance, where\n\t * alpha is the percent distance along the line - alpha = 0 will be this\n\t * vector, and alpha = 1 will be the given one.\n\t *\n\t * @param {Vector4} v - The vector to interpolate towards.\n\t * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tlerp( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\t\tthis.z += ( v.z - this.z ) * alpha;\n\t\tthis.w += ( v.w - this.w ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Linearly interpolates between the given vectors, where alpha is the percent\n\t * distance along the line - alpha = 0 will be first vector, and alpha = 1 will\n\t * be the second one. The result is stored in this instance.\n\t *\n\t * @param {Vector4} v1 - The first vector.\n\t * @param {Vector4} v2 - The second vector.\n\t * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tlerpVectors( v1, v2, alpha ) {\n\n\t\tthis.x = v1.x + ( v2.x - v1.x ) * alpha;\n\t\tthis.y = v1.y + ( v2.y - v1.y ) * alpha;\n\t\tthis.z = v1.z + ( v2.z - v1.z ) * alpha;\n\t\tthis.w = v1.w + ( v2.w - v1.w ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this vector is equal with the given one.\n\t *\n\t * @param {Vector4} v - The vector to test for equality.\n\t * @return {boolean} Whether this vector is equal with the given one.\n\t */\n\tequals( v ) {\n\n\t\treturn ( ( v.x === this.x ) \u0026\u0026 ( v.y === this.y ) \u0026\u0026 ( v.z === this.z ) \u0026\u0026 ( v.w === this.w ) );\n\n\t}\n\n\t/**\n\t * Sets this vector's x value to be `array[ offset ]`, y value to be `array[ offset + 1 ]`,\n\t * z value to be `array[ offset + 2 ]`, w value to be `array[ offset + 3 ]`.\n\t *\n\t * @param {Array\u003cnumber\u003e} array - An array holding the vector component values.\n\t * @param {number} [offset=0] - The offset into the array.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\t\tthis.z = array[ offset + 2 ];\n\t\tthis.w = array[ offset + 3 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Writes the components of this vector to the given array. If no array is provided,\n\t * the method returns a new instance.\n\t *\n\t * @param {Array\u003cnumber\u003e} [array=[]] - The target array holding the vector components.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Array\u003cnumber\u003e} The vector components.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\t\tarray[ offset + 2 ] = this.z;\n\t\tarray[ offset + 3 ] = this.w;\n\n\t\treturn array;\n\n\t}\n\n\t/**\n\t * Sets the components of this vector from the given buffer attribute.\n\t *\n\t * @param {BufferAttribute} attribute - The buffer attribute holding vector data.\n\t * @param {number} index - The index into the attribute.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\t\tthis.z = attribute.getZ( index );\n\t\tthis.w = attribute.getW( index );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets each component of this vector to a pseudo-random value between `0` and\n\t * `1`, excluding `1`.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\trandom() {\n\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\tthis.w = Math.random();\n\n\t\treturn this;\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t\tyield this.w;\n\n\t}\n\n}\n\n/**\n * A render target is a buffer where the video card draws pixels for a scene\n * that is being rendered in the background. It is used in different effects,\n * such as applying postprocessing to a rendered image before displaying it\n * on the screen.\n *\n * @augments EventDispatcher\n */\nclass RenderTarget extends EventDispatcher {\n\n\t/**\n\t * Render target options.\n\t *\n\t * @typedef {Object} RenderTarget~Options\n\t * @property {boolean} [generateMipmaps=false] - Whether to generate mipmaps or not.\n\t * @property {number} [magFilter=LinearFilter] - The mag filter.\n\t * @property {number} [minFilter=LinearFilter] - The min filter.\n\t * @property {number} [format=RGBAFormat] - The texture format.\n\t * @property {number} [type=UnsignedByteType] - The texture type.\n\t * @property {?string} [internalFormat=null] - The texture's internal format.\n\t * @property {number} [wrapS=ClampToEdgeWrapping] - The texture's uv wrapping mode.\n\t * @property {number} [wrapT=ClampToEdgeWrapping] - The texture's uv wrapping mode.\n\t * @property {number} [anisotropy=1] - The texture's anisotropy value.\n\t * @property {string} [colorSpace=NoColorSpace] - The texture's color space.\n\t * @property {boolean} [depthBuffer=true] - Whether to allocate a depth buffer or not.\n\t * @property {boolean} [stencilBuffer=false] - Whether to allocate a stencil buffer or not.\n\t * @property {boolean} [resolveDepthBuffer=true] - Whether to resolve the depth buffer or not.\n\t * @property {boolean} [resolveStencilBuffer=true] - Whether  to resolve the stencil buffer or not.\n\t * @property {?Texture} [depthTexture=null] - Reference to a depth texture.\n\t * @property {number} [samples=0] - The MSAA samples count.\n\t * @property {number} [count=1] - Defines the number of color attachments . Must be at least `1`.\n\t * @property {number} [depth=1] - The texture depth.\n\t * @property {boolean} [multiview=false] - Whether this target is used for multiview rendering.\n\t */\n\n\t/**\n\t * Constructs a new render target.\n\t *\n\t * @param {number} [width=1] - The width of the render target.\n\t * @param {number} [height=1] - The height of the render target.\n\t * @param {RenderTarget~Options} [options] - The configuration object.\n\t */\n\tconstructor( width = 1, height = 1, options = {} ) {\n\n\t\tsuper();\n\n\t\toptions = Object.assign( {\n\t\t\tgenerateMipmaps: false,\n\t\t\tinternalFormat: null,\n\t\t\tminFilter: LinearFilter,\n\t\t\tdepthBuffer: true,\n\t\t\tstencilBuffer: false,\n\t\t\tresolveDepthBuffer: true,\n\t\t\tresolveStencilBuffer: true,\n\t\t\tdepthTexture: null,\n\t\t\tsamples: 0,\n\t\t\tcount: 1,\n\t\t\tdepth: 1,\n\t\t\tmultiview: false\n\t\t}, options );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isRenderTarget = true;\n\n\t\t/**\n\t\t * The width of the render target.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.width = width;\n\n\t\t/**\n\t\t * The height of the render target.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.height = height;\n\n\t\t/**\n\t\t * The depth of the render target.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.depth = options.depth;\n\n\t\t/**\n\t\t * A rectangular area inside the render target's viewport. Fragments that are\n\t\t * outside the area will be discarded.\n\t\t *\n\t\t * @type {Vector4}\n\t\t * @default (0,0,width,height)\n\t\t */\n\t\tthis.scissor = new Vector4( 0, 0, width, height );\n\n\t\t/**\n\t\t * Indicates whether the scissor test should be enabled when rendering into\n\t\t * this render target or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.scissorTest = false;\n\n\t\t/**\n\t\t * A rectangular area representing the render target's viewport.\n\t\t *\n\t\t * @type {Vector4}\n\t\t * @default (0,0,width,height)\n\t\t */\n\t\tthis.viewport = new Vector4( 0, 0, width, height );\n\n\t\tconst image = { width: width, height: height, depth: options.depth };\n\n\t\tconst texture = new Texture( image );\n\n\t\t/**\n\t\t * An array of textures. Each color attachment is represented as a separate texture.\n\t\t * Has at least a single entry for the default color attachment.\n\t\t *\n\t\t * @type {Array\u003cTexture\u003e}\n\t\t */\n\t\tthis.textures = [];\n\n\t\tconst count = options.count;\n\t\tfor ( let i = 0; i \u003c count; i ++ ) {\n\n\t\t\tthis.textures[ i ] = texture.clone();\n\t\t\tthis.textures[ i ].isRenderTargetTexture = true;\n\t\t\tthis.textures[ i ].renderTarget = this;\n\n\t\t}\n\n\t\tthis._setTextureOptions( options );\n\n\t\t/**\n\t\t * Whether to allocate a depth buffer or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.depthBuffer = options.depthBuffer;\n\n\t\t/**\n\t\t * Whether to allocate a stencil buffer or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.stencilBuffer = options.stencilBuffer;\n\n\t\t/**\n\t\t * Whether to resolve the depth buffer or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.resolveDepthBuffer = options.resolveDepthBuffer;\n\n\t\t/**\n\t\t * Whether to resolve the stencil buffer or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.resolveStencilBuffer = options.resolveStencilBuffer;\n\n\t\tthis._depthTexture = null;\n\t\tthis.depthTexture = options.depthTexture;\n\n\t\t/**\n\t\t * The number of MSAA samples.\n\t\t *\n\t\t * A value of `0` disables MSAA.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.samples = options.samples;\n\n\t\t/**\n\t\t * Whether to this target is used in multiview rendering.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.multiview = options.multiview;\n\n\t}\n\n\t_setTextureOptions( options = {} ) {\n\n\t\tconst values = {\n\t\t\tminFilter: LinearFilter,\n\t\t\tgenerateMipmaps: false,\n\t\t\tflipY: false,\n\t\t\tinternalFormat: null\n\t\t};\n\n\t\tif ( options.mapping !== undefined ) values.mapping = options.mapping;\n\t\tif ( options.wrapS !== undefined ) values.wrapS = options.wrapS;\n\t\tif ( options.wrapT !== undefined ) values.wrapT = options.wrapT;\n\t\tif ( options.wrapR !== undefined ) values.wrapR = options.wrapR;\n\t\tif ( options.magFilter !== undefined ) values.magFilter = options.magFilter;\n\t\tif ( options.minFilter !== undefined ) values.minFilter = options.minFilter;\n\t\tif ( options.format !== undefined ) values.format = options.format;\n\t\tif ( options.type !== undefined ) values.type = options.type;\n\t\tif ( options.anisotropy !== undefined ) values.anisotropy = options.anisotropy;\n\t\tif ( options.colorSpace !== undefined ) values.colorSpace = options.colorSpace;\n\t\tif ( options.flipY !== undefined ) values.flipY = options.flipY;\n\t\tif ( options.generateMipmaps !== undefined ) values.generateMipmaps = options.generateMipmaps;\n\t\tif ( options.internalFormat !== undefined ) values.internalFormat = options.internalFormat;\n\n\t\tfor ( let i = 0; i \u003c this.textures.length; i ++ ) {\n\n\t\t\tconst texture = this.textures[ i ];\n\t\t\ttexture.setValues( values );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * The texture representing the default color attachment.\n\t *\n\t * @type {Texture}\n\t */\n\tget texture() {\n\n\t\treturn this.textures[ 0 ];\n\n\t}\n\n\tset texture( value ) {\n\n\t\tthis.textures[ 0 ] = value;\n\n\t}\n\n\tset depthTexture( current ) {\n\n\t\tif ( this._depthTexture !== null ) this._depthTexture.renderTarget = null;\n\t\tif ( current !== null ) current.renderTarget = this;\n\n\t\tthis._depthTexture = current;\n\n\t}\n\n\t/**\n\t * Instead of saving the depth in a renderbuffer, a texture\n\t * can be used instead which is useful for further processing\n\t * e.g. in context of post-processing.\n\t *\n\t * @type {?DepthTexture}\n\t * @default null\n\t */\n\tget depthTexture() {\n\n\t\treturn this._depthTexture;\n\n\t}\n\n\t/**\n\t * Sets the size of this render target.\n\t *\n\t * @param {number} width - The width.\n\t * @param {number} height - The height.\n\t * @param {number} [depth=1] - The depth.\n\t */\n\tsetSize( width, height, depth = 1 ) {\n\n\t\tif ( this.width !== width || this.height !== height || this.depth !== depth ) {\n\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\t\t\tthis.depth = depth;\n\n\t\t\tfor ( let i = 0, il = this.textures.length; i \u003c il; i ++ ) {\n\n\t\t\t\tthis.textures[ i ].image.width = width;\n\t\t\t\tthis.textures[ i ].image.height = height;\n\t\t\t\tthis.textures[ i ].image.depth = depth;\n\n\t\t\t\tif ( this.textures[ i ].isData3DTexture !== true ) { // Fix for #31693\n\n\t\t\t\t\t// TODO: Reconsider setting isArrayTexture flag here and in the ctor of Texture.\n\t\t\t\t\t// Maybe a method `isArrayTexture()` or just a getter could replace a flag since\n\t\t\t\t\t// both are evaluated on each call?\n\n\t\t\t\t\tthis.textures[ i ].isArrayTexture = this.textures[ i ].image.depth \u003e 1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.dispose();\n\n\t\t}\n\n\t\tthis.viewport.set( 0, 0, width, height );\n\t\tthis.scissor.set( 0, 0, width, height );\n\n\t}\n\n\t/**\n\t * Returns a new render target with copied values from this instance.\n\t *\n\t * @return {RenderTarget} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Copies the settings of the given render target. This is a structural copy so\n\t * no resources are shared between render targets after the copy. That includes\n\t * all MRT textures and the depth texture.\n\t *\n\t * @param {RenderTarget} source - The render target to copy.\n\t * @return {RenderTarget} A reference to this instance.\n\t */\n\tcopy( source ) {\n\n\t\tthis.width = source.width;\n\t\tthis.height = source.height;\n\t\tthis.depth = source.depth;\n\n\t\tthis.scissor.copy( source.scissor );\n\t\tthis.scissorTest = source.scissorTest;\n\n\t\tthis.viewport.copy( source.viewport );\n\n\t\tthis.textures.length = 0;\n\n\t\tfor ( let i = 0, il = source.textures.length; i \u003c il; i ++ ) {\n\n\t\t\tthis.textures[ i ] = source.textures[ i ].clone();\n\t\t\tthis.textures[ i ].isRenderTargetTexture = true;\n\t\t\tthis.textures[ i ].renderTarget = this;\n\n\t\t\t// ensure image object is not shared, see #20328\n\n\t\t\tconst image = Object.assign( {}, source.textures[ i ].image );\n\t\t\tthis.textures[ i ].source = new Source( image );\n\n\t\t}\n\n\t\tthis.depthBuffer = source.depthBuffer;\n\t\tthis.stencilBuffer = source.stencilBuffer;\n\n\t\tthis.resolveDepthBuffer = source.resolveDepthBuffer;\n\t\tthis.resolveStencilBuffer = source.resolveStencilBuffer;\n\n\t\tif ( source.depthTexture !== null ) this.depthTexture = source.depthTexture.clone();\n\n\t\tthis.samples = source.samples;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t *\n\t * @fires RenderTarget#dispose\n\t */\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n}\n\n/**\n * A render target used in context of {@link WebGLRenderer}.\n *\n * @augments RenderTarget\n */\nclass WebGLRenderTarget extends RenderTarget {\n\n\t/**\n\t * Constructs a new 3D render target.\n\t *\n\t * @param {number} [width=1] - The width of the render target.\n\t * @param {number} [height=1] - The height of the render target.\n\t * @param {RenderTarget~Options} [options] - The configuration object.\n\t */\n\tconstructor( width = 1, height = 1, options = {} ) {\n\n\t\tsuper( width, height, options );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isWebGLRenderTarget = true;\n\n\t}\n\n}\n\n/**\n * Creates an array of textures directly from raw buffer data.\n *\n * @augments Texture\n */\nclass DataArrayTexture extends Texture {\n\n\t/**\n\t * Constructs a new data array texture.\n\t *\n\t * @param {?TypedArray} [data=null] - The buffer data.\n\t * @param {number} [width=1] - The width of the texture.\n\t * @param {number} [height=1] - The height of the texture.\n\t * @param {number} [depth=1] - The depth of the texture.\n\t */\n\tconstructor( data = null, width = 1, height = 1, depth = 1 ) {\n\n\t\tsuper( null );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isDataArrayTexture = true;\n\n\t\t/**\n\t\t * The image definition of a data texture.\n\t\t *\n\t\t * @type {{data:TypedArray,width:number,height:number,depth:number}}\n\t\t */\n\t\tthis.image = { data, width, height, depth };\n\n\t\t/**\n\t\t * How the texture is sampled when a texel covers more than one pixel.\n\t\t *\n\t\t * Overwritten and set to `NearestFilter` by default.\n\t\t *\n\t\t * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)}\n\t\t * @default NearestFilter\n\t\t */\n\t\tthis.magFilter = NearestFilter;\n\n\t\t/**\n\t\t * How the texture is sampled when a texel covers less than one pixel.\n\t\t *\n\t\t * Overwritten and set to `NearestFilter` by default.\n\t\t *\n\t\t * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)}\n\t\t * @default NearestFilter\n\t\t */\n\t\tthis.minFilter = NearestFilter;\n\n\t\t/**\n\t\t * This defines how the texture is wrapped in the depth and corresponds to\n\t\t * *W* in UVW mapping.\n\t\t *\n\t\t * @type {(RepeatWrapping|ClampToEdgeWrapping|MirroredRepeatWrapping)}\n\t\t * @default ClampToEdgeWrapping\n\t\t */\n\t\tthis.wrapR = ClampToEdgeWrapping;\n\n\t\t/**\n\t\t * Whether to generate mipmaps (if possible) for a texture.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.generateMipmaps = false;\n\n\t\t/**\n\t\t * If set to `true`, the texture is flipped along the vertical axis when\n\t\t * uploaded to the GPU.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flipY = false;\n\n\t\t/**\n\t\t * Specifies the alignment requirements for the start of each pixel row in memory.\n\t\t *\n\t\t * Overwritten and set to `1` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default 1\n\t\t */\n\t\tthis.unpackAlignment = 1;\n\n\t\t/**\n\t\t * A set of all layers which need to be updated in the texture.\n\t\t *\n\t\t * @type {Set\u003cnumber\u003e}\n\t\t */\n\t\tthis.layerUpdates = new Set();\n\n\t}\n\n\t/**\n\t * Describes that a specific layer of the texture needs to be updated.\n\t * Normally when {@link Texture#needsUpdate} is set to `true`, the\n\t * entire data texture array is sent to the GPU. Marking specific\n\t * layers will only transmit subsets of all mipmaps associated with a\n\t * specific depth in the array which is often much more performant.\n\t *\n\t * @param {number} layerIndex - The layer index that should be updated.\n\t */\n\taddLayerUpdate( layerIndex ) {\n\n\t\tthis.layerUpdates.add( layerIndex );\n\n\t}\n\n\t/**\n\t * Resets the layer updates registry.\n\t */\n\tclearLayerUpdates() {\n\n\t\tthis.layerUpdates.clear();\n\n\t}\n\n}\n\n/**\n * An array render target used in context of {@link WebGLRenderer}.\n *\n * @augments WebGLRenderTarget\n */\nclass WebGLArrayRenderTarget extends WebGLRenderTarget {\n\n\t/**\n\t * Constructs a new array render target.\n\t *\n\t * @param {number} [width=1] - The width of the render target.\n\t * @param {number} [height=1] - The height of the render target.\n\t * @param {number} [depth=1] - The height of the render target.\n\t * @param {RenderTarget~Options} [options] - The configuration object.\n\t */\n\tconstructor( width = 1, height = 1, depth = 1, options = {} ) {\n\n\t\tsuper( width, height, options );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isWebGLArrayRenderTarget = true;\n\n\t\tthis.depth = depth;\n\n\t\t/**\n\t\t * Overwritten with a different texture type.\n\t\t *\n\t\t * @type {DataArrayTexture}\n\t\t */\n\t\tthis.texture = new DataArrayTexture( null, width, height, depth );\n\t\tthis._setTextureOptions( options );\n\n\t\tthis.texture.isRenderTargetTexture = true;\n\n\t}\n\n}\n\n/**\n * Creates a three-dimensional texture from raw data, with parameters to\n * divide it into width, height, and depth.\n *\n * @augments Texture\n */\nclass Data3DTexture extends Texture {\n\n\t/**\n\t * Constructs a new data array texture.\n\t *\n\t * @param {?TypedArray} [data=null] - The buffer data.\n\t * @param {number} [width=1] - The width of the texture.\n\t * @param {number} [height=1] - The height of the texture.\n\t * @param {number} [depth=1] - The depth of the texture.\n\t */\n\tconstructor( data = null, width = 1, height = 1, depth = 1 ) {\n\n\t\t// We're going to add .setXXX() methods for setting properties later.\n\t\t// Users can still set in Data3DTexture directly.\n\t\t//\n\t\t//\tconst texture = new THREE.Data3DTexture( data, width, height, depth );\n\t\t// \ttexture.anisotropy = 16;\n\t\t//\n\t\t// See #14839\n\n\t\tsuper( null );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isData3DTexture = true;\n\n\t\t/**\n\t\t * The image definition of a data texture.\n\t\t *\n\t\t * @type {{data:TypedArray,width:number,height:number,depth:number}}\n\t\t */\n\t\tthis.image = { data, width, height, depth };\n\n\t\t/**\n\t\t * How the texture is sampled when a texel covers more than one pixel.\n\t\t *\n\t\t * Overwritten and set to `NearestFilter` by default.\n\t\t *\n\t\t * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)}\n\t\t * @default NearestFilter\n\t\t */\n\t\tthis.magFilter = NearestFilter;\n\n\t\t/**\n\t\t * How the texture is sampled when a texel covers less than one pixel.\n\t\t *\n\t\t * Overwritten and set to `NearestFilter` by default.\n\t\t *\n\t\t * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)}\n\t\t * @default NearestFilter\n\t\t */\n\t\tthis.minFilter = NearestFilter;\n\n\t\t/**\n\t\t * This defines how the texture is wrapped in the depth and corresponds to\n\t\t * *W* in UVW mapping.\n\t\t *\n\t\t * @type {(RepeatWrapping|ClampToEdgeWrapping|MirroredRepeatWrapping)}\n\t\t * @default ClampToEdgeWrapping\n\t\t */\n\t\tthis.wrapR = ClampToEdgeWrapping;\n\n\t\t/**\n\t\t * Whether to generate mipmaps (if possible) for a texture.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.generateMipmaps = false;\n\n\t\t/**\n\t\t * If set to `true`, the texture is flipped along the vertical axis when\n\t\t * uploaded to the GPU.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flipY = false;\n\n\t\t/**\n\t\t * Specifies the alignment requirements for the start of each pixel row in memory.\n\t\t *\n\t\t * Overwritten and set to `1` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default 1\n\t\t */\n\t\tthis.unpackAlignment = 1;\n\n\t}\n\n}\n\n/**\n * A 3D render target used in context of {@link WebGLRenderer}.\n *\n * @augments WebGLRenderTarget\n */\nclass WebGL3DRenderTarget extends WebGLRenderTarget {\n\n\t/**\n\t * Constructs a new 3D render target.\n\t *\n\t * @param {number} [width=1] - The width of the render target.\n\t * @param {number} [height=1] - The height of the render target.\n\t * @param {number} [depth=1] - The height of the render target.\n\t * @param {RenderTarget~Options} [options] - The configuration object.\n\t */\n\tconstructor( width = 1, height = 1, depth = 1, options = {} ) {\n\n\t\tsuper( width, height, options );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isWebGL3DRenderTarget = true;\n\n\t\tthis.depth = depth;\n\n\t\t/**\n\t\t * Overwritten with a different texture type.\n\t\t *\n\t\t * @type {Data3DTexture}\n\t\t */\n\t\tthis.texture = new Data3DTexture( null, width, height, depth );\n\t\tthis._setTextureOptions( options );\n\n\t\tthis.texture.isRenderTargetTexture = true;\n\n\t}\n\n}\n\n/**\n * Represents an axis-aligned bounding box (AABB) in 3D space.\n */\nclass Box3 {\n\n\t/**\n\t * Constructs a new bounding box.\n\t *\n\t * @param {Vector3} [min=(Infinity,Infinity,Infinity)] - A vector representing the lower boundary of the box.\n\t * @param {Vector3} [max=(-Infinity,-Infinity,-Infinity)] - A vector representing the upper boundary of the box.\n\t */\n\tconstructor( min = new Vector3( + Infinity, + Infinity, + Infinity ), max = new Vector3( - Infinity, - Infinity, - Infinity ) ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isBox3 = true;\n\n\t\t/**\n\t\t * The lower boundary of the box.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.min = min;\n\n\t\t/**\n\t\t * The upper boundary of the box.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.max = max;\n\n\t}\n\n\t/**\n\t * Sets the lower and upper boundaries of this box.\n\t * Please note that this method only copies the values from the given objects.\n\t *\n\t * @param {Vector3} min - The lower boundary of the box.\n\t * @param {Vector3} max - The upper boundary of the box.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tset( min, max ) {\n\n\t\tthis.min.copy( min );\n\t\tthis.max.copy( max );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the upper and lower bounds of this box so it encloses the position data\n\t * in the given array.\n\t *\n\t * @param {Array\u003cnumber\u003e} array - An array holding 3D position data.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tsetFromArray( array ) {\n\n\t\tthis.makeEmpty();\n\n\t\tfor ( let i = 0, il = array.length; i \u003c il; i += 3 ) {\n\n\t\t\tthis.expandByPoint( _vector$b.fromArray( array, i ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the upper and lower bounds of this box so it encloses the position data\n\t * in the given buffer attribute.\n\t *\n\t * @param {BufferAttribute} attribute - A buffer attribute holding 3D position data.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tsetFromBufferAttribute( attribute ) {\n\n\t\tthis.makeEmpty();\n\n\t\tfor ( let i = 0, il = attribute.count; i \u003c il; i ++ ) {\n\n\t\t\tthis.expandByPoint( _vector$b.fromBufferAttribute( attribute, i ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the upper and lower bounds of this box so it encloses the position data\n\t * in the given array.\n\t *\n\t * @param {Array\u003cVector3\u003e} points - An array holding 3D position data as instances of {@link Vector3}.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tsetFromPoints( points ) {\n\n\t\tthis.makeEmpty();\n\n\t\tfor ( let i = 0, il = points.length; i \u003c il; i ++ ) {\n\n\t\t\tthis.expandByPoint( points[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Centers this box on the given center vector and sets this box's width, height and\n\t * depth to the given size values.\n\t *\n\t * @param {Vector3} center - The center of the box.\n\t * @param {Vector3} size - The x, y and z dimensions of the box.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tsetFromCenterAndSize( center, size ) {\n\n\t\tconst halfSize = _vector$b.copy( size ).multiplyScalar( 0.5 );\n\n\t\tthis.min.copy( center ).sub( halfSize );\n\t\tthis.max.copy( center ).add( halfSize );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes the world-axis-aligned bounding box for the given 3D object\n\t * (including its children), accounting for the object's, and children's,\n\t * world transforms. The function may result in a larger box than strictly necessary.\n\t *\n\t * @param {Object3D} object - The 3D object to compute the bounding box for.\n\t * @param {boolean} [precise=false] - If set to `true`, the method computes the smallest\n\t * world-axis-aligned bounding box at the expense of more computation.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tsetFromObject( object, precise = false ) {\n\n\t\tthis.makeEmpty();\n\n\t\treturn this.expandByObject( object, precise );\n\n\t}\n\n\t/**\n\t * Returns a new box with copied values from this instance.\n\t *\n\t * @return {Box3} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Copies the values of the given box to this instance.\n\t *\n\t * @param {Box3} box - The box to copy.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tcopy( box ) {\n\n\t\tthis.min.copy( box.min );\n\t\tthis.max.copy( box.max );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Makes this box empty which means in encloses a zero space in 3D.\n\t *\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tmakeEmpty() {\n\n\t\tthis.min.x = this.min.y = this.min.z = + Infinity;\n\t\tthis.max.x = this.max.y = this.max.z = - Infinity;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns true if this box includes zero points within its bounds.\n\t * Note that a box with equal lower and upper bounds still includes one\n\t * point, the one both bounds share.\n\t *\n\t * @return {boolean} Whether this box is empty or not.\n\t */\n\tisEmpty() {\n\n\t\t// this is a more robust check for empty than ( volume \u003c= 0 ) because volume can get positive with two negative axes\n\n\t\treturn ( this.max.x \u003c this.min.x ) || ( this.max.y \u003c this.min.y ) || ( this.max.z \u003c this.min.z );\n\n\t}\n\n\t/**\n\t * Returns the center point of this box.\n\t *\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The center point.\n\t */\n\tgetCenter( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 );\n\n\t}\n\n\t/**\n\t * Returns the dimensions of this box.\n\t *\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The size.\n\t */\n\tgetSize( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0, 0 ) : target.subVectors( this.max, this.min );\n\n\t}\n\n\t/**\n\t * Expands the boundaries of this box to include the given point.\n\t *\n\t * @param {Vector3} point - The point that should be included by the bounding box.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\texpandByPoint( point ) {\n\n\t\tthis.min.min( point );\n\t\tthis.max.max( point );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Expands this box equilaterally by the given vector. The width of this\n\t * box will be expanded by the x component of the vector in both\n\t * directions. The height of this box will be expanded by the y component of\n\t * the vector in both directions. The depth of this box will be\n\t * expanded by the z component of the vector in both directions.\n\t *\n\t * @param {Vector3} vector - The vector that should expand the bounding box.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\texpandByVector( vector ) {\n\n\t\tthis.min.sub( vector );\n\t\tthis.max.add( vector );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Expands each dimension of the box by the given scalar. If negative, the\n\t * dimensions of the box will be contracted.\n\t *\n\t * @param {number} scalar - The scalar value that should expand the bounding box.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\texpandByScalar( scalar ) {\n\n\t\tthis.min.addScalar( - scalar );\n\t\tthis.max.addScalar( scalar );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Expands the boundaries of this box to include the given 3D object and\n\t * its children, accounting for the object's, and children's, world\n\t * transforms. The function may result in a larger box than strictly\n\t * necessary (unless the precise parameter is set to true).\n\t *\n\t * @param {Object3D} object - The 3D object that should expand the bounding box.\n\t * @param {boolean} precise - If set to `true`, the method expands the bounding box\n\t * as little as necessary at the expense of more computation.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\texpandByObject( object, precise = false ) {\n\n\t\t// Computes the world-axis-aligned bounding box of an object (including its children),\n\t\t// accounting for both the object's, and children's, world transforms\n\n\t\tobject.updateWorldMatrix( false, false );\n\n\t\tconst geometry = object.geometry;\n\n\t\tif ( geometry !== undefined ) {\n\n\t\t\tconst positionAttribute = geometry.getAttribute( 'position' );\n\n\t\t\t// precise AABB computation based on vertex data requires at least a position attribute.\n\t\t\t// instancing isn't supported so far and uses the normal (conservative) code path.\n\n\t\t\tif ( precise === true \u0026\u0026 positionAttribute !== undefined \u0026\u0026 object.isInstancedMesh !== true ) {\n\n\t\t\t\tfor ( let i = 0, l = positionAttribute.count; i \u003c l; i ++ ) {\n\n\t\t\t\t\tif ( object.isMesh === true ) {\n\n\t\t\t\t\t\tobject.getVertexPosition( i, _vector$b );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_vector$b.fromBufferAttribute( positionAttribute, i );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_vector$b.applyMatrix4( object.matrixWorld );\n\t\t\t\t\tthis.expandByPoint( _vector$b );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( object.boundingBox !== undefined ) {\n\n\t\t\t\t\t// object-level bounding box\n\n\t\t\t\t\tif ( object.boundingBox === null ) {\n\n\t\t\t\t\t\tobject.computeBoundingBox();\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_box$4.copy( object.boundingBox );\n\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// geometry-level bounding box\n\n\t\t\t\t\tif ( geometry.boundingBox === null ) {\n\n\t\t\t\t\t\tgeometry.computeBoundingBox();\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_box$4.copy( geometry.boundingBox );\n\n\t\t\t\t}\n\n\t\t\t\t_box$4.applyMatrix4( object.matrixWorld );\n\n\t\t\t\tthis.union( _box$4 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst children = object.children;\n\n\t\tfor ( let i = 0, l = children.length; i \u003c l; i ++ ) {\n\n\t\t\tthis.expandByObject( children[ i ], precise );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if the given point lies within or on the boundaries of this box.\n\t *\n\t * @param {Vector3} point - The point to test.\n\t * @return {boolean} Whether the bounding box contains the given point or not.\n\t */\n\tcontainsPoint( point ) {\n\n\t\treturn point.x \u003e= this.min.x \u0026\u0026 point.x \u003c= this.max.x \u0026\u0026\n\t\t\tpoint.y \u003e= this.min.y \u0026\u0026 point.y \u003c= this.max.y \u0026\u0026\n\t\t\tpoint.z \u003e= this.min.z \u0026\u0026 point.z \u003c= this.max.z;\n\n\t}\n\n\t/**\n\t * Returns `true` if this bounding box includes the entirety of the given bounding box.\n\t * If this box and the given one are identical, this function also returns `true`.\n\t *\n\t * @param {Box3} box - The bounding box to test.\n\t * @return {boolean} Whether the bounding box contains the given bounding box or not.\n\t */\n\tcontainsBox( box ) {\n\n\t\treturn this.min.x \u003c= box.min.x \u0026\u0026 box.max.x \u003c= this.max.x \u0026\u0026\n\t\t\tthis.min.y \u003c= box.min.y \u0026\u0026 box.max.y \u003c= this.max.y \u0026\u0026\n\t\t\tthis.min.z \u003c= box.min.z \u0026\u0026 box.max.z \u003c= this.max.z;\n\n\t}\n\n\t/**\n\t * Returns a point as a proportion of this box's width, height and depth.\n\t *\n\t * @param {Vector3} point - A point in 3D space.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} A point as a proportion of this box's width, height and depth.\n\t */\n\tgetParameter( point, target ) {\n\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\n\t\treturn target.set(\n\t\t\t( point.x - this.min.x ) / ( this.max.x - this.min.x ),\n\t\t\t( point.y - this.min.y ) / ( this.max.y - this.min.y ),\n\t\t\t( point.z - this.min.z ) / ( this.max.z - this.min.z )\n\t\t);\n\n\t}\n\n\t/**\n\t * Returns `true` if the given bounding box intersects with this bounding box.\n\t *\n\t * @param {Box3} box - The bounding box to test.\n\t * @return {boolean} Whether the given bounding box intersects with this bounding box.\n\t */\n\tintersectsBox( box ) {\n\n\t\t// using 6 splitting planes to rule out intersections.\n\t\treturn box.max.x \u003e= this.min.x \u0026\u0026 box.min.x \u003c= this.max.x \u0026\u0026\n\t\t\tbox.max.y \u003e= this.min.y \u0026\u0026 box.min.y \u003c= this.max.y \u0026\u0026\n\t\t\tbox.max.z \u003e= this.min.z \u0026\u0026 box.min.z \u003c= this.max.z;\n\n\t}\n\n\t/**\n\t * Returns `true` if the given bounding sphere intersects with this bounding box.\n\t *\n\t * @param {Sphere} sphere - The bounding sphere to test.\n\t * @return {boolean} Whether the given bounding sphere intersects with this bounding box.\n\t */\n\tintersectsSphere( sphere ) {\n\n\t\t// Find the point on the AABB closest to the sphere center.\n\t\tthis.clampPoint( sphere.center, _vector$b );\n\n\t\t// If that point is inside the sphere, the AABB and sphere intersect.\n\t\treturn _vector$b.distanceToSquared( sphere.center ) \u003c= ( sphere.radius * sphere.radius );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given plane intersects with this bounding box.\n\t *\n\t * @param {Plane} plane - The plane to test.\n\t * @return {boolean} Whether the given plane intersects with this bounding box.\n\t */\n\tintersectsPlane( plane ) {\n\n\t\t// We compute the minimum and maximum dot product values. If those values\n\t\t// are on the same side (back or front) of the plane, then there is no intersection.\n\n\t\tlet min, max;\n\n\t\tif ( plane.normal.x \u003e 0 ) {\n\n\t\t\tmin = plane.normal.x * this.min.x;\n\t\t\tmax = plane.normal.x * this.max.x;\n\n\t\t} else {\n\n\t\t\tmin = plane.normal.x * this.max.x;\n\t\t\tmax = plane.normal.x * this.min.x;\n\n\t\t}\n\n\t\tif ( plane.normal.y \u003e 0 ) {\n\n\t\t\tmin += plane.normal.y * this.min.y;\n\t\t\tmax += plane.normal.y * this.max.y;\n\n\t\t} else {\n\n\t\t\tmin += plane.normal.y * this.max.y;\n\t\t\tmax += plane.normal.y * this.min.y;\n\n\t\t}\n\n\t\tif ( plane.normal.z \u003e 0 ) {\n\n\t\t\tmin += plane.normal.z * this.min.z;\n\t\t\tmax += plane.normal.z * this.max.z;\n\n\t\t} else {\n\n\t\t\tmin += plane.normal.z * this.max.z;\n\t\t\tmax += plane.normal.z * this.min.z;\n\n\t\t}\n\n\t\treturn ( min \u003c= - plane.constant \u0026\u0026 max \u003e= - plane.constant );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given triangle intersects with this bounding box.\n\t *\n\t * @param {Triangle} triangle - The triangle to test.\n\t * @return {boolean} Whether the given triangle intersects with this bounding box.\n\t */\n\tintersectsTriangle( triangle ) {\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\t// compute box center and extents\n\t\tthis.getCenter( _center );\n\t\t_extents.subVectors( this.max, _center );\n\n\t\t// translate triangle to aabb origin\n\t\t_v0$2.subVectors( triangle.a, _center );\n\t\t_v1$7.subVectors( triangle.b, _center );\n\t\t_v2$4.subVectors( triangle.c, _center );\n\n\t\t// compute edge vectors for triangle\n\t\t_f0.subVectors( _v1$7, _v0$2 );\n\t\t_f1.subVectors( _v2$4, _v1$7 );\n\t\t_f2.subVectors( _v0$2, _v2$4 );\n\n\t\t// test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb\n\t\t// make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation\n\t\t// axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned)\n\t\tlet axes = [\n\t\t\t0, - _f0.z, _f0.y, 0, - _f1.z, _f1.y, 0, - _f2.z, _f2.y,\n\t\t\t_f0.z, 0, - _f0.x, _f1.z, 0, - _f1.x, _f2.z, 0, - _f2.x,\n\t\t\t- _f0.y, _f0.x, 0, - _f1.y, _f1.x, 0, - _f2.y, _f2.x, 0\n\t\t];\n\t\tif ( ! satForAxes( axes, _v0$2, _v1$7, _v2$4, _extents ) ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\t// test 3 face normals from the aabb\n\t\taxes = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ];\n\t\tif ( ! satForAxes( axes, _v0$2, _v1$7, _v2$4, _extents ) ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\t// finally testing the face normal of the triangle\n\t\t// use already existing triangle edge vectors here\n\t\t_triangleNormal.crossVectors( _f0, _f1 );\n\t\taxes = [ _triangleNormal.x, _triangleNormal.y, _triangleNormal.z ];\n\n\t\treturn satForAxes( axes, _v0$2, _v1$7, _v2$4, _extents );\n\n\t}\n\n\t/**\n\t * Clamps the given point within the bounds of this box.\n\t *\n\t * @param {Vector3} point - The point to clamp.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The clamped point.\n\t */\n\tclampPoint( point, target ) {\n\n\t\treturn target.copy( point ).clamp( this.min, this.max );\n\n\t}\n\n\t/**\n\t * Returns the euclidean distance from any edge of this box to the specified point. If\n\t * the given point lies inside of this box, the distance will be `0`.\n\t *\n\t * @param {Vector3} point - The point to compute the distance to.\n\t * @return {number} The euclidean distance.\n\t */\n\tdistanceToPoint( point ) {\n\n\t\treturn this.clampPoint( point, _vector$b ).distanceTo( point );\n\n\t}\n\n\t/**\n\t * Returns a bounding sphere that encloses this bounding box.\n\t *\n\t * @param {Sphere} target - The target sphere that is used to store the method's result.\n\t * @return {Sphere} The bounding sphere that encloses this bounding box.\n\t */\n\tgetBoundingSphere( target ) {\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\ttarget.makeEmpty();\n\n\t\t} else {\n\n\t\t\tthis.getCenter( target.center );\n\n\t\t\ttarget.radius = this.getSize( _vector$b ).length() * 0.5;\n\n\t\t}\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Computes the intersection of this bounding box and the given one, setting the upper\n\t * bound of this box to the lesser of the two boxes' upper bounds and the\n\t * lower bound of this box to the greater of the two boxes' lower bounds. If\n\t * there's no overlap, makes this box empty.\n\t *\n\t * @param {Box3} box - The bounding box to intersect with.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tintersect( box ) {\n\n\t\tthis.min.max( box.min );\n\t\tthis.max.min( box.max );\n\n\t\t// ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.\n\t\tif ( this.isEmpty() ) this.makeEmpty();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes the union of this box and another and the given one, setting the upper\n\t * bound of this box to the greater of the two boxes' upper bounds and the\n\t * lower bound of this box to the lesser of the two boxes' lower bounds.\n\t *\n\t * @param {Box3} box - The bounding box that will be unioned with this instance.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tunion( box ) {\n\n\t\tthis.min.min( box.min );\n\t\tthis.max.max( box.max );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Transforms this bounding box by the given 4x4 transformation matrix.\n\t *\n\t * @param {Matrix4} matrix - The transformation matrix.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tapplyMatrix4( matrix ) {\n\n\t\t// transform of empty box is an empty box.\n\t\tif ( this.isEmpty() ) return this;\n\n\t\t// NOTE: I am using a binary pattern to specify all 2^3 combinations below\n\t\t_points[ 0 ].set( this.min.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 000\n\t\t_points[ 1 ].set( this.min.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 001\n\t\t_points[ 2 ].set( this.min.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 010\n\t\t_points[ 3 ].set( this.min.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 011\n\t\t_points[ 4 ].set( this.max.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 100\n\t\t_points[ 5 ].set( this.max.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 101\n\t\t_points[ 6 ].set( this.max.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 110\n\t\t_points[ 7 ].set( this.max.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 111\n\n\t\tthis.setFromPoints( _points );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given offset to both the upper and lower bounds of this bounding box,\n\t * effectively moving it in 3D space.\n\t *\n\t * @param {Vector3} offset - The offset that should be used to translate the bounding box.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\ttranslate( offset ) {\n\n\t\tthis.min.add( offset );\n\t\tthis.max.add( offset );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this bounding box is equal with the given one.\n\t *\n\t * @param {Box3} box - The box to test for equality.\n\t * @return {boolean} Whether this bounding box is equal with the given one.\n\t */\n\tequals( box ) {\n\n\t\treturn box.min.equals( this.min ) \u0026\u0026 box.max.equals( this.max );\n\n\t}\n\n\t/**\n\t * Returns a serialized structure of the bounding box.\n\t *\n\t * @return {Object} Serialized structure with fields representing the object state.\n\t */\n\ttoJSON() {\n\n\t\treturn {\n\t\t\tmin: this.min.toArray(),\n\t\t\tmax: this.max.toArray()\n\t\t};\n\n\t}\n\n\t/**\n\t * Returns a serialized structure of the bounding box.\n\t *\n\t * @param {Object} json - The serialized json to set the box from.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tfromJSON( json ) {\n\n\t\tthis.min.fromArray( json.min );\n\t\tthis.max.fromArray( json.max );\n\t\treturn this;\n\n\t}\n\n}\n\nconst _points = [\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3()\n];\n\nconst _vector$b = /*@__PURE__*/ new Vector3();\n\nconst _box$4 = /*@__PURE__*/ new Box3();\n\n// triangle centered vertices\n\nconst _v0$2 = /*@__PURE__*/ new Vector3();\nconst _v1$7 = /*@__PURE__*/ new Vector3();\nconst _v2$4 = /*@__PURE__*/ new Vector3();\n\n// triangle edge vectors\n\nconst _f0 = /*@__PURE__*/ new Vector3();\nconst _f1 = /*@__PURE__*/ new Vector3();\nconst _f2 = /*@__PURE__*/ new Vector3();\n\nconst _center = /*@__PURE__*/ new Vector3();\nconst _extents = /*@__PURE__*/ new Vector3();\nconst _triangleNormal = /*@__PURE__*/ new Vector3();\nconst _testAxis = /*@__PURE__*/ new Vector3();\n\nfunction satForAxes( axes, v0, v1, v2, extents ) {\n\n\tfor ( let i = 0, j = axes.length - 3; i \u003c= j; i += 3 ) {\n\n\t\t_testAxis.fromArray( axes, i );\n\t\t// project the aabb onto the separating axis\n\t\tconst r = extents.x * Math.abs( _testAxis.x ) + extents.y * Math.abs( _testAxis.y ) + extents.z * Math.abs( _testAxis.z );\n\t\t// project all 3 vertices of the triangle onto the separating axis\n\t\tconst p0 = v0.dot( _testAxis );\n\t\tconst p1 = v1.dot( _testAxis );\n\t\tconst p2 = v2.dot( _testAxis );\n\t\t// actual test, basically see if either of the most extreme of the triangle points intersects r\n\t\tif ( Math.max( - Math.max( p0, p1, p2 ), Math.min( p0, p1, p2 ) ) \u003e r ) {\n\n\t\t\t// points of the projected triangle are outside the projected half-length of the aabb\n\t\t\t// the axis is separating and we can exit\n\t\t\treturn false;\n\n\t\t}\n\n\t}\n\n\treturn true;\n\n}\n\nconst _box$3 = /*@__PURE__*/ new Box3();\nconst _v1$6 = /*@__PURE__*/ new Vector3();\nconst _v2$3 = /*@__PURE__*/ new Vector3();\n\n/**\n * An analytical 3D sphere defined by a center and radius. This class is mainly\n * used as a Bounding Sphere for 3D objects.\n */\nclass Sphere {\n\n\t/**\n\t * Constructs a new sphere.\n\t *\n\t * @param {Vector3} [center=(0,0,0)] - The center of the sphere\n\t * @param {number} [radius=-1] - The radius of the sphere.\n\t */\n\tconstructor( center = new Vector3(), radius = -1 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSphere = true;\n\n\t\t/**\n\t\t * The center of the sphere\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.center = center;\n\n\t\t/**\n\t\t * The radius of the sphere.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.radius = radius;\n\n\t}\n\n\t/**\n\t * Sets the sphere's components by copying the given values.\n\t *\n\t * @param {Vector3} center - The center.\n\t * @param {number} radius - The radius.\n\t * @return {Sphere} A reference to this sphere.\n\t */\n\tset( center, radius ) {\n\n\t\tthis.center.copy( center );\n\t\tthis.radius = radius;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes the minimum bounding sphere for list of points.\n\t * If the optional center point is given, it is used as the sphere's\n\t * center. Otherwise, the center of the axis-aligned bounding box\n\t * encompassing the points is calculated.\n\t *\n\t * @param {Array\u003cVector3\u003e} points - A list of points in 3D space.\n\t * @param {Vector3} [optionalCenter] - The center of the sphere.\n\t * @return {Sphere} A reference to this sphere.\n\t */\n\tsetFromPoints( points, optionalCenter ) {\n\n\t\tconst center = this.center;\n\n\t\tif ( optionalCenter !== undefined ) {\n\n\t\t\tcenter.copy( optionalCenter );\n\n\t\t} else {\n\n\t\t\t_box$3.setFromPoints( points ).getCenter( center );\n\n\t\t}\n\n\t\tlet maxRadiusSq = 0;\n\n\t\tfor ( let i = 0, il = points.length; i \u003c il; i ++ ) {\n\n\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) );\n\n\t\t}\n\n\t\tthis.radius = Math.sqrt( maxRadiusSq );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the values of the given sphere to this instance.\n\t *\n\t * @param {Sphere} sphere - The sphere to copy.\n\t * @return {Sphere} A reference to this sphere.\n\t */\n\tcopy( sphere ) {\n\n\t\tthis.center.copy( sphere.center );\n\t\tthis.radius = sphere.radius;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if the sphere is empty (the radius set to a negative number).\n\t *\n\t * Spheres with a radius of `0` contain only their center point and are not\n\t * considered to be empty.\n\t *\n\t * @return {boolean} Whether this sphere is empty or not.\n\t */\n\tisEmpty() {\n\n\t\treturn ( this.radius \u003c 0 );\n\n\t}\n\n\t/**\n\t * Makes this sphere empty which means in encloses a zero space in 3D.\n\t *\n\t * @return {Sphere} A reference to this sphere.\n\t */\n\tmakeEmpty() {\n\n\t\tthis.center.set( 0, 0, 0 );\n\t\tthis.radius = -1;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this sphere contains the given point inclusive of\n\t * the surface of the sphere.\n\t *\n\t * @param {Vector3} point - The point to check.\n\t * @return {boolean} Whether this sphere contains the given point or not.\n\t */\n\tcontainsPoint( point ) {\n\n\t\treturn ( point.distanceToSquared( this.center ) \u003c= ( this.radius * this.radius ) );\n\n\t}\n\n\t/**\n\t * Returns the closest distance from the boundary of the sphere to the\n\t * given point. If the sphere contains the point, the distance will\n\t * be negative.\n\t *\n\t * @param {Vector3} point - The point to compute the distance to.\n\t * @return {number} The distance to the point.\n\t */\n\tdistanceToPoint( point ) {\n\n\t\treturn ( point.distanceTo( this.center ) - this.radius );\n\n\t}\n\n\t/**\n\t * Returns `true` if this sphere intersects with the given one.\n\t *\n\t * @param {Sphere} sphere - The sphere to test.\n\t * @return {boolean} Whether this sphere intersects with the given one or not.\n\t */\n\tintersectsSphere( sphere ) {\n\n\t\tconst radiusSum = this.radius + sphere.radius;\n\n\t\treturn sphere.center.distanceToSquared( this.center ) \u003c= ( radiusSum * radiusSum );\n\n\t}\n\n\t/**\n\t * Returns `true` if this sphere intersects with the given box.\n\t *\n\t * @param {Box3} box - The box to test.\n\t * @return {boolean} Whether this sphere intersects with the given box or not.\n\t */\n\tintersectsBox( box ) {\n\n\t\treturn box.intersectsSphere( this );\n\n\t}\n\n\t/**\n\t * Returns `true` if this sphere intersects with the given plane.\n\t *\n\t * @param {Plane} plane - The plane to test.\n\t * @return {boolean} Whether this sphere intersects with the given plane or not.\n\t */\n\tintersectsPlane( plane ) {\n\n\t\treturn Math.abs( plane.distanceToPoint( this.center ) ) \u003c= this.radius;\n\n\t}\n\n\t/**\n\t * Clamps a point within the sphere. If the point is outside the sphere, it\n\t * will clamp it to the closest point on the edge of the sphere. Points\n\t * already inside the sphere will not be affected.\n\t *\n\t * @param {Vector3} point - The plane to clamp.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The clamped point.\n\t */\n\tclampPoint( point, target ) {\n\n\t\tconst deltaLengthSq = this.center.distanceToSquared( point );\n\n\t\ttarget.copy( point );\n\n\t\tif ( deltaLengthSq \u003e ( this.radius * this.radius ) ) {\n\n\t\t\ttarget.sub( this.center ).normalize();\n\t\t\ttarget.multiplyScalar( this.radius ).add( this.center );\n\n\t\t}\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Returns a bounding box that encloses this sphere.\n\t *\n\t * @param {Box3} target - The target box that is used to store the method's result.\n\t * @return {Box3} The bounding box that encloses this sphere.\n\t */\n\tgetBoundingBox( target ) {\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\t// Empty sphere produces empty bounding box\n\t\t\ttarget.makeEmpty();\n\t\t\treturn target;\n\n\t\t}\n\n\t\ttarget.set( this.center, this.center );\n\t\ttarget.expandByScalar( this.radius );\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Transforms this sphere with the given 4x4 transformation matrix.\n\t *\n\t * @param {Matrix4} matrix - The transformation matrix.\n\t * @return {Sphere} A reference to this sphere.\n\t */\n\tapplyMatrix4( matrix ) {\n\n\t\tthis.center.applyMatrix4( matrix );\n\t\tthis.radius = this.radius * matrix.getMaxScaleOnAxis();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Translates the sphere's center by the given offset.\n\t *\n\t * @param {Vector3} offset - The offset.\n\t * @return {Sphere} A reference to this sphere.\n\t */\n\ttranslate( offset ) {\n\n\t\tthis.center.add( offset );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Expands the boundaries of this sphere to include the given point.\n\t *\n\t * @param {Vector3} point - The point to include.\n\t * @return {Sphere} A reference to this sphere.\n\t */\n\texpandByPoint( point ) {\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\tthis.center.copy( point );\n\n\t\t\tthis.radius = 0;\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\t_v1$6.subVectors( point, this.center );\n\n\t\tconst lengthSq = _v1$6.lengthSq();\n\n\t\tif ( lengthSq \u003e ( this.radius * this.radius ) ) {\n\n\t\t\t// calculate the minimal sphere\n\n\t\t\tconst length = Math.sqrt( lengthSq );\n\n\t\t\tconst delta = ( length - this.radius ) * 0.5;\n\n\t\t\tthis.center.addScaledVector( _v1$6, delta / length );\n\n\t\t\tthis.radius += delta;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Expands this sphere to enclose both the original sphere and the given sphere.\n\t *\n\t * @param {Sphere} sphere - The sphere to include.\n\t * @return {Sphere} A reference to this sphere.\n\t */\n\tunion( sphere ) {\n\n\t\tif ( sphere.isEmpty() ) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\tthis.copy( sphere );\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( this.center.equals( sphere.center ) === true ) {\n\n\t\t\t this.radius = Math.max( this.radius, sphere.radius );\n\n\t\t} else {\n\n\t\t\t_v2$3.subVectors( sphere.center, this.center ).setLength( sphere.radius );\n\n\t\t\tthis.expandByPoint( _v1$6.copy( sphere.center ).add( _v2$3 ) );\n\n\t\t\tthis.expandByPoint( _v1$6.copy( sphere.center ).sub( _v2$3 ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this sphere is equal with the given one.\n\t *\n\t * @param {Sphere} sphere - The sphere to test for equality.\n\t * @return {boolean} Whether this bounding sphere is equal with the given one.\n\t */\n\tequals( sphere ) {\n\n\t\treturn sphere.center.equals( this.center ) \u0026\u0026 ( sphere.radius === this.radius );\n\n\t}\n\n\t/**\n\t * Returns a new sphere with copied values from this instance.\n\t *\n\t * @return {Sphere} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Returns a serialized structure of the bounding sphere.\n\t *\n\t * @return {Object} Serialized structure with fields representing the object state.\n\t */\n\ttoJSON() {\n\n\t\treturn {\n\t\t\tradius: this.radius,\n\t\t\tcenter: this.center.toArray()\n\t\t};\n\n\t}\n\n\t/**\n\t * Returns a serialized structure of the bounding sphere.\n\t *\n\t * @param {Object} json - The serialized json to set the sphere from.\n\t * @return {Sphere} A reference to this bounding sphere.\n\t */\n\tfromJSON( json ) {\n\n\t\tthis.radius = json.radius;\n\t\tthis.center.fromArray( json.center );\n\t\treturn this;\n\n\t}\n\n}\n\nconst _vector$a = /*@__PURE__*/ new Vector3();\nconst _segCenter = /*@__PURE__*/ new Vector3();\nconst _segDir = /*@__PURE__*/ new Vector3();\nconst _diff = /*@__PURE__*/ new Vector3();\n\nconst _edge1 = /*@__PURE__*/ new Vector3();\nconst _edge2 = /*@__PURE__*/ new Vector3();\nconst _normal$1 = /*@__PURE__*/ new Vector3();\n\n/**\n * A ray that emits from an origin in a certain direction. The class is used by\n * {@link Raycaster} to assist with raycasting. Raycasting is used for\n * mouse picking (working out what objects in the 3D space the mouse is over)\n * amongst other things.\n */\nclass Ray {\n\n\t/**\n\t * Constructs a new ray.\n\t *\n\t * @param {Vector3} [origin=(0,0,0)] - The origin of the ray.\n\t * @param {Vector3} [direction=(0,0,-1)] - The (normalized) direction of the ray.\n\t */\n\tconstructor( origin = new Vector3(), direction = new Vector3( 0, 0, -1 ) ) {\n\n\t\t/**\n\t\t * The origin of the ray.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.origin = origin;\n\n\t\t/**\n\t\t * The (normalized) direction of the ray.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.direction = direction;\n\n\t}\n\n\t/**\n\t * Sets the ray's components by copying the given values.\n\t *\n\t * @param {Vector3} origin - The origin.\n\t * @param {Vector3} direction - The direction.\n\t * @return {Ray} A reference to this ray.\n\t */\n\tset( origin, direction ) {\n\n\t\tthis.origin.copy( origin );\n\t\tthis.direction.copy( direction );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the values of the given ray to this instance.\n\t *\n\t * @param {Ray} ray - The ray to copy.\n\t * @return {Ray} A reference to this ray.\n\t */\n\tcopy( ray ) {\n\n\t\tthis.origin.copy( ray.origin );\n\t\tthis.direction.copy( ray.direction );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a vector that is located at a given distance along this ray.\n\t *\n\t * @param {number} t - The distance along the ray to retrieve a position for.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} A position on the ray.\n\t */\n\tat( t, target ) {\n\n\t\treturn target.copy( this.origin ).addScaledVector( this.direction, t );\n\n\t}\n\n\t/**\n\t * Adjusts the direction of the ray to point at the given vector in world space.\n\t *\n\t * @param {Vector3} v - The target position.\n\t * @return {Ray} A reference to this ray.\n\t */\n\tlookAt( v ) {\n\n\t\tthis.direction.copy( v ).sub( this.origin ).normalize();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Shift the origin of this ray along its direction by the given distance.\n\t *\n\t * @param {number} t - The distance along the ray to interpolate.\n\t * @return {Ray} A reference to this ray.\n\t */\n\trecast( t ) {\n\n\t\tthis.origin.copy( this.at( t, _vector$a ) );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the point along this ray that is closest to the given point.\n\t *\n\t * @param {Vector3} point - A point in 3D space to get the closet location on the ray for.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The closest point on this ray.\n\t */\n\tclosestPointToPoint( point, target ) {\n\n\t\ttarget.subVectors( point, this.origin );\n\n\t\tconst directionDistance = target.dot( this.direction );\n\n\t\tif ( directionDistance \u003c 0 ) {\n\n\t\t\treturn target.copy( this.origin );\n\n\t\t}\n\n\t\treturn target.copy( this.origin ).addScaledVector( this.direction, directionDistance );\n\n\t}\n\n\t/**\n\t * Returns the distance of the closest approach between this ray and the given point.\n\t *\n\t * @param {Vector3} point - A point in 3D space to compute the distance to.\n\t * @return {number} The distance.\n\t */\n\tdistanceToPoint( point ) {\n\n\t\treturn Math.sqrt( this.distanceSqToPoint( point ) );\n\n\t}\n\n\t/**\n\t * Returns the squared distance of the closest approach between this ray and the given point.\n\t *\n\t * @param {Vector3} point - A point in 3D space to compute the distance to.\n\t * @return {number} The squared distance.\n\t */\n\tdistanceSqToPoint( point ) {\n\n\t\tconst directionDistance = _vector$a.subVectors( point, this.origin ).dot( this.direction );\n\n\t\t// point behind the ray\n\n\t\tif ( directionDistance \u003c 0 ) {\n\n\t\t\treturn this.origin.distanceToSquared( point );\n\n\t\t}\n\n\t\t_vector$a.copy( this.origin ).addScaledVector( this.direction, directionDistance );\n\n\t\treturn _vector$a.distanceToSquared( point );\n\n\t}\n\n\t/**\n\t * Returns the squared distance between this ray and the given line segment.\n\t *\n\t * @param {Vector3} v0 - The start point of the line segment.\n\t * @param {Vector3} v1 - The end point of the line segment.\n\t * @param {Vector3} [optionalPointOnRay] - When provided, it receives the point on this ray that is closest to the segment.\n\t * @param {Vector3} [optionalPointOnSegment] - When provided, it receives the point on the line segment that is closest to this ray.\n\t * @return {number} The squared distance.\n\t */\n\tdistanceSqToSegment( v0, v1, optionalPointOnRay, optionalPointOnSegment ) {\n\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteDistRaySegment.h\n\t\t// It returns the min distance between the ray and the segment\n\t\t// defined by v0 and v1\n\t\t// It can also set two optional targets :\n\t\t// - The closest point on the ray\n\t\t// - The closest point on the segment\n\n\t\t_segCenter.copy( v0 ).add( v1 ).multiplyScalar( 0.5 );\n\t\t_segDir.copy( v1 ).sub( v0 ).normalize();\n\t\t_diff.copy( this.origin ).sub( _segCenter );\n\n\t\tconst segExtent = v0.distanceTo( v1 ) * 0.5;\n\t\tconst a01 = - this.direction.dot( _segDir );\n\t\tconst b0 = _diff.dot( this.direction );\n\t\tconst b1 = - _diff.dot( _segDir );\n\t\tconst c = _diff.lengthSq();\n\t\tconst det = Math.abs( 1 - a01 * a01 );\n\t\tlet s0, s1, sqrDist, extDet;\n\n\t\tif ( det \u003e 0 ) {\n\n\t\t\t// The ray and segment are not parallel.\n\n\t\t\ts0 = a01 * b1 - b0;\n\t\t\ts1 = a01 * b0 - b1;\n\t\t\textDet = segExtent * det;\n\n\t\t\tif ( s0 \u003e= 0 ) {\n\n\t\t\t\tif ( s1 \u003e= - extDet ) {\n\n\t\t\t\t\tif ( s1 \u003c= extDet ) {\n\n\t\t\t\t\t\t// region 0\n\t\t\t\t\t\t// Minimum at interior points of ray and segment.\n\n\t\t\t\t\t\tconst invDet = 1 / det;\n\t\t\t\t\t\ts0 *= invDet;\n\t\t\t\t\t\ts1 *= invDet;\n\t\t\t\t\t\tsqrDist = s0 * ( s0 + a01 * s1 + 2 * b0 ) + s1 * ( a01 * s0 + s1 + 2 * b1 ) + c;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// region 1\n\n\t\t\t\t\t\ts1 = segExtent;\n\t\t\t\t\t\ts0 = Math.max( 0, - ( a01 * s1 + b0 ) );\n\t\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// region 5\n\n\t\t\t\t\ts1 = - segExtent;\n\t\t\t\t\ts0 = Math.max( 0, - ( a01 * s1 + b0 ) );\n\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( s1 \u003c= - extDet ) {\n\n\t\t\t\t\t// region 4\n\n\t\t\t\t\ts0 = Math.max( 0, - ( - a01 * segExtent + b0 ) );\n\t\t\t\t\ts1 = ( s0 \u003e 0 ) ? - segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent );\n\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t} else if ( s1 \u003c= extDet ) {\n\n\t\t\t\t\t// region 3\n\n\t\t\t\t\ts0 = 0;\n\t\t\t\t\ts1 = Math.min( Math.max( - segExtent, - b1 ), segExtent );\n\t\t\t\t\tsqrDist = s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// region 2\n\n\t\t\t\t\ts0 = Math.max( 0, - ( a01 * segExtent + b0 ) );\n\t\t\t\t\ts1 = ( s0 \u003e 0 ) ? segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent );\n\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// Ray and segment are parallel.\n\n\t\t\ts1 = ( a01 \u003e 0 ) ? - segExtent : segExtent;\n\t\t\ts0 = Math.max( 0, - ( a01 * s1 + b0 ) );\n\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t}\n\n\t\tif ( optionalPointOnRay ) {\n\n\t\t\toptionalPointOnRay.copy( this.origin ).addScaledVector( this.direction, s0 );\n\n\t\t}\n\n\t\tif ( optionalPointOnSegment ) {\n\n\t\t\toptionalPointOnSegment.copy( _segCenter ).addScaledVector( _segDir, s1 );\n\n\t\t}\n\n\t\treturn sqrDist;\n\n\t}\n\n\t/**\n\t * Intersects this ray with the given sphere, returning the intersection\n\t * point or `null` if there is no intersection.\n\t *\n\t * @param {Sphere} sphere - The sphere to intersect.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The intersection point.\n\t */\n\tintersectSphere( sphere, target ) {\n\n\t\t_vector$a.subVectors( sphere.center, this.origin );\n\t\tconst tca = _vector$a.dot( this.direction );\n\t\tconst d2 = _vector$a.dot( _vector$a ) - tca * tca;\n\t\tconst radius2 = sphere.radius * sphere.radius;\n\n\t\tif ( d2 \u003e radius2 ) return null;\n\n\t\tconst thc = Math.sqrt( radius2 - d2 );\n\n\t\t// t0 = first intersect point - entrance on front of sphere\n\t\tconst t0 = tca - thc;\n\n\t\t// t1 = second intersect point - exit point on back of sphere\n\t\tconst t1 = tca + thc;\n\n\t\t// test to see if t1 is behind the ray - if so, return null\n\t\tif ( t1 \u003c 0 ) return null;\n\n\t\t// test to see if t0 is behind the ray:\n\t\t// if it is, the ray is inside the sphere, so return the second exit point scaled by t1,\n\t\t// in order to always return an intersect point that is in front of the ray.\n\t\tif ( t0 \u003c 0 ) return this.at( t1, target );\n\n\t\t// else t0 is in front of the ray, so return the first collision point scaled by t0\n\t\treturn this.at( t0, target );\n\n\t}\n\n\t/**\n\t * Returns `true` if this ray intersects with the given sphere.\n\t *\n\t * @param {Sphere} sphere - The sphere to intersect.\n\t * @return {boolean} Whether this ray intersects with the given sphere or not.\n\t */\n\tintersectsSphere( sphere ) {\n\n\t\tif ( sphere.radius \u003c 0 ) return false; // handle empty spheres, see #31187\n\n\t\treturn this.distanceSqToPoint( sphere.center ) \u003c= ( sphere.radius * sphere.radius );\n\n\t}\n\n\t/**\n\t * Computes the distance from the ray's origin to the given plane. Returns `null` if the ray\n\t * does not intersect with the plane.\n\t *\n\t * @param {Plane} plane - The plane to compute the distance to.\n\t * @return {?number} Whether this ray intersects with the given sphere or not.\n\t */\n\tdistanceToPlane( plane ) {\n\n\t\tconst denominator = plane.normal.dot( this.direction );\n\n\t\tif ( denominator === 0 ) {\n\n\t\t\t// line is coplanar, return origin\n\t\t\tif ( plane.distanceToPoint( this.origin ) === 0 ) {\n\n\t\t\t\treturn 0;\n\n\t\t\t}\n\n\t\t\t// Null is preferable to undefined since undefined means.... it is undefined\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst t = - ( this.origin.dot( plane.normal ) + plane.constant ) / denominator;\n\n\t\t// Return if the ray never intersects the plane\n\n\t\treturn t \u003e= 0 ? t : null;\n\n\t}\n\n\t/**\n\t * Intersects this ray with the given plane, returning the intersection\n\t * point or `null` if there is no intersection.\n\t *\n\t * @param {Plane} plane - The plane to intersect.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The intersection point.\n\t */\n\tintersectPlane( plane, target ) {\n\n\t\tconst t = this.distanceToPlane( plane );\n\n\t\tif ( t === null ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\treturn this.at( t, target );\n\n\t}\n\n\t/**\n\t * Returns `true` if this ray intersects with the given plane.\n\t *\n\t * @param {Plane} plane - The plane to intersect.\n\t * @return {boolean} Whether this ray intersects with the given plane or not.\n\t */\n\tintersectsPlane( plane ) {\n\n\t\t// check if the ray lies on the plane first\n\n\t\tconst distToPoint = plane.distanceToPoint( this.origin );\n\n\t\tif ( distToPoint === 0 ) {\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\tconst denominator = plane.normal.dot( this.direction );\n\n\t\tif ( denominator * distToPoint \u003c 0 ) {\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\t// ray origin is behind the plane (and is pointing behind it)\n\n\t\treturn false;\n\n\t}\n\n\t/**\n\t * Intersects this ray with the given bounding box, returning the intersection\n\t * point or `null` if there is no intersection.\n\t *\n\t * @param {Box3} box - The box to intersect.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The intersection point.\n\t */\n\tintersectBox( box, target ) {\n\n\t\tlet tmin, tmax, tymin, tymax, tzmin, tzmax;\n\n\t\tconst invdirx = 1 / this.direction.x,\n\t\t\tinvdiry = 1 / this.direction.y,\n\t\t\tinvdirz = 1 / this.direction.z;\n\n\t\tconst origin = this.origin;\n\n\t\tif ( invdirx \u003e= 0 ) {\n\n\t\t\ttmin = ( box.min.x - origin.x ) * invdirx;\n\t\t\ttmax = ( box.max.x - origin.x ) * invdirx;\n\n\t\t} else {\n\n\t\t\ttmin = ( box.max.x - origin.x ) * invdirx;\n\t\t\ttmax = ( box.min.x - origin.x ) * invdirx;\n\n\t\t}\n\n\t\tif ( invdiry \u003e= 0 ) {\n\n\t\t\ttymin = ( box.min.y - origin.y ) * invdiry;\n\t\t\ttymax = ( box.max.y - origin.y ) * invdiry;\n\n\t\t} else {\n\n\t\t\ttymin = ( box.max.y - origin.y ) * invdiry;\n\t\t\ttymax = ( box.min.y - origin.y ) * invdiry;\n\n\t\t}\n\n\t\tif ( ( tmin \u003e tymax ) || ( tymin \u003e tmax ) ) return null;\n\n\t\tif ( tymin \u003e tmin || isNaN( tmin ) ) tmin = tymin;\n\n\t\tif ( tymax \u003c tmax || isNaN( tmax ) ) tmax = tymax;\n\n\t\tif ( invdirz \u003e= 0 ) {\n\n\t\t\ttzmin = ( box.min.z - origin.z ) * invdirz;\n\t\t\ttzmax = ( box.max.z - origin.z ) * invdirz;\n\n\t\t} else {\n\n\t\t\ttzmin = ( box.max.z - origin.z ) * invdirz;\n\t\t\ttzmax = ( box.min.z - origin.z ) * invdirz;\n\n\t\t}\n\n\t\tif ( ( tmin \u003e tzmax ) || ( tzmin \u003e tmax ) ) return null;\n\n\t\tif ( tzmin \u003e tmin || tmin !== tmin ) tmin = tzmin;\n\n\t\tif ( tzmax \u003c tmax || tmax !== tmax ) tmax = tzmax;\n\n\t\t//return point closest to the ray (positive side)\n\n\t\tif ( tmax \u003c 0 ) return null;\n\n\t\treturn this.at( tmin \u003e= 0 ? tmin : tmax, target );\n\n\t}\n\n\t/**\n\t * Returns `true` if this ray intersects with the given box.\n\t *\n\t * @param {Box3} box - The box to intersect.\n\t * @return {boolean} Whether this ray intersects with the given box or not.\n\t */\n\tintersectsBox( box ) {\n\n\t\treturn this.intersectBox( box, _vector$a ) !== null;\n\n\t}\n\n\t/**\n\t * Intersects this ray with the given triangle, returning the intersection\n\t * point or `null` if there is no intersection.\n\t *\n\t * @param {Vector3} a - The first vertex of the triangle.\n\t * @param {Vector3} b - The second vertex of the triangle.\n\t * @param {Vector3} c - The third vertex of the triangle.\n\t * @param {boolean} backfaceCulling - Whether to use backface culling or not.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The intersection point.\n\t */\n\tintersectTriangle( a, b, c, backfaceCulling, target ) {\n\n\t\t// Compute the offset origin, edges, and normal.\n\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h\n\n\t\t_edge1.subVectors( b, a );\n\t\t_edge2.subVectors( c, a );\n\t\t_normal$1.crossVectors( _edge1, _edge2 );\n\n\t\t// Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction,\n\t\t// E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by\n\t\t//   |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))\n\t\t//   |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))\n\t\t//   |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)\n\t\tlet DdN = this.direction.dot( _normal$1 );\n\t\tlet sign;\n\n\t\tif ( DdN \u003e 0 ) {\n\n\t\t\tif ( backfaceCulling ) return null;\n\t\t\tsign = 1;\n\n\t\t} else if ( DdN \u003c 0 ) {\n\n\t\t\tsign = -1;\n\t\t\tDdN = - DdN;\n\n\t\t} else {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t_diff.subVectors( this.origin, a );\n\t\tconst DdQxE2 = sign * this.direction.dot( _edge2.crossVectors( _diff, _edge2 ) );\n\n\t\t// b1 \u003c 0, no intersection\n\t\tif ( DdQxE2 \u003c 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst DdE1xQ = sign * this.direction.dot( _edge1.cross( _diff ) );\n\n\t\t// b2 \u003c 0, no intersection\n\t\tif ( DdE1xQ \u003c 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// b1+b2 \u003e 1, no intersection\n\t\tif ( DdQxE2 + DdE1xQ \u003e DdN ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// Line intersects triangle, check if ray does.\n\t\tconst QdN = - sign * _diff.dot( _normal$1 );\n\n\t\t// t \u003c 0, no intersection\n\t\tif ( QdN \u003c 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// Ray intersects triangle.\n\t\treturn this.at( QdN / DdN, target );\n\n\t}\n\n\t/**\n\t * Transforms this ray with the given 4x4 transformation matrix.\n\t *\n\t * @param {Matrix4} matrix4 - The transformation matrix.\n\t * @return {Ray} A reference to this ray.\n\t */\n\tapplyMatrix4( matrix4 ) {\n\n\t\tthis.origin.applyMatrix4( matrix4 );\n\t\tthis.direction.transformDirection( matrix4 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this ray is equal with the given one.\n\t *\n\t * @param {Ray} ray - The ray to test for equality.\n\t * @return {boolean} Whether this ray is equal with the given one.\n\t */\n\tequals( ray ) {\n\n\t\treturn ray.origin.equals( this.origin ) \u0026\u0026 ray.direction.equals( this.direction );\n\n\t}\n\n\t/**\n\t * Returns a new ray with copied values from this instance.\n\t *\n\t * @return {Ray} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\n/**\n * Represents a 4x4 matrix.\n *\n * The most common use of a 4x4 matrix in 3D computer graphics is as a transformation matrix.\n * For an introduction to transformation matrices as used in WebGL, check out [this tutorial](https://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices)\n *\n * This allows a 3D vector representing a point in 3D space to undergo\n * transformations such as translation, rotation, shear, scale, reflection,\n * orthogonal or perspective projection and so on, by being multiplied by the\n * matrix. This is known as `applying` the matrix to the vector.\n *\n * A Note on Row-Major and Column-Major Ordering:\n *\n * The constructor and {@link Matrix3#set} method take arguments in\n * [row-major](https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order)\n * order, while internally they are stored in the {@link Matrix3#elements} array in column-major order.\n * This means that calling:\n * ```js\n * const m = new THREE.Matrix4();\n * m.set( 11, 12, 13, 14,\n *        21, 22, 23, 24,\n *        31, 32, 33, 34,\n *        41, 42, 43, 44 );\n * ```\n * will result in the elements array containing:\n * ```js\n * m.elements = [ 11, 21, 31, 41,\n *                12, 22, 32, 42,\n *                13, 23, 33, 43,\n *                14, 24, 34, 44 ];\n * ```\n * and internally all calculations are performed using column-major ordering.\n * However, as the actual ordering makes no difference mathematically and\n * most people are used to thinking about matrices in row-major order, the\n * three.js documentation shows matrices in row-major order. Just bear in\n * mind that if you are reading the source code, you'll have to take the\n * transpose of any matrices outlined here to make sense of the calculations.\n */\nclass Matrix4 {\n\n\t/**\n\t * Constructs a new 4x4 matrix. The arguments are supposed to be\n\t * in row-major order. If no arguments are provided, the constructor\n\t * initializes the matrix as an identity matrix.\n\t *\n\t * @param {number} [n11] - 1-1 matrix element.\n\t * @param {number} [n12] - 1-2 matrix element.\n\t * @param {number} [n13] - 1-3 matrix element.\n\t * @param {number} [n14] - 1-4 matrix element.\n\t * @param {number} [n21] - 2-1 matrix element.\n\t * @param {number} [n22] - 2-2 matrix element.\n\t * @param {number} [n23] - 2-3 matrix element.\n\t * @param {number} [n24] - 2-4 matrix element.\n\t * @param {number} [n31] - 3-1 matrix element.\n\t * @param {number} [n32] - 3-2 matrix element.\n\t * @param {number} [n33] - 3-3 matrix element.\n\t * @param {number} [n34] - 3-4 matrix element.\n\t * @param {number} [n41] - 4-1 matrix element.\n\t * @param {number} [n42] - 4-2 matrix element.\n\t * @param {number} [n43] - 4-3 matrix element.\n\t * @param {number} [n44] - 4-4 matrix element.\n\t */\n\tconstructor( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tMatrix4.prototype.isMatrix4 = true;\n\n\t\t/**\n\t\t * A column-major list of matrix values.\n\t\t *\n\t\t * @type {Array\u003cnumber\u003e}\n\t\t */\n\t\tthis.elements = [\n\n\t\t\t1, 0, 0, 0,\n\t\t\t0, 1, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t];\n\n\t\tif ( n11 !== undefined ) {\n\n\t\t\tthis.set( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Sets the elements of the matrix.The arguments are supposed to be\n\t * in row-major order.\n\t *\n\t * @param {number} [n11] - 1-1 matrix element.\n\t * @param {number} [n12] - 1-2 matrix element.\n\t * @param {number} [n13] - 1-3 matrix element.\n\t * @param {number} [n14] - 1-4 matrix element.\n\t * @param {number} [n21] - 2-1 matrix element.\n\t * @param {number} [n22] - 2-2 matrix element.\n\t * @param {number} [n23] - 2-3 matrix element.\n\t * @param {number} [n24] - 2-4 matrix element.\n\t * @param {number} [n31] - 3-1 matrix element.\n\t * @param {number} [n32] - 3-2 matrix element.\n\t * @param {number} [n33] - 3-3 matrix element.\n\t * @param {number} [n34] - 3-4 matrix element.\n\t * @param {number} [n41] - 4-1 matrix element.\n\t * @param {number} [n42] - 4-2 matrix element.\n\t * @param {number} [n43] - 4-3 matrix element.\n\t * @param {number} [n44] - 4-4 matrix element.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tset( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] = n11; te[ 4 ] = n12; te[ 8 ] = n13; te[ 12 ] = n14;\n\t\tte[ 1 ] = n21; te[ 5 ] = n22; te[ 9 ] = n23; te[ 13 ] = n24;\n\t\tte[ 2 ] = n31; te[ 6 ] = n32; te[ 10 ] = n33; te[ 14 ] = n34;\n\t\tte[ 3 ] = n41; te[ 7 ] = n42; te[ 11 ] = n43; te[ 15 ] = n44;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix to the 4x4 identity matrix.\n\t *\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tidentity() {\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0, 0,\n\t\t\t0, 1, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a matrix with copied values from this instance.\n\t *\n\t * @return {Matrix4} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new Matrix4().fromArray( this.elements );\n\n\t}\n\n\t/**\n\t * Copies the values of the given matrix to this instance.\n\t *\n\t * @param {Matrix4} m - The matrix to copy.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tcopy( m ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tte[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; te[ 3 ] = me[ 3 ];\n\t\tte[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ];\n\t\tte[ 8 ] = me[ 8 ]; te[ 9 ] = me[ 9 ]; te[ 10 ] = me[ 10 ]; te[ 11 ] = me[ 11 ];\n\t\tte[ 12 ] = me[ 12 ]; te[ 13 ] = me[ 13 ]; te[ 14 ] = me[ 14 ]; te[ 15 ] = me[ 15 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the translation component of the given matrix\n\t * into this matrix's translation component.\n\t *\n\t * @param {Matrix4} m - The matrix to copy the translation component.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tcopyPosition( m ) {\n\n\t\tconst te = this.elements, me = m.elements;\n\n\t\tte[ 12 ] = me[ 12 ];\n\t\tte[ 13 ] = me[ 13 ];\n\t\tte[ 14 ] = me[ 14 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Set the upper 3x3 elements of this matrix to the values of given 3x3 matrix.\n\t *\n\t * @param {Matrix3} m - The 3x3 matrix.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tsetFromMatrix3( m ) {\n\n\t\tconst me = m.elements;\n\n\t\tthis.set(\n\n\t\t\tme[ 0 ], me[ 3 ], me[ 6 ], 0,\n\t\t\tme[ 1 ], me[ 4 ], me[ 7 ], 0,\n\t\t\tme[ 2 ], me[ 5 ], me[ 8 ], 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Extracts the basis of this matrix into the three axis vectors provided.\n\t *\n\t * @param {Vector3} xAxis - The basis's x axis.\n\t * @param {Vector3} yAxis - The basis's y axis.\n\t * @param {Vector3} zAxis - The basis's z axis.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\textractBasis( xAxis, yAxis, zAxis ) {\n\n\t\tif ( this.determinant() === 0 ) {\n\n\t\t\txAxis.set( 1, 0, 0 );\n\t\t\tyAxis.set( 0, 1, 0 );\n\t\t\tzAxis.set( 0, 0, 1 );\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\txAxis.setFromMatrixColumn( this, 0 );\n\t\tyAxis.setFromMatrixColumn( this, 1 );\n\t\tzAxis.setFromMatrixColumn( this, 2 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given basis vectors to this matrix.\n\t *\n\t * @param {Vector3} xAxis - The basis's x axis.\n\t * @param {Vector3} yAxis - The basis's y axis.\n\t * @param {Vector3} zAxis - The basis's z axis.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeBasis( xAxis, yAxis, zAxis ) {\n\n\t\tthis.set(\n\t\t\txAxis.x, yAxis.x, zAxis.x, 0,\n\t\t\txAxis.y, yAxis.y, zAxis.y, 0,\n\t\t\txAxis.z, yAxis.z, zAxis.z, 0,\n\t\t\t0, 0, 0, 1\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Extracts the rotation component of the given matrix\n\t * into this matrix's rotation component.\n\t *\n\t * Note: This method does not support reflection matrices.\n\t *\n\t * @param {Matrix4} m - The matrix.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\textractRotation( m ) {\n\n\t\tif ( m.determinant() === 0 ) {\n\n\t\t\treturn this.identity();\n\n\t\t}\n\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tconst scaleX = 1 / _v1$5.setFromMatrixColumn( m, 0 ).length();\n\t\tconst scaleY = 1 / _v1$5.setFromMatrixColumn( m, 1 ).length();\n\t\tconst scaleZ = 1 / _v1$5.setFromMatrixColumn( m, 2 ).length();\n\n\t\tte[ 0 ] = me[ 0 ] * scaleX;\n\t\tte[ 1 ] = me[ 1 ] * scaleX;\n\t\tte[ 2 ] = me[ 2 ] * scaleX;\n\t\tte[ 3 ] = 0;\n\n\t\tte[ 4 ] = me[ 4 ] * scaleY;\n\t\tte[ 5 ] = me[ 5 ] * scaleY;\n\t\tte[ 6 ] = me[ 6 ] * scaleY;\n\t\tte[ 7 ] = 0;\n\n\t\tte[ 8 ] = me[ 8 ] * scaleZ;\n\t\tte[ 9 ] = me[ 9 ] * scaleZ;\n\t\tte[ 10 ] = me[ 10 ] * scaleZ;\n\t\tte[ 11 ] = 0;\n\n\t\tte[ 12 ] = 0;\n\t\tte[ 13 ] = 0;\n\t\tte[ 14 ] = 0;\n\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the rotation component (the upper left 3x3 matrix) of this matrix to\n\t * the rotation specified by the given Euler angles. The rest of\n\t * the matrix is set to the identity. Depending on the {@link Euler#order},\n\t * there are six possible outcomes. See [this page](https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix)\n\t * for a complete list.\n\t *\n\t * @param {Euler} euler - The Euler angles.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeRotationFromEuler( euler ) {\n\n\t\tconst te = this.elements;\n\n\t\tconst x = euler.x, y = euler.y, z = euler.z;\n\t\tconst a = Math.cos( x ), b = Math.sin( x );\n\t\tconst c = Math.cos( y ), d = Math.sin( y );\n\t\tconst e = Math.cos( z ), f = Math.sin( z );\n\n\t\tif ( euler.order === 'XYZ' ) {\n\n\t\t\tconst ae = a * e, af = a * f, be = b * e, bf = b * f;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = - c * f;\n\t\t\tte[ 8 ] = d;\n\n\t\t\tte[ 1 ] = af + be * d;\n\t\t\tte[ 5 ] = ae - bf * d;\n\t\t\tte[ 9 ] = - b * c;\n\n\t\t\tte[ 2 ] = bf - ae * d;\n\t\t\tte[ 6 ] = be + af * d;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'YXZ' ) {\n\n\t\t\tconst ce = c * e, cf = c * f, de = d * e, df = d * f;\n\n\t\t\tte[ 0 ] = ce + df * b;\n\t\t\tte[ 4 ] = de * b - cf;\n\t\t\tte[ 8 ] = a * d;\n\n\t\t\tte[ 1 ] = a * f;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = - b;\n\n\t\t\tte[ 2 ] = cf * b - de;\n\t\t\tte[ 6 ] = df + ce * b;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'ZXY' ) {\n\n\t\t\tconst ce = c * e, cf = c * f, de = d * e, df = d * f;\n\n\t\t\tte[ 0 ] = ce - df * b;\n\t\t\tte[ 4 ] = - a * f;\n\t\t\tte[ 8 ] = de + cf * b;\n\n\t\t\tte[ 1 ] = cf + de * b;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = df - ce * b;\n\n\t\t\tte[ 2 ] = - a * d;\n\t\t\tte[ 6 ] = b;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'ZYX' ) {\n\n\t\t\tconst ae = a * e, af = a * f, be = b * e, bf = b * f;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = be * d - af;\n\t\t\tte[ 8 ] = ae * d + bf;\n\n\t\t\tte[ 1 ] = c * f;\n\t\t\tte[ 5 ] = bf * d + ae;\n\t\t\tte[ 9 ] = af * d - be;\n\n\t\t\tte[ 2 ] = - d;\n\t\t\tte[ 6 ] = b * c;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'YZX' ) {\n\n\t\t\tconst ac = a * c, ad = a * d, bc = b * c, bd = b * d;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = bd - ac * f;\n\t\t\tte[ 8 ] = bc * f + ad;\n\n\t\t\tte[ 1 ] = f;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = - b * e;\n\n\t\t\tte[ 2 ] = - d * e;\n\t\t\tte[ 6 ] = ad * f + bc;\n\t\t\tte[ 10 ] = ac - bd * f;\n\n\t\t} else if ( euler.order === 'XZY' ) {\n\n\t\t\tconst ac = a * c, ad = a * d, bc = b * c, bd = b * d;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = - f;\n\t\t\tte[ 8 ] = d * e;\n\n\t\t\tte[ 1 ] = ac * f + bd;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = ad * f - bc;\n\n\t\t\tte[ 2 ] = bc * f - ad;\n\t\t\tte[ 6 ] = b * e;\n\t\t\tte[ 10 ] = bd * f + ac;\n\n\t\t}\n\n\t\t// bottom row\n\t\tte[ 3 ] = 0;\n\t\tte[ 7 ] = 0;\n\t\tte[ 11 ] = 0;\n\n\t\t// last column\n\t\tte[ 12 ] = 0;\n\t\tte[ 13 ] = 0;\n\t\tte[ 14 ] = 0;\n\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the rotation component of this matrix to the rotation specified by\n\t * the given Quaternion as outlined [here](https://en.wikipedia.org/wiki/Rotation_matrix#Quaternion)\n\t * The rest of the matrix is set to the identity.\n\t *\n\t * @param {Quaternion} q - The Quaternion.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeRotationFromQuaternion( q ) {\n\n\t\treturn this.compose( _zero, q, _one );\n\n\t}\n\n\t/**\n\t * Sets the rotation component of the transformation matrix, looking from `eye` towards\n\t * `target`, and oriented by the up-direction.\n\t *\n\t * @param {Vector3} eye - The eye vector.\n\t * @param {Vector3} target - The target vector.\n\t * @param {Vector3} up - The up vector.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tlookAt( eye, target, up ) {\n\n\t\tconst te = this.elements;\n\n\t\t_z.subVectors( eye, target );\n\n\t\tif ( _z.lengthSq() === 0 ) {\n\n\t\t\t// eye and target are in the same position\n\n\t\t\t_z.z = 1;\n\n\t\t}\n\n\t\t_z.normalize();\n\t\t_x.crossVectors( up, _z );\n\n\t\tif ( _x.lengthSq() === 0 ) {\n\n\t\t\t// up and z are parallel\n\n\t\t\tif ( Math.abs( up.z ) === 1 ) {\n\n\t\t\t\t_z.x += 0.0001;\n\n\t\t\t} else {\n\n\t\t\t\t_z.z += 0.0001;\n\n\t\t\t}\n\n\t\t\t_z.normalize();\n\t\t\t_x.crossVectors( up, _z );\n\n\t\t}\n\n\t\t_x.normalize();\n\t\t_y.crossVectors( _z, _x );\n\n\t\tte[ 0 ] = _x.x; te[ 4 ] = _y.x; te[ 8 ] = _z.x;\n\t\tte[ 1 ] = _x.y; te[ 5 ] = _y.y; te[ 9 ] = _z.y;\n\t\tte[ 2 ] = _x.z; te[ 6 ] = _y.z; te[ 10 ] = _z.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Post-multiplies this matrix by the given 4x4 matrix.\n\t *\n\t * @param {Matrix4} m - The matrix to multiply with.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmultiply( m ) {\n\n\t\treturn this.multiplyMatrices( this, m );\n\n\t}\n\n\t/**\n\t * Pre-multiplies this matrix by the given 4x4 matrix.\n\t *\n\t * @param {Matrix4} m - The matrix to multiply with.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tpremultiply( m ) {\n\n\t\treturn this.multiplyMatrices( m, this );\n\n\t}\n\n\t/**\n\t * Multiples the given 4x4 matrices and stores the result\n\t * in this matrix.\n\t *\n\t * @param {Matrix4} a - The first matrix.\n\t * @param {Matrix4} b - The second matrix.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmultiplyMatrices( a, b ) {\n\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\n\t\tconst a11 = ae[ 0 ], a12 = ae[ 4 ], a13 = ae[ 8 ], a14 = ae[ 12 ];\n\t\tconst a21 = ae[ 1 ], a22 = ae[ 5 ], a23 = ae[ 9 ], a24 = ae[ 13 ];\n\t\tconst a31 = ae[ 2 ], a32 = ae[ 6 ], a33 = ae[ 10 ], a34 = ae[ 14 ];\n\t\tconst a41 = ae[ 3 ], a42 = ae[ 7 ], a43 = ae[ 11 ], a44 = ae[ 15 ];\n\n\t\tconst b11 = be[ 0 ], b12 = be[ 4 ], b13 = be[ 8 ], b14 = be[ 12 ];\n\t\tconst b21 = be[ 1 ], b22 = be[ 5 ], b23 = be[ 9 ], b24 = be[ 13 ];\n\t\tconst b31 = be[ 2 ], b32 = be[ 6 ], b33 = be[ 10 ], b34 = be[ 14 ];\n\t\tconst b41 = be[ 3 ], b42 = be[ 7 ], b43 = be[ 11 ], b44 = be[ 15 ];\n\n\t\tte[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;\n\t\tte[ 4 ] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;\n\t\tte[ 8 ] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;\n\t\tte[ 12 ] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;\n\n\t\tte[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;\n\t\tte[ 5 ] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;\n\t\tte[ 9 ] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;\n\t\tte[ 13 ] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;\n\n\t\tte[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;\n\t\tte[ 6 ] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;\n\t\tte[ 10 ] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;\n\t\tte[ 14 ] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;\n\n\t\tte[ 3 ] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;\n\t\tte[ 7 ] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;\n\t\tte[ 11 ] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;\n\t\tte[ 15 ] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies every component of the matrix by the given scalar.\n\t *\n\t * @param {number} s - The scalar.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmultiplyScalar( s ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] *= s; te[ 4 ] *= s; te[ 8 ] *= s; te[ 12 ] *= s;\n\t\tte[ 1 ] *= s; te[ 5 ] *= s; te[ 9 ] *= s; te[ 13 ] *= s;\n\t\tte[ 2 ] *= s; te[ 6 ] *= s; te[ 10 ] *= s; te[ 14 ] *= s;\n\t\tte[ 3 ] *= s; te[ 7 ] *= s; te[ 11 ] *= s; te[ 15 ] *= s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes and returns the determinant of this matrix.\n\t *\n\t * Based on the method outlined [here](http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.html).\n\t *\n\t * @return {number} The determinant.\n\t */\n\tdeterminant() {\n\n\t\tconst te = this.elements;\n\n\t\tconst n11 = te[ 0 ], n12 = te[ 4 ], n13 = te[ 8 ], n14 = te[ 12 ];\n\t\tconst n21 = te[ 1 ], n22 = te[ 5 ], n23 = te[ 9 ], n24 = te[ 13 ];\n\t\tconst n31 = te[ 2 ], n32 = te[ 6 ], n33 = te[ 10 ], n34 = te[ 14 ];\n\t\tconst n41 = te[ 3 ], n42 = te[ 7 ], n43 = te[ 11 ], n44 = te[ 15 ];\n\n\t\tconst t11 = n23 * n34 - n24 * n33;\n\t\tconst t12 = n22 * n34 - n24 * n32;\n\t\tconst t13 = n22 * n33 - n23 * n32;\n\n\t\tconst t21 = n21 * n34 - n24 * n31;\n\t\tconst t22 = n21 * n33 - n23 * n31;\n\t\tconst t23 = n21 * n32 - n22 * n31;\n\n\t\treturn n11 * ( n42 * t11 - n43 * t12 + n44 * t13 ) -\n\t\t\tn12 * ( n41 * t11 - n43 * t21 + n44 * t22 ) +\n\t\t\tn13 * ( n41 * t12 - n42 * t21 + n44 * t23 ) -\n\t\t\tn14 * ( n41 * t13 - n42 * t22 + n43 * t23 );\n\n\t}\n\n\t/**\n\t * Transposes this matrix in place.\n\t *\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\ttranspose() {\n\n\t\tconst te = this.elements;\n\t\tlet tmp;\n\n\t\ttmp = te[ 1 ]; te[ 1 ] = te[ 4 ]; te[ 4 ] = tmp;\n\t\ttmp = te[ 2 ]; te[ 2 ] = te[ 8 ]; te[ 8 ] = tmp;\n\t\ttmp = te[ 6 ]; te[ 6 ] = te[ 9 ]; te[ 9 ] = tmp;\n\n\t\ttmp = te[ 3 ]; te[ 3 ] = te[ 12 ]; te[ 12 ] = tmp;\n\t\ttmp = te[ 7 ]; te[ 7 ] = te[ 13 ]; te[ 13 ] = tmp;\n\t\ttmp = te[ 11 ]; te[ 11 ] = te[ 14 ]; te[ 14 ] = tmp;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the position component for this matrix from the given vector,\n\t * without affecting the rest of the matrix.\n\t *\n\t * @param {number|Vector3} x - The x component of the vector or alternatively the vector object.\n\t * @param {number} y - The y component of the vector.\n\t * @param {number} z - The z component of the vector.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tsetPosition( x, y, z ) {\n\n\t\tconst te = this.elements;\n\n\t\tif ( x.isVector3 ) {\n\n\t\t\tte[ 12 ] = x.x;\n\t\t\tte[ 13 ] = x.y;\n\t\t\tte[ 14 ] = x.z;\n\n\t\t} else {\n\n\t\t\tte[ 12 ] = x;\n\t\t\tte[ 13 ] = y;\n\t\t\tte[ 14 ] = z;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Inverts this matrix, using the [analytic method](https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution).\n\t * You can not invert with a determinant of zero. If you attempt this, the method produces\n\t * a zero matrix instead.\n\t *\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tinvert() {\n\n\t\t// based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n\t\tconst te = this.elements,\n\n\t\t\tn11 = te[ 0 ], n21 = te[ 1 ], n31 = te[ 2 ], n41 = te[ 3 ],\n\t\t\tn12 = te[ 4 ], n22 = te[ 5 ], n32 = te[ 6 ], n42 = te[ 7 ],\n\t\t\tn13 = te[ 8 ], n23 = te[ 9 ], n33 = te[ 10 ], n43 = te[ 11 ],\n\t\t\tn14 = te[ 12 ], n24 = te[ 13 ], n34 = te[ 14 ], n44 = te[ 15 ],\n\n\t\t\tt11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44,\n\t\t\tt12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44,\n\t\t\tt13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44,\n\t\t\tt14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;\n\n\t\tconst det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;\n\n\t\tif ( det === 0 ) return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );\n\n\t\tconst detInv = 1 / det;\n\n\t\tte[ 0 ] = t11 * detInv;\n\t\tte[ 1 ] = ( n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44 ) * detInv;\n\t\tte[ 2 ] = ( n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44 ) * detInv;\n\t\tte[ 3 ] = ( n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43 ) * detInv;\n\n\t\tte[ 4 ] = t12 * detInv;\n\t\tte[ 5 ] = ( n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44 ) * detInv;\n\t\tte[ 6 ] = ( n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44 ) * detInv;\n\t\tte[ 7 ] = ( n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43 ) * detInv;\n\n\t\tte[ 8 ] = t13 * detInv;\n\t\tte[ 9 ] = ( n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44 ) * detInv;\n\t\tte[ 10 ] = ( n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44 ) * detInv;\n\t\tte[ 11 ] = ( n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43 ) * detInv;\n\n\t\tte[ 12 ] = t14 * detInv;\n\t\tte[ 13 ] = ( n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34 ) * detInv;\n\t\tte[ 14 ] = ( n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34 ) * detInv;\n\t\tte[ 15 ] = ( n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33 ) * detInv;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the columns of this matrix by the given vector.\n\t *\n\t * @param {Vector3} v - The scale vector.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tscale( v ) {\n\n\t\tconst te = this.elements;\n\t\tconst x = v.x, y = v.y, z = v.z;\n\n\t\tte[ 0 ] *= x; te[ 4 ] *= y; te[ 8 ] *= z;\n\t\tte[ 1 ] *= x; te[ 5 ] *= y; te[ 9 ] *= z;\n\t\tte[ 2 ] *= x; te[ 6 ] *= y; te[ 10 ] *= z;\n\t\tte[ 3 ] *= x; te[ 7 ] *= y; te[ 11 ] *= z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Gets the maximum scale value of the three axes.\n\t *\n\t * @return {number} The maximum scale.\n\t */\n\tgetMaxScaleOnAxis() {\n\n\t\tconst te = this.elements;\n\n\t\tconst scaleXSq = te[ 0 ] * te[ 0 ] + te[ 1 ] * te[ 1 ] + te[ 2 ] * te[ 2 ];\n\t\tconst scaleYSq = te[ 4 ] * te[ 4 ] + te[ 5 ] * te[ 5 ] + te[ 6 ] * te[ 6 ];\n\t\tconst scaleZSq = te[ 8 ] * te[ 8 ] + te[ 9 ] * te[ 9 ] + te[ 10 ] * te[ 10 ];\n\n\t\treturn Math.sqrt( Math.max( scaleXSq, scaleYSq, scaleZSq ) );\n\n\t}\n\n\t/**\n\t * Sets this matrix as a translation transform from the given vector.\n\t *\n\t * @param {number|Vector3} x - The amount to translate in the X axis or alternatively a translation vector.\n\t * @param {number} y - The amount to translate in the Y axis.\n\t * @param {number} z - The amount to translate in the z axis.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeTranslation( x, y, z ) {\n\n\t\tif ( x.isVector3 ) {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, 0, x.x,\n\t\t\t\t0, 1, 0, x.y,\n\t\t\t\t0, 0, 1, x.z,\n\t\t\t\t0, 0, 0, 1\n\n\t\t\t);\n\n\t\t} else {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, 0, x,\n\t\t\t\t0, 1, 0, y,\n\t\t\t\t0, 0, 1, z,\n\t\t\t\t0, 0, 0, 1\n\n\t\t\t);\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix as a rotational transformation around the X axis by\n\t * the given angle.\n\t *\n\t * @param {number} theta - The rotation in radians.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeRotationX( theta ) {\n\n\t\tconst c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0, 0,\n\t\t\t0, c, - s, 0,\n\t\t\t0, s, c, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix as a rotational transformation around the Y axis by\n\t * the given angle.\n\t *\n\t * @param {number} theta - The rotation in radians.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeRotationY( theta ) {\n\n\t\tconst c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\t c, 0, s, 0,\n\t\t\t 0, 1, 0, 0,\n\t\t\t- s, 0, c, 0,\n\t\t\t 0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix as a rotational transformation around the Z axis by\n\t * the given angle.\n\t *\n\t * @param {number} theta - The rotation in radians.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeRotationZ( theta ) {\n\n\t\tconst c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\tc, - s, 0, 0,\n\t\t\ts, c, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix as a rotational transformation around the given axis by\n\t * the given angle.\n\t *\n\t * This is a somewhat controversial but mathematically sound alternative to\n\t * rotating via Quaternions. See the discussion [here](https://www.gamedev.net/articles/programming/math-and-physics/do-we-really-need-quaternions-r1199).\n\t *\n\t * @param {Vector3} axis - The normalized rotation axis.\n\t * @param {number} angle - The rotation in radians.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeRotationAxis( axis, angle ) {\n\n\t\t// Based on http://www.gamedev.net/reference/articles/article1199.asp\n\n\t\tconst c = Math.cos( angle );\n\t\tconst s = Math.sin( angle );\n\t\tconst t = 1 - c;\n\t\tconst x = axis.x, y = axis.y, z = axis.z;\n\t\tconst tx = t * x, ty = t * y;\n\n\t\tthis.set(\n\n\t\t\ttx * x + c, tx * y - s * z, tx * z + s * y, 0,\n\t\t\ttx * y + s * z, ty * y + c, ty * z - s * x, 0,\n\t\t\ttx * z - s * y, ty * z + s * x, t * z * z + c, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix as a scale transformation.\n\t *\n\t * @param {number} x - The amount to scale in the X axis.\n\t * @param {number} y - The amount to scale in the Y axis.\n\t * @param {number} z - The amount to scale in the Z axis.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeScale( x, y, z ) {\n\n\t\tthis.set(\n\n\t\t\tx, 0, 0, 0,\n\t\t\t0, y, 0, 0,\n\t\t\t0, 0, z, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix as a shear transformation.\n\t *\n\t * @param {number} xy - The amount to shear X by Y.\n\t * @param {number} xz - The amount to shear X by Z.\n\t * @param {number} yx - The amount to shear Y by X.\n\t * @param {number} yz - The amount to shear Y by Z.\n\t * @param {number} zx - The amount to shear Z by X.\n\t * @param {number} zy - The amount to shear Z by Y.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeShear( xy, xz, yx, yz, zx, zy ) {\n\n\t\tthis.set(\n\n\t\t\t1, yx, zx, 0,\n\t\t\txy, 1, zy, 0,\n\t\t\txz, yz, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix to the transformation composed of the given position,\n\t * rotation (Quaternion) and scale.\n\t *\n\t * @param {Vector3} position - The position vector.\n\t * @param {Quaternion} quaternion - The rotation as a Quaternion.\n\t * @param {Vector3} scale - The scale vector.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tcompose( position, quaternion, scale ) {\n\n\t\tconst te = this.elements;\n\n\t\tconst x = quaternion._x, y = quaternion._y, z = quaternion._z, w = quaternion._w;\n\t\tconst x2 = x + x,\ty2 = y + y, z2 = z + z;\n\t\tconst xx = x * x2, xy = x * y2, xz = x * z2;\n\t\tconst yy = y * y2, yz = y * z2, zz = z * z2;\n\t\tconst wx = w * x2, wy = w * y2, wz = w * z2;\n\n\t\tconst sx = scale.x, sy = scale.y, sz = scale.z;\n\n\t\tte[ 0 ] = ( 1 - ( yy + zz ) ) * sx;\n\t\tte[ 1 ] = ( xy + wz ) * sx;\n\t\tte[ 2 ] = ( xz - wy ) * sx;\n\t\tte[ 3 ] = 0;\n\n\t\tte[ 4 ] = ( xy - wz ) * sy;\n\t\tte[ 5 ] = ( 1 - ( xx + zz ) ) * sy;\n\t\tte[ 6 ] = ( yz + wx ) * sy;\n\t\tte[ 7 ] = 0;\n\n\t\tte[ 8 ] = ( xz + wy ) * sz;\n\t\tte[ 9 ] = ( yz - wx ) * sz;\n\t\tte[ 10 ] = ( 1 - ( xx + yy ) ) * sz;\n\t\tte[ 11 ] = 0;\n\n\t\tte[ 12 ] = position.x;\n\t\tte[ 13 ] = position.y;\n\t\tte[ 14 ] = position.z;\n\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Decomposes this matrix into its position, rotation and scale components\n\t * and provides the result in the given objects.\n\t *\n\t * Note: Not all matrices are decomposable in this way. For example, if an\n\t * object has a non-uniformly scaled parent, then the object's world matrix\n\t * may not be decomposable, and this method may not be appropriate.\n\t *\n\t * @param {Vector3} position - The position vector.\n\t * @param {Quaternion} quaternion - The rotation as a Quaternion.\n\t * @param {Vector3} scale - The scale vector.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tdecompose( position, quaternion, scale ) {\n\n\t\tconst te = this.elements;\n\n\t\tposition.x = te[ 12 ];\n\t\tposition.y = te[ 13 ];\n\t\tposition.z = te[ 14 ];\n\n\t\tif ( this.determinant() === 0 ) {\n\n\t\t\tscale.set( 1, 1, 1 );\n\t\t\tquaternion.identity();\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tlet sx = _v1$5.set( te[ 0 ], te[ 1 ], te[ 2 ] ).length();\n\t\tconst sy = _v1$5.set( te[ 4 ], te[ 5 ], te[ 6 ] ).length();\n\t\tconst sz = _v1$5.set( te[ 8 ], te[ 9 ], te[ 10 ] ).length();\n\n\t\t// if determine is negative, we need to invert one scale\n\t\tconst det = this.determinant();\n\t\tif ( det \u003c 0 ) sx = - sx;\n\n\t\t// scale the rotation part\n\t\t_m1$2.copy( this );\n\n\t\tconst invSX = 1 / sx;\n\t\tconst invSY = 1 / sy;\n\t\tconst invSZ = 1 / sz;\n\n\t\t_m1$2.elements[ 0 ] *= invSX;\n\t\t_m1$2.elements[ 1 ] *= invSX;\n\t\t_m1$2.elements[ 2 ] *= invSX;\n\n\t\t_m1$2.elements[ 4 ] *= invSY;\n\t\t_m1$2.elements[ 5 ] *= invSY;\n\t\t_m1$2.elements[ 6 ] *= invSY;\n\n\t\t_m1$2.elements[ 8 ] *= invSZ;\n\t\t_m1$2.elements[ 9 ] *= invSZ;\n\t\t_m1$2.elements[ 10 ] *= invSZ;\n\n\t\tquaternion.setFromRotationMatrix( _m1$2 );\n\n\t\tscale.x = sx;\n\t\tscale.y = sy;\n\t\tscale.z = sz;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Creates a perspective projection matrix. This is used internally by\n\t * {@link PerspectiveCamera#updateProjectionMatrix}.\n\n\t * @param {number} left - Left boundary of the viewing frustum at the near plane.\n\t * @param {number} right - Right boundary of the viewing frustum at the near plane.\n\t * @param {number} top - Top boundary of the viewing frustum at the near plane.\n\t * @param {number} bottom - Bottom boundary of the viewing frustum at the near plane.\n\t * @param {number} near - The distance from the camera to the near plane.\n\t * @param {number} far - The distance from the camera to the far plane.\n\t * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system.\n\t * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakePerspective( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem, reversedDepth = false ) {\n\n\t\tconst te = this.elements;\n\n\t\tconst x = 2 * near / ( right - left );\n\t\tconst y = 2 * near / ( top - bottom );\n\n\t\tconst a = ( right + left ) / ( right - left );\n\t\tconst b = ( top + bottom ) / ( top - bottom );\n\n\t\tlet c, d;\n\n\t\tif ( reversedDepth ) {\n\n\t\t\tc = near / ( far - near );\n\t\t\td = ( far * near ) / ( far - near );\n\n\t\t} else {\n\n\t\t\tif ( coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\t\tc = - ( far + near ) / ( far - near );\n\t\t\t\td = ( -2 * far * near ) / ( far - near );\n\n\t\t\t} else if ( coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\t\tc = - far / ( far - near );\n\t\t\t\td = ( - far * near ) / ( far - near );\n\n\t\t\t} else {\n\n\t\t\t\tthrow new Error( 'THREE.Matrix4.makePerspective(): Invalid coordinate system: ' + coordinateSystem );\n\n\t\t\t}\n\n\t\t}\n\n\t\tte[ 0 ] = x;\tte[ 4 ] = 0;\tte[ 8 ] = a; \tte[ 12 ] = 0;\n\t\tte[ 1 ] = 0;\tte[ 5 ] = y;\tte[ 9 ] = b; \tte[ 13 ] = 0;\n\t\tte[ 2 ] = 0;\tte[ 6 ] = 0;\tte[ 10 ] = c; \tte[ 14 ] = d;\n\t\tte[ 3 ] = 0;\tte[ 7 ] = 0;\tte[ 11 ] = -1;\tte[ 15 ] = 0;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Creates a orthographic projection matrix. This is used internally by\n\t * {@link OrthographicCamera#updateProjectionMatrix}.\n\n\t * @param {number} left - Left boundary of the viewing frustum at the near plane.\n\t * @param {number} right - Right boundary of the viewing frustum at the near plane.\n\t * @param {number} top - Top boundary of the viewing frustum at the near plane.\n\t * @param {number} bottom - Bottom boundary of the viewing frustum at the near plane.\n\t * @param {number} near - The distance from the camera to the near plane.\n\t * @param {number} far - The distance from the camera to the far plane.\n\t * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system.\n\t * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeOrthographic( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem, reversedDepth = false ) {\n\n\t\tconst te = this.elements;\n\n\t\tconst x = 2 / ( right - left );\n\t\tconst y = 2 / ( top - bottom );\n\n\t\tconst a = - ( right + left ) / ( right - left );\n\t\tconst b = - ( top + bottom ) / ( top - bottom );\n\n\t\tlet c, d;\n\n\t\tif ( reversedDepth ) {\n\n\t\t\tc = 1 / ( far - near );\n\t\t\td = far / ( far - near );\n\n\t\t} else {\n\n\t\t\tif ( coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\t\tc = -2 / ( far - near );\n\t\t\t\td = - ( far + near ) / ( far - near );\n\n\t\t\t} else if ( coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\t\tc = -1 / ( far - near );\n\t\t\t\td = - near / ( far - near );\n\n\t\t\t} else {\n\n\t\t\t\tthrow new Error( 'THREE.Matrix4.makeOrthographic(): Invalid coordinate system: ' + coordinateSystem );\n\n\t\t\t}\n\n\t\t}\n\n\t\tte[ 0 ] = x;\t\tte[ 4 ] = 0;\t\tte[ 8 ] = 0; \t\tte[ 12 ] = a;\n\t\tte[ 1 ] = 0; \t\tte[ 5 ] = y;\t\tte[ 9 ] = 0; \t\tte[ 13 ] = b;\n\t\tte[ 2 ] = 0; \t\tte[ 6 ] = 0;\t\tte[ 10 ] = c;\t\tte[ 14 ] = d;\n\t\tte[ 3 ] = 0; \t\tte[ 7 ] = 0;\t\tte[ 11 ] = 0;\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this matrix is equal with the given one.\n\t *\n\t * @param {Matrix4} matrix - The matrix to test for equality.\n\t * @return {boolean} Whether this matrix is equal with the given one.\n\t */\n\tequals( matrix ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor ( let i = 0; i \u003c 16; i ++ ) {\n\n\t\t\tif ( te[ i ] !== me[ i ] ) return false;\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\t/**\n\t * Sets the elements of the matrix from the given array.\n\t *\n\t * @param {Array\u003cnumber\u003e} array - The matrix elements in column-major order.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tfor ( let i = 0; i \u003c 16; i ++ ) {\n\n\t\t\tthis.elements[ i ] = array[ i + offset ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Writes the elements of this matrix to the given array. If no array is provided,\n\t * the method returns a new instance.\n\t *\n\t * @param {Array\u003cnumber\u003e} [array=[]] - The target array holding the matrix elements in column-major order.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Array\u003cnumber\u003e} The matrix elements in column-major order.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tconst te = this.elements;\n\n\t\tarray[ offset ] = te[ 0 ];\n\t\tarray[ offset + 1 ] = te[ 1 ];\n\t\tarray[ offset + 2 ] = te[ 2 ];\n\t\tarray[ offset + 3 ] = te[ 3 ];\n\n\t\tarray[ offset + 4 ] = te[ 4 ];\n\t\tarray[ offset + 5 ] = te[ 5 ];\n\t\tarray[ offset + 6 ] = te[ 6 ];\n\t\tarray[ offset + 7 ] = te[ 7 ];\n\n\t\tarray[ offset + 8 ] = te[ 8 ];\n\t\tarray[ offset + 9 ] = te[ 9 ];\n\t\tarray[ offset + 10 ] = te[ 10 ];\n\t\tarray[ offset + 11 ] = te[ 11 ];\n\n\t\tarray[ offset + 12 ] = te[ 12 ];\n\t\tarray[ offset + 13 ] = te[ 13 ];\n\t\tarray[ offset + 14 ] = te[ 14 ];\n\t\tarray[ offset + 15 ] = te[ 15 ];\n\n\t\treturn array;\n\n\t}\n\n}\n\nconst _v1$5 = /*@__PURE__*/ new Vector3();\nconst _m1$2 = /*@__PURE__*/ new Matrix4();\nconst _zero = /*@__PURE__*/ new Vector3( 0, 0, 0 );\nconst _one = /*@__PURE__*/ new Vector3( 1, 1, 1 );\nconst _x = /*@__PURE__*/ new Vector3();\nconst _y = /*@__PURE__*/ new Vector3();\nconst _z = /*@__PURE__*/ new Vector3();\n\nconst _matrix$2 = /*@__PURE__*/ new Matrix4();\nconst _quaternion$3 = /*@__PURE__*/ new Quaternion();\n\n/**\n * A class representing Euler angles.\n *\n * Euler angles describe a rotational transformation by rotating an object on\n * its various axes in specified amounts per axis, and a specified axis\n * order.\n *\n * Iterating through an instance will yield its components (x, y, z,\n * order) in the corresponding order.\n *\n * ```js\n * const a = new THREE.Euler( 0, 1, 1.57, 'XYZ' );\n * const b = new THREE.Vector3( 1, 0, 1 );\n * b.applyEuler(a);\n * ```\n */\nclass Euler {\n\n\t/**\n\t * Constructs a new euler instance.\n\t *\n\t * @param {number} [x=0] - The angle of the x axis in radians.\n\t * @param {number} [y=0] - The angle of the y axis in radians.\n\t * @param {number} [z=0] - The angle of the z axis in radians.\n\t * @param {string} [order=Euler.DEFAULT_ORDER] - A string representing the order that the rotations are applied.\n\t */\n\tconstructor( x = 0, y = 0, z = 0, order = Euler.DEFAULT_ORDER ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isEuler = true;\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\n\t}\n\n\t/**\n\t * The angle of the x axis in radians.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget x() {\n\n\t\treturn this._x;\n\n\t}\n\n\tset x( value ) {\n\n\t\tthis._x = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\t/**\n\t * The angle of the y axis in radians.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget y() {\n\n\t\treturn this._y;\n\n\t}\n\n\tset y( value ) {\n\n\t\tthis._y = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\t/**\n\t * The angle of the z axis in radians.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget z() {\n\n\t\treturn this._z;\n\n\t}\n\n\tset z( value ) {\n\n\t\tthis._z = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\t/**\n\t * A string representing the order that the rotations are applied.\n\t *\n\t * @type {string}\n\t * @default 'XYZ'\n\t */\n\tget order() {\n\n\t\treturn this._order;\n\n\t}\n\n\tset order( value ) {\n\n\t\tthis._order = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\t/**\n\t * Sets the Euler components.\n\t *\n\t * @param {number} x - The angle of the x axis in radians.\n\t * @param {number} y - The angle of the y axis in radians.\n\t * @param {number} z - The angle of the z axis in radians.\n\t * @param {string} [order] - A string representing the order that the rotations are applied.\n\t * @return {Euler} A reference to this Euler instance.\n\t */\n\tset( x, y, z, order = this._order ) {\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new Euler instance with copied values from this instance.\n\t *\n\t * @return {Euler} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor( this._x, this._y, this._z, this._order );\n\n\t}\n\n\t/**\n\t * Copies the values of the given Euler instance to this instance.\n\t *\n\t * @param {Euler} euler - The Euler instance to copy.\n\t * @return {Euler} A reference to this Euler instance.\n\t */\n\tcopy( euler ) {\n\n\t\tthis._x = euler._x;\n\t\tthis._y = euler._y;\n\t\tthis._z = euler._z;\n\t\tthis._order = euler._order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the angles of this Euler instance from a pure rotation matrix.\n\t *\n\t * @param {Matrix4} m - A 4x4 matrix of which the upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled).\n\t * @param {string} [order] - A string representing the order that the rotations are applied.\n\t * @param {boolean} [update=true] - Whether the internal `onChange` callback should be executed or not.\n\t * @return {Euler} A reference to this Euler instance.\n\t */\n\tsetFromRotationMatrix( m, order = this._order, update = true ) {\n\n\t\tconst te = m.elements;\n\t\tconst m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ];\n\t\tconst m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ];\n\t\tconst m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ];\n\n\t\tswitch ( order ) {\n\n\t\t\tcase 'XYZ':\n\n\t\t\t\tthis._y = Math.asin( clamp( m13, -1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m13 ) \u003c 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( - m23, m33 );\n\t\t\t\t\tthis._z = Math.atan2( - m12, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = Math.atan2( m32, m22 );\n\t\t\t\t\tthis._z = 0;\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\n\t\t\t\tthis._x = Math.asin( - clamp( m23, -1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m23 ) \u003c 0.9999999 ) {\n\n\t\t\t\t\tthis._y = Math.atan2( m13, m33 );\n\t\t\t\t\tthis._z = Math.atan2( m21, m22 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._y = Math.atan2( - m31, m11 );\n\t\t\t\t\tthis._z = 0;\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\n\t\t\t\tthis._x = Math.asin( clamp( m32, -1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m32 ) \u003c 0.9999999 ) {\n\n\t\t\t\t\tthis._y = Math.atan2( - m31, m33 );\n\t\t\t\t\tthis._z = Math.atan2( - m12, m22 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._y = 0;\n\t\t\t\t\tthis._z = Math.atan2( m21, m11 );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\n\t\t\t\tthis._y = Math.asin( - clamp( m31, -1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m31 ) \u003c 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( m32, m33 );\n\t\t\t\t\tthis._z = Math.atan2( m21, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._z = Math.atan2( - m12, m22 );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\n\t\t\t\tthis._z = Math.asin( clamp( m21, -1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m21 ) \u003c 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( - m23, m22 );\n\t\t\t\t\tthis._y = Math.atan2( - m31, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._y = Math.atan2( m13, m33 );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\n\t\t\t\tthis._z = Math.asin( - clamp( m12, -1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m12 ) \u003c 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( m32, m22 );\n\t\t\t\t\tthis._y = Math.atan2( m13, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = Math.atan2( - m23, m33 );\n\t\t\t\t\tthis._y = 0;\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\twarn( 'Euler: .setFromRotationMatrix() encountered an unknown order: ' + order );\n\n\t\t}\n\n\t\tthis._order = order;\n\n\t\tif ( update === true ) this._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the angles of this Euler instance from a normalized quaternion.\n\t *\n\t * @param {Quaternion} q - A normalized Quaternion.\n\t * @param {string} [order] - A string representing the order that the rotations are applied.\n\t * @param {boolean} [update=true] - Whether the internal `onChange` callback should be executed or not.\n\t * @return {Euler} A reference to this Euler instance.\n\t */\n\tsetFromQuaternion( q, order, update ) {\n\n\t\t_matrix$2.makeRotationFromQuaternion( q );\n\n\t\treturn this.setFromRotationMatrix( _matrix$2, order, update );\n\n\t}\n\n\t/**\n\t * Sets the angles of this Euler instance from the given vector.\n\t *\n\t * @param {Vector3} v - The vector.\n\t * @param {string} [order] - A string representing the order that the rotations are applied.\n\t * @return {Euler} A reference to this Euler instance.\n\t */\n\tsetFromVector3( v, order = this._order ) {\n\n\t\treturn this.set( v.x, v.y, v.z, order );\n\n\t}\n\n\t/**\n\t * Resets the euler angle with a new order by creating a quaternion from this\n\t * euler angle and then setting this euler angle with the quaternion and the\n\t * new order.\n\t *\n\t * Warning: This discards revolution information.\n\t *\n\t * @param {string} [newOrder] - A string representing the new order that the rotations are applied.\n\t * @return {Euler} A reference to this Euler instance.\n\t */\n\treorder( newOrder ) {\n\n\t\t_quaternion$3.setFromEuler( this );\n\n\t\treturn this.setFromQuaternion( _quaternion$3, newOrder );\n\n\t}\n\n\t/**\n\t * Returns `true` if this Euler instance is equal with the given one.\n\t *\n\t * @param {Euler} euler - The Euler instance to test for equality.\n\t * @return {boolean} Whether this Euler instance is equal with the given one.\n\t */\n\tequals( euler ) {\n\n\t\treturn ( euler._x === this._x ) \u0026\u0026 ( euler._y === this._y ) \u0026\u0026 ( euler._z === this._z ) \u0026\u0026 ( euler._order === this._order );\n\n\t}\n\n\t/**\n\t * Sets this Euler instance's components to values from the given array. The first three\n\t * entries of the array are assign to the x,y and z components. An optional fourth entry\n\t * defines the Euler order.\n\t *\n\t * @param {Array\u003cnumber,number,number,?string\u003e} array - An array holding the Euler component values.\n\t * @return {Euler} A reference to this Euler instance.\n\t */\n\tfromArray( array ) {\n\n\t\tthis._x = array[ 0 ];\n\t\tthis._y = array[ 1 ];\n\t\tthis._z = array[ 2 ];\n\t\tif ( array[ 3 ] !== undefined ) this._order = array[ 3 ];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Writes the components of this Euler instance to the given array. If no array is provided,\n\t * the method returns a new instance.\n\t *\n\t * @param {Array\u003cnumber,number,number,string\u003e} [array=[]] - The target array holding the Euler components.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Array\u003cnumber,number,number,string\u003e} The Euler components.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this._x;\n\t\tarray[ offset + 1 ] = this._y;\n\t\tarray[ offset + 2 ] = this._z;\n\t\tarray[ offset + 3 ] = this._order;\n\n\t\treturn array;\n\n\t}\n\n\t_onChange( callback ) {\n\n\t\tthis._onChangeCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._order;\n\n\t}\n\n}\n\n/**\n * The default Euler angle order.\n *\n * @static\n * @type {string}\n * @default 'XYZ'\n */\nEuler.DEFAULT_ORDER = 'XYZ';\n\n/**\n * A layers object assigns an 3D object to 1 or more of 32\n * layers numbered `0` to `31` - internally the layers are stored as a\n * bit mask], and by default all 3D objects are a member of layer `0`.\n *\n * This can be used to control visibility - an object must share a layer with\n * a camera to be visible when that camera's view is\n * rendered.\n *\n * All classes that inherit from {@link Object3D} have an `layers` property which\n * is an instance of this class.\n */\nclass Layers {\n\n\t/**\n\t * Constructs a new layers instance, with membership\n\t * initially set to layer `0`.\n\t */\n\tconstructor() {\n\n\t\t/**\n\t\t * A bit mask storing which of the 32 layers this layers object is currently\n\t\t * a member of.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.mask = 1 | 0;\n\n\t}\n\n\t/**\n\t * Sets membership to the given layer, and remove membership all other layers.\n\t *\n\t * @param {number} layer - The layer to set.\n\t */\n\tset( layer ) {\n\n\t\tthis.mask = ( 1 \u003c\u003c layer | 0 ) \u003e\u003e\u003e 0;\n\n\t}\n\n\t/**\n\t * Adds membership of the given layer.\n\t *\n\t * @param {number} layer - The layer to enable.\n\t */\n\tenable( layer ) {\n\n\t\tthis.mask |= 1 \u003c\u003c layer | 0;\n\n\t}\n\n\t/**\n\t * Adds membership to all layers.\n\t */\n\tenableAll() {\n\n\t\tthis.mask = 0xffffffff | 0;\n\n\t}\n\n\t/**\n\t * Toggles the membership of the given layer.\n\t *\n\t * @param {number} layer - The layer to toggle.\n\t */\n\ttoggle( layer ) {\n\n\t\tthis.mask ^= 1 \u003c\u003c layer | 0;\n\n\t}\n\n\t/**\n\t * Removes membership of the given layer.\n\t *\n\t * @param {number} layer - The layer to enable.\n\t */\n\tdisable( layer ) {\n\n\t\tthis.mask \u0026= ~ ( 1 \u003c\u003c layer | 0 );\n\n\t}\n\n\t/**\n\t * Removes the membership from all layers.\n\t */\n\tdisableAll() {\n\n\t\tthis.mask = 0;\n\n\t}\n\n\t/**\n\t * Returns `true` if this and the given layers object have at least one\n\t * layer in common.\n\t *\n\t * @param {Layers} layers - The layers to test.\n\t * @return {boolean } Whether this and the given layers object have at least one layer in common or not.\n\t */\n\ttest( layers ) {\n\n\t\treturn ( this.mask \u0026 layers.mask ) !== 0;\n\n\t}\n\n\t/**\n\t * Returns `true` if the given layer is enabled.\n\t *\n\t * @param {number} layer - The layer to test.\n\t * @return {boolean } Whether the given layer is enabled or not.\n\t */\n\tisEnabled( layer ) {\n\n\t\treturn ( this.mask \u0026 ( 1 \u003c\u003c layer | 0 ) ) !== 0;\n\n\t}\n\n}\n\nlet _object3DId = 0;\n\nconst _v1$4 = /*@__PURE__*/ new Vector3();\nconst _q1 = /*@__PURE__*/ new Quaternion();\nconst _m1$1 = /*@__PURE__*/ new Matrix4();\nconst _target = /*@__PURE__*/ new Vector3();\n\nconst _position$3 = /*@__PURE__*/ new Vector3();\nconst _scale$2 = /*@__PURE__*/ new Vector3();\nconst _quaternion$2 = /*@__PURE__*/ new Quaternion();\n\nconst _xAxis = /*@__PURE__*/ new Vector3( 1, 0, 0 );\nconst _yAxis = /*@__PURE__*/ new Vector3( 0, 1, 0 );\nconst _zAxis = /*@__PURE__*/ new Vector3( 0, 0, 1 );\n\n/**\n * Fires when the object has been added to its parent object.\n *\n * @event Object3D#added\n * @type {Object}\n */\nconst _addedEvent = { type: 'added' };\n\n/**\n * Fires when the object has been removed from its parent object.\n *\n * @event Object3D#removed\n * @type {Object}\n */\nconst _removedEvent = { type: 'removed' };\n\n/**\n * Fires when a new child object has been added.\n *\n * @event Object3D#childadded\n * @type {Object}\n */\nconst _childaddedEvent = { type: 'childadded', child: null };\n\n/**\n * Fires when a child object has been removed.\n *\n * @event Object3D#childremoved\n * @type {Object}\n */\nconst _childremovedEvent = { type: 'childremoved', child: null };\n\n/**\n * This is the base class for most objects in three.js and provides a set of\n * properties and methods for manipulating objects in 3D space.\n *\n * @augments EventDispatcher\n */\nclass Object3D extends EventDispatcher {\n\n\t/**\n\t * Constructs a new 3D object.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isObject3D = true;\n\n\t\t/**\n\t\t * The ID of the 3D object.\n\t\t *\n\t\t * @name Object3D#id\n\t\t * @type {number}\n\t\t * @readonly\n\t\t */\n\t\tObject.defineProperty( this, 'id', { value: _object3DId ++ } );\n\n\t\t/**\n\t\t * The UUID of the 3D object.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.uuid = generateUUID();\n\n\t\t/**\n\t\t * The name of the 3D object.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\n\t\t/**\n\t\t * The type property is used for detecting the object type\n\t\t * in context of serialization/deserialization.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.type = 'Object3D';\n\n\t\t/**\n\t\t * A reference to the parent object.\n\t\t *\n\t\t * @type {?Object3D}\n\t\t * @default null\n\t\t */\n\t\tthis.parent = null;\n\n\t\t/**\n\t\t * An array holding the child 3D objects of this instance.\n\t\t *\n\t\t * @type {Array\u003cObject3D\u003e}\n\t\t */\n\t\tthis.children = [];\n\n\t\t/**\n\t\t * Defines the `up` direction of the 3D object which influences\n\t\t * the orientation via methods like {@link Object3D#lookAt}.\n\t\t *\n\t\t * The default values for all 3D objects is defined by `Object3D.DEFAULT_UP`.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.up = Object3D.DEFAULT_UP.clone();\n\n\t\tconst position = new Vector3();\n\t\tconst rotation = new Euler();\n\t\tconst quaternion = new Quaternion();\n\t\tconst scale = new Vector3( 1, 1, 1 );\n\n\t\tfunction onRotationChange() {\n\n\t\t\tquaternion.setFromEuler( rotation, false );\n\n\t\t}\n\n\t\tfunction onQuaternionChange() {\n\n\t\t\trotation.setFromQuaternion( quaternion, undefined, false );\n\n\t\t}\n\n\t\trotation._onChange( onRotationChange );\n\t\tquaternion._onChange( onQuaternionChange );\n\n\t\tObject.defineProperties( this, {\n\t\t\t/**\n\t\t\t * Represents the object's local position.\n\t\t\t *\n\t\t\t * @name Object3D#position\n\t\t\t * @type {Vector3}\n\t\t\t * @default (0,0,0)\n\t\t\t */\n\t\t\tposition: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: position\n\t\t\t},\n\t\t\t/**\n\t\t\t * Represents the object's local rotation as Euler angles, in radians.\n\t\t\t *\n\t\t\t * @name Object3D#rotation\n\t\t\t * @type {Euler}\n\t\t\t * @default (0,0,0)\n\t\t\t */\n\t\t\trotation: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: rotation\n\t\t\t},\n\t\t\t/**\n\t\t\t * Represents the object's local rotation as Quaternions.\n\t\t\t *\n\t\t\t * @name Object3D#quaternion\n\t\t\t * @type {Quaternion}\n\t\t\t */\n\t\t\tquaternion: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: quaternion\n\t\t\t},\n\t\t\t/**\n\t\t\t * Represents the object's local scale.\n\t\t\t *\n\t\t\t * @name Object3D#scale\n\t\t\t * @type {Vector3}\n\t\t\t * @default (1,1,1)\n\t\t\t */\n\t\t\tscale: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: scale\n\t\t\t},\n\t\t\t/**\n\t\t\t * Represents the object's model-view matrix.\n\t\t\t *\n\t\t\t * @name Object3D#modelViewMatrix\n\t\t\t * @type {Matrix4}\n\t\t\t */\n\t\t\tmodelViewMatrix: {\n\t\t\t\tvalue: new Matrix4()\n\t\t\t},\n\t\t\t/**\n\t\t\t * Represents the object's normal matrix.\n\t\t\t *\n\t\t\t * @name Object3D#normalMatrix\n\t\t\t * @type {Matrix3}\n\t\t\t */\n\t\t\tnormalMatrix: {\n\t\t\t\tvalue: new Matrix3()\n\t\t\t}\n\t\t} );\n\n\t\t/**\n\t\t * Represents the object's transformation matrix in local space.\n\t\t *\n\t\t * @type {Matrix4}\n\t\t */\n\t\tthis.matrix = new Matrix4();\n\n\t\t/**\n\t\t * Represents the object's transformation matrix in world space.\n\t\t * If the 3D object has no parent, then it's identical to the local transformation matrix\n\t\t *\n\t\t * @type {Matrix4}\n\t\t */\n\t\tthis.matrixWorld = new Matrix4();\n\n\t\t/**\n\t\t * When set to `true`, the engine automatically computes the local matrix from position,\n\t\t * rotation and scale every frame.\n\t\t *\n\t\t * The default values for all 3D objects is defined by `Object3D.DEFAULT_MATRIX_AUTO_UPDATE`.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.matrixAutoUpdate = Object3D.DEFAULT_MATRIX_AUTO_UPDATE;\n\n\t\t/**\n\t\t * When set to `true`, the engine automatically computes the world matrix from the current local\n\t\t * matrix and the object's transformation hierarchy.\n\t\t *\n\t\t * The default values for all 3D objects is defined by `Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE`.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.matrixWorldAutoUpdate = Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE; // checked by the renderer\n\n\t\t/**\n\t\t * When set to `true`, it calculates the world matrix in that frame and resets this property\n\t\t * to `false`.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.matrixWorldNeedsUpdate = false;\n\n\t\t/**\n\t\t * The layer membership of the 3D object. The 3D object is only visible if it has\n\t\t * at least one layer in common with the camera in use. This property can also be\n\t\t * used to filter out unwanted objects in ray-intersection tests when using {@link Raycaster}.\n\t\t *\n\t\t * @type {Layers}\n\t\t */\n\t\tthis.layers = new Layers();\n\n\t\t/**\n\t\t * When set to `true`, the 3D object gets rendered.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.visible = true;\n\n\t\t/**\n\t\t * When set to `true`, the 3D object gets rendered into shadow maps.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.castShadow = false;\n\n\t\t/**\n\t\t * When set to `true`, the 3D object is affected by shadows in the scene.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.receiveShadow = false;\n\n\t\t/**\n\t\t * When set to `true`, the 3D object is honored by view frustum culling.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.frustumCulled = true;\n\n\t\t/**\n\t\t * This value allows the default rendering order of scene graph objects to be\n\t\t * overridden although opaque and transparent objects remain sorted independently.\n\t\t * When this property is set for an instance of {@link Group},all descendants\n\t\t * objects will be sorted and rendered together. Sorting is from lowest to highest\n\t\t * render order.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.renderOrder = 0;\n\n\t\t/**\n\t\t * An array holding the animation clips of the 3D object.\n\t\t *\n\t\t * @type {Array\u003cAnimationClip\u003e}\n\t\t */\n\t\tthis.animations = [];\n\n\t\t/**\n\t\t * Custom depth material to be used when rendering to the depth map. Can only be used\n\t\t * in context of meshes. When shadow-casting with a {@link DirectionalLight} or {@link SpotLight},\n\t\t * if you are modifying vertex positions in the vertex shader you must specify a custom depth\n\t\t * material for proper shadows.\n\t\t *\n\t\t * Only relevant in context of {@link WebGLRenderer}.\n\t\t *\n\t\t * @type {(Material|undefined)}\n\t\t * @default undefined\n\t\t */\n\t\tthis.customDepthMaterial = undefined;\n\n\t\t/**\n\t\t * Same as {@link Object3D#customDepthMaterial}, but used with {@link PointLight}.\n\t\t *\n\t\t * Only relevant in context of {@link WebGLRenderer}.\n\t\t *\n\t\t * @type {(Material|undefined)}\n\t\t * @default undefined\n\t\t */\n\t\tthis.customDistanceMaterial = undefined;\n\n\t\t/**\n\t\t * An object that can be used to store custom data about the 3D object. It\n\t\t * should not hold references to functions as these will not be cloned.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.userData = {};\n\n\t}\n\n\t/**\n\t * A callback that is executed immediately before a 3D object is rendered to a shadow map.\n\t *\n\t * @param {Renderer|WebGLRenderer} renderer - The renderer.\n\t * @param {Object3D} object - The 3D object.\n\t * @param {Camera} camera - The camera that is used to render the scene.\n\t * @param {Camera} shadowCamera - The shadow camera.\n\t * @param {BufferGeometry} geometry - The 3D object's geometry.\n\t * @param {Material} depthMaterial - The depth material.\n\t * @param {Object} group - The geometry group data.\n\t */\n\tonBeforeShadow( /* renderer, object, camera, shadowCamera, geometry, depthMaterial, group */ ) {}\n\n\t/**\n\t * A callback that is executed immediately after a 3D object is rendered to a shadow map.\n\t *\n\t * @param {Renderer|WebGLRenderer} renderer - The renderer.\n\t * @param {Object3D} object - The 3D object.\n\t * @param {Camera} camera - The camera that is used to render the scene.\n\t * @param {Camera} shadowCamera - The shadow camera.\n\t * @param {BufferGeometry} geometry - The 3D object's geometry.\n\t * @param {Material} depthMaterial - The depth material.\n\t * @param {Object} group - The geometry group data.\n\t */\n\tonAfterShadow( /* renderer, object, camera, shadowCamera, geometry, depthMaterial, group */ ) {}\n\n\t/**\n\t * A callback that is executed immediately before a 3D object is rendered.\n\t *\n\t * @param {Renderer|WebGLRenderer} renderer - The renderer.\n\t * @param {Object3D} object - The 3D object.\n\t * @param {Camera} camera - The camera that is used to render the scene.\n\t * @param {BufferGeometry} geometry - The 3D object's geometry.\n\t * @param {Material} material - The 3D object's material.\n\t * @param {Object} group - The geometry group data.\n\t */\n\tonBeforeRender( /* renderer, scene, camera, geometry, material, group */ ) {}\n\n\t/**\n\t * A callback that is executed immediately after a 3D object is rendered.\n\t *\n\t * @param {Renderer|WebGLRenderer} renderer - The renderer.\n\t * @param {Object3D} object - The 3D object.\n\t * @param {Camera} camera - The camera that is used to render the scene.\n\t * @param {BufferGeometry} geometry - The 3D object's geometry.\n\t * @param {Material} material - The 3D object's material.\n\t * @param {Object} group - The geometry group data.\n\t */\n\tonAfterRender( /* renderer, scene, camera, geometry, material, group */ ) {}\n\n\t/**\n\t * Applies the given transformation matrix to the object and updates the object's position,\n\t * rotation and scale.\n\t *\n\t * @param {Matrix4} matrix - The transformation matrix.\n\t */\n\tapplyMatrix4( matrix ) {\n\n\t\tif ( this.matrixAutoUpdate ) this.updateMatrix();\n\n\t\tthis.matrix.premultiply( matrix );\n\n\t\tthis.matrix.decompose( this.position, this.quaternion, this.scale );\n\n\t}\n\n\t/**\n\t * Applies a rotation represented by given the quaternion to the 3D object.\n\t *\n\t * @param {Quaternion} q - The quaternion.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\tapplyQuaternion( q ) {\n\n\t\tthis.quaternion.premultiply( q );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given rotation represented as an axis/angle couple to the 3D object.\n\t *\n\t * @param {Vector3} axis - The (normalized) axis vector.\n\t * @param {number} angle - The angle in radians.\n\t */\n\tsetRotationFromAxisAngle( axis, angle ) {\n\n\t\t// assumes axis is normalized\n\n\t\tthis.quaternion.setFromAxisAngle( axis, angle );\n\n\t}\n\n\t/**\n\t * Sets the given rotation represented as Euler angles to the 3D object.\n\t *\n\t * @param {Euler} euler - The Euler angles.\n\t */\n\tsetRotationFromEuler( euler ) {\n\n\t\tthis.quaternion.setFromEuler( euler, true );\n\n\t}\n\n\t/**\n\t * Sets the given rotation represented as rotation matrix to the 3D object.\n\t *\n\t * @param {Matrix4} m - Although a 4x4 matrix is expected, the upper 3x3 portion must be\n\t * a pure rotation matrix (i.e, unscaled).\n\t */\n\tsetRotationFromMatrix( m ) {\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tthis.quaternion.setFromRotationMatrix( m );\n\n\t}\n\n\t/**\n\t * Sets the given rotation represented as a Quaternion to the 3D object.\n\t *\n\t * @param {Quaternion} q - The Quaternion\n\t */\n\tsetRotationFromQuaternion( q ) {\n\n\t\t// assumes q is normalized\n\n\t\tthis.quaternion.copy( q );\n\n\t}\n\n\t/**\n\t * Rotates the 3D object along an axis in local space.\n\t *\n\t * @param {Vector3} axis - The (normalized) axis vector.\n\t * @param {number} angle - The angle in radians.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\trotateOnAxis( axis, angle ) {\n\n\t\t// rotate object on axis in object space\n\t\t// axis is assumed to be normalized\n\n\t\t_q1.setFromAxisAngle( axis, angle );\n\n\t\tthis.quaternion.multiply( _q1 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Rotates the 3D object along an axis in world space.\n\t *\n\t * @param {Vector3} axis - The (normalized) axis vector.\n\t * @param {number} angle - The angle in radians.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\trotateOnWorldAxis( axis, angle ) {\n\n\t\t// rotate object on axis in world space\n\t\t// axis is assumed to be normalized\n\t\t// method assumes no rotated parent\n\n\t\t_q1.setFromAxisAngle( axis, angle );\n\n\t\tthis.quaternion.premultiply( _q1 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Rotates the 3D object around its X axis in local space.\n\t *\n\t * @param {number} angle - The angle in radians.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\trotateX( angle ) {\n\n\t\treturn this.rotateOnAxis( _xAxis, angle );\n\n\t}\n\n\t/**\n\t * Rotates the 3D object around its Y axis in local space.\n\t *\n\t * @param {number} angle - The angle in radians.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\trotateY( angle ) {\n\n\t\treturn this.rotateOnAxis( _yAxis, angle );\n\n\t}\n\n\t/**\n\t * Rotates the 3D object around its Z axis in local space.\n\t *\n\t * @param {number} angle - The angle in radians.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\trotateZ( angle ) {\n\n\t\treturn this.rotateOnAxis( _zAxis, angle );\n\n\t}\n\n\t/**\n\t * Translate the 3D object by a distance along the given axis in local space.\n\t *\n\t * @param {Vector3} axis - The (normalized) axis vector.\n\t * @param {number} distance - The distance in world units.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\ttranslateOnAxis( axis, distance ) {\n\n\t\t// translate object by distance along axis in object space\n\t\t// axis is assumed to be normalized\n\n\t\t_v1$4.copy( axis ).applyQuaternion( this.quaternion );\n\n\t\tthis.position.add( _v1$4.multiplyScalar( distance ) );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Translate the 3D object by a distance along its X-axis in local space.\n\t *\n\t * @param {number} distance - The distance in world units.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\ttranslateX( distance ) {\n\n\t\treturn this.translateOnAxis( _xAxis, distance );\n\n\t}\n\n\t/**\n\t * Translate the 3D object by a distance along its Y-axis in local space.\n\t *\n\t * @param {number} distance - The distance in world units.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\ttranslateY( distance ) {\n\n\t\treturn this.translateOnAxis( _yAxis, distance );\n\n\t}\n\n\t/**\n\t * Translate the 3D object by a distance along its Z-axis in local space.\n\t *\n\t * @param {number} distance - The distance in world units.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\ttranslateZ( distance ) {\n\n\t\treturn this.translateOnAxis( _zAxis, distance );\n\n\t}\n\n\t/**\n\t * Converts the given vector from this 3D object's local space to world space.\n\t *\n\t * @param {Vector3} vector - The vector to convert.\n\t * @return {Vector3} The converted vector.\n\t */\n\tlocalToWorld( vector ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\treturn vector.applyMatrix4( this.matrixWorld );\n\n\t}\n\n\t/**\n\t * Converts the given vector from this 3D object's word space to local space.\n\t *\n\t * @param {Vector3} vector - The vector to convert.\n\t * @return {Vector3} The converted vector.\n\t */\n\tworldToLocal( vector ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\treturn vector.applyMatrix4( _m1$1.copy( this.matrixWorld ).invert() );\n\n\t}\n\n\t/**\n\t * Rotates the object to face a point in world space.\n\t *\n\t * This method does not support objects having non-uniformly-scaled parent(s).\n\t *\n\t * @param {number|Vector3} x - The x coordinate in world space. Alternatively, a vector representing a position in world space\n\t * @param {number} [y] - The y coordinate in world space.\n\t * @param {number} [z] - The z coordinate in world space.\n\t */\n\tlookAt( x, y, z ) {\n\n\t\t// This method does not support objects having non-uniformly-scaled parent(s)\n\n\t\tif ( x.isVector3 ) {\n\n\t\t\t_target.copy( x );\n\n\t\t} else {\n\n\t\t\t_target.set( x, y, z );\n\n\t\t}\n\n\t\tconst parent = this.parent;\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\t_position$3.setFromMatrixPosition( this.matrixWorld );\n\n\t\tif ( this.isCamera || this.isLight ) {\n\n\t\t\t_m1$1.lookAt( _position$3, _target, this.up );\n\n\t\t} else {\n\n\t\t\t_m1$1.lookAt( _target, _position$3, this.up );\n\n\t\t}\n\n\t\tthis.quaternion.setFromRotationMatrix( _m1$1 );\n\n\t\tif ( parent ) {\n\n\t\t\t_m1$1.extractRotation( parent.matrixWorld );\n\t\t\t_q1.setFromRotationMatrix( _m1$1 );\n\t\t\tthis.quaternion.premultiply( _q1.invert() );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Adds the given 3D object as a child to this 3D object. An arbitrary number of\n\t * objects may be added. Any current parent on an object passed in here will be\n\t * removed, since an object can have at most one parent.\n\t *\n\t * @fires Object3D#added\n\t * @fires Object3D#childadded\n\t * @param {Object3D} object - The 3D object to add.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\tadd( object ) {\n\n\t\tif ( arguments.length \u003e 1 ) {\n\n\t\t\tfor ( let i = 0; i \u003c arguments.length; i ++ ) {\n\n\t\t\t\tthis.add( arguments[ i ] );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( object === this ) {\n\n\t\t\terror( 'Object3D.add: object can\\'t be added as a child of itself.', object );\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( object \u0026\u0026 object.isObject3D ) {\n\n\t\t\tobject.removeFromParent();\n\t\t\tobject.parent = this;\n\t\t\tthis.children.push( object );\n\n\t\t\tobject.dispatchEvent( _addedEvent );\n\n\t\t\t_childaddedEvent.child = object;\n\t\t\tthis.dispatchEvent( _childaddedEvent );\n\t\t\t_childaddedEvent.child = null;\n\n\t\t} else {\n\n\t\t\terror( 'Object3D.add: object not an instance of THREE.Object3D.', object );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Removes the given 3D object as child from this 3D object.\n\t * An arbitrary number of objects may be removed.\n\t *\n\t * @fires Object3D#removed\n\t * @fires Object3D#childremoved\n\t * @param {Object3D} object - The 3D object to remove.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\tremove( object ) {\n\n\t\tif ( arguments.length \u003e 1 ) {\n\n\t\t\tfor ( let i = 0; i \u003c arguments.length; i ++ ) {\n\n\t\t\t\tthis.remove( arguments[ i ] );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tconst index = this.children.indexOf( object );\n\n\t\tif ( index !== -1 ) {\n\n\t\t\tobject.parent = null;\n\t\t\tthis.children.splice( index, 1 );\n\n\t\t\tobject.dispatchEvent( _removedEvent );\n\n\t\t\t_childremovedEvent.child = object;\n\t\t\tthis.dispatchEvent( _childremovedEvent );\n\t\t\t_childremovedEvent.child = null;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Removes this 3D object from its current parent.\n\t *\n\t * @fires Object3D#removed\n\t * @fires Object3D#childremoved\n\t * @return {Object3D} A reference to this instance.\n\t */\n\tremoveFromParent() {\n\n\t\tconst parent = this.parent;\n\n\t\tif ( parent !== null ) {\n\n\t\t\tparent.remove( this );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Removes all child objects.\n\t *\n\t * @fires Object3D#removed\n\t * @fires Object3D#childremoved\n\t * @return {Object3D} A reference to this instance.\n\t */\n\tclear() {\n\n\t\treturn this.remove( ... this.children );\n\n\t}\n\n\t/**\n\t * Adds the given 3D object as a child of this 3D object, while maintaining the object's world\n\t * transform. This method does not support scene graphs having non-uniformly-scaled nodes(s).\n\t *\n\t * @fires Object3D#added\n\t * @fires Object3D#childadded\n\t * @param {Object3D} object - The 3D object to attach.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\tattach( object ) {\n\n\t\t// adds object as a child of this, while maintaining the object's world transform\n\n\t\t// Note: This method does not support scene graphs having non-uniformly-scaled nodes(s)\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\t_m1$1.copy( this.matrixWorld ).invert();\n\n\t\tif ( object.parent !== null ) {\n\n\t\t\tobject.parent.updateWorldMatrix( true, false );\n\n\t\t\t_m1$1.multiply( object.parent.matrixWorld );\n\n\t\t}\n\n\t\tobject.applyMatrix4( _m1$1 );\n\n\t\tobject.removeFromParent();\n\t\tobject.parent = this;\n\t\tthis.children.push( object );\n\n\t\tobject.updateWorldMatrix( false, true );\n\n\t\tobject.dispatchEvent( _addedEvent );\n\n\t\t_childaddedEvent.child = object;\n\t\tthis.dispatchEvent( _childaddedEvent );\n\t\t_childaddedEvent.child = null;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Searches through the 3D object and its children, starting with the 3D object\n\t * itself, and returns the first with a matching ID.\n\t *\n\t * @param {number} id - The id.\n\t * @return {Object3D|undefined} The found 3D object. Returns `undefined` if no 3D object has been found.\n\t */\n\tgetObjectById( id ) {\n\n\t\treturn this.getObjectByProperty( 'id', id );\n\n\t}\n\n\t/**\n\t * Searches through the 3D object and its children, starting with the 3D object\n\t * itself, and returns the first with a matching name.\n\t *\n\t * @param {string} name - The name.\n\t * @return {Object3D|undefined} The found 3D object. Returns `undefined` if no 3D object has been found.\n\t */\n\tgetObjectByName( name ) {\n\n\t\treturn this.getObjectByProperty( 'name', name );\n\n\t}\n\n\t/**\n\t * Searches through the 3D object and its children, starting with the 3D object\n\t * itself, and returns the first with a matching property value.\n\t *\n\t * @param {string} name - The name of the property.\n\t * @param {any} value - The value.\n\t * @return {Object3D|undefined} The found 3D object. Returns `undefined` if no 3D object has been found.\n\t */\n\tgetObjectByProperty( name, value ) {\n\n\t\tif ( this[ name ] === value ) return this;\n\n\t\tfor ( let i = 0, l = this.children.length; i \u003c l; i ++ ) {\n\n\t\t\tconst child = this.children[ i ];\n\t\t\tconst object = child.getObjectByProperty( name, value );\n\n\t\t\tif ( object !== undefined ) {\n\n\t\t\t\treturn object;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn undefined;\n\n\t}\n\n\t/**\n\t * Searches through the 3D object and its children, starting with the 3D object\n\t * itself, and returns all 3D objects with a matching property value.\n\t *\n\t * @param {string} name - The name of the property.\n\t * @param {any} value - The value.\n\t * @param {Array\u003cObject3D\u003e} result - The method stores the result in this array.\n\t * @return {Array\u003cObject3D\u003e} The found 3D objects.\n\t */\n\tgetObjectsByProperty( name, value, result = [] ) {\n\n\t\tif ( this[ name ] === value ) result.push( this );\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i \u003c l; i ++ ) {\n\n\t\t\tchildren[ i ].getObjectsByProperty( name, value, result );\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n\t/**\n\t * Returns a vector representing the position of the 3D object in world space.\n\t *\n\t * @param {Vector3} target - The target vector the result is stored to.\n\t * @return {Vector3} The 3D object's position in world space.\n\t */\n\tgetWorldPosition( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\treturn target.setFromMatrixPosition( this.matrixWorld );\n\n\t}\n\n\t/**\n\t * Returns a Quaternion representing the position of the 3D object in world space.\n\t *\n\t * @param {Quaternion} target - The target Quaternion the result is stored to.\n\t * @return {Quaternion} The 3D object's rotation in world space.\n\t */\n\tgetWorldQuaternion( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\tthis.matrixWorld.decompose( _position$3, target, _scale$2 );\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Returns a vector representing the scale of the 3D object in world space.\n\t *\n\t * @param {Vector3} target - The target vector the result is stored to.\n\t * @return {Vector3} The 3D object's scale in world space.\n\t */\n\tgetWorldScale( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\tthis.matrixWorld.decompose( _position$3, _quaternion$2, target );\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Returns a vector representing the (\"look\") direction of the 3D object in world space.\n\t *\n\t * @param {Vector3} target - The target vector the result is stored to.\n\t * @return {Vector3} The 3D object's direction in world space.\n\t */\n\tgetWorldDirection( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\tconst e = this.matrixWorld.elements;\n\n\t\treturn target.set( e[ 8 ], e[ 9 ], e[ 10 ] ).normalize();\n\n\t}\n\n\t/**\n\t * Abstract method to get intersections between a casted ray and this\n\t * 3D object. Renderable 3D objects such as {@link Mesh}, {@link Line} or {@link Points}\n\t * implement this method in order to use raycasting.\n\t *\n\t * @abstract\n\t * @param {Raycaster} raycaster - The raycaster.\n\t * @param {Array\u003cObject\u003e} intersects - An array holding the result of the method.\n\t */\n\traycast( /* raycaster, intersects */ ) {}\n\n\t/**\n\t * Executes the callback on this 3D object and all descendants.\n\t *\n\t * Note: Modifying the scene graph inside the callback is discouraged.\n\t *\n\t * @param {Function} callback - A callback function that allows to process the current 3D object.\n\t */\n\ttraverse( callback ) {\n\n\t\tcallback( this );\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i \u003c l; i ++ ) {\n\n\t\t\tchildren[ i ].traverse( callback );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Like {@link Object3D#traverse}, but the callback will only be executed for visible 3D objects.\n\t * Descendants of invisible 3D objects are not traversed.\n\t *\n\t * Note: Modifying the scene graph inside the callback is discouraged.\n\t *\n\t * @param {Function} callback - A callback function that allows to process the current 3D object.\n\t */\n\ttraverseVisible( callback ) {\n\n\t\tif ( this.visible === false ) return;\n\n\t\tcallback( this );\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i \u003c l; i ++ ) {\n\n\t\t\tchildren[ i ].traverseVisible( callback );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Like {@link Object3D#traverse}, but the callback will only be executed for all ancestors.\n\t *\n\t * Note: Modifying the scene graph inside the callback is discouraged.\n\t *\n\t * @param {Function} callback - A callback function that allows to process the current 3D object.\n\t */\n\ttraverseAncestors( callback ) {\n\n\t\tconst parent = this.parent;\n\n\t\tif ( parent !== null ) {\n\n\t\t\tcallback( parent );\n\n\t\t\tparent.traverseAncestors( callback );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Updates the transformation matrix in local space by computing it from the current\n\t * position, rotation and scale values.\n\t */\n\tupdateMatrix() {\n\n\t\tthis.matrix.compose( this.position, this.quaternion, this.scale );\n\n\t\tthis.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t/**\n\t * Updates the transformation matrix in world space of this 3D objects and its descendants.\n\t *\n\t * To ensure correct results, this method also recomputes the 3D object's transformation matrix in\n\t * local space. The computation of the local and world matrix can be controlled with the\n\t * {@link Object3D#matrixAutoUpdate} and {@link Object3D#matrixWorldAutoUpdate} flags which are both\n\t * `true` by default.  Set these flags to `false` if you need more control over the update matrix process.\n\t *\n\t * @param {boolean} [force=false] - When set to `true`, a recomputation of world matrices is forced even\n\t * when {@link Object3D#matrixWorldAutoUpdate} is set to `false`.\n\t */\n\tupdateMatrixWorld( force ) {\n\n\t\tif ( this.matrixAutoUpdate ) this.updateMatrix();\n\n\t\tif ( this.matrixWorldNeedsUpdate || force ) {\n\n\t\t\tif ( this.matrixWorldAutoUpdate === true ) {\n\n\t\t\t\tif ( this.parent === null ) {\n\n\t\t\t\t\tthis.matrixWorld.copy( this.matrix );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.matrixWorldNeedsUpdate = false;\n\n\t\t\tforce = true;\n\n\t\t}\n\n\t\t// make sure descendants are updated if required\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i \u003c l; i ++ ) {\n\n\t\t\tconst child = children[ i ];\n\n\t\t\tchild.updateMatrixWorld( force );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * An alternative version of {@link Object3D#updateMatrixWorld} with more control over the\n\t * update of ancestor and descendant nodes.\n\t *\n\t * @param {boolean} [updateParents=false] Whether ancestor nodes should be updated or not.\n\t * @param {boolean} [updateChildren=false] Whether descendant nodes should be updated or not.\n\t */\n\tupdateWorldMatrix( updateParents, updateChildren ) {\n\n\t\tconst parent = this.parent;\n\n\t\tif ( updateParents === true \u0026\u0026 parent !== null ) {\n\n\t\t\tparent.updateWorldMatrix( true, false );\n\n\t\t}\n\n\t\tif ( this.matrixAutoUpdate ) this.updateMatrix();\n\n\t\tif ( this.matrixWorldAutoUpdate === true ) {\n\n\t\t\tif ( this.parent === null ) {\n\n\t\t\t\tthis.matrixWorld.copy( this.matrix );\n\n\t\t\t} else {\n\n\t\t\t\tthis.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// make sure descendants are updated\n\n\t\tif ( updateChildren === true ) {\n\n\t\t\tconst children = this.children;\n\n\t\t\tfor ( let i = 0, l = children.length; i \u003c l; i ++ ) {\n\n\t\t\t\tconst child = children[ i ];\n\n\t\t\t\tchild.updateWorldMatrix( false, true );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Serializes the 3D object into JSON.\n\t *\n\t * @param {?(Object|string)} meta - An optional value holding meta information about the serialization.\n\t * @return {Object} A JSON object representing the serialized 3D object.\n\t * @see {@link ObjectLoader#parse}\n\t */\n\ttoJSON( meta ) {\n\n\t\t// meta is a string when called from JSON.stringify\n\t\tconst isRootObject = ( meta === undefined || typeof meta === 'string' );\n\n\t\tconst output = {};\n\n\t\t// meta is a hash used to collect geometries, materials.\n\t\t// not providing it implies that this is the root object\n\t\t// being serialized.\n\t\tif ( isRootObject ) {\n\n\t\t\t// initialize meta obj\n\t\t\tmeta = {\n\t\t\t\tgeometries: {},\n\t\t\t\tmaterials: {},\n\t\t\t\ttextures: {},\n\t\t\t\timages: {},\n\t\t\t\tshapes: {},\n\t\t\t\tskeletons: {},\n\t\t\t\tanimations: {},\n\t\t\t\tnodes: {}\n\t\t\t};\n\n\t\t\toutput.metadata = {\n\t\t\t\tversion: 4.7,\n\t\t\t\ttype: 'Object',\n\t\t\t\tgenerator: 'Object3D.toJSON'\n\t\t\t};\n\n\t\t}\n\n\t\t// standard Object3D serialization\n\n\t\tconst object = {};\n\n\t\tobject.uuid = this.uuid;\n\t\tobject.type = this.type;\n\n\t\tif ( this.name !== '' ) object.name = this.name;\n\t\tif ( this.castShadow === true ) object.castShadow = true;\n\t\tif ( this.receiveShadow === true ) object.receiveShadow = true;\n\t\tif ( this.visible === false ) object.visible = false;\n\t\tif ( this.frustumCulled === false ) object.frustumCulled = false;\n\t\tif ( this.renderOrder !== 0 ) object.renderOrder = this.renderOrder;\n\t\tif ( Object.keys( this.userData ).length \u003e 0 ) object.userData = this.userData;\n\n\t\tobject.layers = this.layers.mask;\n\t\tobject.matrix = this.matrix.toArray();\n\t\tobject.up = this.up.toArray();\n\n\t\tif ( this.matrixAutoUpdate === false ) object.matrixAutoUpdate = false;\n\n\t\t// object specific properties\n\n\t\tif ( this.isInstancedMesh ) {\n\n\t\t\tobject.type = 'InstancedMesh';\n\t\t\tobject.count = this.count;\n\t\t\tobject.instanceMatrix = this.instanceMatrix.toJSON();\n\t\t\tif ( this.instanceColor !== null ) object.instanceColor = this.instanceColor.toJSON();\n\n\t\t}\n\n\t\tif ( this.isBatchedMesh ) {\n\n\t\t\tobject.type = 'BatchedMesh';\n\t\t\tobject.perObjectFrustumCulled = this.perObjectFrustumCulled;\n\t\t\tobject.sortObjects = this.sortObjects;\n\n\t\t\tobject.drawRanges = this._drawRanges;\n\t\t\tobject.reservedRanges = this._reservedRanges;\n\n\t\t\tobject.geometryInfo = this._geometryInfo.map( info =\u003e ( {\n\t\t\t\t...info,\n\t\t\t\tboundingBox: info.boundingBox ? info.boundingBox.toJSON() : undefined,\n\t\t\t\tboundingSphere: info.boundingSphere ? info.boundingSphere.toJSON() : undefined\n\t\t\t} ) );\n\t\t\tobject.instanceInfo = this._instanceInfo.map( info =\u003e ( { ...info } ) );\n\n\t\t\tobject.availableInstanceIds = this._availableInstanceIds.slice();\n\t\t\tobject.availableGeometryIds = this._availableGeometryIds.slice();\n\n\t\t\tobject.nextIndexStart = this._nextIndexStart;\n\t\t\tobject.nextVertexStart = this._nextVertexStart;\n\t\t\tobject.geometryCount = this._geometryCount;\n\n\t\t\tobject.maxInstanceCount = this._maxInstanceCount;\n\t\t\tobject.maxVertexCount = this._maxVertexCount;\n\t\t\tobject.maxIndexCount = this._maxIndexCount;\n\n\t\t\tobject.geometryInitialized = this._geometryInitialized;\n\n\t\t\tobject.matricesTexture = this._matricesTexture.toJSON( meta );\n\n\t\t\tobject.indirectTexture = this._indirectTexture.toJSON( meta );\n\n\t\t\tif ( this._colorsTexture !== null ) {\n\n\t\t\t\tobject.colorsTexture = this._colorsTexture.toJSON( meta );\n\n\t\t\t}\n\n\t\t\tif ( this.boundingSphere !== null ) {\n\n\t\t\t\tobject.boundingSphere = this.boundingSphere.toJSON();\n\n\t\t\t}\n\n\t\t\tif ( this.boundingBox !== null ) {\n\n\t\t\t\tobject.boundingBox = this.boundingBox.toJSON();\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tfunction serialize( library, element ) {\n\n\t\t\tif ( library[ element.uuid ] === undefined ) {\n\n\t\t\t\tlibrary[ element.uuid ] = element.toJSON( meta );\n\n\t\t\t}\n\n\t\t\treturn element.uuid;\n\n\t\t}\n\n\t\tif ( this.isScene ) {\n\n\t\t\tif ( this.background ) {\n\n\t\t\t\tif ( this.background.isColor ) {\n\n\t\t\t\t\tobject.background = this.background.toJSON();\n\n\t\t\t\t} else if ( this.background.isTexture ) {\n\n\t\t\t\t\tobject.background = this.background.toJSON( meta ).uuid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.environment \u0026\u0026 this.environment.isTexture \u0026\u0026 this.environment.isRenderTargetTexture !== true ) {\n\n\t\t\t\tobject.environment = this.environment.toJSON( meta ).uuid;\n\n\t\t\t}\n\n\t\t} else if ( this.isMesh || this.isLine || this.isPoints ) {\n\n\t\t\tobject.geometry = serialize( meta.geometries, this.geometry );\n\n\t\t\tconst parameters = this.geometry.parameters;\n\n\t\t\tif ( parameters !== undefined \u0026\u0026 parameters.shapes !== undefined ) {\n\n\t\t\t\tconst shapes = parameters.shapes;\n\n\t\t\t\tif ( Array.isArray( shapes ) ) {\n\n\t\t\t\t\tfor ( let i = 0, l = shapes.length; i \u003c l; i ++ ) {\n\n\t\t\t\t\t\tconst shape = shapes[ i ];\n\n\t\t\t\t\t\tserialize( meta.shapes, shape );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tserialize( meta.shapes, shapes );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.isSkinnedMesh ) {\n\n\t\t\tobject.bindMode = this.bindMode;\n\t\t\tobject.bindMatrix = this.bindMatrix.toArray();\n\n\t\t\tif ( this.skeleton !== undefined ) {\n\n\t\t\t\tserialize( meta.skeletons, this.skeleton );\n\n\t\t\t\tobject.skeleton = this.skeleton.uuid;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.material !== undefined ) {\n\n\t\t\tif ( Array.isArray( this.material ) ) {\n\n\t\t\t\tconst uuids = [];\n\n\t\t\t\tfor ( let i = 0, l = this.material.length; i \u003c l; i ++ ) {\n\n\t\t\t\t\tuuids.push( serialize( meta.materials, this.material[ i ] ) );\n\n\t\t\t\t}\n\n\t\t\t\tobject.material = uuids;\n\n\t\t\t} else {\n\n\t\t\t\tobject.material = serialize( meta.materials, this.material );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tif ( this.children.length \u003e 0 ) {\n\n\t\t\tobject.children = [];\n\n\t\t\tfor ( let i = 0; i \u003c this.children.length; i ++ ) {\n\n\t\t\t\tobject.children.push( this.children[ i ].toJSON( meta ).object );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tif ( this.animations.length \u003e 0 ) {\n\n\t\t\tobject.animations = [];\n\n\t\t\tfor ( let i = 0; i \u003c this.animations.length; i ++ ) {\n\n\t\t\t\tconst animation = this.animations[ i ];\n\n\t\t\t\tobject.animations.push( serialize( meta.animations, animation ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( isRootObject ) {\n\n\t\t\tconst geometries = extractFromCache( meta.geometries );\n\t\t\tconst materials = extractFromCache( meta.materials );\n\t\t\tconst textures = extractFromCache( meta.textures );\n\t\t\tconst images = extractFromCache( meta.images );\n\t\t\tconst shapes = extractFromCache( meta.shapes );\n\t\t\tconst skeletons = extractFromCache( meta.skeletons );\n\t\t\tconst animations = extractFromCache( meta.animations );\n\t\t\tconst nodes = extractFromCache( meta.nodes );\n\n\t\t\tif ( geometries.length \u003e 0 ) output.geometries = geometries;\n\t\t\tif ( materials.length \u003e 0 ) output.materials = materials;\n\t\t\tif ( textures.length \u003e 0 ) output.textures = textures;\n\t\t\tif ( images.length \u003e 0 ) output.images = images;\n\t\t\tif ( shapes.length \u003e 0 ) output.shapes = shapes;\n\t\t\tif ( skeletons.length \u003e 0 ) output.skeletons = skeletons;\n\t\t\tif ( animations.length \u003e 0 ) output.animations = animations;\n\t\t\tif ( nodes.length \u003e 0 ) output.nodes = nodes;\n\n\t\t}\n\n\t\toutput.object = object;\n\n\t\treturn output;\n\n\t\t// extract data from the cache hash\n\t\t// remove metadata on each item\n\t\t// and return as array\n\t\tfunction extractFromCache( cache ) {\n\n\t\t\tconst values = [];\n\t\t\tfor ( const key in cache ) {\n\n\t\t\t\tconst data = cache[ key ];\n\t\t\t\tdelete data.metadata;\n\t\t\t\tvalues.push( data );\n\n\t\t\t}\n\n\t\t\treturn values;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns a new 3D object with copied values from this instance.\n\t *\n\t * @param {boolean} [recursive=true] - When set to `true`, descendants of the 3D object are also cloned.\n\t * @return {Object3D} A clone of this instance.\n\t */\n\tclone( recursive ) {\n\n\t\treturn new this.constructor().copy( this, recursive );\n\n\t}\n\n\t/**\n\t * Copies the values of the given 3D object to this instance.\n\t *\n\t * @param {Object3D} source - The 3D object to copy.\n\t * @param {boolean} [recursive=true] - When set to `true`, descendants of the 3D object are cloned.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\tcopy( source, recursive = true ) {\n\n\t\tthis.name = source.name;\n\n\t\tthis.up.copy( source.up );\n\n\t\tthis.position.copy( source.position );\n\t\tthis.rotation.order = source.rotation.order;\n\t\tthis.quaternion.copy( source.quaternion );\n\t\tthis.scale.copy( source.scale );\n\n\t\tthis.matrix.copy( source.matrix );\n\t\tthis.matrixWorld.copy( source.matrixWorld );\n\n\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\n\t\tthis.matrixWorldAutoUpdate = source.matrixWorldAutoUpdate;\n\t\tthis.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate;\n\n\t\tthis.layers.mask = source.layers.mask;\n\t\tthis.visible = source.visible;\n\n\t\tthis.castShadow = source.castShadow;\n\t\tthis.receiveShadow = source.receiveShadow;\n\n\t\tthis.frustumCulled = source.frustumCulled;\n\t\tthis.renderOrder = source.renderOrder;\n\n\t\tthis.animations = source.animations.slice();\n\n\t\tthis.userData = JSON.parse( JSON.stringify( source.userData ) );\n\n\t\tif ( recursive === true ) {\n\n\t\t\tfor ( let i = 0; i \u003c source.children.length; i ++ ) {\n\n\t\t\t\tconst child = source.children[ i ];\n\t\t\t\tthis.add( child.clone() );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * The default up direction for objects, also used as the default\n * position for {@link DirectionalLight} and {@link HemisphereLight}.\n *\n * @static\n * @type {Vector3}\n * @default (0,1,0)\n */\nObject3D.DEFAULT_UP = /*@__PURE__*/ new Vector3( 0, 1, 0 );\n\n/**\n * The default setting for {@link Object3D#matrixAutoUpdate} for\n * newly created 3D objects.\n *\n * @static\n * @type {boolean}\n * @default true\n */\nObject3D.DEFAULT_MATRIX_AUTO_UPDATE = true;\n\n/**\n * The default setting for {@link Object3D#matrixWorldAutoUpdate} for\n * newly created 3D objects.\n *\n * @static\n * @type {boolean}\n * @default true\n */\nObject3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = true;\n\nconst _v0$1 = /*@__PURE__*/ new Vector3();\nconst _v1$3 = /*@__PURE__*/ new Vector3();\nconst _v2$2 = /*@__PURE__*/ new Vector3();\nconst _v3$2 = /*@__PURE__*/ new Vector3();\n\nconst _vab = /*@__PURE__*/ new Vector3();\nconst _vac = /*@__PURE__*/ new Vector3();\nconst _vbc = /*@__PURE__*/ new Vector3();\nconst _vap = /*@__PURE__*/ new Vector3();\nconst _vbp = /*@__PURE__*/ new Vector3();\nconst _vcp = /*@__PURE__*/ new Vector3();\n\nconst _v40 = /*@__PURE__*/ new Vector4();\nconst _v41 = /*@__PURE__*/ new Vector4();\nconst _v42 = /*@__PURE__*/ new Vector4();\n\n/**\n * A geometric triangle as defined by three vectors representing its three corners.\n */\nclass Triangle {\n\n\t/**\n\t * Constructs a new triangle.\n\t *\n\t * @param {Vector3} [a=(0,0,0)] - The first corner of the triangle.\n\t * @param {Vector3} [b=(0,0,0)] - The second corner of the triangle.\n\t * @param {Vector3} [c=(0,0,0)] - The third corner of the triangle.\n\t */\n\tconstructor( a = new Vector3(), b = new Vector3(), c = new Vector3() ) {\n\n\t\t/**\n\t\t * The first corner of the triangle.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.a = a;\n\n\t\t/**\n\t\t * The second corner of the triangle.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.b = b;\n\n\t\t/**\n\t\t * The third corner of the triangle.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.c = c;\n\n\t}\n\n\t/**\n\t * Computes the normal vector of a triangle.\n\t *\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The triangle's normal.\n\t */\n\tstatic getNormal( a, b, c, target ) {\n\n\t\ttarget.subVectors( c, b );\n\t\t_v0$1.subVectors( a, b );\n\t\ttarget.cross( _v0$1 );\n\n\t\tconst targetLengthSq = target.lengthSq();\n\t\tif ( targetLengthSq \u003e 0 ) {\n\n\t\t\treturn target.multiplyScalar( 1 / Math.sqrt( targetLengthSq ) );\n\n\t\t}\n\n\t\treturn target.set( 0, 0, 0 );\n\n\t}\n\n\t/**\n\t * Computes a barycentric coordinates from the given vector.\n\t * Returns `null` if the triangle is degenerate.\n\t *\n\t * @param {Vector3} point - A point in 3D space.\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The barycentric coordinates for the given point\n\t */\n\tstatic getBarycoord( point, a, b, c, target ) {\n\n\t\t// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\n\n\t\t_v0$1.subVectors( c, a );\n\t\t_v1$3.subVectors( b, a );\n\t\t_v2$2.subVectors( point, a );\n\n\t\tconst dot00 = _v0$1.dot( _v0$1 );\n\t\tconst dot01 = _v0$1.dot( _v1$3 );\n\t\tconst dot02 = _v0$1.dot( _v2$2 );\n\t\tconst dot11 = _v1$3.dot( _v1$3 );\n\t\tconst dot12 = _v1$3.dot( _v2$2 );\n\n\t\tconst denom = ( dot00 * dot11 - dot01 * dot01 );\n\n\t\t// collinear or singular triangle\n\t\tif ( denom === 0 ) {\n\n\t\t\ttarget.set( 0, 0, 0 );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst invDenom = 1 / denom;\n\t\tconst u = ( dot11 * dot02 - dot01 * dot12 ) * invDenom;\n\t\tconst v = ( dot00 * dot12 - dot01 * dot02 ) * invDenom;\n\n\t\t// barycentric coordinates must always sum to 1\n\t\treturn target.set( 1 - u - v, v, u );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given point, when projected onto the plane of the\n\t * triangle, lies within the triangle.\n\t *\n\t * @param {Vector3} point - The point in 3D space to test.\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @return {boolean} Whether the given point, when projected onto the plane of the\n\t * triangle, lies within the triangle or not.\n\t */\n\tstatic containsPoint( point, a, b, c ) {\n\n\t\t// if the triangle is degenerate then we can't contain a point\n\t\tif ( this.getBarycoord( point, a, b, c, _v3$2 ) === null ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn ( _v3$2.x \u003e= 0 ) \u0026\u0026 ( _v3$2.y \u003e= 0 ) \u0026\u0026 ( ( _v3$2.x + _v3$2.y ) \u003c= 1 );\n\n\t}\n\n\t/**\n\t * Computes the value barycentrically interpolated for the given point on the\n\t * triangle. Returns `null` if the triangle is degenerate.\n\t *\n\t * @param {Vector3} point - Position of interpolated point.\n\t * @param {Vector3} p1 - The first corner of the triangle.\n\t * @param {Vector3} p2 - The second corner of the triangle.\n\t * @param {Vector3} p3 - The third corner of the triangle.\n\t * @param {Vector3} v1 - Value to interpolate of first vertex.\n\t * @param {Vector3} v2 - Value to interpolate of second vertex.\n\t * @param {Vector3} v3 - Value to interpolate of third vertex.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The interpolated value.\n\t */\n\tstatic getInterpolation( point, p1, p2, p3, v1, v2, v3, target ) {\n\n\t\tif ( this.getBarycoord( point, p1, p2, p3, _v3$2 ) === null ) {\n\n\t\t\ttarget.x = 0;\n\t\t\ttarget.y = 0;\n\t\t\tif ( 'z' in target ) target.z = 0;\n\t\t\tif ( 'w' in target ) target.w = 0;\n\t\t\treturn null;\n\n\t\t}\n\n\t\ttarget.setScalar( 0 );\n\t\ttarget.addScaledVector( v1, _v3$2.x );\n\t\ttarget.addScaledVector( v2, _v3$2.y );\n\t\ttarget.addScaledVector( v3, _v3$2.z );\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Computes the value barycentrically interpolated for the given attribute and indices.\n\t *\n\t * @param {BufferAttribute} attr - The attribute to interpolate.\n\t * @param {number} i1 - Index of first vertex.\n\t * @param {number} i2 - Index of second vertex.\n\t * @param {number} i3 - Index of third vertex.\n\t * @param {Vector3} barycoord - The barycoordinate value to use to interpolate.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The interpolated attribute value.\n\t */\n\tstatic getInterpolatedAttribute( attr, i1, i2, i3, barycoord, target ) {\n\n\t\t_v40.setScalar( 0 );\n\t\t_v41.setScalar( 0 );\n\t\t_v42.setScalar( 0 );\n\n\t\t_v40.fromBufferAttribute( attr, i1 );\n\t\t_v41.fromBufferAttribute( attr, i2 );\n\t\t_v42.fromBufferAttribute( attr, i3 );\n\n\t\ttarget.setScalar( 0 );\n\t\ttarget.addScaledVector( _v40, barycoord.x );\n\t\ttarget.addScaledVector( _v41, barycoord.y );\n\t\ttarget.addScaledVector( _v42, barycoord.z );\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Returns `true` if the triangle is oriented towards the given direction.\n\t *\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @param {Vector3} direction - The (normalized) direction vector.\n\t * @return {boolean} Whether the triangle is oriented towards the given direction or not.\n\t */\n\tstatic isFrontFacing( a, b, c, direction ) {\n\n\t\t_v0$1.subVectors( c, b );\n\t\t_v1$3.subVectors( a, b );\n\n\t\t// strictly front facing\n\t\treturn ( _v0$1.cross( _v1$3 ).dot( direction ) \u003c 0 ) ? true : false;\n\n\t}\n\n\t/**\n\t * Sets the triangle's vertices by copying the given values.\n\t *\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @return {Triangle} A reference to this triangle.\n\t */\n\tset( a, b, c ) {\n\n\t\tthis.a.copy( a );\n\t\tthis.b.copy( b );\n\t\tthis.c.copy( c );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the triangle's vertices by copying the given array values.\n\t *\n\t * @param {Array\u003cVector3\u003e} points - An array with 3D points.\n\t * @param {number} i0 - The array index representing the first corner of the triangle.\n\t * @param {number} i1 - The array index representing the second corner of the triangle.\n\t * @param {number} i2 - The array index representing the third corner of the triangle.\n\t * @return {Triangle} A reference to this triangle.\n\t */\n\tsetFromPointsAndIndices( points, i0, i1, i2 ) {\n\n\t\tthis.a.copy( points[ i0 ] );\n\t\tthis.b.copy( points[ i1 ] );\n\t\tthis.c.copy( points[ i2 ] );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the triangle's vertices by copying the given attribute values.\n\t *\n\t * @param {BufferAttribute} attribute - A buffer attribute with 3D points data.\n\t * @param {number} i0 - The attribute index representing the first corner of the triangle.\n\t * @param {number} i1 - The attribute index representing the second corner of the triangle.\n\t * @param {number} i2 - The attribute index representing the third corner of the triangle.\n\t * @return {Triangle} A reference to this triangle.\n\t */\n\tsetFromAttributeAndIndices( attribute, i0, i1, i2 ) {\n\n\t\tthis.a.fromBufferAttribute( attribute, i0 );\n\t\tthis.b.fromBufferAttribute( attribute, i1 );\n\t\tthis.c.fromBufferAttribute( attribute, i2 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new triangle with copied values from this instance.\n\t *\n\t * @return {Triangle} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Copies the values of the given triangle to this instance.\n\t *\n\t * @param {Triangle} triangle - The triangle to copy.\n\t * @return {Triangle} A reference to this triangle.\n\t */\n\tcopy( triangle ) {\n\n\t\tthis.a.copy( triangle.a );\n\t\tthis.b.copy( triangle.b );\n\t\tthis.c.copy( triangle.c );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes the area of the triangle.\n\t *\n\t * @return {number} The triangle's area.\n\t */\n\tgetArea() {\n\n\t\t_v0$1.subVectors( this.c, this.b );\n\t\t_v1$3.subVectors( this.a, this.b );\n\n\t\treturn _v0$1.cross( _v1$3 ).length() * 0.5;\n\n\t}\n\n\t/**\n\t * Computes the midpoint of the triangle.\n\t *\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The triangle's midpoint.\n\t */\n\tgetMidpoint( target ) {\n\n\t\treturn target.addVectors( this.a, this.b ).add( this.c ).multiplyScalar( 1 / 3 );\n\n\t}\n\n\t/**\n\t * Computes the normal of the triangle.\n\t *\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The triangle's normal.\n\t */\n\tgetNormal( target ) {\n\n\t\treturn Triangle.getNormal( this.a, this.b, this.c, target );\n\n\t}\n\n\t/**\n\t * Computes a plane the triangle lies within.\n\t *\n\t * @param {Plane} target - The target vector that is used to store the method's result.\n\t * @return {Plane} The plane the triangle lies within.\n\t */\n\tgetPlane( target ) {\n\n\t\treturn target.setFromCoplanarPoints( this.a, this.b, this.c );\n\n\t}\n\n\t/**\n\t * Computes a barycentric coordinates from the given vector.\n\t * Returns `null` if the triangle is degenerate.\n\t *\n\t * @param {Vector3} point - A point in 3D space.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The barycentric coordinates for the given point\n\t */\n\tgetBarycoord( point, target ) {\n\n\t\treturn Triangle.getBarycoord( point, this.a, this.b, this.c, target );\n\n\t}\n\n\t/**\n\t * Computes the value barycentrically interpolated for the given point on the\n\t * triangle. Returns `null` if the triangle is degenerate.\n\t *\n\t * @param {Vector3} point - Position of interpolated point.\n\t * @param {Vector3} v1 - Value to interpolate of first vertex.\n\t * @param {Vector3} v2 - Value to interpolate of second vertex.\n\t * @param {Vector3} v3 - Value to interpolate of third vertex.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The interpolated value.\n\t */\n\tgetInterpolation( point, v1, v2, v3, target ) {\n\n\t\treturn Triangle.getInterpolation( point, this.a, this.b, this.c, v1, v2, v3, target );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given point, when projected onto the plane of the\n\t * triangle, lies within the triangle.\n\t *\n\t * @param {Vector3} point - The point in 3D space to test.\n\t * @return {boolean} Whether the given point, when projected onto the plane of the\n\t * triangle, lies within the triangle or not.\n\t */\n\tcontainsPoint( point ) {\n\n\t\treturn Triangle.containsPoint( point, this.a, this.b, this.c );\n\n\t}\n\n\t/**\n\t * Returns `true` if the triangle is oriented towards the given direction.\n\t *\n\t * @param {Vector3} direction - The (normalized) direction vector.\n\t * @return {boolean} Whether the triangle is oriented towards the given direction or not.\n\t */\n\tisFrontFacing( direction ) {\n\n\t\treturn Triangle.isFrontFacing( this.a, this.b, this.c, direction );\n\n\t}\n\n\t/**\n\t * Returns `true` if this triangle intersects with the given box.\n\t *\n\t * @param {Box3} box - The box to intersect.\n\t * @return {boolean} Whether this triangle intersects with the given box or not.\n\t */\n\tintersectsBox( box ) {\n\n\t\treturn box.intersectsTriangle( this );\n\n\t}\n\n\t/**\n\t * Returns the closest point on the triangle to the given point.\n\t *\n\t * @param {Vector3} p - The point to compute the closest point for.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The closest point on the triangle.\n\t */\n\tclosestPointToPoint( p, target ) {\n\n\t\tconst a = this.a, b = this.b, c = this.c;\n\t\tlet v, w;\n\n\t\t// algorithm thanks to Real-Time Collision Detection by Christer Ericson,\n\t\t// published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc.,\n\t\t// under the accompanying license; see chapter 5.1.5 for detailed explanation.\n\t\t// basically, we're distinguishing which of the voronoi regions of the triangle\n\t\t// the point lies in with the minimum amount of redundant computation.\n\n\t\t_vab.subVectors( b, a );\n\t\t_vac.subVectors( c, a );\n\t\t_vap.subVectors( p, a );\n\t\tconst d1 = _vab.dot( _vap );\n\t\tconst d2 = _vac.dot( _vap );\n\t\tif ( d1 \u003c= 0 \u0026\u0026 d2 \u003c= 0 ) {\n\n\t\t\t// vertex region of A; barycentric coords (1, 0, 0)\n\t\t\treturn target.copy( a );\n\n\t\t}\n\n\t\t_vbp.subVectors( p, b );\n\t\tconst d3 = _vab.dot( _vbp );\n\t\tconst d4 = _vac.dot( _vbp );\n\t\tif ( d3 \u003e= 0 \u0026\u0026 d4 \u003c= d3 ) {\n\n\t\t\t// vertex region of B; barycentric coords (0, 1, 0)\n\t\t\treturn target.copy( b );\n\n\t\t}\n\n\t\tconst vc = d1 * d4 - d3 * d2;\n\t\tif ( vc \u003c= 0 \u0026\u0026 d1 \u003e= 0 \u0026\u0026 d3 \u003c= 0 ) {\n\n\t\t\tv = d1 / ( d1 - d3 );\n\t\t\t// edge region of AB; barycentric coords (1-v, v, 0)\n\t\t\treturn target.copy( a ).addScaledVector( _vab, v );\n\n\t\t}\n\n\t\t_vcp.subVectors( p, c );\n\t\tconst d5 = _vab.dot( _vcp );\n\t\tconst d6 = _vac.dot( _vcp );\n\t\tif ( d6 \u003e= 0 \u0026\u0026 d5 \u003c= d6 ) {\n\n\t\t\t// vertex region of C; barycentric coords (0, 0, 1)\n\t\t\treturn target.copy( c );\n\n\t\t}\n\n\t\tconst vb = d5 * d2 - d1 * d6;\n\t\tif ( vb \u003c= 0 \u0026\u0026 d2 \u003e= 0 \u0026\u0026 d6 \u003c= 0 ) {\n\n\t\t\tw = d2 / ( d2 - d6 );\n\t\t\t// edge region of AC; barycentric coords (1-w, 0, w)\n\t\t\treturn target.copy( a ).addScaledVector( _vac, w );\n\n\t\t}\n\n\t\tconst va = d3 * d6 - d5 * d4;\n\t\tif ( va \u003c= 0 \u0026\u0026 ( d4 - d3 ) \u003e= 0 \u0026\u0026 ( d5 - d6 ) \u003e= 0 ) {\n\n\t\t\t_vbc.subVectors( c, b );\n\t\t\tw = ( d4 - d3 ) / ( ( d4 - d3 ) + ( d5 - d6 ) );\n\t\t\t// edge region of BC; barycentric coords (0, 1-w, w)\n\t\t\treturn target.copy( b ).addScaledVector( _vbc, w ); // edge region of BC\n\n\t\t}\n\n\t\t// face region\n\t\tconst denom = 1 / ( va + vb + vc );\n\t\t// u = va * denom\n\t\tv = vb * denom;\n\t\tw = vc * denom;\n\n\t\treturn target.copy( a ).addScaledVector( _vab, v ).addScaledVector( _vac, w );\n\n\t}\n\n\t/**\n\t * Returns `true` if this triangle is equal with the given one.\n\t *\n\t * @param {Triangle} triangle - The triangle to test for equality.\n\t * @return {boolean} Whether this triangle is equal with the given one.\n\t */\n\tequals( triangle ) {\n\n\t\treturn triangle.a.equals( this.a ) \u0026\u0026 triangle.b.equals( this.b ) \u0026\u0026 triangle.c.equals( this.c );\n\n\t}\n\n}\n\nconst _colorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF,\n\t'beige': 0xF5F5DC, 'bisque': 0xFFE4C4, 'black': 0x000000, 'blanchedalmond': 0xFFEBCD, 'blue': 0x0000FF, 'blueviolet': 0x8A2BE2,\n\t'brown': 0xA52A2A, 'burlywood': 0xDEB887, 'cadetblue': 0x5F9EA0, 'chartreuse': 0x7FFF00, 'chocolate': 0xD2691E, 'coral': 0xFF7F50,\n\t'cornflowerblue': 0x6495ED, 'cornsilk': 0xFFF8DC, 'crimson': 0xDC143C, 'cyan': 0x00FFFF, 'darkblue': 0x00008B, 'darkcyan': 0x008B8B,\n\t'darkgoldenrod': 0xB8860B, 'darkgray': 0xA9A9A9, 'darkgreen': 0x006400, 'darkgrey': 0xA9A9A9, 'darkkhaki': 0xBDB76B, 'darkmagenta': 0x8B008B,\n\t'darkolivegreen': 0x556B2F, 'darkorange': 0xFF8C00, 'darkorchid': 0x9932CC, 'darkred': 0x8B0000, 'darksalmon': 0xE9967A, 'darkseagreen': 0x8FBC8F,\n\t'darkslateblue': 0x483D8B, 'darkslategray': 0x2F4F4F, 'darkslategrey': 0x2F4F4F, 'darkturquoise': 0x00CED1, 'darkviolet': 0x9400D3,\n\t'deeppink': 0xFF1493, 'deepskyblue': 0x00BFFF, 'dimgray': 0x696969, 'dimgrey': 0x696969, 'dodgerblue': 0x1E90FF, 'firebrick': 0xB22222,\n\t'floralwhite': 0xFFFAF0, 'forestgreen': 0x228B22, 'fuchsia': 0xFF00FF, 'gainsboro': 0xDCDCDC, 'ghostwhite': 0xF8F8FF, 'gold': 0xFFD700,\n\t'goldenrod': 0xDAA520, 'gray': 0x808080, 'green': 0x008000, 'greenyellow': 0xADFF2F, 'grey': 0x808080, 'honeydew': 0xF0FFF0, 'hotpink': 0xFF69B4,\n\t'indianred': 0xCD5C5C, 'indigo': 0x4B0082, 'ivory': 0xFFFFF0, 'khaki': 0xF0E68C, 'lavender': 0xE6E6FA, 'lavenderblush': 0xFFF0F5, 'lawngreen': 0x7CFC00,\n\t'lemonchiffon': 0xFFFACD, 'lightblue': 0xADD8E6, 'lightcoral': 0xF08080, 'lightcyan': 0xE0FFFF, 'lightgoldenrodyellow': 0xFAFAD2, 'lightgray': 0xD3D3D3,\n\t'lightgreen': 0x90EE90, 'lightgrey': 0xD3D3D3, 'lightpink': 0xFFB6C1, 'lightsalmon': 0xFFA07A, 'lightseagreen': 0x20B2AA, 'lightskyblue': 0x87CEFA,\n\t'lightslategray': 0x778899, 'lightslategrey': 0x778899, 'lightsteelblue': 0xB0C4DE, 'lightyellow': 0xFFFFE0, 'lime': 0x00FF00, 'limegreen': 0x32CD32,\n\t'linen': 0xFAF0E6, 'magenta': 0xFF00FF, 'maroon': 0x800000, 'mediumaquamarine': 0x66CDAA, 'mediumblue': 0x0000CD, 'mediumorchid': 0xBA55D3,\n\t'mediumpurple': 0x9370DB, 'mediumseagreen': 0x3CB371, 'mediumslateblue': 0x7B68EE, 'mediumspringgreen': 0x00FA9A, 'mediumturquoise': 0x48D1CC,\n\t'mediumvioletred': 0xC71585, 'midnightblue': 0x191970, 'mintcream': 0xF5FFFA, 'mistyrose': 0xFFE4E1, 'moccasin': 0xFFE4B5, 'navajowhite': 0xFFDEAD,\n\t'navy': 0x000080, 'oldlace': 0xFDF5E6, 'olive': 0x808000, 'olivedrab': 0x6B8E23, 'orange': 0xFFA500, 'orangered': 0xFF4500, 'orchid': 0xDA70D6,\n\t'palegoldenrod': 0xEEE8AA, 'palegreen': 0x98FB98, 'paleturquoise': 0xAFEEEE, 'palevioletred': 0xDB7093, 'papayawhip': 0xFFEFD5, 'peachpuff': 0xFFDAB9,\n\t'peru': 0xCD853F, 'pink': 0xFFC0CB, 'plum': 0xDDA0DD, 'powderblue': 0xB0E0E6, 'purple': 0x800080, 'rebeccapurple': 0x663399, 'red': 0xFF0000, 'rosybrown': 0xBC8F8F,\n\t'royalblue': 0x4169E1, 'saddlebrown': 0x8B4513, 'salmon': 0xFA8072, 'sandybrown': 0xF4A460, 'seagreen': 0x2E8B57, 'seashell': 0xFFF5EE,\n\t'sienna': 0xA0522D, 'silver': 0xC0C0C0, 'skyblue': 0x87CEEB, 'slateblue': 0x6A5ACD, 'slategray': 0x708090, 'slategrey': 0x708090, 'snow': 0xFFFAFA,\n\t'springgreen': 0x00FF7F, 'steelblue': 0x4682B4, 'tan': 0xD2B48C, 'teal': 0x008080, 'thistle': 0xD8BFD8, 'tomato': 0xFF6347, 'turquoise': 0x40E0D0,\n\t'violet': 0xEE82EE, 'wheat': 0xF5DEB3, 'white': 0xFFFFFF, 'whitesmoke': 0xF5F5F5, 'yellow': 0xFFFF00, 'yellowgreen': 0x9ACD32 };\n\nconst _hslA = { h: 0, s: 0, l: 0 };\nconst _hslB = { h: 0, s: 0, l: 0 };\n\nfunction hue2rgb( p, q, t ) {\n\n\tif ( t \u003c 0 ) t += 1;\n\tif ( t \u003e 1 ) t -= 1;\n\tif ( t \u003c 1 / 6 ) return p + ( q - p ) * 6 * t;\n\tif ( t \u003c 1 / 2 ) return q;\n\tif ( t \u003c 2 / 3 ) return p + ( q - p ) * 6 * ( 2 / 3 - t );\n\treturn p;\n\n}\n\n/**\n * A Color instance is represented by RGB components in the linear \u003ci\u003eworking\n * color space\u003c/i\u003e, which defaults to `LinearSRGBColorSpace`. Inputs\n * conventionally using `SRGBColorSpace` (such as hexadecimals and CSS\n * strings) are converted to the working color space automatically.\n *\n * ```js\n * // converted automatically from SRGBColorSpace to LinearSRGBColorSpace\n * const color = new THREE.Color().setHex( 0x112233 );\n * ```\n * Source color spaces may be specified explicitly, to ensure correct conversions.\n * ```js\n * // assumed already LinearSRGBColorSpace; no conversion\n * const color = new THREE.Color().setRGB( 0.5, 0.5, 0.5 );\n *\n * // converted explicitly from SRGBColorSpace to LinearSRGBColorSpace\n * const color = new THREE.Color().setRGB( 0.5, 0.5, 0.5, SRGBColorSpace );\n * ```\n * If THREE.ColorManagement is disabled, no conversions occur. For details,\n * see \u003ci\u003eColor management\u003c/i\u003e. Iterating through a Color instance will yield\n * its components (r, g, b) in the corresponding order. A Color can be initialised\n * in any of the following ways:\n * ```js\n * //empty constructor - will default white\n * const color1 = new THREE.Color();\n *\n * //Hexadecimal color (recommended)\n * const color2 = new THREE.Color( 0xff0000 );\n *\n * //RGB string\n * const color3 = new THREE.Color(\"rgb(255, 0, 0)\");\n * const color4 = new THREE.Color(\"rgb(100%, 0%, 0%)\");\n *\n * //X11 color name - all 140 color names are supported.\n * //Note the lack of CamelCase in the name\n * const color5 = new THREE.Color( 'skyblue' );\n * //HSL string\n * const color6 = new THREE.Color(\"hsl(0, 100%, 50%)\");\n *\n * //Separate RGB values between 0 and 1\n * const color7 = new THREE.Color( 1, 0, 0 );\n * ```\n */\nclass Color {\n\n\t/**\n\t * Constructs a new color.\n\t *\n\t * Note that standard method of specifying color in three.js is with a hexadecimal triplet,\n\t * and that method is used throughout the rest of the documentation.\n\t *\n\t * @param {(number|string|Color)} [r] - The red component of the color. If `g` and `b` are\n\t * not provided, it can be hexadecimal triplet, a CSS-style string or another `Color` instance.\n\t * @param {number} [g] - The green component.\n\t * @param {number} [b] - The blue component.\n\t */\n\tconstructor( r, g, b ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isColor = true;\n\n\t\t/**\n\t\t * The red component.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.r = 1;\n\n\t\t/**\n\t\t * The green component.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.g = 1;\n\n\t\t/**\n\t\t * The blue component.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.b = 1;\n\n\t\treturn this.set( r, g, b );\n\n\t}\n\n\t/**\n\t * Sets the colors's components from the given values.\n\t *\n\t * @param {(number|string|Color)} [r] - The red component of the color. If `g` and `b` are\n\t * not provided, it can be hexadecimal triplet, a CSS-style string or another `Color` instance.\n\t * @param {number} [g] - The green component.\n\t * @param {number} [b] - The blue component.\n\t * @return {Color} A reference to this color.\n\t */\n\tset( r, g, b ) {\n\n\t\tif ( g === undefined \u0026\u0026 b === undefined ) {\n\n\t\t\t// r is THREE.Color, hex or string\n\n\t\t\tconst value = r;\n\n\t\t\tif ( value \u0026\u0026 value.isColor ) {\n\n\t\t\t\tthis.copy( value );\n\n\t\t\t} else if ( typeof value === 'number' ) {\n\n\t\t\t\tthis.setHex( value );\n\n\t\t\t} else if ( typeof value === 'string' ) {\n\n\t\t\t\tthis.setStyle( value );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tthis.setRGB( r, g, b );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the colors's components to the given scalar value.\n\t *\n\t * @param {number} scalar - The scalar value.\n\t * @return {Color} A reference to this color.\n\t */\n\tsetScalar( scalar ) {\n\n\t\tthis.r = scalar;\n\t\tthis.g = scalar;\n\t\tthis.b = scalar;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this color from a hexadecimal value.\n\t *\n\t * @param {number} hex - The hexadecimal value.\n\t * @param {string} [colorSpace=SRGBColorSpace] - The color space.\n\t * @return {Color} A reference to this color.\n\t */\n\tsetHex( hex, colorSpace = SRGBColorSpace ) {\n\n\t\thex = Math.floor( hex );\n\n\t\tthis.r = ( hex \u003e\u003e 16 \u0026 255 ) / 255;\n\t\tthis.g = ( hex \u003e\u003e 8 \u0026 255 ) / 255;\n\t\tthis.b = ( hex \u0026 255 ) / 255;\n\n\t\tColorManagement.colorSpaceToWorking( this, colorSpace );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this color from RGB values.\n\t *\n\t * @param {number} r - Red channel value between `0.0` and `1.0`.\n\t * @param {number} g - Green channel value between `0.0` and `1.0`.\n\t * @param {number} b - Blue channel value between `0.0` and `1.0`.\n\t * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.\n\t * @return {Color} A reference to this color.\n\t */\n\tsetRGB( r, g, b, colorSpace = ColorManagement.workingColorSpace ) {\n\n\t\tthis.r = r;\n\t\tthis.g = g;\n\t\tthis.b = b;\n\n\t\tColorManagement.colorSpaceToWorking( this, colorSpace );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this color from RGB values.\n\t *\n\t * @param {number} h - Hue value between `0.0` and `1.0`.\n\t * @param {number} s - Saturation value between `0.0` and `1.0`.\n\t * @param {number} l - Lightness value between `0.0` and `1.0`.\n\t * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.\n\t * @return {Color} A reference to this color.\n\t */\n\tsetHSL( h, s, l, colorSpace = ColorManagement.workingColorSpace ) {\n\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\th = euclideanModulo( h, 1 );\n\t\ts = clamp( s, 0, 1 );\n\t\tl = clamp( l, 0, 1 );\n\n\t\tif ( s === 0 ) {\n\n\t\t\tthis.r = this.g = this.b = l;\n\n\t\t} else {\n\n\t\t\tconst p = l \u003c= 0.5 ? l * ( 1 + s ) : l + s - ( l * s );\n\t\t\tconst q = ( 2 * l ) - p;\n\n\t\t\tthis.r = hue2rgb( q, p, h + 1 / 3 );\n\t\t\tthis.g = hue2rgb( q, p, h );\n\t\t\tthis.b = hue2rgb( q, p, h - 1 / 3 );\n\n\t\t}\n\n\t\tColorManagement.colorSpaceToWorking( this, colorSpace );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this color from a CSS-style string. For example, `rgb(250, 0,0)`,\n\t * `rgb(100%, 0%, 0%)`, `hsl(0, 100%, 50%)`, `#ff0000`, `#f00`, or `red` ( or\n\t * any [X11 color name](https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart) -\n\t * all 140 color names are supported).\n\t *\n\t * @param {string} style - Color as a CSS-style string.\n\t * @param {string} [colorSpace=SRGBColorSpace] - The color space.\n\t * @return {Color} A reference to this color.\n\t */\n\tsetStyle( style, colorSpace = SRGBColorSpace ) {\n\n\t\tfunction handleAlpha( string ) {\n\n\t\t\tif ( string === undefined ) return;\n\n\t\t\tif ( parseFloat( string ) \u003c 1 ) {\n\n\t\t\t\twarn( 'Color: Alpha component of ' + style + ' will be ignored.' );\n\n\t\t\t}\n\n\t\t}\n\n\n\t\tlet m;\n\n\t\tif ( m = /^(\\w+)\\(([^\\)]*)\\)/.exec( style ) ) {\n\n\t\t\t// rgb / hsl\n\n\t\t\tlet color;\n\t\t\tconst name = m[ 1 ];\n\t\t\tconst components = m[ 2 ];\n\n\t\t\tswitch ( name ) {\n\n\t\t\t\tcase 'rgb':\n\t\t\t\tcase 'rgba':\n\n\t\t\t\t\tif ( color = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec( components ) ) {\n\n\t\t\t\t\t\t// rgb(255,0,0) rgba(255,0,0,0.5)\n\n\t\t\t\t\t\thandleAlpha( color[ 4 ] );\n\n\t\t\t\t\t\treturn this.setRGB(\n\t\t\t\t\t\t\tMath.min( 255, parseInt( color[ 1 ], 10 ) ) / 255,\n\t\t\t\t\t\t\tMath.min( 255, parseInt( color[ 2 ], 10 ) ) / 255,\n\t\t\t\t\t\t\tMath.min( 255, parseInt( color[ 3 ], 10 ) ) / 255,\n\t\t\t\t\t\t\tcolorSpace\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( color = /^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec( components ) ) {\n\n\t\t\t\t\t\t// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)\n\n\t\t\t\t\t\thandleAlpha( color[ 4 ] );\n\n\t\t\t\t\t\treturn this.setRGB(\n\t\t\t\t\t\t\tMath.min( 100, parseInt( color[ 1 ], 10 ) ) / 100,\n\t\t\t\t\t\t\tMath.min( 100, parseInt( color[ 2 ], 10 ) ) / 100,\n\t\t\t\t\t\t\tMath.min( 100, parseInt( color[ 3 ], 10 ) ) / 100,\n\t\t\t\t\t\t\tcolorSpace\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'hsl':\n\t\t\t\tcase 'hsla':\n\n\t\t\t\t\tif ( color = /^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec( components ) ) {\n\n\t\t\t\t\t\t// hsl(120,50%,50%) hsla(120,50%,50%,0.5)\n\n\t\t\t\t\t\thandleAlpha( color[ 4 ] );\n\n\t\t\t\t\t\treturn this.setHSL(\n\t\t\t\t\t\t\tparseFloat( color[ 1 ] ) / 360,\n\t\t\t\t\t\t\tparseFloat( color[ 2 ] ) / 100,\n\t\t\t\t\t\t\tparseFloat( color[ 3 ] ) / 100,\n\t\t\t\t\t\t\tcolorSpace\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\twarn( 'Color: Unknown color model ' + style );\n\n\t\t\t}\n\n\t\t} else if ( m = /^\\#([A-Fa-f\\d]+)$/.exec( style ) ) {\n\n\t\t\t// hex color\n\n\t\t\tconst hex = m[ 1 ];\n\t\t\tconst size = hex.length;\n\n\t\t\tif ( size === 3 ) {\n\n\t\t\t\t// #ff0\n\t\t\t\treturn this.setRGB(\n\t\t\t\t\tparseInt( hex.charAt( 0 ), 16 ) / 15,\n\t\t\t\t\tparseInt( hex.charAt( 1 ), 16 ) / 15,\n\t\t\t\t\tparseInt( hex.charAt( 2 ), 16 ) / 15,\n\t\t\t\t\tcolorSpace\n\t\t\t\t);\n\n\t\t\t} else if ( size === 6 ) {\n\n\t\t\t\t// #ff0000\n\t\t\t\treturn this.setHex( parseInt( hex, 16 ), colorSpace );\n\n\t\t\t} else {\n\n\t\t\t\twarn( 'Color: Invalid hex color ' + style );\n\n\t\t\t}\n\n\t\t} else if ( style \u0026\u0026 style.length \u003e 0 ) {\n\n\t\t\treturn this.setColorName( style, colorSpace );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this color from a color name. Faster than {@link Color#setStyle} if\n\t * you don't need the other CSS-style formats.\n\t *\n\t * For convenience, the list of names is exposed in `Color.NAMES` as a hash.\n\t * ```js\n\t * Color.NAMES.aliceblue // returns 0xF0F8FF\n\t * ```\n\t *\n\t * @param {string} style - The color name.\n\t * @param {string} [colorSpace=SRGBColorSpace] - The color space.\n\t * @return {Color} A reference to this color.\n\t */\n\tsetColorName( style, colorSpace = SRGBColorSpace ) {\n\n\t\t// color keywords\n\t\tconst hex = _colorKeywords[ style.toLowerCase() ];\n\n\t\tif ( hex !== undefined ) {\n\n\t\t\t// red\n\t\t\tthis.setHex( hex, colorSpace );\n\n\t\t} else {\n\n\t\t\t// unknown color\n\t\t\twarn( 'Color: Unknown color ' + style );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new color with copied values from this instance.\n\t *\n\t * @return {Color} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor( this.r, this.g, this.b );\n\n\t}\n\n\t/**\n\t * Copies the values of the given color to this instance.\n\t *\n\t * @param {Color} color - The color to copy.\n\t * @return {Color} A reference to this color.\n\t */\n\tcopy( color ) {\n\n\t\tthis.r = color.r;\n\t\tthis.g = color.g;\n\t\tthis.b = color.b;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the given color into this color, and then converts this color from\n\t * `SRGBColorSpace` to `LinearSRGBColorSpace`.\n\t *\n\t * @param {Color} color - The color to copy/convert.\n\t * @return {Color} A reference to this color.\n\t */\n\tcopySRGBToLinear( color ) {\n\n\t\tthis.r = SRGBToLinear( color.r );\n\t\tthis.g = SRGBToLinear( color.g );\n\t\tthis.b = SRGBToLinear( color.b );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the given color into this color, and then converts this color from\n\t * `LinearSRGBColorSpace` to `SRGBColorSpace`.\n\t *\n\t * @param {Color} color - The color to copy/convert.\n\t * @return {Color} A reference to this color.\n\t */\n\tcopyLinearToSRGB( color ) {\n\n\t\tthis.r = LinearToSRGB( color.r );\n\t\tthis.g = LinearToSRGB( color.g );\n\t\tthis.b = LinearToSRGB( color.b );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Converts this color from `SRGBColorSpace` to `LinearSRGBColorSpace`.\n\t *\n\t * @return {Color} A reference to this color.\n\t */\n\tconvertSRGBToLinear() {\n\n\t\tthis.copySRGBToLinear( this );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Converts this color from `LinearSRGBColorSpace` to `SRGBColorSpace`.\n\t *\n\t * @return {Color} A reference to this color.\n\t */\n\tconvertLinearToSRGB() {\n\n\t\tthis.copyLinearToSRGB( this );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the hexadecimal value of this color.\n\t *\n\t * @param {string} [colorSpace=SRGBColorSpace] - The color space.\n\t * @return {number} The hexadecimal value.\n\t */\n\tgetHex( colorSpace = SRGBColorSpace ) {\n\n\t\tColorManagement.workingToColorSpace( _color.copy( this ), colorSpace );\n\n\t\treturn Math.round( clamp( _color.r * 255, 0, 255 ) ) * 65536 + Math.round( clamp( _color.g * 255, 0, 255 ) ) * 256 + Math.round( clamp( _color.b * 255, 0, 255 ) );\n\n\t}\n\n\t/**\n\t * Returns the hexadecimal value of this color as a string (for example, 'FFFFFF').\n\t *\n\t * @param {string} [colorSpace=SRGBColorSpace] - The color space.\n\t * @return {string} The hexadecimal value as a string.\n\t */\n\tgetHexString( colorSpace = SRGBColorSpace ) {\n\n\t\treturn ( '000000' + this.getHex( colorSpace ).toString( 16 ) ).slice( -6 );\n\n\t}\n\n\t/**\n\t * Converts the colors RGB values into the HSL format and stores them into the\n\t * given target object.\n\t *\n\t * @param {{h:number,s:number,l:number}} target - The target object that is used to store the method's result.\n\t * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.\n\t * @return {{h:number,s:number,l:number}} The HSL representation of this color.\n\t */\n\tgetHSL( target, colorSpace = ColorManagement.workingColorSpace ) {\n\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\n\t\tColorManagement.workingToColorSpace( _color.copy( this ), colorSpace );\n\n\t\tconst r = _color.r, g = _color.g, b = _color.b;\n\n\t\tconst max = Math.max( r, g, b );\n\t\tconst min = Math.min( r, g, b );\n\n\t\tlet hue, saturation;\n\t\tconst lightness = ( min + max ) / 2.0;\n\n\t\tif ( min === max ) {\n\n\t\t\thue = 0;\n\t\t\tsaturation = 0;\n\n\t\t} else {\n\n\t\t\tconst delta = max - min;\n\n\t\t\tsaturation = lightness \u003c= 0.5 ? delta / ( max + min ) : delta / ( 2 - max - min );\n\n\t\t\tswitch ( max ) {\n\n\t\t\t\tcase r: hue = ( g - b ) / delta + ( g \u003c b ? 6 : 0 ); break;\n\t\t\t\tcase g: hue = ( b - r ) / delta + 2; break;\n\t\t\t\tcase b: hue = ( r - g ) / delta + 4; break;\n\n\t\t\t}\n\n\t\t\thue /= 6;\n\n\t\t}\n\n\t\ttarget.h = hue;\n\t\ttarget.s = saturation;\n\t\ttarget.l = lightness;\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Returns the RGB values of this color and stores them into the given target object.\n\t *\n\t * @param {Color} target - The target color that is used to store the method's result.\n\t * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.\n\t * @return {Color} The RGB representation of this color.\n\t */\n\tgetRGB( target, colorSpace = ColorManagement.workingColorSpace ) {\n\n\t\tColorManagement.workingToColorSpace( _color.copy( this ), colorSpace );\n\n\t\ttarget.r = _color.r;\n\t\ttarget.g = _color.g;\n\t\ttarget.b = _color.b;\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Returns the value of this color as a CSS style string. Example: `rgb(255,0,0)`.\n\t *\n\t * @param {string} [colorSpace=SRGBColorSpace] - The color space.\n\t * @return {string} The CSS representation of this color.\n\t */\n\tgetStyle( colorSpace = SRGBColorSpace ) {\n\n\t\tColorManagement.workingToColorSpace( _color.copy( this ), colorSpace );\n\n\t\tconst r = _color.r, g = _color.g, b = _color.b;\n\n\t\tif ( colorSpace !== SRGBColorSpace ) {\n\n\t\t\t// Requires CSS Color Module Level 4 (https://www.w3.org/TR/css-color-4/).\n\t\t\treturn `color(${ colorSpace } ${ r.toFixed( 3 ) } ${ g.toFixed( 3 ) } ${ b.toFixed( 3 ) })`;\n\n\t\t}\n\n\t\treturn `rgb(${ Math.round( r * 255 ) },${ Math.round( g * 255 ) },${ Math.round( b * 255 ) })`;\n\n\t}\n\n\t/**\n\t * Adds the given HSL values to this color's values.\n\t * Internally, this converts the color's RGB values to HSL, adds HSL\n\t * and then converts the color back to RGB.\n\t *\n\t * @param {number} h - Hue value between `0.0` and `1.0`.\n\t * @param {number} s - Saturation value between `0.0` and `1.0`.\n\t * @param {number} l - Lightness value between `0.0` and `1.0`.\n\t * @return {Color} A reference to this color.\n\t */\n\toffsetHSL( h, s, l ) {\n\n\t\tthis.getHSL( _hslA );\n\n\t\treturn this.setHSL( _hslA.h + h, _hslA.s + s, _hslA.l + l );\n\n\t}\n\n\t/**\n\t * Adds the RGB values of the given color to the RGB values of this color.\n\t *\n\t * @param {Color} color - The color to add.\n\t * @return {Color} A reference to this color.\n\t */\n\tadd( color ) {\n\n\t\tthis.r += color.r;\n\t\tthis.g += color.g;\n\t\tthis.b += color.b;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the RGB values of the given colors and stores the result in this instance.\n\t *\n\t * @param {Color} color1 - The first color.\n\t * @param {Color} color2 - The second color.\n\t * @return {Color} A reference to this color.\n\t */\n\taddColors( color1, color2 ) {\n\n\t\tthis.r = color1.r + color2.r;\n\t\tthis.g = color1.g + color2.g;\n\t\tthis.b = color1.b + color2.b;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given scalar value to the RGB values of this color.\n\t *\n\t * @param {number} s - The scalar to add.\n\t * @return {Color} A reference to this color.\n\t */\n\taddScalar( s ) {\n\n\t\tthis.r += s;\n\t\tthis.g += s;\n\t\tthis.b += s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the RGB values of the given color from the RGB values of this color.\n\t *\n\t * @param {Color} color - The color to subtract.\n\t * @return {Color} A reference to this color.\n\t */\n\tsub( color ) {\n\n\t\tthis.r = Math.max( 0, this.r - color.r );\n\t\tthis.g = Math.max( 0, this.g - color.g );\n\t\tthis.b = Math.max( 0, this.b - color.b );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the RGB values of the given color with the RGB values of this color.\n\t *\n\t * @param {Color} color - The color to multiply.\n\t * @return {Color} A reference to this color.\n\t */\n\tmultiply( color ) {\n\n\t\tthis.r *= color.r;\n\t\tthis.g *= color.g;\n\t\tthis.b *= color.b;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given scalar value with the RGB values of this color.\n\t *\n\t * @param {number} s - The scalar to multiply.\n\t * @return {Color} A reference to this color.\n\t */\n\tmultiplyScalar( s ) {\n\n\t\tthis.r *= s;\n\t\tthis.g *= s;\n\t\tthis.b *= s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Linearly interpolates this color's RGB values toward the RGB values of the\n\t * given color. The alpha argument can be thought of as the ratio between\n\t * the two colors, where `0.0` is this color and `1.0` is the first argument.\n\t *\n\t * @param {Color} color - The color to converge on.\n\t * @param {number} alpha - The interpolation factor in the closed interval `[0,1]`.\n\t * @return {Color} A reference to this color.\n\t */\n\tlerp( color, alpha ) {\n\n\t\tthis.r += ( color.r - this.r ) * alpha;\n\t\tthis.g += ( color.g - this.g ) * alpha;\n\t\tthis.b += ( color.b - this.b ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Linearly interpolates between the given colors and stores the result in this instance.\n\t * The alpha argument can be thought of as the ratio between the two colors, where `0.0`\n\t * is the first and `1.0` is the second color.\n\t *\n\t * @param {Color} color1 - The first color.\n\t * @param {Color} color2 - The second color.\n\t * @param {number} alpha - The interpolation factor in the closed interval `[0,1]`.\n\t * @return {Color} A reference to this color.\n\t */\n\tlerpColors( color1, color2, alpha ) {\n\n\t\tthis.r = color1.r + ( color2.r - color1.r ) * alpha;\n\t\tthis.g = color1.g + ( color2.g - color1.g ) * alpha;\n\t\tthis.b = color1.b + ( color2.b - color1.b ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Linearly interpolates this color's HSL values toward the HSL values of the\n\t * given color. It differs from {@link Color#lerp} by not interpolating straight\n\t * from one color to the other, but instead going through all the hues in between\n\t * those two colors. The alpha argument can be thought of as the ratio between\n\t * the two colors, where 0.0 is this color and 1.0 is the first argument.\n\t *\n\t * @param {Color} color - The color to converge on.\n\t * @param {number} alpha - The interpolation factor in the closed interval `[0,1]`.\n\t * @return {Color} A reference to this color.\n\t */\n\tlerpHSL( color, alpha ) {\n\n\t\tthis.getHSL( _hslA );\n\t\tcolor.getHSL( _hslB );\n\n\t\tconst h = lerp( _hslA.h, _hslB.h, alpha );\n\t\tconst s = lerp( _hslA.s, _hslB.s, alpha );\n\t\tconst l = lerp( _hslA.l, _hslB.l, alpha );\n\n\t\tthis.setHSL( h, s, l );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the color's RGB components from the given 3D vector.\n\t *\n\t * @param {Vector3} v - The vector to set.\n\t * @return {Color} A reference to this color.\n\t */\n\tsetFromVector3( v ) {\n\n\t\tthis.r = v.x;\n\t\tthis.g = v.y;\n\t\tthis.b = v.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Transforms this color with the given 3x3 matrix.\n\t *\n\t * @param {Matrix3} m - The matrix.\n\t * @return {Color} A reference to this color.\n\t */\n\tapplyMatrix3( m ) {\n\n\t\tconst r = this.r, g = this.g, b = this.b;\n\t\tconst e = m.elements;\n\n\t\tthis.r = e[ 0 ] * r + e[ 3 ] * g + e[ 6 ] * b;\n\t\tthis.g = e[ 1 ] * r + e[ 4 ] * g + e[ 7 ] * b;\n\t\tthis.b = e[ 2 ] * r + e[ 5 ] * g + e[ 8 ] * b;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this color is equal with the given one.\n\t *\n\t * @param {Color} c - The color to test for equality.\n\t * @return {boolean} Whether this bounding color is equal with the given one.\n\t */\n\tequals( c ) {\n\n\t\treturn ( c.r === this.r ) \u0026\u0026 ( c.g === this.g ) \u0026\u0026 ( c.b === this.b );\n\n\t}\n\n\t/**\n\t * Sets this color's RGB components from the given array.\n\t *\n\t * @param {Array\u003cnumber\u003e} array - An array holding the RGB values.\n\t * @param {number} [offset=0] - The offset into the array.\n\t * @return {Color} A reference to this color.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.r = array[ offset ];\n\t\tthis.g = array[ offset + 1 ];\n\t\tthis.b = array[ offset + 2 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Writes the RGB components of this color to the given array. If no array is provided,\n\t * the method returns a new instance.\n\t *\n\t * @param {Array\u003cnumber\u003e} [array=[]] - The target array holding the color components.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Array\u003cnumber\u003e} The color components.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.r;\n\t\tarray[ offset + 1 ] = this.g;\n\t\tarray[ offset + 2 ] = this.b;\n\n\t\treturn array;\n\n\t}\n\n\t/**\n\t * Sets the components of this color from the given buffer attribute.\n\t *\n\t * @param {BufferAttribute} attribute - The buffer attribute holding color data.\n\t * @param {number} index - The index into the attribute.\n\t * @return {Color} A reference to this color.\n\t */\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.r = attribute.getX( index );\n\t\tthis.g = attribute.getY( index );\n\t\tthis.b = attribute.getZ( index );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * This methods defines the serialization result of this class. Returns the color\n\t * as a hexadecimal value.\n\t *\n\t * @return {number} The hexadecimal value.\n\t */\n\ttoJSON() {\n\n\t\treturn this.getHex();\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.r;\n\t\tyield this.g;\n\t\tyield this.b;\n\n\t}\n\n}\n\nconst _color = /*@__PURE__*/ new Color();\n\n/**\n * A dictionary with X11 color names.\n *\n * Note that multiple words such as Dark Orange become the string 'darkorange'.\n *\n * @static\n * @type {Object}\n */\nColor.NAMES = _colorKeywords;\n\nlet _materialId = 0;\n\n/**\n * Abstract base class for materials.\n *\n * Materials define the appearance of renderable 3D objects.\n *\n * @abstract\n * @augments EventDispatcher\n */\nclass Material extends EventDispatcher {\n\n\t/**\n\t * Constructs a new material.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMaterial = true;\n\n\t\t/**\n\t\t * The ID of the material.\n\t\t *\n\t\t * @name Material#id\n\t\t * @type {number}\n\t\t * @readonly\n\t\t */\n\t\tObject.defineProperty( this, 'id', { value: _materialId ++ } );\n\n\t\t/**\n\t\t * The UUID of the material.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.uuid = generateUUID();\n\n\t\t/**\n\t\t * The name of the material.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\n\t\t/**\n\t\t * The type property is used for detecting the object type\n\t\t * in context of serialization/deserialization.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.type = 'Material';\n\n\t\t/**\n\t\t * Defines the blending type of the material.\n\t\t *\n\t\t * It must be set to `CustomBlending` if custom blending properties like\n\t\t * {@link Material#blendSrc}, {@link Material#blendDst} or {@link Material#blendEquation}\n\t\t * should have any effect.\n\t\t *\n\t\t * @type {(NoBlending|NormalBlending|AdditiveBlending|SubtractiveBlending|MultiplyBlending|CustomBlending)}\n\t\t * @default NormalBlending\n\t\t */\n\t\tthis.blending = NormalBlending;\n\n\t\t/**\n\t\t * Defines which side of faces will be rendered - front, back or both.\n\t\t *\n\t\t * @type {(FrontSide|BackSide|DoubleSide)}\n\t\t * @default FrontSide\n\t\t */\n\t\tthis.side = FrontSide;\n\n\t\t/**\n\t\t * If set to `true`, vertex colors should be used.\n\t\t *\n\t\t * The engine supports RGB and RGBA vertex colors depending on whether a three (RGB) or\n\t\t * four (RGBA) component color buffer attribute is used.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.vertexColors = false;\n\n\t\t/**\n\t\t * Defines how transparent the material is.\n\t\t * A value of `0.0` indicates fully transparent, `1.0` is fully opaque.\n\t\t *\n\t\t * If the {@link Material#transparent} is not set to `true`,\n\t\t * the material will remain fully opaque and this value will only affect its color.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.opacity = 1;\n\n\t\t/**\n\t\t * Defines whether this material is transparent. This has an effect on\n\t\t * rendering as transparent objects need special treatment and are rendered\n\t\t * after non-transparent objects.\n\t\t *\n\t\t * When set to true, the extent to which the material is transparent is\n\t\t * controlled by {@link Material#opacity}.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.transparent = false;\n\n\t\t/**\n\t\t * Enables alpha hashed transparency, an alternative to {@link Material#transparent} or\n\t\t * {@link Material#alphaTest}. The material will not be rendered if opacity is lower than\n\t\t * a random threshold. Randomization introduces some grain or noise, but approximates alpha\n\t\t * blending without the associated problems of sorting. Using TAA can reduce the resulting noise.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.alphaHash = false;\n\n\t\t/**\n\t\t * Defines the blending source factor.\n\t\t *\n\t\t * @type {(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)}\n\t\t * @default SrcAlphaFactor\n\t\t */\n\t\tthis.blendSrc = SrcAlphaFactor;\n\n\t\t/**\n\t\t * Defines the blending destination factor.\n\t\t *\n\t\t * @type {(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)}\n\t\t * @default OneMinusSrcAlphaFactor\n\t\t */\n\t\tthis.blendDst = OneMinusSrcAlphaFactor;\n\n\t\t/**\n\t\t * Defines the blending equation.\n\t\t *\n\t\t * @type {(AddEquation|SubtractEquation|ReverseSubtractEquation|MinEquation|MaxEquation)}\n\t\t * @default AddEquation\n\t\t */\n\t\tthis.blendEquation = AddEquation;\n\n\t\t/**\n\t\t * Defines the blending source alpha factor.\n\t\t *\n\t\t * @type {?(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)}\n\t\t * @default null\n\t\t */\n\t\tthis.blendSrcAlpha = null;\n\n\t\t/**\n\t\t * Defines the blending destination alpha factor.\n\t\t *\n\t\t * @type {?(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)}\n\t\t * @default null\n\t\t */\n\t\tthis.blendDstAlpha = null;\n\n\t\t/**\n\t\t * Defines the blending equation of the alpha channel.\n\t\t *\n\t\t * @type {?(AddEquation|SubtractEquation|ReverseSubtractEquation|MinEquation|MaxEquation)}\n\t\t * @default null\n\t\t */\n\t\tthis.blendEquationAlpha = null;\n\n\t\t/**\n\t\t * Represents the RGB values of the constant blend color.\n\t\t *\n\t\t * This property has only an effect when using custom blending with `ConstantColor` or `OneMinusConstantColor`.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.blendColor = new Color( 0, 0, 0 );\n\n\t\t/**\n\t\t * Represents the alpha value of the constant blend color.\n\t\t *\n\t\t * This property has only an effect when using custom blending with `ConstantAlpha` or `OneMinusConstantAlpha`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.blendAlpha = 0;\n\n\t\t/**\n\t\t * Defines the depth function.\n\t\t *\n\t\t * @type {(NeverDepth|AlwaysDepth|LessDepth|LessEqualDepth|EqualDepth|GreaterEqualDepth|GreaterDepth|NotEqualDepth)}\n\t\t * @default LessEqualDepth\n\t\t */\n\t\tthis.depthFunc = LessEqualDepth;\n\n\t\t/**\n\t\t * Whether to have depth test enabled when rendering this material.\n\t\t * When the depth test is disabled, the depth write will also be implicitly disabled.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.depthTest = true;\n\n\t\t/**\n\t\t * Whether rendering this material has any effect on the depth buffer.\n\t\t *\n\t\t * When drawing 2D overlays it can be useful to disable the depth writing in\n\t\t * order to layer several things together without creating z-index artifacts.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.depthWrite = true;\n\n\t\t/**\n\t\t * The bit mask to use when writing to the stencil buffer.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0xff\n\t\t */\n\t\tthis.stencilWriteMask = 0xff;\n\n\t\t/**\n\t\t * The stencil comparison function to use.\n\t\t *\n\t\t * @type {NeverStencilFunc|LessStencilFunc|EqualStencilFunc|LessEqualStencilFunc|GreaterStencilFunc|NotEqualStencilFunc|GreaterEqualStencilFunc|AlwaysStencilFunc}\n\t\t * @default AlwaysStencilFunc\n\t\t */\n\t\tthis.stencilFunc = AlwaysStencilFunc;\n\n\t\t/**\n\t\t * The value to use when performing stencil comparisons or stencil operations.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.stencilRef = 0;\n\n\t\t/**\n\t\t * The bit mask to use when comparing against the stencil buffer.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0xff\n\t\t */\n\t\tthis.stencilFuncMask = 0xff;\n\n\t\t/**\n\t\t * Which stencil operation to perform when the comparison function returns `false`.\n\t\t *\n\t\t * @type {ZeroStencilOp|KeepStencilOp|ReplaceStencilOp|IncrementStencilOp|DecrementStencilOp|IncrementWrapStencilOp|DecrementWrapStencilOp|InvertStencilOp}\n\t\t * @default KeepStencilOp\n\t\t */\n\t\tthis.stencilFail = KeepStencilOp;\n\n\t\t/**\n\t\t * Which stencil operation to perform when the comparison function returns\n\t\t * `true` but the depth test fails.\n\t\t *\n\t\t * @type {ZeroStencilOp|KeepStencilOp|ReplaceStencilOp|IncrementStencilOp|DecrementStencilOp|IncrementWrapStencilOp|DecrementWrapStencilOp|InvertStencilOp}\n\t\t * @default KeepStencilOp\n\t\t */\n\t\tthis.stencilZFail = KeepStencilOp;\n\n\t\t/**\n\t\t * Which stencil operation to perform when the comparison function returns\n\t\t * `true` and the depth test passes.\n\t\t *\n\t\t * @type {ZeroStencilOp|KeepStencilOp|ReplaceStencilOp|IncrementStencilOp|DecrementStencilOp|IncrementWrapStencilOp|DecrementWrapStencilOp|InvertStencilOp}\n\t\t * @default KeepStencilOp\n\t\t */\n\t\tthis.stencilZPass = KeepStencilOp;\n\n\t\t/**\n\t\t * Whether stencil operations are performed against the stencil buffer. In\n\t\t * order to perform writes or comparisons against the stencil buffer this\n\t\t * value must be `true`.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.stencilWrite = false;\n\n\t\t/**\n\t\t * User-defined clipping planes specified as THREE.Plane objects in world\n\t\t * space. These planes apply to the objects this material is attached to.\n\t\t * Points in space whose signed distance to the plane is negative are clipped\n\t\t * (not rendered). This requires {@link WebGLRenderer#localClippingEnabled} to\n\t\t * be `true`.\n\t\t *\n\t\t * @type {?Array\u003cPlane\u003e}\n\t\t * @default null\n\t\t */\n\t\tthis.clippingPlanes = null;\n\n\t\t/**\n\t\t * Changes the behavior of clipping planes so that only their intersection is\n\t\t * clipped, rather than their union.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.clipIntersection = false;\n\n\t\t/**\n\t\t * Defines whether to clip shadows according to the clipping planes specified\n\t\t * on this material.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.clipShadows = false;\n\n\t\t/**\n\t\t * Defines which side of faces cast shadows. If `null`, the side casting shadows\n\t\t * is determined as follows:\n\t\t *\n\t\t * - When {@link Material#side} is set to `FrontSide`, the back side cast shadows.\n\t\t * - When {@link Material#side} is set to `BackSide`, the front side cast shadows.\n\t\t * - When {@link Material#side} is set to `DoubleSide`, both sides cast shadows.\n\t\t *\n\t\t * @type {?(FrontSide|BackSide|DoubleSide)}\n\t\t * @default null\n\t\t */\n\t\tthis.shadowSide = null;\n\n\t\t/**\n\t\t * Whether to render the material's color.\n\t\t *\n\t\t * This can be used in conjunction with {@link Object3D#renderOder} to create invisible\n\t\t * objects that occlude other objects.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.colorWrite = true;\n\n\t\t/**\n\t\t * Override the renderer's default precision for this material.\n\t\t *\n\t\t * @type {?('highp'|'mediump'|'lowp')}\n\t\t * @default null\n\t\t */\n\t\tthis.precision = null;\n\n\t\t/**\n\t\t * Whether to use polygon offset or not. When enabled, each fragment's depth value will\n\t\t * be offset after it is interpolated from the depth values of the appropriate vertices.\n\t\t * The offset is added before the depth test is performed and before the value is written\n\t\t * into the depth buffer.\n\t\t *\n\t\t * Can be useful for rendering hidden-line images, for applying decals to surfaces, and for\n\t\t * rendering solids with highlighted edges.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.polygonOffset = false;\n\n\t\t/**\n\t\t * Specifies a scale factor that is used to create a variable depth offset for each polygon.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.polygonOffsetFactor = 0;\n\n\t\t/**\n\t\t * Is multiplied by an implementation-specific value to create a constant depth offset.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.polygonOffsetUnits = 0;\n\n\t\t/**\n\t\t * Whether to apply dithering to the color to remove the appearance of banding.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.dithering = false;\n\n\t\t/**\n\t\t * Whether alpha to coverage should be enabled or not. Can only be used with MSAA-enabled contexts\n\t\t * (meaning when the renderer was created with *antialias* parameter set to `true`). Enabling this\n\t\t * will smooth aliasing on clip plane edges and alphaTest-clipped edges.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.alphaToCoverage = false;\n\n\t\t/**\n\t\t * Whether to premultiply the alpha (transparency) value.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.premultipliedAlpha = false;\n\n\t\t/**\n\t\t * Whether double-sided, transparent objects should be rendered with a single pass or not.\n\t\t *\n\t\t * The engine renders double-sided, transparent objects with two draw calls (back faces first,\n\t\t * then front faces) to mitigate transparency artifacts. There are scenarios however where this\n\t\t * approach produces no quality gains but still doubles draw calls e.g. when rendering flat\n\t\t * vegetation like grass sprites. In these cases, set the `forceSinglePass` flag to `true` to\n\t\t * disable the two pass rendering to avoid performance issues.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.forceSinglePass = false;\n\n\t\t/**\n\t\t * Whether it's possible to override the material with {@link Scene#overrideMaterial} or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.allowOverride = true;\n\n\t\t/**\n\t\t * Defines whether 3D objects using this material are visible.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.visible = true;\n\n\t\t/**\n\t\t * Defines whether this material is tone mapped according to the renderer's tone mapping setting.\n\t\t *\n\t\t * It is ignored when rendering to a render target or using post processing or when using\n\t\t * `WebGPURenderer`. In all these cases, all materials are honored by tone mapping.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.toneMapped = true;\n\n\t\t/**\n\t\t * An object that can be used to store custom data about the Material. It\n\t\t * should not hold references to functions as these will not be cloned.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.userData = {};\n\n\t\t/**\n\t\t * This starts at `0` and counts how many times {@link Material#needsUpdate} is set to `true`.\n\t\t *\n\t\t * @type {number}\n\t\t * @readonly\n\t\t * @default 0\n\t\t */\n\t\tthis.version = 0;\n\n\t\tthis._alphaTest = 0;\n\n\t}\n\n\t/**\n\t * Sets the alpha value to be used when running an alpha test. The material\n\t * will not be rendered if the opacity is lower than this value.\n\t *\n\t * @type {number}\n\t * @readonly\n\t * @default 0\n\t */\n\tget alphaTest() {\n\n\t\treturn this._alphaTest;\n\n\t}\n\n\tset alphaTest( value ) {\n\n\t\tif ( this._alphaTest \u003e 0 !== value \u003e 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._alphaTest = value;\n\n\t}\n\n\t/**\n\t * An optional callback that is executed immediately before the material is used to render a 3D object.\n\t *\n\t * This method can only be used when rendering with {@link WebGLRenderer}.\n\t *\n\t * @param {WebGLRenderer} renderer - The renderer.\n\t * @param {Scene} scene - The scene.\n\t * @param {Camera} camera - The camera that is used to render the scene.\n\t * @param {BufferGeometry} geometry - The 3D object's geometry.\n\t * @param {Object3D} object - The 3D object.\n\t * @param {Object} group - The geometry group data.\n\t */\n\tonBeforeRender( /* renderer, scene, camera, geometry, object, group */ ) {}\n\n\t/**\n\t * An optional callback that is executed immediately before the shader\n\t * program is compiled. This function is called with the shader source code\n\t * as a parameter. Useful for the modification of built-in materials.\n\t *\n\t * This method can only be used when rendering with {@link WebGLRenderer}. The\n\t * recommended approach when customizing materials is to use `WebGPURenderer` with the new\n\t * Node Material system and [TSL](https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language).\n\t *\n\t * @param {{vertexShader:string,fragmentShader:string,uniforms:Object}} shaderobject - The object holds the uniforms and the vertex and fragment shader source.\n\t * @param {WebGLRenderer} renderer - A reference to the renderer.\n\t */\n\tonBeforeCompile( /* shaderobject, renderer */ ) {}\n\n\t/**\n\t * In case {@link Material#onBeforeCompile} is used, this callback can be used to identify\n\t * values of settings used in `onBeforeCompile()`, so three.js can reuse a cached\n\t * shader or recompile the shader for this material as needed.\n\t *\n\t * This method can only be used when rendering with {@link WebGLRenderer}.\n\t *\n\t * @return {string} The custom program cache key.\n\t */\n\tcustomProgramCacheKey() {\n\n\t\treturn this.onBeforeCompile.toString();\n\n\t}\n\n\t/**\n\t * This method can be used to set default values from parameter objects.\n\t * It is a generic implementation so it can be used with different types\n\t * of materials.\n\t *\n\t * @param {Object} [values] - The material values to set.\n\t */\n\tsetValues( values ) {\n\n\t\tif ( values === undefined ) return;\n\n\t\tfor ( const key in values ) {\n\n\t\t\tconst newValue = values[ key ];\n\n\t\t\tif ( newValue === undefined ) {\n\n\t\t\t\twarn( `Material: parameter '${ key }' has value of undefined.` );\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tconst currentValue = this[ key ];\n\n\t\t\tif ( currentValue === undefined ) {\n\n\t\t\t\twarn( `Material: '${ key }' is not a property of THREE.${ this.type }.` );\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tif ( currentValue \u0026\u0026 currentValue.isColor ) {\n\n\t\t\t\tcurrentValue.set( newValue );\n\n\t\t\t} else if ( ( currentValue \u0026\u0026 currentValue.isVector3 ) \u0026\u0026 ( newValue \u0026\u0026 newValue.isVector3 ) ) {\n\n\t\t\t\tcurrentValue.copy( newValue );\n\n\t\t\t} else {\n\n\t\t\t\tthis[ key ] = newValue;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Serializes the material into JSON.\n\t *\n\t * @param {?(Object|string)} meta - An optional value holding meta information about the serialization.\n\t * @return {Object} A JSON object representing the serialized material.\n\t * @see {@link ObjectLoader#parse}\n\t */\n\ttoJSON( meta ) {\n\n\t\tconst isRootObject = ( meta === undefined || typeof meta === 'string' );\n\n\t\tif ( isRootObject ) {\n\n\t\t\tmeta = {\n\t\t\t\ttextures: {},\n\t\t\t\timages: {}\n\t\t\t};\n\n\t\t}\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.7,\n\t\t\t\ttype: 'Material',\n\t\t\t\tgenerator: 'Material.toJSON'\n\t\t\t}\n\t\t};\n\n\t\t// standard Material serialization\n\t\tdata.uuid = this.uuid;\n\t\tdata.type = this.type;\n\n\t\tif ( this.name !== '' ) data.name = this.name;\n\n\t\tif ( this.color \u0026\u0026 this.color.isColor ) data.color = this.color.getHex();\n\n\t\tif ( this.roughness !== undefined ) data.roughness = this.roughness;\n\t\tif ( this.metalness !== undefined ) data.metalness = this.metalness;\n\n\t\tif ( this.sheen !== undefined ) data.sheen = this.sheen;\n\t\tif ( this.sheenColor \u0026\u0026 this.sheenColor.isColor ) data.sheenColor = this.sheenColor.getHex();\n\t\tif ( this.sheenRoughness !== undefined ) data.sheenRoughness = this.sheenRoughness;\n\t\tif ( this.emissive \u0026\u0026 this.emissive.isColor ) data.emissive = this.emissive.getHex();\n\t\tif ( this.emissiveIntensity !== undefined \u0026\u0026 this.emissiveIntensity !== 1 ) data.emissiveIntensity = this.emissiveIntensity;\n\n\t\tif ( this.specular \u0026\u0026 this.specular.isColor ) data.specular = this.specular.getHex();\n\t\tif ( this.specularIntensity !== undefined ) data.specularIntensity = this.specularIntensity;\n\t\tif ( this.specularColor \u0026\u0026 this.specularColor.isColor ) data.specularColor = this.specularColor.getHex();\n\t\tif ( this.shininess !== undefined ) data.shininess = this.shininess;\n\t\tif ( this.clearcoat !== undefined ) data.clearcoat = this.clearcoat;\n\t\tif ( this.clearcoatRoughness !== undefined ) data.clearcoatRoughness = this.clearcoatRoughness;\n\n\t\tif ( this.clearcoatMap \u0026\u0026 this.clearcoatMap.isTexture ) {\n\n\t\t\tdata.clearcoatMap = this.clearcoatMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.clearcoatRoughnessMap \u0026\u0026 this.clearcoatRoughnessMap.isTexture ) {\n\n\t\t\tdata.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.clearcoatNormalMap \u0026\u0026 this.clearcoatNormalMap.isTexture ) {\n\n\t\t\tdata.clearcoatNormalMap = this.clearcoatNormalMap.toJSON( meta ).uuid;\n\t\t\tdata.clearcoatNormalScale = this.clearcoatNormalScale.toArray();\n\n\t\t}\n\n\t\tif ( this.sheenColorMap \u0026\u0026 this.sheenColorMap.isTexture ) {\n\n\t\t\tdata.sheenColorMap = this.sheenColorMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.sheenRoughnessMap \u0026\u0026 this.sheenRoughnessMap.isTexture ) {\n\n\t\t\tdata.sheenRoughnessMap = this.sheenRoughnessMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.dispersion !== undefined ) data.dispersion = this.dispersion;\n\n\t\tif ( this.iridescence !== undefined ) data.iridescence = this.iridescence;\n\t\tif ( this.iridescenceIOR !== undefined ) data.iridescenceIOR = this.iridescenceIOR;\n\t\tif ( this.iridescenceThicknessRange !== undefined ) data.iridescenceThicknessRange = this.iridescenceThicknessRange;\n\n\t\tif ( this.iridescenceMap \u0026\u0026 this.iridescenceMap.isTexture ) {\n\n\t\t\tdata.iridescenceMap = this.iridescenceMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.iridescenceThicknessMap \u0026\u0026 this.iridescenceThicknessMap.isTexture ) {\n\n\t\t\tdata.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.anisotropy !== undefined ) data.anisotropy = this.anisotropy;\n\t\tif ( this.anisotropyRotation !== undefined ) data.anisotropyRotation = this.anisotropyRotation;\n\n\t\tif ( this.anisotropyMap \u0026\u0026 this.anisotropyMap.isTexture ) {\n\n\t\t\tdata.anisotropyMap = this.anisotropyMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.map \u0026\u0026 this.map.isTexture ) data.map = this.map.toJSON( meta ).uuid;\n\t\tif ( this.matcap \u0026\u0026 this.matcap.isTexture ) data.matcap = this.matcap.toJSON( meta ).uuid;\n\t\tif ( this.alphaMap \u0026\u0026 this.alphaMap.isTexture ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid;\n\n\t\tif ( this.lightMap \u0026\u0026 this.lightMap.isTexture ) {\n\n\t\t\tdata.lightMap = this.lightMap.toJSON( meta ).uuid;\n\t\t\tdata.lightMapIntensity = this.lightMapIntensity;\n\n\t\t}\n\n\t\tif ( this.aoMap \u0026\u0026 this.aoMap.isTexture ) {\n\n\t\t\tdata.aoMap = this.aoMap.toJSON( meta ).uuid;\n\t\t\tdata.aoMapIntensity = this.aoMapIntensity;\n\n\t\t}\n\n\t\tif ( this.bumpMap \u0026\u0026 this.bumpMap.isTexture ) {\n\n\t\t\tdata.bumpMap = this.bumpMap.toJSON( meta ).uuid;\n\t\t\tdata.bumpScale = this.bumpScale;\n\n\t\t}\n\n\t\tif ( this.normalMap \u0026\u0026 this.normalMap.isTexture ) {\n\n\t\t\tdata.normalMap = this.normalMap.toJSON( meta ).uuid;\n\t\t\tdata.normalMapType = this.normalMapType;\n\t\t\tdata.normalScale = this.normalScale.toArray();\n\n\t\t}\n\n\t\tif ( this.displacementMap \u0026\u0026 this.displacementMap.isTexture ) {\n\n\t\t\tdata.displacementMap = this.displacementMap.toJSON( meta ).uuid;\n\t\t\tdata.displacementScale = this.displacementScale;\n\t\t\tdata.displacementBias = this.displacementBias;\n\n\t\t}\n\n\t\tif ( this.roughnessMap \u0026\u0026 this.roughnessMap.isTexture ) data.roughnessMap = this.roughnessMap.toJSON( meta ).uuid;\n\t\tif ( this.metalnessMap \u0026\u0026 this.metalnessMap.isTexture ) data.metalnessMap = this.metalnessMap.toJSON( meta ).uuid;\n\n\t\tif ( this.emissiveMap \u0026\u0026 this.emissiveMap.isTexture ) data.emissiveMap = this.emissiveMap.toJSON( meta ).uuid;\n\t\tif ( this.specularMap \u0026\u0026 this.specularMap.isTexture ) data.specularMap = this.specularMap.toJSON( meta ).uuid;\n\t\tif ( this.specularIntensityMap \u0026\u0026 this.specularIntensityMap.isTexture ) data.specularIntensityMap = this.specularIntensityMap.toJSON( meta ).uuid;\n\t\tif ( this.specularColorMap \u0026\u0026 this.specularColorMap.isTexture ) data.specularColorMap = this.specularColorMap.toJSON( meta ).uuid;\n\n\t\tif ( this.envMap \u0026\u0026 this.envMap.isTexture ) {\n\n\t\t\tdata.envMap = this.envMap.toJSON( meta ).uuid;\n\n\t\t\tif ( this.combine !== undefined ) data.combine = this.combine;\n\n\t\t}\n\n\t\tif ( this.envMapRotation !== undefined ) data.envMapRotation = this.envMapRotation.toArray();\n\t\tif ( this.envMapIntensity !== undefined ) data.envMapIntensity = this.envMapIntensity;\n\t\tif ( this.reflectivity !== undefined ) data.reflectivity = this.reflectivity;\n\t\tif ( this.refractionRatio !== undefined ) data.refractionRatio = this.refractionRatio;\n\n\t\tif ( this.gradientMap \u0026\u0026 this.gradientMap.isTexture ) {\n\n\t\t\tdata.gradientMap = this.gradientMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.transmission !== undefined ) data.transmission = this.transmission;\n\t\tif ( this.transmissionMap \u0026\u0026 this.transmissionMap.isTexture ) data.transmissionMap = this.transmissionMap.toJSON( meta ).uuid;\n\t\tif ( this.thickness !== undefined ) data.thickness = this.thickness;\n\t\tif ( this.thicknessMap \u0026\u0026 this.thicknessMap.isTexture ) data.thicknessMap = this.thicknessMap.toJSON( meta ).uuid;\n\t\tif ( this.attenuationDistance !== undefined \u0026\u0026 this.attenuationDistance !== Infinity ) data.attenuationDistance = this.attenuationDistance;\n\t\tif ( this.attenuationColor !== undefined ) data.attenuationColor = this.attenuationColor.getHex();\n\n\t\tif ( this.size !== undefined ) data.size = this.size;\n\t\tif ( this.shadowSide !== null ) data.shadowSide = this.shadowSide;\n\t\tif ( this.sizeAttenuation !== undefined ) data.sizeAttenuation = this.sizeAttenuation;\n\n\t\tif ( this.blending !== NormalBlending ) data.blending = this.blending;\n\t\tif ( this.side !== FrontSide ) data.side = this.side;\n\t\tif ( this.vertexColors === true ) data.vertexColors = true;\n\n\t\tif ( this.opacity \u003c 1 ) data.opacity = this.opacity;\n\t\tif ( this.transparent === true ) data.transparent = true;\n\n\t\tif ( this.blendSrc !== SrcAlphaFactor ) data.blendSrc = this.blendSrc;\n\t\tif ( this.blendDst !== OneMinusSrcAlphaFactor ) data.blendDst = this.blendDst;\n\t\tif ( this.blendEquation !== AddEquation ) data.blendEquation = this.blendEquation;\n\t\tif ( this.blendSrcAlpha !== null ) data.blendSrcAlpha = this.blendSrcAlpha;\n\t\tif ( this.blendDstAlpha !== null ) data.blendDstAlpha = this.blendDstAlpha;\n\t\tif ( this.blendEquationAlpha !== null ) data.blendEquationAlpha = this.blendEquationAlpha;\n\t\tif ( this.blendColor \u0026\u0026 this.blendColor.isColor ) data.blendColor = this.blendColor.getHex();\n\t\tif ( this.blendAlpha !== 0 ) data.blendAlpha = this.blendAlpha;\n\n\t\tif ( this.depthFunc !== LessEqualDepth ) data.depthFunc = this.depthFunc;\n\t\tif ( this.depthTest === false ) data.depthTest = this.depthTest;\n\t\tif ( this.depthWrite === false ) data.depthWrite = this.depthWrite;\n\t\tif ( this.colorWrite === false ) data.colorWrite = this.colorWrite;\n\n\t\tif ( this.stencilWriteMask !== 0xff ) data.stencilWriteMask = this.stencilWriteMask;\n\t\tif ( this.stencilFunc !== AlwaysStencilFunc ) data.stencilFunc = this.stencilFunc;\n\t\tif ( this.stencilRef !== 0 ) data.stencilRef = this.stencilRef;\n\t\tif ( this.stencilFuncMask !== 0xff ) data.stencilFuncMask = this.stencilFuncMask;\n\t\tif ( this.stencilFail !== KeepStencilOp ) data.stencilFail = this.stencilFail;\n\t\tif ( this.stencilZFail !== KeepStencilOp ) data.stencilZFail = this.stencilZFail;\n\t\tif ( this.stencilZPass !== KeepStencilOp ) data.stencilZPass = this.stencilZPass;\n\t\tif ( this.stencilWrite === true ) data.stencilWrite = this.stencilWrite;\n\n\t\t// rotation (SpriteMaterial)\n\t\tif ( this.rotation !== undefined \u0026\u0026 this.rotation !== 0 ) data.rotation = this.rotation;\n\n\t\tif ( this.polygonOffset === true ) data.polygonOffset = true;\n\t\tif ( this.polygonOffsetFactor !== 0 ) data.polygonOffsetFactor = this.polygonOffsetFactor;\n\t\tif ( this.polygonOffsetUnits !== 0 ) data.polygonOffsetUnits = this.polygonOffsetUnits;\n\n\t\tif ( this.linewidth !== undefined \u0026\u0026 this.linewidth !== 1 ) data.linewidth = this.linewidth;\n\t\tif ( this.dashSize !== undefined ) data.dashSize = this.dashSize;\n\t\tif ( this.gapSize !== undefined ) data.gapSize = this.gapSize;\n\t\tif ( this.scale !== undefined ) data.scale = this.scale;\n\n\t\tif ( this.dithering === true ) data.dithering = true;\n\n\t\tif ( this.alphaTest \u003e 0 ) data.alphaTest = this.alphaTest;\n\t\tif ( this.alphaHash === true ) data.alphaHash = true;\n\t\tif ( this.alphaToCoverage === true ) data.alphaToCoverage = true;\n\t\tif ( this.premultipliedAlpha === true ) data.premultipliedAlpha = true;\n\t\tif ( this.forceSinglePass === true ) data.forceSinglePass = true;\n\t\tif ( this.allowOverride === false ) data.allowOverride = false;\n\n\t\tif ( this.wireframe === true ) data.wireframe = true;\n\t\tif ( this.wireframeLinewidth \u003e 1 ) data.wireframeLinewidth = this.wireframeLinewidth;\n\t\tif ( this.wireframeLinecap !== 'round' ) data.wireframeLinecap = this.wireframeLinecap;\n\t\tif ( this.wireframeLinejoin !== 'round' ) data.wireframeLinejoin = this.wireframeLinejoin;\n\n\t\tif ( this.flatShading === true ) data.flatShading = true;\n\n\t\tif ( this.visible === false ) data.visible = false;\n\n\t\tif ( this.toneMapped === false ) data.toneMapped = false;\n\n\t\tif ( this.fog === false ) data.fog = false;\n\n\t\tif ( Object.keys( this.userData ).length \u003e 0 ) data.userData = this.userData;\n\n\t\t// TODO: Copied from Object3D.toJSON\n\n\t\tfunction extractFromCache( cache ) {\n\n\t\t\tconst values = [];\n\n\t\t\tfor ( const key in cache ) {\n\n\t\t\t\tconst data = cache[ key ];\n\t\t\t\tdelete data.metadata;\n\t\t\t\tvalues.push( data );\n\n\t\t\t}\n\n\t\t\treturn values;\n\n\t\t}\n\n\t\tif ( isRootObject ) {\n\n\t\t\tconst textures = extractFromCache( meta.textures );\n\t\t\tconst images = extractFromCache( meta.images );\n\n\t\t\tif ( textures.length \u003e 0 ) data.textures = textures;\n\t\t\tif ( images.length \u003e 0 ) data.images = images;\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\t/**\n\t * Returns a new material with copied values from this instance.\n\t *\n\t * @return {Material} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Copies the values of the given material to this instance.\n\t *\n\t * @param {Material} source - The material to copy.\n\t * @return {Material} A reference to this instance.\n\t */\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\n\t\tthis.blending = source.blending;\n\t\tthis.side = source.side;\n\t\tthis.vertexColors = source.vertexColors;\n\n\t\tthis.opacity = source.opacity;\n\t\tthis.transparent = source.transparent;\n\n\t\tthis.blendSrc = source.blendSrc;\n\t\tthis.blendDst = source.blendDst;\n\t\tthis.blendEquation = source.blendEquation;\n\t\tthis.blendSrcAlpha = source.blendSrcAlpha;\n\t\tthis.blendDstAlpha = source.blendDstAlpha;\n\t\tthis.blendEquationAlpha = source.blendEquationAlpha;\n\t\tthis.blendColor.copy( source.blendColor );\n\t\tthis.blendAlpha = source.blendAlpha;\n\n\t\tthis.depthFunc = source.depthFunc;\n\t\tthis.depthTest = source.depthTest;\n\t\tthis.depthWrite = source.depthWrite;\n\n\t\tthis.stencilWriteMask = source.stencilWriteMask;\n\t\tthis.stencilFunc = source.stencilFunc;\n\t\tthis.stencilRef = source.stencilRef;\n\t\tthis.stencilFuncMask = source.stencilFuncMask;\n\t\tthis.stencilFail = source.stencilFail;\n\t\tthis.stencilZFail = source.stencilZFail;\n\t\tthis.stencilZPass = source.stencilZPass;\n\t\tthis.stencilWrite = source.stencilWrite;\n\n\t\tconst srcPlanes = source.clippingPlanes;\n\t\tlet dstPlanes = null;\n\n\t\tif ( srcPlanes !== null ) {\n\n\t\t\tconst n = srcPlanes.length;\n\t\t\tdstPlanes = new Array( n );\n\n\t\t\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\t\t\tdstPlanes[ i ] = srcPlanes[ i ].clone();\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.clippingPlanes = dstPlanes;\n\t\tthis.clipIntersection = source.clipIntersection;\n\t\tthis.clipShadows = source.clipShadows;\n\n\t\tthis.shadowSide = source.shadowSide;\n\n\t\tthis.colorWrite = source.colorWrite;\n\n\t\tthis.precision = source.precision;\n\n\t\tthis.polygonOffset = source.polygonOffset;\n\t\tthis.polygonOffsetFactor = source.polygonOffsetFactor;\n\t\tthis.polygonOffsetUnits = source.polygonOffsetUnits;\n\n\t\tthis.dithering = source.dithering;\n\n\t\tthis.alphaTest = source.alphaTest;\n\t\tthis.alphaHash = source.alphaHash;\n\t\tthis.alphaToCoverage = source.alphaToCoverage;\n\t\tthis.premultipliedAlpha = source.premultipliedAlpha;\n\t\tthis.forceSinglePass = source.forceSinglePass;\n\t\tthis.allowOverride = source.allowOverride;\n\n\t\tthis.visible = source.visible;\n\n\t\tthis.toneMapped = source.toneMapped;\n\n\t\tthis.userData = JSON.parse( JSON.stringify( source.userData ) );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t *\n\t * @fires Material#dispose\n\t */\n\tdispose() {\n\n\t\t/**\n\t\t * Fires when the material has been disposed of.\n\t\t *\n\t\t * @event Material#dispose\n\t\t * @type {Object}\n\t\t */\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n\t/**\n\t * Setting this property to `true` indicates the engine the material\n\t * needs to be recompiled.\n\t *\n\t * @type {boolean}\n\t * @default false\n\t * @param {boolean} value\n\t */\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n}\n\n/**\n * A material for drawing geometries in a simple shaded (flat or wireframe) way.\n *\n * This material is not affected by lights.\n *\n * @augments Material\n * @demo scenes/material-browser.html#MeshBasicMaterial\n */\nclass MeshBasicMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh basic material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshBasicMaterial = true;\n\n\t\tthis.type = 'MeshBasicMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The light map. Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.lightMap = null;\n\n\t\t/**\n\t\t * Intensity of the baked light.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\t/**\n\t\t * The red channel of this texture is used as the ambient occlusion map.\n\t\t * Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.aoMap = null;\n\n\t\t/**\n\t\t * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0`\n\t\t * disables ambient occlusion. Where intensity is `1` and the AO map's\n\t\t * red channel is also `1`, ambient light is fully occluded on a surface.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\t/**\n\t\t * Specular map used by the material.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.specularMap = null;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * The environment map.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.envMap = null;\n\n\t\t/**\n\t\t * The rotation of the environment map in radians.\n\t\t *\n\t\t * @type {Euler}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.envMapRotation = new Euler();\n\n\t\t/**\n\t\t * How to combine the result of the surface's color with the environment map, if any.\n\t\t *\n\t\t * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to\n\t\t * blend between the two colors.\n\t\t *\n\t\t * @type {(MultiplyOperation|MixOperation|AddOperation)}\n\t\t * @default MultiplyOperation\n\t\t */\n\t\tthis.combine = MultiplyOperation;\n\n\t\t/**\n\t\t * How much the environment map affects the surface.\n\t\t * The valid range is between `0` (no reflections) and `1` (full reflections).\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.reflectivity = 1;\n\n\t\t/**\n\t\t * The index of refraction (IOR) of air (approximately 1) divided by the\n\t\t * index of refraction of the material. It is used with environment mapping\n\t\t * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}.\n\t\t * The refraction ratio should not exceed `1`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0.98\n\t\t */\n\t\tthis.refractionRatio = 0.98;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\t/**\n\t\t * Defines appearance of wireframe ends.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinecap = 'round';\n\n\t\t/**\n\t\t * Defines appearance of wireframe joints.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapRotation.copy( source.envMapRotation );\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\n// Fast Half Float Conversions, http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n\nconst _tables = /*@__PURE__*/ _generateTables();\n\nfunction _generateTables() {\n\n\t// float32 to float16 helpers\n\n\tconst buffer = new ArrayBuffer( 4 );\n\tconst floatView = new Float32Array( buffer );\n\tconst uint32View = new Uint32Array( buffer );\n\n\tconst baseTable = new Uint32Array( 512 );\n\tconst shiftTable = new Uint32Array( 512 );\n\n\tfor ( let i = 0; i \u003c 256; ++ i ) {\n\n\t\tconst e = i - 127;\n\n\t\t// very small number (0, -0)\n\n\t\tif ( e \u003c -27 ) {\n\n\t\t\tbaseTable[ i ] = 0x0000;\n\t\t\tbaseTable[ i | 0x100 ] = 0x8000;\n\t\t\tshiftTable[ i ] = 24;\n\t\t\tshiftTable[ i | 0x100 ] = 24;\n\n\t\t\t// small number (denorm)\n\n\t\t} else if ( e \u003c -14 ) {\n\n\t\t\tbaseTable[ i ] = 0x0400 \u003e\u003e ( - e - 14 );\n\t\t\tbaseTable[ i | 0x100 ] = ( 0x0400 \u003e\u003e ( - e - 14 ) ) | 0x8000;\n\t\t\tshiftTable[ i ] = - e - 1;\n\t\t\tshiftTable[ i | 0x100 ] = - e - 1;\n\n\t\t\t// normal number\n\n\t\t} else if ( e \u003c= 15 ) {\n\n\t\t\tbaseTable[ i ] = ( e + 15 ) \u003c\u003c 10;\n\t\t\tbaseTable[ i | 0x100 ] = ( ( e + 15 ) \u003c\u003c 10 ) | 0x8000;\n\t\t\tshiftTable[ i ] = 13;\n\t\t\tshiftTable[ i | 0x100 ] = 13;\n\n\t\t\t// large number (Infinity, -Infinity)\n\n\t\t} else if ( e \u003c 128 ) {\n\n\t\t\tbaseTable[ i ] = 0x7c00;\n\t\t\tbaseTable[ i | 0x100 ] = 0xfc00;\n\t\t\tshiftTable[ i ] = 24;\n\t\t\tshiftTable[ i | 0x100 ] = 24;\n\n\t\t\t// stay (NaN, Infinity, -Infinity)\n\n\t\t} else {\n\n\t\t\tbaseTable[ i ] = 0x7c00;\n\t\t\tbaseTable[ i | 0x100 ] = 0xfc00;\n\t\t\tshiftTable[ i ] = 13;\n\t\t\tshiftTable[ i | 0x100 ] = 13;\n\n\t\t}\n\n\t}\n\n\t// float16 to float32 helpers\n\n\tconst mantissaTable = new Uint32Array( 2048 );\n\tconst exponentTable = new Uint32Array( 64 );\n\tconst offsetTable = new Uint32Array( 64 );\n\n\tfor ( let i = 1; i \u003c 1024; ++ i ) {\n\n\t\tlet m = i \u003c\u003c 13; // zero pad mantissa bits\n\t\tlet e = 0; // zero exponent\n\n\t\t// normalized\n\t\twhile ( ( m \u0026 0x00800000 ) === 0 ) {\n\n\t\t\tm \u003c\u003c= 1;\n\t\t\te -= 0x00800000; // decrement exponent\n\n\t\t}\n\n\t\tm \u0026= -8388609; // clear leading 1 bit\n\t\te += 0x38800000; // adjust bias\n\n\t\tmantissaTable[ i ] = m | e;\n\n\t}\n\n\tfor ( let i = 1024; i \u003c 2048; ++ i ) {\n\n\t\tmantissaTable[ i ] = 0x38000000 + ( ( i - 1024 ) \u003c\u003c 13 );\n\n\t}\n\n\tfor ( let i = 1; i \u003c 31; ++ i ) {\n\n\t\texponentTable[ i ] = i \u003c\u003c 23;\n\n\t}\n\n\texponentTable[ 31 ] = 0x47800000;\n\texponentTable[ 32 ] = 0x80000000;\n\n\tfor ( let i = 33; i \u003c 63; ++ i ) {\n\n\t\texponentTable[ i ] = 0x80000000 + ( ( i - 32 ) \u003c\u003c 23 );\n\n\t}\n\n\texponentTable[ 63 ] = 0xc7800000;\n\n\tfor ( let i = 1; i \u003c 64; ++ i ) {\n\n\t\tif ( i !== 32 ) {\n\n\t\t\toffsetTable[ i ] = 1024;\n\n\t\t}\n\n\t}\n\n\treturn {\n\t\tfloatView: floatView,\n\t\tuint32View: uint32View,\n\t\tbaseTable: baseTable,\n\t\tshiftTable: shiftTable,\n\t\tmantissaTable: mantissaTable,\n\t\texponentTable: exponentTable,\n\t\toffsetTable: offsetTable\n\t};\n\n}\n\n/**\n * Returns a half precision floating point value (FP16) from the given single\n * precision floating point value (FP32).\n *\n * @param {number} val - A single precision floating point value.\n * @return {number} The FP16 value.\n */\nfunction toHalfFloat( val ) {\n\n\tif ( Math.abs( val ) \u003e 65504 ) warn( 'DataUtils.toHalfFloat(): Value out of range.' );\n\n\tval = clamp( val, -65504, 65504 );\n\n\t_tables.floatView[ 0 ] = val;\n\tconst f = _tables.uint32View[ 0 ];\n\tconst e = ( f \u003e\u003e 23 ) \u0026 0x1ff;\n\treturn _tables.baseTable[ e ] + ( ( f \u0026 0x007fffff ) \u003e\u003e _tables.shiftTable[ e ] );\n\n}\n\n/**\n * Returns a single precision floating point value (FP32) from the given half\n * precision floating point value (FP16).\n *\n * @param {number} val - A half precision floating point value.\n * @return {number} The FP32 value.\n */\nfunction fromHalfFloat( val ) {\n\n\tconst m = val \u003e\u003e 10;\n\t_tables.uint32View[ 0 ] = _tables.mantissaTable[ _tables.offsetTable[ m ] + ( val \u0026 0x3ff ) ] + _tables.exponentTable[ m ];\n\treturn _tables.floatView[ 0 ];\n\n}\n\n/**\n * A class containing utility functions for data.\n *\n * @hideconstructor\n */\nclass DataUtils {\n\n\t/**\n\t * Returns a half precision floating point value (FP16) from the given single\n\t * precision floating point value (FP32).\n\t *\n\t * @param {number} val - A single precision floating point value.\n\t * @return {number} The FP16 value.\n\t */\n\tstatic toHalfFloat( val ) {\n\n\t\treturn toHalfFloat( val );\n\n\t}\n\n\t/**\n\t * Returns a single precision floating point value (FP32) from the given half\n\t * precision floating point value (FP16).\n\t *\n\t * @param {number} val - A half precision floating point value.\n\t * @return {number} The FP32 value.\n\t */\n\tstatic fromHalfFloat( val ) {\n\n\t\treturn fromHalfFloat( val );\n\n\t}\n\n}\n\nconst _vector$9 = /*@__PURE__*/ new Vector3();\nconst _vector2$1 = /*@__PURE__*/ new Vector2();\n\nlet _id$2 = 0;\n\n/**\n * This class stores data for an attribute (such as vertex positions, face\n * indices, normals, colors, UVs, and any custom attributes ) associated with\n * a geometry, which allows for more efficient passing of data to the GPU.\n *\n * When working with vector-like data, the `fromBufferAttribute( attribute, index )`\n * helper methods on vector and color class might be helpful. E.g. {@link Vector3#fromBufferAttribute}.\n */\nclass BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {TypedArray} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized = false ) {\n\n\t\tif ( Array.isArray( array ) ) {\n\n\t\t\tthrow new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' );\n\n\t\t}\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isBufferAttribute = true;\n\n\t\t/**\n\t\t * The ID of the buffer attribute.\n\t\t *\n\t\t * @name BufferAttribute#id\n\t\t * @type {number}\n\t\t * @readonly\n\t\t */\n\t\tObject.defineProperty( this, 'id', { value: _id$2 ++ } );\n\n\t\t/**\n\t\t * The name of the buffer attribute.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\n\t\t/**\n\t\t * The array holding the attribute data. It should have `itemSize * numVertices`\n\t\t * elements, where `numVertices` is the number of vertices in the associated geometry.\n\t\t *\n\t\t * @type {TypedArray}\n\t\t */\n\t\tthis.array = array;\n\n\t\t/**\n\t\t * The number of values of the array that should be associated with a particular vertex.\n\t\t * For instance, if this attribute is storing a 3-component vector (such as a position,\n\t\t * normal, or color), then the value should be `3`.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.itemSize = itemSize;\n\n\t\t/**\n\t\t * Represents the number of items this buffer attribute stores. It is internally computed\n\t\t * by dividing the `array` length by the `itemSize`.\n\t\t *\n\t\t * @type {number}\n\t\t * @readonly\n\t\t */\n\t\tthis.count = array !== undefined ? array.length / itemSize : 0;\n\n\t\t/**\n\t\t * Applies to integer data only. Indicates how the underlying data in the buffer maps to\n\t\t * the values in the GLSL code. For instance, if `array` is an instance of `UInt16Array`,\n\t\t * and `normalized` is `true`, the values `0 - +65535` in the array data will be mapped to\n\t\t * `0.0f - +1.0f` in the GLSL attribute. If `normalized` is `false`, the values will be converted\n\t\t * to floats unmodified, i.e. `65535` becomes `65535.0f`.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tthis.normalized = normalized;\n\n\t\t/**\n\t\t * Defines the intended usage pattern of the data store for optimization purposes.\n\t\t *\n\t\t * Note: After the initial use of a buffer, its usage cannot be changed. Instead,\n\t\t * instantiate a new one and set the desired usage before the next render.\n\t\t *\n\t\t * @type {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)}\n\t\t * @default StaticDrawUsage\n\t\t */\n\t\tthis.usage = StaticDrawUsage;\n\n\t\t/**\n\t\t * This can be used to only update some components of stored vectors (for example, just the\n\t\t * component related to color). Use the `addUpdateRange()` function to add ranges to this array.\n\t\t *\n\t\t * @type {Array\u003cObject\u003e}\n\t\t */\n\t\tthis.updateRanges = [];\n\n\t\t/**\n\t\t * Configures the bound GPU type for use in shaders.\n\t\t *\n\t\t * Note: this only has an effect for integer arrays and is not configurable for float arrays.\n\t\t * For lower precision float types, use `Float16BufferAttribute`.\n\t\t *\n\t\t * @type {(FloatType|IntType)}\n\t\t * @default FloatType\n\t\t */\n\t\tthis.gpuType = FloatType;\n\n\t\t/**\n\t\t * A version number, incremented every time the `needsUpdate` is set to `true`.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.version = 0;\n\n\t}\n\n\t/**\n\t * A callback function that is executed after the renderer has transferred the attribute\n\t * array data to the GPU.\n\t */\n\tonUploadCallback() {}\n\n\t/**\n\t * Flag to indicate that this attribute has changed and should be re-sent to\n\t * the GPU. Set this to `true` when you modify the value of the array.\n\t *\n\t * @type {number}\n\t * @default false\n\t * @param {boolean} value\n\t */\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\t/**\n\t * Sets the usage of this buffer attribute.\n\t *\n\t * @param {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)} value - The usage to set.\n\t * @return {BufferAttribute} A reference to this buffer attribute.\n\t */\n\tsetUsage( value ) {\n\n\t\tthis.usage = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds a range of data in the data array to be updated on the GPU.\n\t *\n\t * @param {number} start - Position at which to start update.\n\t * @param {number} count - The number of components to update.\n\t */\n\taddUpdateRange( start, count ) {\n\n\t\tthis.updateRanges.push( { start, count } );\n\n\t}\n\n\t/**\n\t * Clears the update ranges.\n\t */\n\tclearUpdateRanges() {\n\n\t\tthis.updateRanges.length = 0;\n\n\t}\n\n\t/**\n\t * Copies the values of the given buffer attribute to this instance.\n\t *\n\t * @param {BufferAttribute} source - The buffer attribute to copy.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\t\tthis.array = new source.array.constructor( source.array );\n\t\tthis.itemSize = source.itemSize;\n\t\tthis.count = source.count;\n\t\tthis.normalized = source.normalized;\n\n\t\tthis.usage = source.usage;\n\t\tthis.gpuType = source.gpuType;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies a vector from the given buffer attribute to this one. The start\n\t * and destination position in the attribute buffers are represented by the\n\t * given indices.\n\t *\n\t * @param {number} index1 - The destination index into this buffer attribute.\n\t * @param {BufferAttribute} attribute - The buffer attribute to copy from.\n\t * @param {number} index2 - The source index into the given buffer attribute.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tcopyAt( index1, attribute, index2 ) {\n\n\t\tindex1 *= this.itemSize;\n\t\tindex2 *= attribute.itemSize;\n\n\t\tfor ( let i = 0, l = this.itemSize; i \u003c l; i ++ ) {\n\n\t\t\tthis.array[ index1 + i ] = attribute.array[ index2 + i ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the given array data into this buffer attribute.\n\t *\n\t * @param {(TypedArray|Array)} array - The array to copy.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tcopyArray( array ) {\n\n\t\tthis.array.set( array );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Applies the given 3x3 matrix to the given attribute. Works with\n\t * item size `2` and `3`.\n\t *\n\t * @param {Matrix3} m - The matrix to apply.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tapplyMatrix3( m ) {\n\n\t\tif ( this.itemSize === 2 ) {\n\n\t\t\tfor ( let i = 0, l = this.count; i \u003c l; i ++ ) {\n\n\t\t\t\t_vector2$1.fromBufferAttribute( this, i );\n\t\t\t\t_vector2$1.applyMatrix3( m );\n\n\t\t\t\tthis.setXY( i, _vector2$1.x, _vector2$1.y );\n\n\t\t\t}\n\n\t\t} else if ( this.itemSize === 3 ) {\n\n\t\t\tfor ( let i = 0, l = this.count; i \u003c l; i ++ ) {\n\n\t\t\t\t_vector$9.fromBufferAttribute( this, i );\n\t\t\t\t_vector$9.applyMatrix3( m );\n\n\t\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Applies the given 4x4 matrix to the given attribute. Only works with\n\t * item size `3`.\n\t *\n\t * @param {Matrix4} m - The matrix to apply.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tapplyMatrix4( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i \u003c l; i ++ ) {\n\n\t\t\t_vector$9.fromBufferAttribute( this, i );\n\n\t\t\t_vector$9.applyMatrix4( m );\n\n\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Applies the given 3x3 normal matrix to the given attribute. Only works with\n\t * item size `3`.\n\t *\n\t * @param {Matrix3} m - The normal matrix to apply.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tapplyNormalMatrix( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i \u003c l; i ++ ) {\n\n\t\t\t_vector$9.fromBufferAttribute( this, i );\n\n\t\t\t_vector$9.applyNormalMatrix( m );\n\n\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Applies the given 4x4 matrix to the given attribute. Only works with\n\t * item size `3` and with direction vectors.\n\t *\n\t * @param {Matrix4} m - The matrix to apply.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\ttransformDirection( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i \u003c l; i ++ ) {\n\n\t\t\t_vector$9.fromBufferAttribute( this, i );\n\n\t\t\t_vector$9.transformDirection( m );\n\n\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given array data in the buffer attribute.\n\t *\n\t * @param {(TypedArray|Array)} value - The array data to set.\n\t * @param {number} [offset=0] - The offset in this buffer attribute's array.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tset( value, offset = 0 ) {\n\n\t\t// Matching BufferAttribute constructor, do not normalize the array.\n\t\tthis.array.set( value, offset );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the given component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} component - The component index.\n\t * @return {number} The returned value.\n\t */\n\tgetComponent( index, component ) {\n\n\t\tlet value = this.array[ index * this.itemSize + component ];\n\n\t\tif ( this.normalized ) value = denormalize( value, this.array );\n\n\t\treturn value;\n\n\t}\n\n\t/**\n\t * Sets the given value to the given component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} component - The component index.\n\t * @param {number} value - The value to set.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetComponent( index, component, value ) {\n\n\t\tif ( this.normalized ) value = normalize( value, this.array );\n\n\t\tthis.array[ index * this.itemSize + component ] = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the x component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @return {number} The x component.\n\t */\n\tgetX( index ) {\n\n\t\tlet x = this.array[ index * this.itemSize ];\n\n\t\tif ( this.normalized ) x = denormalize( x, this.array );\n\n\t\treturn x;\n\n\t}\n\n\t/**\n\t * Sets the x component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} x - The value to set.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetX( index, x ) {\n\n\t\tif ( this.normalized ) x = normalize( x, this.array );\n\n\t\tthis.array[ index * this.itemSize ] = x;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the y component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @return {number} The y component.\n\t */\n\tgetY( index ) {\n\n\t\tlet y = this.array[ index * this.itemSize + 1 ];\n\n\t\tif ( this.normalized ) y = denormalize( y, this.array );\n\n\t\treturn y;\n\n\t}\n\n\t/**\n\t * Sets the y component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} y - The value to set.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetY( index, y ) {\n\n\t\tif ( this.normalized ) y = normalize( y, this.array );\n\n\t\tthis.array[ index * this.itemSize + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the z component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @return {number} The z component.\n\t */\n\tgetZ( index ) {\n\n\t\tlet z = this.array[ index * this.itemSize + 2 ];\n\n\t\tif ( this.normalized ) z = denormalize( z, this.array );\n\n\t\treturn z;\n\n\t}\n\n\t/**\n\t * Sets the z component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} z - The value to set.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetZ( index, z ) {\n\n\t\tif ( this.normalized ) z = normalize( z, this.array );\n\n\t\tthis.array[ index * this.itemSize + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the w component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @return {number} The w component.\n\t */\n\tgetW( index ) {\n\n\t\tlet w = this.array[ index * this.itemSize + 3 ];\n\n\t\tif ( this.normalized ) w = denormalize( w, this.array );\n\n\t\treturn w;\n\n\t}\n\n\t/**\n\t * Sets the w component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} w - The value to set.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetW( index, w ) {\n\n\t\tif ( this.normalized ) w = normalize( w, this.array );\n\n\t\tthis.array[ index * this.itemSize + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the x and y component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} x - The value for the x component to set.\n\t * @param {number} y - The value for the y component to set.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetXY( index, x, y ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = x;\n\t\tthis.array[ index + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the x, y and z component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} x - The value for the x component to set.\n\t * @param {number} y - The value for the y component to set.\n\t * @param {number} z - The value for the z component to set.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetXYZ( index, x, y, z ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = x;\n\t\tthis.array[ index + 1 ] = y;\n\t\tthis.array[ index + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the x, y, z and w component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} x - The value for the x component to set.\n\t * @param {number} y - The value for the y component to set.\n\t * @param {number} z - The value for the z component to set.\n\t * @param {number} w - The value for the w component to set.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetXYZW( index, x, y, z, w ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\t\t\tw = normalize( w, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = x;\n\t\tthis.array[ index + 1 ] = y;\n\t\tthis.array[ index + 2 ] = z;\n\t\tthis.array[ index + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given callback function that is executed after the Renderer has transferred\n\t * the attribute array data to the GPU. Can be used to perform clean-up operations after\n\t * the upload when attribute data are not needed anymore on the CPU side.\n\t *\n\t * @param {Function} callback - The `onUpload()` callback.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tonUpload( callback ) {\n\n\t\tthis.onUploadCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new buffer attribute with copied values from this instance.\n\t *\n\t * @return {BufferAttribute} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor( this.array, this.itemSize ).copy( this );\n\n\t}\n\n\t/**\n\t * Serializes the buffer attribute into JSON.\n\t *\n\t * @return {Object} A JSON object representing the serialized buffer attribute.\n\t */\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\titemSize: this.itemSize,\n\t\t\ttype: this.array.constructor.name,\n\t\t\tarray: Array.from( this.array ),\n\t\t\tnormalized: this.normalized\n\t\t};\n\n\t\tif ( this.name !== '' ) data.name = this.name;\n\t\tif ( this.usage !== StaticDrawUsage ) data.usage = this.usage;\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * Convenient class that can be used when creating a `Int8` buffer attribute with\n * a plain `Array` instance.\n *\n * @augments BufferAttribute\n */\nclass Int8BufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {(Array\u003cnumber\u003e|Int8Array)} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Int8Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\n/**\n * Convenient class that can be used when creating a `UInt8` buffer attribute with\n * a plain `Array` instance.\n *\n * @augments BufferAttribute\n */\nclass Uint8BufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {(Array\u003cnumber\u003e|Uint8Array)} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint8Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\n/**\n * Convenient class that can be used when creating a `UInt8Clamped` buffer attribute with\n * a plain `Array` instance.\n *\n * @augments BufferAttribute\n */\nclass Uint8ClampedBufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {(Array\u003cnumber\u003e|Uint8ClampedArray)} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint8ClampedArray( array ), itemSize, normalized );\n\n\t}\n\n}\n\n/**\n * Convenient class that can be used when creating a `Int16` buffer attribute with\n * a plain `Array` instance.\n *\n * @augments BufferAttribute\n */\nclass Int16BufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {(Array\u003cnumber\u003e|Int16Array)} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Int16Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\n/**\n * Convenient class that can be used when creating a `UInt16` buffer attribute with\n * a plain `Array` instance.\n *\n * @augments BufferAttribute\n */\nclass Uint16BufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {(Array\u003cnumber\u003e|Uint16Array)} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint16Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\n/**\n * Convenient class that can be used when creating a `Int32` buffer attribute with\n * a plain `Array` instance.\n *\n * @augments BufferAttribute\n */\nclass Int32BufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {(Array\u003cnumber\u003e|Int32Array)} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Int32Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\n/**\n * Convenient class that can be used when creating a `UInt32` buffer attribute with\n * a plain `Array` instance.\n *\n * @augments BufferAttribute\n */\nclass Uint32BufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {(Array\u003cnumber\u003e|Uint32Array)} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint32Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\n/**\n * Convenient class that can be used when creating a `Float16` buffer attribute with\n * a plain `Array` instance.\n *\n * This class automatically converts to and from FP16 via `Uint16Array` since `Float16Array`\n * browser support is still problematic.\n *\n * @augments BufferAttribute\n */\nclass Float16BufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {(Array\u003cnumber\u003e|Uint16Array)} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint16Array( array ), itemSize, normalized );\n\n\t\tthis.isFloat16BufferAttribute = true;\n\n\t}\n\n\tgetX( index ) {\n\n\t\tlet x = fromHalfFloat( this.array[ index * this.itemSize ] );\n\n\t\tif ( this.normalized ) x = denormalize( x, this.array );\n\n\t\treturn x;\n\n\t}\n\n\tsetX( index, x ) {\n\n\t\tif ( this.normalized ) x = normalize( x, this.array );\n\n\t\tthis.array[ index * this.itemSize ] = toHalfFloat( x );\n\n\t\treturn this;\n\n\t}\n\n\tgetY( index ) {\n\n\t\tlet y = fromHalfFloat( this.array[ index * this.itemSize + 1 ] );\n\n\t\tif ( this.normalized ) y = denormalize( y, this.array );\n\n\t\treturn y;\n\n\t}\n\n\tsetY( index, y ) {\n\n\t\tif ( this.normalized ) y = normalize( y, this.array );\n\n\t\tthis.array[ index * this.itemSize + 1 ] = toHalfFloat( y );\n\n\t\treturn this;\n\n\t}\n\n\tgetZ( index ) {\n\n\t\tlet z = fromHalfFloat( this.array[ index * this.itemSize + 2 ] );\n\n\t\tif ( this.normalized ) z = denormalize( z, this.array );\n\n\t\treturn z;\n\n\t}\n\n\tsetZ( index, z ) {\n\n\t\tif ( this.normalized ) z = normalize( z, this.array );\n\n\t\tthis.array[ index * this.itemSize + 2 ] = toHalfFloat( z );\n\n\t\treturn this;\n\n\t}\n\n\tgetW( index ) {\n\n\t\tlet w = fromHalfFloat( this.array[ index * this.itemSize + 3 ] );\n\n\t\tif ( this.normalized ) w = denormalize( w, this.array );\n\n\t\treturn w;\n\n\t}\n\n\tsetW( index, w ) {\n\n\t\tif ( this.normalized ) w = normalize( w, this.array );\n\n\t\tthis.array[ index * this.itemSize + 3 ] = toHalfFloat( w );\n\n\t\treturn this;\n\n\t}\n\n\tsetXY( index, x, y ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = toHalfFloat( x );\n\t\tthis.array[ index + 1 ] = toHalfFloat( y );\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZ( index, x, y, z ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = toHalfFloat( x );\n\t\tthis.array[ index + 1 ] = toHalfFloat( y );\n\t\tthis.array[ index + 2 ] = toHalfFloat( z );\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZW( index, x, y, z, w ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\t\t\tw = normalize( w, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = toHalfFloat( x );\n\t\tthis.array[ index + 1 ] = toHalfFloat( y );\n\t\tthis.array[ index + 2 ] = toHalfFloat( z );\n\t\tthis.array[ index + 3 ] = toHalfFloat( w );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * Convenient class that can be used when creating a `Float32` buffer attribute with\n * a plain `Array` instance.\n *\n * @augments BufferAttribute\n */\nclass Float32BufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {(Array\u003cnumber\u003e|Float32Array)} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Float32Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nlet _id$1 = 0;\n\nconst _m1 = /*@__PURE__*/ new Matrix4();\nconst _obj = /*@__PURE__*/ new Object3D();\nconst _offset = /*@__PURE__*/ new Vector3();\nconst _box$2 = /*@__PURE__*/ new Box3();\nconst _boxMorphTargets = /*@__PURE__*/ new Box3();\nconst _vector$8 = /*@__PURE__*/ new Vector3();\n\n/**\n * A representation of mesh, line, or point geometry. Includes vertex\n * positions, face indices, normals, colors, UVs, and custom attributes\n * within buffers, reducing the cost of passing all this data to the GPU.\n *\n * ```js\n * const geometry = new THREE.BufferGeometry();\n * // create a simple square shape. We duplicate the top left and bottom right\n * // vertices because each vertex needs to appear once per triangle.\n * const vertices = new Float32Array( [\n * \t-1.0, -1.0,  1.0, // v0\n * \t 1.0, -1.0,  1.0, // v1\n * \t 1.0,  1.0,  1.0, // v2\n *\n * \t 1.0,  1.0,  1.0, // v3\n * \t-1.0,  1.0,  1.0, // v4\n * \t-1.0, -1.0,  1.0  // v5\n * ] );\n * // itemSize = 3 because there are 3 values (components) per vertex\n * geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );\n * const material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );\n * const mesh = new THREE.Mesh( geometry, material );\n * ```\n *\n * @augments EventDispatcher\n */\nclass BufferGeometry extends EventDispatcher {\n\n\t/**\n\t * Constructs a new geometry.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isBufferGeometry = true;\n\n\t\t/**\n\t\t * The ID of the geometry.\n\t\t *\n\t\t * @name BufferGeometry#id\n\t\t * @type {number}\n\t\t * @readonly\n\t\t */\n\t\tObject.defineProperty( this, 'id', { value: _id$1 ++ } );\n\n\t\t/**\n\t\t * The UUID of the geometry.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.uuid = generateUUID();\n\n\t\t/**\n\t\t * The name of the geometry.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\t\tthis.type = 'BufferGeometry';\n\n\t\t/**\n\t\t * Allows for vertices to be re-used across multiple triangles; this is\n\t\t * called using \"indexed triangles\". Each triangle is associated with the\n\t\t * indices of three vertices. This attribute therefore stores the index of\n\t\t * each vertex for each triangular face. If this attribute is not set, the\n\t\t * renderer assumes that each three contiguous positions represent a single triangle.\n\t\t *\n\t\t * @type {?BufferAttribute}\n\t\t * @default null\n\t\t */\n\t\tthis.index = null;\n\n\t\t/**\n\t\t * A (storage) buffer attribute which was generated with a compute shader and\n\t\t * now defines indirect draw calls.\n\t\t *\n\t\t * Can only be used with {@link WebGPURenderer} and a WebGPU backend.\n\t\t *\n\t\t * @type {?BufferAttribute}\n\t\t * @default null\n\t\t */\n\t\tthis.indirect = null;\n\n\t\t/**\n\t\t * The offset, in bytes, into the indirect drawing buffer where the value data begins. If an array is provided, multiple indirect draw calls will be made for each offset.\n\t\t *\n\t\t * Can only be used with {@link WebGPURenderer} and a WebGPU backend.\n\t\t *\n\t\t * @type {number|Array\u003cnumber\u003e}\n\t\t * @default 0\n\t\t */\n\t\tthis.indirectOffset = 0;\n\n\t\t/**\n\t\t * This dictionary has as id the name of the attribute to be set and as value\n\t\t * the buffer attribute to set it to. Rather than accessing this property directly,\n\t\t * use `setAttribute()` and `getAttribute()` to access attributes of this geometry.\n\t\t *\n\t\t * @type {Object\u003cstring,(BufferAttribute|InterleavedBufferAttribute)\u003e}\n\t\t */\n\t\tthis.attributes = {};\n\n\t\t/**\n\t\t * This dictionary holds the morph targets of the geometry.\n\t\t *\n\t\t * Note: Once the geometry has been rendered, the morph attribute data cannot\n\t\t * be changed. You will have to call `dispose()`, and create a new geometry instance.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.morphAttributes = {};\n\n\t\t/**\n\t\t * Used to control the morph target behavior; when set to `true`, the morph\n\t\t * target data is treated as relative offsets, rather than as absolute\n\t\t * positions/normals.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.morphTargetsRelative = false;\n\n\t\t/**\n\t\t * Split the geometry into groups, each of which will be rendered in a\n\t\t * separate draw call. This allows an array of materials to be used with the geometry.\n\t\t *\n\t\t * Use `addGroup()` and `clearGroups()` to edit groups, rather than modifying this array directly.\n\t\t *\n\t\t * Every vertex and index must belong to exactly one group — groups must not share vertices or\n\t\t * indices, and must not leave vertices or indices unused.\n\t\t *\n\t\t * @type {Array\u003cObject\u003e}\n\t\t */\n\t\tthis.groups = [];\n\n\t\t/**\n\t\t * Bounding box for the geometry which can be calculated with `computeBoundingBox()`.\n\t\t *\n\t\t * @type {?Box3}\n\t\t * @default null\n\t\t */\n\t\tthis.boundingBox = null;\n\n\t\t/**\n\t\t * Bounding sphere for the geometry which can be calculated with `computeBoundingSphere()`.\n\t\t *\n\t\t * @type {?Sphere}\n\t\t * @default null\n\t\t */\n\t\tthis.boundingSphere = null;\n\n\t\t/**\n\t\t * Determines the part of the geometry to render. This should not be set directly,\n\t\t * instead use `setDrawRange()`.\n\t\t *\n\t\t * @type {{start:number,count:number}}\n\t\t */\n\t\tthis.drawRange = { start: 0, count: Infinity };\n\n\t\t/**\n\t\t * An object that can be used to store custom data about the geometry.\n\t\t * It should not hold references to functions as these will not be cloned.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.userData = {};\n\n\t}\n\n\t/**\n\t * Returns the index of this geometry.\n\t *\n\t * @return {?BufferAttribute} The index. Returns `null` if no index is defined.\n\t */\n\tgetIndex() {\n\n\t\treturn this.index;\n\n\t}\n\n\t/**\n\t * Sets the given index to this geometry.\n\t *\n\t * @param {Array\u003cnumber\u003e|BufferAttribute} index - The index to set.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tsetIndex( index ) {\n\n\t\tif ( Array.isArray( index ) ) {\n\n\t\t\tthis.index = new ( arrayNeedsUint32( index ) ? Uint32BufferAttribute : Uint16BufferAttribute )( index, 1 );\n\n\t\t} else {\n\n\t\t\tthis.index = index;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given indirect attribute to this geometry.\n\t *\n\t * @param {BufferAttribute} indirect - The attribute holding indirect draw calls.\n\t * @param {number|Array\u003cnumber\u003e} [indirectOffset=0] - The offset, in bytes, into the indirect drawing buffer where the value data begins. If an array is provided, multiple indirect draw calls will be made for each offset.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tsetIndirect( indirect, indirectOffset = 0 ) {\n\n\t\tthis.indirect = indirect;\n\t\tthis.indirectOffset = indirectOffset;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the indirect attribute of this geometry.\n\t *\n\t * @return {?BufferAttribute} The indirect attribute. Returns `null` if no indirect attribute is defined.\n\t */\n\tgetIndirect() {\n\n\t\treturn this.indirect;\n\n\t}\n\n\t/**\n\t * Returns the buffer attribute for the given name.\n\t *\n\t * @param {string} name - The attribute name.\n\t * @return {BufferAttribute|InterleavedBufferAttribute|undefined} The buffer attribute.\n\t * Returns `undefined` if not attribute has been found.\n\t */\n\tgetAttribute( name ) {\n\n\t\treturn this.attributes[ name ];\n\n\t}\n\n\t/**\n\t * Sets the given attribute for the given name.\n\t *\n\t * @param {string} name - The attribute name.\n\t * @param {BufferAttribute|InterleavedBufferAttribute} attribute - The attribute to set.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tsetAttribute( name, attribute ) {\n\n\t\tthis.attributes[ name ] = attribute;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Deletes the attribute for the given name.\n\t *\n\t * @param {string} name - The attribute name to delete.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tdeleteAttribute( name ) {\n\n\t\tdelete this.attributes[ name ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this geometry has an attribute for the given name.\n\t *\n\t * @param {string} name - The attribute name.\n\t * @return {boolean} Whether this geometry has an attribute for the given name or not.\n\t */\n\thasAttribute( name ) {\n\n\t\treturn this.attributes[ name ] !== undefined;\n\n\t}\n\n\t/**\n\t * Adds a group to this geometry.\n\t *\n\t * @param {number} start - The first element in this draw call. That is the first\n\t * vertex for non-indexed geometry, otherwise the first triangle index.\n\t * @param {number} count - Specifies how many vertices (or indices) are part of this group.\n\t * @param {number} [materialIndex=0] - The material array index to use.\n\t */\n\taddGroup( start, count, materialIndex = 0 ) {\n\n\t\tthis.groups.push( {\n\n\t\t\tstart: start,\n\t\t\tcount: count,\n\t\t\tmaterialIndex: materialIndex\n\n\t\t} );\n\n\t}\n\n\t/**\n\t * Clears all groups.\n\t */\n\tclearGroups() {\n\n\t\tthis.groups = [];\n\n\t}\n\n\t/**\n\t * Sets the draw range for this geometry.\n\t *\n\t * @param {number} start - The first vertex for non-indexed geometry, otherwise the first triangle index.\n\t * @param {number} count - For non-indexed BufferGeometry, `count` is the number of vertices to render.\n\t * For indexed BufferGeometry, `count` is the number of indices to render.\n\t */\n\tsetDrawRange( start, count ) {\n\n\t\tthis.drawRange.start = start;\n\t\tthis.drawRange.count = count;\n\n\t}\n\n\t/**\n\t * Applies the given 4x4 transformation matrix to the geometry.\n\t *\n\t * @param {Matrix4} matrix - The matrix to apply.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tapplyMatrix4( matrix ) {\n\n\t\tconst position = this.attributes.position;\n\n\t\tif ( position !== undefined ) {\n\n\t\t\tposition.applyMatrix4( matrix );\n\n\t\t\tposition.needsUpdate = true;\n\n\t\t}\n\n\t\tconst normal = this.attributes.normal;\n\n\t\tif ( normal !== undefined ) {\n\n\t\t\tconst normalMatrix = new Matrix3().getNormalMatrix( matrix );\n\n\t\t\tnormal.applyNormalMatrix( normalMatrix );\n\n\t\t\tnormal.needsUpdate = true;\n\n\t\t}\n\n\t\tconst tangent = this.attributes.tangent;\n\n\t\tif ( tangent !== undefined ) {\n\n\t\t\ttangent.transformDirection( matrix );\n\n\t\t\ttangent.needsUpdate = true;\n\n\t\t}\n\n\t\tif ( this.boundingBox !== null ) {\n\n\t\t\tthis.computeBoundingBox();\n\n\t\t}\n\n\t\tif ( this.boundingSphere !== null ) {\n\n\t\t\tthis.computeBoundingSphere();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Applies the rotation represented by the Quaternion to the geometry.\n\t *\n\t * @param {Quaternion} q - The Quaternion to apply.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tapplyQuaternion( q ) {\n\n\t\t_m1.makeRotationFromQuaternion( q );\n\n\t\tthis.applyMatrix4( _m1 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Rotates the geometry about the X axis. This is typically done as a one time\n\t * operation, and not during a loop. Use {@link Object3D#rotation} for typical\n\t * real-time mesh rotation.\n\t *\n\t * @param {number} angle - The angle in radians.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\trotateX( angle ) {\n\n\t\t// rotate geometry around world x-axis\n\n\t\t_m1.makeRotationX( angle );\n\n\t\tthis.applyMatrix4( _m1 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Rotates the geometry about the Y axis. This is typically done as a one time\n\t * operation, and not during a loop. Use {@link Object3D#rotation} for typical\n\t * real-time mesh rotation.\n\t *\n\t * @param {number} angle - The angle in radians.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\trotateY( angle ) {\n\n\t\t// rotate geometry around world y-axis\n\n\t\t_m1.makeRotationY( angle );\n\n\t\tthis.applyMatrix4( _m1 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Rotates the geometry about the Z axis. This is typically done as a one time\n\t * operation, and not during a loop. Use {@link Object3D#rotation} for typical\n\t * real-time mesh rotation.\n\t *\n\t * @param {number} angle - The angle in radians.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\trotateZ( angle ) {\n\n\t\t// rotate geometry around world z-axis\n\n\t\t_m1.makeRotationZ( angle );\n\n\t\tthis.applyMatrix4( _m1 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Translates the geometry. This is typically done as a one time\n\t * operation, and not during a loop. Use {@link Object3D#position} for typical\n\t * real-time mesh rotation.\n\t *\n\t * @param {number} x - The x offset.\n\t * @param {number} y - The y offset.\n\t * @param {number} z - The z offset.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\ttranslate( x, y, z ) {\n\n\t\t// translate geometry\n\n\t\t_m1.makeTranslation( x, y, z );\n\n\t\tthis.applyMatrix4( _m1 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Scales the geometry. This is typically done as a one time\n\t * operation, and not during a loop. Use {@link Object3D#scale} for typical\n\t * real-time mesh rotation.\n\t *\n\t * @param {number} x - The x scale.\n\t * @param {number} y - The y scale.\n\t * @param {number} z - The z scale.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tscale( x, y, z ) {\n\n\t\t// scale geometry\n\n\t\t_m1.makeScale( x, y, z );\n\n\t\tthis.applyMatrix4( _m1 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Rotates the geometry to face a point in 3D space. This is typically done as a one time\n\t * operation, and not during a loop. Use {@link Object3D#lookAt} for typical\n\t * real-time mesh rotation.\n\t *\n\t * @param {Vector3} vector - The target point.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tlookAt( vector ) {\n\n\t\t_obj.lookAt( vector );\n\n\t\t_obj.updateMatrix();\n\n\t\tthis.applyMatrix4( _obj.matrix );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Center the geometry based on its bounding box.\n\t *\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tcenter() {\n\n\t\tthis.computeBoundingBox();\n\n\t\tthis.boundingBox.getCenter( _offset ).negate();\n\n\t\tthis.translate( _offset.x, _offset.y, _offset.z );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Defines a geometry by creating a `position` attribute based on the given array of points. The array\n\t * can hold 2D or 3D vectors. When using two-dimensional data, the `z` coordinate for all vertices is\n\t * set to `0`.\n\t *\n\t * If the method is used with an existing `position` attribute, the vertex data are overwritten with the\n\t * data from the array. The length of the array must match the vertex count.\n\t *\n\t * @param {Array\u003cVector2\u003e|Array\u003cVector3\u003e} points - The points.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tsetFromPoints( points ) {\n\n\t\tconst positionAttribute = this.getAttribute( 'position' );\n\n\t\tif ( positionAttribute === undefined ) {\n\n\t\t\tconst position = [];\n\n\t\t\tfor ( let i = 0, l = points.length; i \u003c l; i ++ ) {\n\n\t\t\t\tconst point = points[ i ];\n\t\t\t\tposition.push( point.x, point.y, point.z || 0 );\n\n\t\t\t}\n\n\t\t\tthis.setAttribute( 'position', new Float32BufferAttribute( position, 3 ) );\n\n\t\t} else {\n\n\t\t\tconst l = Math.min( points.length, positionAttribute.count ); // make sure data do not exceed buffer size\n\n\t\t\tfor ( let i = 0; i \u003c l; i ++ ) {\n\n\t\t\t\tconst point = points[ i ];\n\t\t\t\tpositionAttribute.setXYZ( i, point.x, point.y, point.z || 0 );\n\n\t\t\t}\n\n\t\t\tif ( points.length \u003e positionAttribute.count ) {\n\n\t\t\t\twarn( 'BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.' );\n\n\t\t\t}\n\n\t\t\tpositionAttribute.needsUpdate = true;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes the bounding box of the geometry, and updates the `boundingBox` member.\n\t * The bounding box is not computed by the engine; it must be computed by your app.\n\t * You may need to recompute the bounding box if the geometry vertices are modified.\n\t */\n\tcomputeBoundingBox() {\n\n\t\tif ( this.boundingBox === null ) {\n\n\t\t\tthis.boundingBox = new Box3();\n\n\t\t}\n\n\t\tconst position = this.attributes.position;\n\t\tconst morphAttributesPosition = this.morphAttributes.position;\n\n\t\tif ( position \u0026\u0026 position.isGLBufferAttribute ) {\n\n\t\t\terror( 'BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.', this );\n\n\t\t\tthis.boundingBox.set(\n\t\t\t\tnew Vector3( - Infinity, - Infinity, - Infinity ),\n\t\t\t\tnew Vector3( + Infinity, + Infinity, + Infinity )\n\t\t\t);\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( position !== undefined ) {\n\n\t\t\tthis.boundingBox.setFromBufferAttribute( position );\n\n\t\t\t// process morph attributes if present\n\n\t\t\tif ( morphAttributesPosition ) {\n\n\t\t\t\tfor ( let i = 0, il = morphAttributesPosition.length; i \u003c il; i ++ ) {\n\n\t\t\t\t\tconst morphAttribute = morphAttributesPosition[ i ];\n\t\t\t\t\t_box$2.setFromBufferAttribute( morphAttribute );\n\n\t\t\t\t\tif ( this.morphTargetsRelative ) {\n\n\t\t\t\t\t\t_vector$8.addVectors( this.boundingBox.min, _box$2.min );\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _vector$8 );\n\n\t\t\t\t\t\t_vector$8.addVectors( this.boundingBox.max, _box$2.max );\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _vector$8 );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _box$2.min );\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _box$2.max );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tthis.boundingBox.makeEmpty();\n\n\t\t}\n\n\t\tif ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) {\n\n\t\t\terror( 'BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.', this );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Computes the bounding sphere of the geometry, and updates the `boundingSphere` member.\n\t * The engine automatically computes the bounding sphere when it is needed, e.g., for ray casting or view frustum culling.\n\t * You may need to recompute the bounding sphere if the geometry vertices are modified.\n\t */\n\tcomputeBoundingSphere() {\n\n\t\tif ( this.boundingSphere === null ) {\n\n\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tconst position = this.attributes.position;\n\t\tconst morphAttributesPosition = this.morphAttributes.position;\n\n\t\tif ( position \u0026\u0026 position.isGLBufferAttribute ) {\n\n\t\t\terror( 'BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.', this );\n\n\t\t\tthis.boundingSphere.set( new Vector3(), Infinity );\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( position ) {\n\n\t\t\t// first, find the center of the bounding sphere\n\n\t\t\tconst center = this.boundingSphere.center;\n\n\t\t\t_box$2.setFromBufferAttribute( position );\n\n\t\t\t// process morph attributes if present\n\n\t\t\tif ( morphAttributesPosition ) {\n\n\t\t\t\tfor ( let i = 0, il = morphAttributesPosition.length; i \u003c il; i ++ ) {\n\n\t\t\t\t\tconst morphAttribute = morphAttributesPosition[ i ];\n\t\t\t\t\t_boxMorphTargets.setFromBufferAttribute( morphAttribute );\n\n\t\t\t\t\tif ( this.morphTargetsRelative ) {\n\n\t\t\t\t\t\t_vector$8.addVectors( _box$2.min, _boxMorphTargets.min );\n\t\t\t\t\t\t_box$2.expandByPoint( _vector$8 );\n\n\t\t\t\t\t\t_vector$8.addVectors( _box$2.max, _boxMorphTargets.max );\n\t\t\t\t\t\t_box$2.expandByPoint( _vector$8 );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_box$2.expandByPoint( _boxMorphTargets.min );\n\t\t\t\t\t\t_box$2.expandByPoint( _boxMorphTargets.max );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_box$2.getCenter( center );\n\n\t\t\t// second, try to find a boundingSphere with a radius smaller than the\n\t\t\t// boundingSphere of the boundingBox: sqrt(3) smaller in the best case\n\n\t\t\tlet maxRadiusSq = 0;\n\n\t\t\tfor ( let i = 0, il = position.count; i \u003c il; i ++ ) {\n\n\t\t\t\t_vector$8.fromBufferAttribute( position, i );\n\n\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector$8 ) );\n\n\t\t\t}\n\n\t\t\t// process morph attributes if present\n\n\t\t\tif ( morphAttributesPosition ) {\n\n\t\t\t\tfor ( let i = 0, il = morphAttributesPosition.length; i \u003c il; i ++ ) {\n\n\t\t\t\t\tconst morphAttribute = morphAttributesPosition[ i ];\n\t\t\t\t\tconst morphTargetsRelative = this.morphTargetsRelative;\n\n\t\t\t\t\tfor ( let j = 0, jl = morphAttribute.count; j \u003c jl; j ++ ) {\n\n\t\t\t\t\t\t_vector$8.fromBufferAttribute( morphAttribute, j );\n\n\t\t\t\t\t\tif ( morphTargetsRelative ) {\n\n\t\t\t\t\t\t\t_offset.fromBufferAttribute( position, j );\n\t\t\t\t\t\t\t_vector$8.add( _offset );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector$8 ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.boundingSphere.radius = Math.sqrt( maxRadiusSq );\n\n\t\t\tif ( isNaN( this.boundingSphere.radius ) ) {\n\n\t\t\t\terror( 'BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \"position\" attribute is likely to have NaN values.', this );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Calculates and adds a tangent attribute to this geometry.\n\t *\n\t * The computation is only supported for indexed geometries and if position, normal, and uv attributes\n\t * are defined. When using a tangent space normal map, prefer the MikkTSpace algorithm provided by\n\t * {@link BufferGeometryUtils#computeMikkTSpaceTangents} instead.\n\t */\n\tcomputeTangents() {\n\n\t\tconst index = this.index;\n\t\tconst attributes = this.attributes;\n\n\t\t// based on http://www.terathon.com/code/tangent.html\n\t\t// (per vertex tangents)\n\n\t\tif ( index === null ||\n\t\t\t attributes.position === undefined ||\n\t\t\t attributes.normal === undefined ||\n\t\t\t attributes.uv === undefined ) {\n\n\t\t\terror( 'BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst positionAttribute = attributes.position;\n\t\tconst normalAttribute = attributes.normal;\n\t\tconst uvAttribute = attributes.uv;\n\n\t\tif ( this.hasAttribute( 'tangent' ) === false ) {\n\n\t\t\tthis.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * positionAttribute.count ), 4 ) );\n\n\t\t}\n\n\t\tconst tangentAttribute = this.getAttribute( 'tangent' );\n\n\t\tconst tan1 = [], tan2 = [];\n\n\t\tfor ( let i = 0; i \u003c positionAttribute.count; i ++ ) {\n\n\t\t\ttan1[ i ] = new Vector3();\n\t\t\ttan2[ i ] = new Vector3();\n\n\t\t}\n\n\t\tconst vA = new Vector3(),\n\t\t\tvB = new Vector3(),\n\t\t\tvC = new Vector3(),\n\n\t\t\tuvA = new Vector2(),\n\t\t\tuvB = new Vector2(),\n\t\t\tuvC = new Vector2(),\n\n\t\t\tsdir = new Vector3(),\n\t\t\ttdir = new Vector3();\n\n\t\tfunction handleTriangle( a, b, c ) {\n\n\t\t\tvA.fromBufferAttribute( positionAttribute, a );\n\t\t\tvB.fromBufferAttribute( positionAttribute, b );\n\t\t\tvC.fromBufferAttribute( positionAttribute, c );\n\n\t\t\tuvA.fromBufferAttribute( uvAttribute, a );\n\t\t\tuvB.fromBufferAttribute( uvAttribute, b );\n\t\t\tuvC.fromBufferAttribute( uvAttribute, c );\n\n\t\t\tvB.sub( vA );\n\t\t\tvC.sub( vA );\n\n\t\t\tuvB.sub( uvA );\n\t\t\tuvC.sub( uvA );\n\n\t\t\tconst r = 1.0 / ( uvB.x * uvC.y - uvC.x * uvB.y );\n\n\t\t\t// silently ignore degenerate uv triangles having coincident or colinear vertices\n\n\t\t\tif ( ! isFinite( r ) ) return;\n\n\t\t\tsdir.copy( vB ).multiplyScalar( uvC.y ).addScaledVector( vC, - uvB.y ).multiplyScalar( r );\n\t\t\ttdir.copy( vC ).multiplyScalar( uvB.x ).addScaledVector( vB, - uvC.x ).multiplyScalar( r );\n\n\t\t\ttan1[ a ].add( sdir );\n\t\t\ttan1[ b ].add( sdir );\n\t\t\ttan1[ c ].add( sdir );\n\n\t\t\ttan2[ a ].add( tdir );\n\t\t\ttan2[ b ].add( tdir );\n\t\t\ttan2[ c ].add( tdir );\n\n\t\t}\n\n\t\tlet groups = this.groups;\n\n\t\tif ( groups.length === 0 ) {\n\n\t\t\tgroups = [ {\n\t\t\t\tstart: 0,\n\t\t\t\tcount: index.count\n\t\t\t} ];\n\n\t\t}\n\n\t\tfor ( let i = 0, il = groups.length; i \u003c il; ++ i ) {\n\n\t\t\tconst group = groups[ i ];\n\n\t\t\tconst start = group.start;\n\t\t\tconst count = group.count;\n\n\t\t\tfor ( let j = start, jl = start + count; j \u003c jl; j += 3 ) {\n\n\t\t\t\thandleTriangle(\n\t\t\t\t\tindex.getX( j + 0 ),\n\t\t\t\t\tindex.getX( j + 1 ),\n\t\t\t\t\tindex.getX( j + 2 )\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst tmp = new Vector3(), tmp2 = new Vector3();\n\t\tconst n = new Vector3(), n2 = new Vector3();\n\n\t\tfunction handleVertex( v ) {\n\n\t\t\tn.fromBufferAttribute( normalAttribute, v );\n\t\t\tn2.copy( n );\n\n\t\t\tconst t = tan1[ v ];\n\n\t\t\t// Gram-Schmidt orthogonalize\n\n\t\t\ttmp.copy( t );\n\t\t\ttmp.sub( n.multiplyScalar( n.dot( t ) ) ).normalize();\n\n\t\t\t// Calculate handedness\n\n\t\t\ttmp2.crossVectors( n2, t );\n\t\t\tconst test = tmp2.dot( tan2[ v ] );\n\t\t\tconst w = ( test \u003c 0.0 ) ? -1 : 1.0;\n\n\t\t\ttangentAttribute.setXYZW( v, tmp.x, tmp.y, tmp.z, w );\n\n\t\t}\n\n\t\tfor ( let i = 0, il = groups.length; i \u003c il; ++ i ) {\n\n\t\t\tconst group = groups[ i ];\n\n\t\t\tconst start = group.start;\n\t\t\tconst count = group.count;\n\n\t\t\tfor ( let j = start, jl = start + count; j \u003c jl; j += 3 ) {\n\n\t\t\t\thandleVertex( index.getX( j + 0 ) );\n\t\t\t\thandleVertex( index.getX( j + 1 ) );\n\t\t\t\thandleVertex( index.getX( j + 2 ) );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Computes vertex normals for the given vertex data. For indexed geometries, the method sets\n\t * each vertex normal to be the average of the face normals of the faces that share that vertex.\n\t * For non-indexed geometries, vertices are not shared, and the method sets each vertex normal\n\t * to be the same as the face normal.\n\t */\n\tcomputeVertexNormals() {\n\n\t\tconst index = this.index;\n\t\tconst positionAttribute = this.getAttribute( 'position' );\n\n\t\tif ( positionAttribute !== undefined ) {\n\n\t\t\tlet normalAttribute = this.getAttribute( 'normal' );\n\n\t\t\tif ( normalAttribute === undefined ) {\n\n\t\t\t\tnormalAttribute = new BufferAttribute( new Float32Array( positionAttribute.count * 3 ), 3 );\n\t\t\t\tthis.setAttribute( 'normal', normalAttribute );\n\n\t\t\t} else {\n\n\t\t\t\t// reset existing normals to zero\n\n\t\t\t\tfor ( let i = 0, il = normalAttribute.count; i \u003c il; i ++ ) {\n\n\t\t\t\t\tnormalAttribute.setXYZ( i, 0, 0, 0 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst pA = new Vector3(), pB = new Vector3(), pC = new Vector3();\n\t\t\tconst nA = new Vector3(), nB = new Vector3(), nC = new Vector3();\n\t\t\tconst cb = new Vector3(), ab = new Vector3();\n\n\t\t\t// indexed elements\n\n\t\t\tif ( index ) {\n\n\t\t\t\tfor ( let i = 0, il = index.count; i \u003c il; i += 3 ) {\n\n\t\t\t\t\tconst vA = index.getX( i + 0 );\n\t\t\t\t\tconst vB = index.getX( i + 1 );\n\t\t\t\t\tconst vC = index.getX( i + 2 );\n\n\t\t\t\t\tpA.fromBufferAttribute( positionAttribute, vA );\n\t\t\t\t\tpB.fromBufferAttribute( positionAttribute, vB );\n\t\t\t\t\tpC.fromBufferAttribute( positionAttribute, vC );\n\n\t\t\t\t\tcb.subVectors( pC, pB );\n\t\t\t\t\tab.subVectors( pA, pB );\n\t\t\t\t\tcb.cross( ab );\n\n\t\t\t\t\tnA.fromBufferAttribute( normalAttribute, vA );\n\t\t\t\t\tnB.fromBufferAttribute( normalAttribute, vB );\n\t\t\t\t\tnC.fromBufferAttribute( normalAttribute, vC );\n\n\t\t\t\t\tnA.add( cb );\n\t\t\t\t\tnB.add( cb );\n\t\t\t\t\tnC.add( cb );\n\n\t\t\t\t\tnormalAttribute.setXYZ( vA, nA.x, nA.y, nA.z );\n\t\t\t\t\tnormalAttribute.setXYZ( vB, nB.x, nB.y, nB.z );\n\t\t\t\t\tnormalAttribute.setXYZ( vC, nC.x, nC.y, nC.z );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// non-indexed elements (unconnected triangle soup)\n\n\t\t\t\tfor ( let i = 0, il = positionAttribute.count; i \u003c il; i += 3 ) {\n\n\t\t\t\t\tpA.fromBufferAttribute( positionAttribute, i + 0 );\n\t\t\t\t\tpB.fromBufferAttribute( positionAttribute, i + 1 );\n\t\t\t\t\tpC.fromBufferAttribute( positionAttribute, i + 2 );\n\n\t\t\t\t\tcb.subVectors( pC, pB );\n\t\t\t\t\tab.subVectors( pA, pB );\n\t\t\t\t\tcb.cross( ab );\n\n\t\t\t\t\tnormalAttribute.setXYZ( i + 0, cb.x, cb.y, cb.z );\n\t\t\t\t\tnormalAttribute.setXYZ( i + 1, cb.x, cb.y, cb.z );\n\t\t\t\t\tnormalAttribute.setXYZ( i + 2, cb.x, cb.y, cb.z );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.normalizeNormals();\n\n\t\t\tnormalAttribute.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Ensures every normal vector in a geometry will have a magnitude of `1`. This will\n\t * correct lighting on the geometry surfaces.\n\t */\n\tnormalizeNormals() {\n\n\t\tconst normals = this.attributes.normal;\n\n\t\tfor ( let i = 0, il = normals.count; i \u003c il; i ++ ) {\n\n\t\t\t_vector$8.fromBufferAttribute( normals, i );\n\n\t\t\t_vector$8.normalize();\n\n\t\t\tnormals.setXYZ( i, _vector$8.x, _vector$8.y, _vector$8.z );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Return a new non-index version of this indexed geometry. If the geometry\n\t * is already non-indexed, the method is a NOOP.\n\t *\n\t * @return {BufferGeometry} The non-indexed version of this indexed geometry.\n\t */\n\ttoNonIndexed() {\n\n\t\tfunction convertBufferAttribute( attribute, indices ) {\n\n\t\t\tconst array = attribute.array;\n\t\t\tconst itemSize = attribute.itemSize;\n\t\t\tconst normalized = attribute.normalized;\n\n\t\t\tconst array2 = new array.constructor( indices.length * itemSize );\n\n\t\t\tlet index = 0, index2 = 0;\n\n\t\t\tfor ( let i = 0, l = indices.length; i \u003c l; i ++ ) {\n\n\t\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\t\tindex = indices[ i ] * attribute.data.stride + attribute.offset;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tindex = indices[ i ] * itemSize;\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let j = 0; j \u003c itemSize; j ++ ) {\n\n\t\t\t\t\tarray2[ index2 ++ ] = array[ index ++ ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn new BufferAttribute( array2, itemSize, normalized );\n\n\t\t}\n\n\t\t//\n\n\t\tif ( this.index === null ) {\n\n\t\t\twarn( 'BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.' );\n\t\t\treturn this;\n\n\t\t}\n\n\t\tconst geometry2 = new BufferGeometry();\n\n\t\tconst indices = this.index.array;\n\t\tconst attributes = this.attributes;\n\n\t\t// attributes\n\n\t\tfor ( const name in attributes ) {\n\n\t\t\tconst attribute = attributes[ name ];\n\n\t\t\tconst newAttribute = convertBufferAttribute( attribute, indices );\n\n\t\t\tgeometry2.setAttribute( name, newAttribute );\n\n\t\t}\n\n\t\t// morph attributes\n\n\t\tconst morphAttributes = this.morphAttributes;\n\n\t\tfor ( const name in morphAttributes ) {\n\n\t\t\tconst morphArray = [];\n\t\t\tconst morphAttribute = morphAttributes[ name ]; // morphAttribute: array of Float32BufferAttributes\n\n\t\t\tfor ( let i = 0, il = morphAttribute.length; i \u003c il; i ++ ) {\n\n\t\t\t\tconst attribute = morphAttribute[ i ];\n\n\t\t\t\tconst newAttribute = convertBufferAttribute( attribute, indices );\n\n\t\t\t\tmorphArray.push( newAttribute );\n\n\t\t\t}\n\n\t\t\tgeometry2.morphAttributes[ name ] = morphArray;\n\n\t\t}\n\n\t\tgeometry2.morphTargetsRelative = this.morphTargetsRelative;\n\n\t\t// groups\n\n\t\tconst groups = this.groups;\n\n\t\tfor ( let i = 0, l = groups.length; i \u003c l; i ++ ) {\n\n\t\t\tconst group = groups[ i ];\n\t\t\tgeometry2.addGroup( group.start, group.count, group.materialIndex );\n\n\t\t}\n\n\t\treturn geometry2;\n\n\t}\n\n\t/**\n\t * Serializes the geometry into JSON.\n\t *\n\t * @return {Object} A JSON object representing the serialized geometry.\n\t */\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.7,\n\t\t\t\ttype: 'BufferGeometry',\n\t\t\t\tgenerator: 'BufferGeometry.toJSON'\n\t\t\t}\n\t\t};\n\n\t\t// standard BufferGeometry serialization\n\n\t\tdata.uuid = this.uuid;\n\t\tdata.type = this.type;\n\t\tif ( this.name !== '' ) data.name = this.name;\n\t\tif ( Object.keys( this.userData ).length \u003e 0 ) data.userData = this.userData;\n\n\t\tif ( this.parameters !== undefined ) {\n\n\t\t\tconst parameters = this.parameters;\n\n\t\t\tfor ( const key in parameters ) {\n\n\t\t\t\tif ( parameters[ key ] !== undefined ) data[ key ] = parameters[ key ];\n\n\t\t\t}\n\n\t\t\treturn data;\n\n\t\t}\n\n\t\t// for simplicity the code assumes attributes are not shared across geometries, see #15811\n\n\t\tdata.data = { attributes: {} };\n\n\t\tconst index = this.index;\n\n\t\tif ( index !== null ) {\n\n\t\t\tdata.data.index = {\n\t\t\t\ttype: index.array.constructor.name,\n\t\t\t\tarray: Array.prototype.slice.call( index.array )\n\t\t\t};\n\n\t\t}\n\n\t\tconst attributes = this.attributes;\n\n\t\tfor ( const key in attributes ) {\n\n\t\t\tconst attribute = attributes[ key ];\n\n\t\t\tdata.data.attributes[ key ] = attribute.toJSON( data.data );\n\n\t\t}\n\n\t\tconst morphAttributes = {};\n\t\tlet hasMorphAttributes = false;\n\n\t\tfor ( const key in this.morphAttributes ) {\n\n\t\t\tconst attributeArray = this.morphAttributes[ key ];\n\n\t\t\tconst array = [];\n\n\t\t\tfor ( let i = 0, il = attributeArray.length; i \u003c il; i ++ ) {\n\n\t\t\t\tconst attribute = attributeArray[ i ];\n\n\t\t\t\tarray.push( attribute.toJSON( data.data ) );\n\n\t\t\t}\n\n\t\t\tif ( array.length \u003e 0 ) {\n\n\t\t\t\tmorphAttributes[ key ] = array;\n\n\t\t\t\thasMorphAttributes = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( hasMorphAttributes ) {\n\n\t\t\tdata.data.morphAttributes = morphAttributes;\n\t\t\tdata.data.morphTargetsRelative = this.morphTargetsRelative;\n\n\t\t}\n\n\t\tconst groups = this.groups;\n\n\t\tif ( groups.length \u003e 0 ) {\n\n\t\t\tdata.data.groups = JSON.parse( JSON.stringify( groups ) );\n\n\t\t}\n\n\t\tconst boundingSphere = this.boundingSphere;\n\n\t\tif ( boundingSphere !== null ) {\n\n\t\t\tdata.data.boundingSphere = boundingSphere.toJSON();\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\t/**\n\t * Returns a new geometry with copied values from this instance.\n\t *\n\t * @return {BufferGeometry} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Copies the values of the given geometry to this instance.\n\t *\n\t * @param {BufferGeometry} source - The geometry to copy.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tcopy( source ) {\n\n\t\t// reset\n\n\t\tthis.index = null;\n\t\tthis.attributes = {};\n\t\tthis.morphAttributes = {};\n\t\tthis.groups = [];\n\t\tthis.boundingBox = null;\n\t\tthis.boundingSphere = null;\n\n\t\t// used for storing cloned, shared data\n\n\t\tconst data = {};\n\n\t\t// name\n\n\t\tthis.name = source.name;\n\n\t\t// index\n\n\t\tconst index = source.index;\n\n\t\tif ( index !== null ) {\n\n\t\t\tthis.setIndex( index.clone() );\n\n\t\t}\n\n\t\t// attributes\n\n\t\tconst attributes = source.attributes;\n\n\t\tfor ( const name in attributes ) {\n\n\t\t\tconst attribute = attributes[ name ];\n\t\t\tthis.setAttribute( name, attribute.clone( data ) );\n\n\t\t}\n\n\t\t// morph attributes\n\n\t\tconst morphAttributes = source.morphAttributes;\n\n\t\tfor ( const name in morphAttributes ) {\n\n\t\t\tconst array = [];\n\t\t\tconst morphAttribute = morphAttributes[ name ]; // morphAttribute: array of Float32BufferAttributes\n\n\t\t\tfor ( let i = 0, l = morphAttribute.length; i \u003c l; i ++ ) {\n\n\t\t\t\tarray.push( morphAttribute[ i ].clone( data ) );\n\n\t\t\t}\n\n\t\t\tthis.morphAttributes[ name ] = array;\n\n\t\t}\n\n\t\tthis.morphTargetsRelative = source.morphTargetsRelative;\n\n\t\t// groups\n\n\t\tconst groups = source.groups;\n\n\t\tfor ( let i = 0, l = groups.length; i \u003c l; i ++ ) {\n\n\t\t\tconst group = groups[ i ];\n\t\t\tthis.addGroup( group.start, group.count, group.materialIndex );\n\n\t\t}\n\n\t\t// bounding box\n\n\t\tconst boundingBox = source.boundingBox;\n\n\t\tif ( boundingBox !== null ) {\n\n\t\t\tthis.boundingBox = boundingBox.clone();\n\n\t\t}\n\n\t\t// bounding sphere\n\n\t\tconst boundingSphere = source.boundingSphere;\n\n\t\tif ( boundingSphere !== null ) {\n\n\t\t\tthis.boundingSphere = boundingSphere.clone();\n\n\t\t}\n\n\t\t// draw range\n\n\t\tthis.drawRange.start = source.drawRange.start;\n\t\tthis.drawRange.count = source.drawRange.count;\n\n\t\t// user data\n\n\t\tthis.userData = source.userData;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t *\n\t * @fires BufferGeometry#dispose\n\t */\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n}\n\nconst _inverseMatrix$3 = /*@__PURE__*/ new Matrix4();\nconst _ray$3 = /*@__PURE__*/ new Ray();\nconst _sphere$6 = /*@__PURE__*/ new Sphere();\nconst _sphereHitAt = /*@__PURE__*/ new Vector3();\n\nconst _vA$1 = /*@__PURE__*/ new Vector3();\nconst _vB$1 = /*@__PURE__*/ new Vector3();\nconst _vC$1 = /*@__PURE__*/ new Vector3();\n\nconst _tempA = /*@__PURE__*/ new Vector3();\nconst _morphA = /*@__PURE__*/ new Vector3();\n\nconst _intersectionPoint = /*@__PURE__*/ new Vector3();\nconst _intersectionPointWorld = /*@__PURE__*/ new Vector3();\n\n/**\n * Class representing triangular polygon mesh based objects.\n *\n * ```js\n * const geometry = new THREE.BoxGeometry( 1, 1, 1 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const mesh = new THREE.Mesh( geometry, material );\n * scene.add( mesh );\n * ```\n *\n * @augments Object3D\n */\nclass Mesh extends Object3D {\n\n\t/**\n\t * Constructs a new mesh.\n\t *\n\t * @param {BufferGeometry} [geometry] - The mesh geometry.\n\t * @param {Material|Array\u003cMaterial\u003e} [material] - The mesh material.\n\t */\n\tconstructor( geometry = new BufferGeometry(), material = new MeshBasicMaterial() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMesh = true;\n\n\t\tthis.type = 'Mesh';\n\n\t\t/**\n\t\t * The mesh geometry.\n\t\t *\n\t\t * @type {BufferGeometry}\n\t\t */\n\t\tthis.geometry = geometry;\n\n\t\t/**\n\t\t * The mesh material.\n\t\t *\n\t\t * @type {Material|Array\u003cMaterial\u003e}\n\t\t * @default MeshBasicMaterial\n\t\t */\n\t\tthis.material = material;\n\n\t\t/**\n\t\t * A dictionary representing the morph targets in the geometry. The key is the\n\t\t * morph targets name, the value its attribute index. This member is `undefined`\n\t\t * by default and only set when morph targets are detected in the geometry.\n\t\t *\n\t\t * @type {Object\u003cstring,number\u003e|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.morphTargetDictionary = undefined;\n\n\t\t/**\n\t\t * An array of weights typically in the range `[0,1]` that specify how much of the morph\n\t\t * is applied. This member is `undefined` by default and only set when morph targets are\n\t\t * detected in the geometry.\n\t\t *\n\t\t * @type {Array\u003cnumber\u003e|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.morphTargetInfluences = undefined;\n\n\t\t/**\n\t\t * The number of instances of this mesh.\n\t\t * Can only be used with {@link WebGPURenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.count = 1;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tif ( source.morphTargetInfluences !== undefined ) {\n\n\t\t\tthis.morphTargetInfluences = source.morphTargetInfluences.slice();\n\n\t\t}\n\n\t\tif ( source.morphTargetDictionary !== undefined ) {\n\n\t\t\tthis.morphTargetDictionary = Object.assign( {}, source.morphTargetDictionary );\n\n\t\t}\n\n\t\tthis.material = Array.isArray( source.material ) ? source.material.slice() : source.material;\n\t\tthis.geometry = source.geometry;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the values of {@link Mesh#morphTargetDictionary} and {@link Mesh#morphTargetInfluences}\n\t * to make sure existing morph targets can influence this 3D object.\n\t */\n\tupdateMorphTargets() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst morphAttributes = geometry.morphAttributes;\n\t\tconst keys = Object.keys( morphAttributes );\n\n\t\tif ( keys.length \u003e 0 ) {\n\n\t\t\tconst morphAttribute = morphAttributes[ keys[ 0 ] ];\n\n\t\t\tif ( morphAttribute !== undefined ) {\n\n\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\tfor ( let m = 0, ml = morphAttribute.length; m \u003c ml; m ++ ) {\n\n\t\t\t\t\tconst name = morphAttribute[ m ].name || String( m );\n\n\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\tthis.morphTargetDictionary[ name ] = m;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns the local-space position of the vertex at the given index, taking into\n\t * account the current animation state of both morph targets and skinning.\n\t *\n\t * @param {number} index - The vertex index.\n\t * @param {Vector3} target - The target object that is used to store the method's result.\n\t * @return {Vector3} The vertex position in local space.\n\t */\n\tgetVertexPosition( index, target ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst position = geometry.attributes.position;\n\t\tconst morphPosition = geometry.morphAttributes.position;\n\t\tconst morphTargetsRelative = geometry.morphTargetsRelative;\n\n\t\ttarget.fromBufferAttribute( position, index );\n\n\t\tconst morphInfluences = this.morphTargetInfluences;\n\n\t\tif ( morphPosition \u0026\u0026 morphInfluences ) {\n\n\t\t\t_morphA.set( 0, 0, 0 );\n\n\t\t\tfor ( let i = 0, il = morphPosition.length; i \u003c il; i ++ ) {\n\n\t\t\t\tconst influence = morphInfluences[ i ];\n\t\t\t\tconst morphAttribute = morphPosition[ i ];\n\n\t\t\t\tif ( influence === 0 ) continue;\n\n\t\t\t\t_tempA.fromBufferAttribute( morphAttribute, index );\n\n\t\t\t\tif ( morphTargetsRelative ) {\n\n\t\t\t\t\t_morphA.addScaledVector( _tempA, influence );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_morphA.addScaledVector( _tempA.sub( target ), influence );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\ttarget.add( _morphA );\n\n\t\t}\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Computes intersection points between a casted ray and this line.\n\t *\n\t * @param {Raycaster} raycaster - The raycaster.\n\t * @param {Array\u003cObject\u003e} intersects - The target array that holds the intersection points.\n\t */\n\traycast( raycaster, intersects ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst material = this.material;\n\t\tconst matrixWorld = this.matrixWorld;\n\n\t\tif ( material === undefined ) return;\n\n\t\t// test with bounding sphere in world space\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere$6.copy( geometry.boundingSphere );\n\t\t_sphere$6.applyMatrix4( matrixWorld );\n\n\t\t// check distance from ray origin to bounding sphere\n\n\t\t_ray$3.copy( raycaster.ray ).recast( raycaster.near );\n\n\t\tif ( _sphere$6.containsPoint( _ray$3.origin ) === false ) {\n\n\t\t\tif ( _ray$3.intersectSphere( _sphere$6, _sphereHitAt ) === null ) return;\n\n\t\t\tif ( _ray$3.origin.distanceToSquared( _sphereHitAt ) \u003e ( raycaster.far - raycaster.near ) ** 2 ) return;\n\n\t\t}\n\n\t\t// convert ray to local space of mesh\n\n\t\t_inverseMatrix$3.copy( matrixWorld ).invert();\n\t\t_ray$3.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$3 );\n\n\t\t// test with bounding box in local space\n\n\t\tif ( geometry.boundingBox !== null ) {\n\n\t\t\tif ( _ray$3.intersectsBox( geometry.boundingBox ) === false ) return;\n\n\t\t}\n\n\t\t// test for intersections with geometry\n\n\t\tthis._computeIntersections( raycaster, intersects, _ray$3 );\n\n\t}\n\n\t_computeIntersections( raycaster, intersects, rayLocalSpace ) {\n\n\t\tlet intersection;\n\n\t\tconst geometry = this.geometry;\n\t\tconst material = this.material;\n\n\t\tconst index = geometry.index;\n\t\tconst position = geometry.attributes.position;\n\t\tconst uv = geometry.attributes.uv;\n\t\tconst uv1 = geometry.attributes.uv1;\n\t\tconst normal = geometry.attributes.normal;\n\t\tconst groups = geometry.groups;\n\t\tconst drawRange = geometry.drawRange;\n\n\t\tif ( index !== null ) {\n\n\t\t\t// indexed buffer geometry\n\n\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\tfor ( let i = 0, il = groups.length; i \u003c il; i ++ ) {\n\n\t\t\t\t\tconst group = groups[ i ];\n\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\tconst start = Math.max( group.start, drawRange.start );\n\t\t\t\t\tconst end = Math.min( index.count, Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ) );\n\n\t\t\t\t\tfor ( let j = start, jl = end; j \u003c jl; j += 3 ) {\n\n\t\t\t\t\t\tconst a = index.getX( j );\n\t\t\t\t\t\tconst b = index.getX( j + 1 );\n\t\t\t\t\t\tconst c = index.getX( j + 2 );\n\n\t\t\t\t\t\tintersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\tintersection.faceIndex = Math.floor( j / 3 ); // triangle number in indexed buffer semantics\n\t\t\t\t\t\t\tintersection.face.materialIndex = group.materialIndex;\n\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\t\tconst end = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\t\tfor ( let i = start, il = end; i \u003c il; i += 3 ) {\n\n\t\t\t\t\tconst a = index.getX( i );\n\t\t\t\t\tconst b = index.getX( i + 1 );\n\t\t\t\t\tconst c = index.getX( i + 2 );\n\n\t\t\t\t\tintersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\tintersection.faceIndex = Math.floor( i / 3 ); // triangle number in indexed buffer semantics\n\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else if ( position !== undefined ) {\n\n\t\t\t// non-indexed buffer geometry\n\n\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\tfor ( let i = 0, il = groups.length; i \u003c il; i ++ ) {\n\n\t\t\t\t\tconst group = groups[ i ];\n\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\tconst start = Math.max( group.start, drawRange.start );\n\t\t\t\t\tconst end = Math.min( position.count, Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ) );\n\n\t\t\t\t\tfor ( let j = start, jl = end; j \u003c jl; j += 3 ) {\n\n\t\t\t\t\t\tconst a = j;\n\t\t\t\t\t\tconst b = j + 1;\n\t\t\t\t\t\tconst c = j + 2;\n\n\t\t\t\t\t\tintersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\tintersection.faceIndex = Math.floor( j / 3 ); // triangle number in non-indexed buffer semantics\n\t\t\t\t\t\t\tintersection.face.materialIndex = group.materialIndex;\n\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\t\tconst end = Math.min( position.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\t\tfor ( let i = start, il = end; i \u003c il; i += 3 ) {\n\n\t\t\t\t\tconst a = i;\n\t\t\t\t\tconst b = i + 1;\n\t\t\t\t\tconst c = i + 2;\n\n\t\t\t\t\tintersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\tintersection.faceIndex = Math.floor( i / 3 ); // triangle number in non-indexed buffer semantics\n\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nfunction checkIntersection$1( object, material, raycaster, ray, pA, pB, pC, point ) {\n\n\tlet intersect;\n\n\tif ( material.side === BackSide ) {\n\n\t\tintersect = ray.intersectTriangle( pC, pB, pA, true, point );\n\n\t} else {\n\n\t\tintersect = ray.intersectTriangle( pA, pB, pC, ( material.side === FrontSide ), point );\n\n\t}\n\n\tif ( intersect === null ) return null;\n\n\t_intersectionPointWorld.copy( point );\n\t_intersectionPointWorld.applyMatrix4( object.matrixWorld );\n\n\tconst distance = raycaster.ray.origin.distanceTo( _intersectionPointWorld );\n\n\tif ( distance \u003c raycaster.near || distance \u003e raycaster.far ) return null;\n\n\treturn {\n\t\tdistance: distance,\n\t\tpoint: _intersectionPointWorld.clone(),\n\t\tobject: object\n\t};\n\n}\n\nfunction checkGeometryIntersection( object, material, raycaster, ray, uv, uv1, normal, a, b, c ) {\n\n\tobject.getVertexPosition( a, _vA$1 );\n\tobject.getVertexPosition( b, _vB$1 );\n\tobject.getVertexPosition( c, _vC$1 );\n\n\tconst intersection = checkIntersection$1( object, material, raycaster, ray, _vA$1, _vB$1, _vC$1, _intersectionPoint );\n\n\tif ( intersection ) {\n\n\t\tconst barycoord = new Vector3();\n\t\tTriangle.getBarycoord( _intersectionPoint, _vA$1, _vB$1, _vC$1, barycoord );\n\n\t\tif ( uv ) {\n\n\t\t\tintersection.uv = Triangle.getInterpolatedAttribute( uv, a, b, c, barycoord, new Vector2() );\n\n\t\t}\n\n\t\tif ( uv1 ) {\n\n\t\t\tintersection.uv1 = Triangle.getInterpolatedAttribute( uv1, a, b, c, barycoord, new Vector2() );\n\n\t\t}\n\n\t\tif ( normal ) {\n\n\t\t\tintersection.normal = Triangle.getInterpolatedAttribute( normal, a, b, c, barycoord, new Vector3() );\n\n\t\t\tif ( intersection.normal.dot( ray.direction ) \u003e 0 ) {\n\n\t\t\t\tintersection.normal.multiplyScalar( -1 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst face = {\n\t\t\ta: a,\n\t\t\tb: b,\n\t\t\tc: c,\n\t\t\tnormal: new Vector3(),\n\t\t\tmaterialIndex: 0\n\t\t};\n\n\t\tTriangle.getNormal( _vA$1, _vB$1, _vC$1, face.normal );\n\n\t\tintersection.face = face;\n\t\tintersection.barycoord = barycoord;\n\n\t}\n\n\treturn intersection;\n\n}\n\n/**\n * A geometry class for a rectangular cuboid with a given width, height, and depth.\n * On creation, the cuboid is centred on the origin, with each edge parallel to one\n * of the axes.\n *\n * ```js\n * const geometry = new THREE.BoxGeometry( 1, 1, 1 );\n * const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );\n * const cube = new THREE.Mesh( geometry, material );\n * scene.add( cube );\n * ```\n *\n * @augments BufferGeometry\n * @demo scenes/geometry-browser.html#BoxGeometry\n */\nclass BoxGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new box geometry.\n\t *\n\t * @param {number} [width=1] - The width. That is, the length of the edges parallel to the X axis.\n\t * @param {number} [height=1] - The height. That is, the length of the edges parallel to the Y axis.\n\t * @param {number} [depth=1] - The depth. That is, the length of the edges parallel to the Z axis.\n\t * @param {number} [widthSegments=1] - Number of segmented rectangular faces along the width of the sides.\n\t * @param {number} [heightSegments=1] - Number of segmented rectangular faces along the height of the sides.\n\t * @param {number} [depthSegments=1] - Number of segmented rectangular faces along the depth of the sides.\n\t */\n\tconstructor( width = 1, height = 1, depth = 1, widthSegments = 1, heightSegments = 1, depthSegments = 1 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'BoxGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\twidth: width,\n\t\t\theight: height,\n\t\t\tdepth: depth,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\tdepthSegments: depthSegments\n\t\t};\n\n\t\tconst scope = this;\n\n\t\t// segments\n\n\t\twidthSegments = Math.floor( widthSegments );\n\t\theightSegments = Math.floor( heightSegments );\n\t\tdepthSegments = Math.floor( depthSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tlet numberOfVertices = 0;\n\t\tlet groupStart = 0;\n\n\t\t// build each side of the box geometry\n\n\t\tbuildPlane( 'z', 'y', 'x', -1, -1, depth, height, width, depthSegments, heightSegments, 0 ); // px\n\t\tbuildPlane( 'z', 'y', 'x', 1, -1, depth, height, - width, depthSegments, heightSegments, 1 ); // nx\n\t\tbuildPlane( 'x', 'z', 'y', 1, 1, width, depth, height, widthSegments, depthSegments, 2 ); // py\n\t\tbuildPlane( 'x', 'z', 'y', 1, -1, width, depth, - height, widthSegments, depthSegments, 3 ); // ny\n\t\tbuildPlane( 'x', 'y', 'z', 1, -1, width, height, depth, widthSegments, heightSegments, 4 ); // pz\n\t\tbuildPlane( 'x', 'y', 'z', -1, -1, width, height, - depth, widthSegments, heightSegments, 5 ); // nz\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\tfunction buildPlane( u, v, w, udir, vdir, width, height, depth, gridX, gridY, materialIndex ) {\n\n\t\t\tconst segmentWidth = width / gridX;\n\t\t\tconst segmentHeight = height / gridY;\n\n\t\t\tconst widthHalf = width / 2;\n\t\t\tconst heightHalf = height / 2;\n\t\t\tconst depthHalf = depth / 2;\n\n\t\t\tconst gridX1 = gridX + 1;\n\t\t\tconst gridY1 = gridY + 1;\n\n\t\t\tlet vertexCounter = 0;\n\t\t\tlet groupCount = 0;\n\n\t\t\tconst vector = new Vector3();\n\n\t\t\t// generate vertices, normals and uvs\n\n\t\t\tfor ( let iy = 0; iy \u003c gridY1; iy ++ ) {\n\n\t\t\t\tconst y = iy * segmentHeight - heightHalf;\n\n\t\t\t\tfor ( let ix = 0; ix \u003c gridX1; ix ++ ) {\n\n\t\t\t\t\tconst x = ix * segmentWidth - widthHalf;\n\n\t\t\t\t\t// set values to correct vector component\n\n\t\t\t\t\tvector[ u ] = x * udir;\n\t\t\t\t\tvector[ v ] = y * vdir;\n\t\t\t\t\tvector[ w ] = depthHalf;\n\n\t\t\t\t\t// now apply vector to vertex buffer\n\n\t\t\t\t\tvertices.push( vector.x, vector.y, vector.z );\n\n\t\t\t\t\t// set values to correct vector component\n\n\t\t\t\t\tvector[ u ] = 0;\n\t\t\t\t\tvector[ v ] = 0;\n\t\t\t\t\tvector[ w ] = depth \u003e 0 ? 1 : -1;\n\n\t\t\t\t\t// now apply vector to normal buffer\n\n\t\t\t\t\tnormals.push( vector.x, vector.y, vector.z );\n\n\t\t\t\t\t// uvs\n\n\t\t\t\t\tuvs.push( ix / gridX );\n\t\t\t\t\tuvs.push( 1 - ( iy / gridY ) );\n\n\t\t\t\t\t// counters\n\n\t\t\t\t\tvertexCounter += 1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// indices\n\n\t\t\t// 1. you need three indices to draw a single face\n\t\t\t// 2. a single segment consists of two faces\n\t\t\t// 3. so we need to generate six (2*3) indices per segment\n\n\t\t\tfor ( let iy = 0; iy \u003c gridY; iy ++ ) {\n\n\t\t\t\tfor ( let ix = 0; ix \u003c gridX; ix ++ ) {\n\n\t\t\t\t\tconst a = numberOfVertices + ix + gridX1 * iy;\n\t\t\t\t\tconst b = numberOfVertices + ix + gridX1 * ( iy + 1 );\n\t\t\t\t\tconst c = numberOfVertices + ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\t\t\tconst d = numberOfVertices + ( ix + 1 ) + gridX1 * iy;\n\n\t\t\t\t\t// faces\n\n\t\t\t\t\tindices.push( a, b, d );\n\t\t\t\t\tindices.push( b, c, d );\n\n\t\t\t\t\t// increase counter\n\n\t\t\t\t\tgroupCount += 6;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// add a group to the geometry. this will ensure multi material support\n\n\t\t\tscope.addGroup( groupStart, groupCount, materialIndex );\n\n\t\t\t// calculate new start value for groups\n\n\t\t\tgroupStart += groupCount;\n\n\t\t\t// update total number of vertices\n\n\t\t\tnumberOfVertices += vertexCounter;\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {BoxGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new BoxGeometry( data.width, data.height, data.depth, data.widthSegments, data.heightSegments, data.depthSegments );\n\n\t}\n\n}\n\n/**\n * Provides utility functions for managing uniforms.\n *\n * @module UniformsUtils\n */\n\n/**\n * Clones the given uniform definitions by performing a deep-copy. That means\n * if the value of a uniform refers to an object like a Vector3 or Texture,\n * the cloned uniform will refer to a new object reference.\n *\n * @param {Object} src - An object representing uniform definitions.\n * @return {Object} The cloned uniforms.\n */\nfunction cloneUniforms( src ) {\n\n\tconst dst = {};\n\n\tfor ( const u in src ) {\n\n\t\tdst[ u ] = {};\n\n\t\tfor ( const p in src[ u ] ) {\n\n\t\t\tconst property = src[ u ][ p ];\n\n\t\t\tif ( property \u0026\u0026 ( property.isColor ||\n\t\t\t\tproperty.isMatrix3 || property.isMatrix4 ||\n\t\t\t\tproperty.isVector2 || property.isVector3 || property.isVector4 ||\n\t\t\t\tproperty.isTexture || property.isQuaternion ) ) {\n\n\t\t\t\tif ( property.isRenderTargetTexture ) {\n\n\t\t\t\t\twarn( 'UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().' );\n\t\t\t\t\tdst[ u ][ p ] = null;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tdst[ u ][ p ] = property.clone();\n\n\t\t\t\t}\n\n\t\t\t} else if ( Array.isArray( property ) ) {\n\n\t\t\t\tdst[ u ][ p ] = property.slice();\n\n\t\t\t} else {\n\n\t\t\t\tdst[ u ][ p ] = property;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn dst;\n\n}\n\n/**\n * Merges the given uniform definitions into a single object. Since the\n * method internally uses cloneUniforms(), it performs a deep-copy when\n * producing the merged uniform definitions.\n *\n * @param {Array} uniforms - An array of objects containing uniform definitions.\n * @return {Object} The merged uniforms.\n */\nfunction mergeUniforms( uniforms ) {\n\n\tconst merged = {};\n\n\tfor ( let u = 0; u \u003c uniforms.length; u ++ ) {\n\n\t\tconst tmp = cloneUniforms( uniforms[ u ] );\n\n\t\tfor ( const p in tmp ) {\n\n\t\t\tmerged[ p ] = tmp[ p ];\n\n\t\t}\n\n\t}\n\n\treturn merged;\n\n}\n\nfunction cloneUniformsGroups( src ) {\n\n\tconst dst = [];\n\n\tfor ( let u = 0; u \u003c src.length; u ++ ) {\n\n\t\tdst.push( src[ u ].clone() );\n\n\t}\n\n\treturn dst;\n\n}\n\nfunction getUnlitUniformColorSpace( renderer ) {\n\n\tconst currentRenderTarget = renderer.getRenderTarget();\n\n\tif ( currentRenderTarget === null ) {\n\n\t\t// https://github.com/mrdoob/three.js/pull/23937#issuecomment-1111067398\n\t\treturn renderer.outputColorSpace;\n\n\t}\n\n\t// https://github.com/mrdoob/three.js/issues/27868\n\tif ( currentRenderTarget.isXRRenderTarget === true ) {\n\n\t\treturn currentRenderTarget.texture.colorSpace;\n\n\t}\n\n\treturn ColorManagement.workingColorSpace;\n\n}\n\n// Legacy\n\nconst UniformsUtils = { clone: cloneUniforms, merge: mergeUniforms };\n\nvar default_vertex = \"void main() {\\n\\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n}\";\n\nvar default_fragment = \"void main() {\\n\\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\\n}\";\n\n/**\n * A material rendered with custom shaders. A shader is a small program written in GLSL.\n * that runs on the GPU. You may want to use a custom shader if you need to implement an\n * effect not included with any of the built-in materials.\n *\n * There are the following notes to bear in mind when using a `ShaderMaterial`:\n *\n * - `ShaderMaterial` can only be used with {@link WebGLRenderer}.\n * - Built in attributes and uniforms are passed to the shaders along with your code. If\n * you don't want that, use {@link RawShaderMaterial} instead.\n * - You can use the directive `#pragma unroll_loop_start` and `#pragma unroll_loop_end`\n * in order to unroll a `for` loop in GLSL by the shader preprocessor. The directive has\n * to be placed right above the loop. The loop formatting has to correspond to a defined standard.\n *   - The loop has to be [normalized](https://en.wikipedia.org/wiki/Normalized_loop).\n *   - The loop variable has to be *i*.\n *   - The value `UNROLLED_LOOP_INDEX` will be replaced with the explicitly\n * value of *i* for the given iteration and can be used in preprocessor\n * statements.\n *\n * ```js\n * const material = new THREE.ShaderMaterial( {\n * \tuniforms: {\n * \t\ttime: { value: 1.0 },\n * \t\tresolution: { value: new THREE.Vector2() }\n * \t},\n * \tvertexShader: document.getElementById( 'vertexShader' ).textContent,\n * \tfragmentShader: document.getElementById( 'fragmentShader' ).textContent\n * } );\n * ```\n *\n * @augments Material\n */\nclass ShaderMaterial extends Material {\n\n\t/**\n\t * Constructs a new shader material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isShaderMaterial = true;\n\n\t\tthis.type = 'ShaderMaterial';\n\n\t\t/**\n\t\t * Defines custom constants using `#define` directives within the GLSL code\n\t\t * for both the vertex shader and the fragment shader; each key/value pair\n\t\t * yields another directive.\n\t\t * ```js\n\t\t * defines: {\n\t\t * \tFOO: 15,\n\t\t * \tBAR: true\n\t\t * }\n\t\t * ```\n\t\t * Yields the lines:\n\t\t * ```\n\t\t * #define FOO 15\n\t\t * #define BAR true\n\t\t * ```\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.defines = {};\n\n\t\t/**\n\t\t * An object of the form:\n\t\t * ```js\n\t\t * {\n\t\t * \t\"uniform1\": { value: 1.0 },\n\t\t * \t\"uniform2\": { value: 2 }\n\t\t * }\n\t\t * ```\n\t\t * specifying the uniforms to be passed to the shader code; keys are uniform\n\t\t * names, values are definitions of the form\n\t\t * ```\n\t\t * {\n\t\t * \tvalue: 1.0\n\t\t * }\n\t\t * ```\n\t\t * where `value` is the value of the uniform. Names must match the name of\n\t\t * the uniform, as defined in the GLSL code. Note that uniforms are refreshed\n\t\t * on every frame, so updating the value of the uniform will immediately\n\t\t * update the value available to the GLSL code.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.uniforms = {};\n\n\t\t/**\n\t\t * An array holding uniforms groups for configuring UBOs.\n\t\t *\n\t\t * @type {Array\u003cUniformsGroup\u003e}\n\t\t */\n\t\tthis.uniformsGroups = [];\n\n\t\t/**\n\t\t * Vertex shader GLSL code. This is the actual code for the shader.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.vertexShader = default_vertex;\n\n\t\t/**\n\t\t * Fragment shader GLSL code. This is the actual code for the shader.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.fragmentShader = default_fragment;\n\n\t\t/**\n\t\t * Controls line thickness or lines.\n\t\t *\n\t\t * WebGL and WebGPU ignore this setting and always render line primitives with a\n\t\t * width of one pixel.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.linewidth = 1;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * WebGL and WebGPU ignore this property and always render\n\t\t * 1 pixel wide lines.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\t/**\n\t\t * Defines whether the material color is affected by global fog settings; `true`\n\t\t * to pass fog uniforms to the shader.\n\t\t *\n\t\t * Setting this property to `true` requires the definition of fog uniforms. It is\n\t\t * recommended to use `UniformsUtils.merge()` to combine the custom shader uniforms\n\t\t * with predefined fog uniforms.\n\t\t *\n\t\t * ```js\n\t\t * const material = new ShaderMaterial( {\n\t\t *     uniforms: UniformsUtils.merge( [ UniformsLib[ 'fog' ], shaderUniforms ] );\n\t\t *     vertexShader: vertexShader,\n\t\t *     fragmentShader: fragmentShader,\n\t\t *     fog: true\n\t\t * } );\n\t\t * ```\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.fog = false;\n\n\t\t/**\n\t\t * Defines whether this material uses lighting; `true` to pass uniform data\n\t\t * related to lighting to this shader.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.lights = false;\n\n\t\t/**\n\t\t * Defines whether this material supports clipping; `true` to let the renderer\n\t\t * pass the clippingPlanes uniform.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.clipping = false;\n\n\t\t/**\n\t\t * Overwritten and set to `true` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.forceSinglePass = true;\n\n\t\t/**\n\t\t * This object allows to enable certain WebGL 2 extensions.\n\t\t *\n\t\t * - clipCullDistance: set to `true` to use vertex shader clipping\n\t\t * - multiDraw: set to `true` to use vertex shader multi_draw / enable gl_DrawID\n\t\t *\n\t\t * @type {{clipCullDistance:false,multiDraw:false}}\n\t\t */\n\t\tthis.extensions = {\n\t\t\tclipCullDistance: false, // set to use vertex shader clipping\n\t\t\tmultiDraw: false // set to use vertex shader multi_draw / enable gl_DrawID\n\t\t};\n\n\t\t/**\n\t\t * When the rendered geometry doesn't include these attributes but the\n\t\t * material does, these default values will be passed to the shaders. This\n\t\t * avoids errors when buffer data is missing.\n\t\t *\n\t\t * - color: [ 1, 1, 1 ]\n\t\t * - uv: [ 0, 0 ]\n\t\t * - uv1: [ 0, 0 ]\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.defaultAttributeValues = {\n\t\t\t'color': [ 1, 1, 1 ],\n\t\t\t'uv': [ 0, 0 ],\n\t\t\t'uv1': [ 0, 0 ]\n\t\t};\n\n\t\t/**\n\t\t * If set, this calls [gl.bindAttribLocation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bindAttribLocation)\n\t\t * to bind a generic vertex index to an attribute variable.\n\t\t *\n\t\t * @type {string|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.index0AttributeName = undefined;\n\n\t\t/**\n\t\t * Can be used to force a uniform update while changing uniforms in\n\t\t * {@link Object3D#onBeforeRender}.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.uniformsNeedUpdate = false;\n\n\t\t/**\n\t\t * Defines the GLSL version of custom shader code.\n\t\t *\n\t\t * @type {?(GLSL1|GLSL3)}\n\t\t * @default null\n\t\t */\n\t\tthis.glslVersion = null;\n\n\t\tif ( parameters !== undefined ) {\n\n\t\t\tthis.setValues( parameters );\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.fragmentShader = source.fragmentShader;\n\t\tthis.vertexShader = source.vertexShader;\n\n\t\tthis.uniforms = cloneUniforms( source.uniforms );\n\t\tthis.uniformsGroups = cloneUniformsGroups( source.uniformsGroups );\n\n\t\tthis.defines = Object.assign( {}, source.defines );\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\tthis.fog = source.fog;\n\t\tthis.lights = source.lights;\n\t\tthis.clipping = source.clipping;\n\n\t\tthis.extensions = Object.assign( {}, source.extensions );\n\n\t\tthis.glslVersion = source.glslVersion;\n\n\t\tthis.defaultAttributeValues = Object.assign( {}, source.defaultAttributeValues );\n\n\t\tthis.index0AttributeName = source.index0AttributeName;\n\n\t\tthis.uniformsNeedUpdate = source.uniformsNeedUpdate;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.glslVersion = this.glslVersion;\n\t\tdata.uniforms = {};\n\n\t\tfor ( const name in this.uniforms ) {\n\n\t\t\tconst uniform = this.uniforms[ name ];\n\t\t\tconst value = uniform.value;\n\n\t\t\tif ( value \u0026\u0026 value.isTexture ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 't',\n\t\t\t\t\tvalue: value.toJSON( meta ).uuid\n\t\t\t\t};\n\n\t\t\t} else if ( value \u0026\u0026 value.isColor ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'c',\n\t\t\t\t\tvalue: value.getHex()\n\t\t\t\t};\n\n\t\t\t} else if ( value \u0026\u0026 value.isVector2 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'v2',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value \u0026\u0026 value.isVector3 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'v3',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value \u0026\u0026 value.isVector4 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'v4',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value \u0026\u0026 value.isMatrix3 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'm3',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value \u0026\u0026 value.isMatrix4 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'm4',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\tvalue: value\n\t\t\t\t};\n\n\t\t\t\t// note: the array variants v2v, v3v, v4v, m4v and tv are not supported so far\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( Object.keys( this.defines ).length \u003e 0 ) data.defines = this.defines;\n\n\t\tdata.vertexShader = this.vertexShader;\n\t\tdata.fragmentShader = this.fragmentShader;\n\n\t\tdata.lights = this.lights;\n\t\tdata.clipping = this.clipping;\n\n\t\tconst extensions = {};\n\n\t\tfor ( const key in this.extensions ) {\n\n\t\t\tif ( this.extensions[ key ] === true ) extensions[ key ] = true;\n\n\t\t}\n\n\t\tif ( Object.keys( extensions ).length \u003e 0 ) data.extensions = extensions;\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * Abstract base class for cameras. This class should always be inherited\n * when you build a new camera.\n *\n * @abstract\n * @augments Object3D\n */\nclass Camera extends Object3D {\n\n\t/**\n\t * Constructs a new camera.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCamera = true;\n\n\t\tthis.type = 'Camera';\n\n\t\t/**\n\t\t * The inverse of the camera's world matrix.\n\t\t *\n\t\t * @type {Matrix4}\n\t\t */\n\t\tthis.matrixWorldInverse = new Matrix4();\n\n\t\t/**\n\t\t * The camera's projection matrix.\n\t\t *\n\t\t * @type {Matrix4}\n\t\t */\n\t\tthis.projectionMatrix = new Matrix4();\n\n\t\t/**\n\t\t * The inverse of the camera's projection matrix.\n\t\t *\n\t\t * @type {Matrix4}\n\t\t */\n\t\tthis.projectionMatrixInverse = new Matrix4();\n\n\t\t/**\n\t\t * The coordinate system in which the camera is used.\n\t\t *\n\t\t * @type {(WebGLCoordinateSystem|WebGPUCoordinateSystem)}\n\t\t */\n\t\tthis.coordinateSystem = WebGLCoordinateSystem;\n\n\t\tthis._reversedDepth = false;\n\n\t}\n\n\t/**\n\t * The flag that indicates whether the camera uses a reversed depth buffer.\n\t *\n\t * @type {boolean}\n\t * @default false\n\t */\n\tget reversedDepth() {\n\n\t\treturn this._reversedDepth;\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.matrixWorldInverse.copy( source.matrixWorldInverse );\n\n\t\tthis.projectionMatrix.copy( source.projectionMatrix );\n\t\tthis.projectionMatrixInverse.copy( source.projectionMatrixInverse );\n\n\t\tthis.coordinateSystem = source.coordinateSystem;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a vector representing the (\"look\") direction of the 3D object in world space.\n\t *\n\t * This method is overwritten since cameras have a different forward vector compared to other\n\t * 3D objects. A camera looks down its local, negative z-axis by default.\n\t *\n\t * @param {Vector3} target - The target vector the result is stored to.\n\t * @return {Vector3} The 3D object's direction in world space.\n\t */\n\tgetWorldDirection( target ) {\n\n\t\treturn super.getWorldDirection( target ).negate();\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tthis.matrixWorldInverse.copy( this.matrixWorld ).invert();\n\n\t}\n\n\tupdateWorldMatrix( updateParents, updateChildren ) {\n\n\t\tsuper.updateWorldMatrix( updateParents, updateChildren );\n\n\t\tthis.matrixWorldInverse.copy( this.matrixWorld ).invert();\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _v3$1 = /*@__PURE__*/ new Vector3();\nconst _minTarget = /*@__PURE__*/ new Vector2();\nconst _maxTarget = /*@__PURE__*/ new Vector2();\n\n/**\n * Camera that uses [perspective projection](https://en.wikipedia.org/wiki/Perspective_(graphical)).\n *\n * This projection mode is designed to mimic the way the human eye sees. It\n * is the most common projection mode used for rendering a 3D scene.\n *\n * ```js\n * const camera = new THREE.PerspectiveCamera( 45, width / height, 1, 1000 );\n * scene.add( camera );\n * ```\n *\n * @augments Camera\n */\nclass PerspectiveCamera extends Camera {\n\n\t/**\n\t * Constructs a new perspective camera.\n\t *\n\t * @param {number} [fov=50] - The vertical field of view.\n\t * @param {number} [aspect=1] - The aspect ratio.\n\t * @param {number} [near=0.1] - The camera's near plane.\n\t * @param {number} [far=2000] - The camera's far plane.\n\t */\n\tconstructor( fov = 50, aspect = 1, near = 0.1, far = 2000 ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isPerspectiveCamera = true;\n\n\t\tthis.type = 'PerspectiveCamera';\n\n\t\t/**\n\t\t * The vertical field of view, from bottom to top of view,\n\t\t * in degrees.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 50\n\t\t */\n\t\tthis.fov = fov;\n\n\t\t/**\n\t\t * The zoom factor of the camera.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.zoom = 1;\n\n\t\t/**\n\t\t * The camera's near plane. The valid range is greater than `0`\n\t\t * and less than the current value of {@link PerspectiveCamera#far}.\n\t\t *\n\t\t * Note that, unlike for the {@link OrthographicCamera}, `0` is \u003cem\u003enot\u003c/em\u003e a\n\t\t * valid value for a perspective camera's near plane.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0.1\n\t\t */\n\t\tthis.near = near;\n\n\t\t/**\n\t\t * The camera's far plane. Must be greater than the\n\t\t * current value of {@link PerspectiveCamera#near}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 2000\n\t\t */\n\t\tthis.far = far;\n\n\t\t/**\n\t\t * Object distance used for stereoscopy and depth-of-field effects. This\n\t\t * parameter does not influence the projection matrix unless a\n\t\t * {@link StereoCamera} is being used.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 10\n\t\t */\n\t\tthis.focus = 10;\n\n\t\t/**\n\t\t * The aspect ratio, usually the canvas width / canvas height.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.aspect = aspect;\n\n\t\t/**\n\t\t * Represents the frustum window specification. This property should not be edited\n\t\t * directly but via {@link PerspectiveCamera#setViewOffset} and {@link PerspectiveCamera#clearViewOffset}.\n\t\t *\n\t\t * @type {?Object}\n\t\t * @default null\n\t\t */\n\t\tthis.view = null;\n\n\t\t/**\n\t\t * Film size used for the larger axis. Default is `35` (millimeters). This\n\t\t * parameter does not influence the projection matrix unless {@link PerspectiveCamera#filmOffset}\n\t\t * is set to a nonzero value.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 35\n\t\t */\n\t\tthis.filmGauge = 35;\n\n\t\t/**\n\t\t * Horizontal off-center offset in the same unit as {@link PerspectiveCamera#filmGauge}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.filmOffset = 0;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.fov = source.fov;\n\t\tthis.zoom = source.zoom;\n\n\t\tthis.near = source.near;\n\t\tthis.far = source.far;\n\t\tthis.focus = source.focus;\n\n\t\tthis.aspect = source.aspect;\n\t\tthis.view = source.view === null ? null : Object.assign( {}, source.view );\n\n\t\tthis.filmGauge = source.filmGauge;\n\t\tthis.filmOffset = source.filmOffset;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the FOV by focal length in respect to the current {@link PerspectiveCamera#filmGauge}.\n\t *\n\t * The default film gauge is 35, so that the focal length can be specified for\n\t * a 35mm (full frame) camera.\n\t *\n\t * @param {number} focalLength - Values for focal length and film gauge must have the same unit.\n\t */\n\tsetFocalLength( focalLength ) {\n\n\t\t/** see {@link http://www.bobatkins.com/photography/technical/field_of_view.html} */\n\t\tconst vExtentSlope = 0.5 * this.getFilmHeight() / focalLength;\n\n\t\tthis.fov = RAD2DEG * 2 * Math.atan( vExtentSlope );\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\t/**\n\t * Returns the focal length from the current {@link PerspectiveCamera#fov} and\n\t * {@link PerspectiveCamera#filmGauge}.\n\t *\n\t * @return {number} The computed focal length.\n\t */\n\tgetFocalLength() {\n\n\t\tconst vExtentSlope = Math.tan( DEG2RAD * 0.5 * this.fov );\n\n\t\treturn 0.5 * this.getFilmHeight() / vExtentSlope;\n\n\t}\n\n\t/**\n\t * Returns the current vertical field of view angle in degrees considering {@link PerspectiveCamera#zoom}.\n\t *\n\t * @return {number} The effective FOV.\n\t */\n\tgetEffectiveFOV() {\n\n\t\treturn RAD2DEG * 2 * Math.atan(\n\t\t\tMath.tan( DEG2RAD * 0.5 * this.fov ) / this.zoom );\n\n\t}\n\n\t/**\n\t * Returns the width of the image on the film. If {@link PerspectiveCamera#aspect} is greater than or\n\t * equal to one (landscape format), the result equals {@link PerspectiveCamera#filmGauge}.\n\t *\n\t * @return {number} The film width.\n\t */\n\tgetFilmWidth() {\n\n\t\t// film not completely covered in portrait format (aspect \u003c 1)\n\t\treturn this.filmGauge * Math.min( this.aspect, 1 );\n\n\t}\n\n\t/**\n\t * Returns the height of the image on the film. If {@link PerspectiveCamera#aspect} is greater than or\n\t * equal to one (landscape format), the result equals {@link PerspectiveCamera#filmGauge}.\n\t *\n\t * @return {number} The film width.\n\t */\n\tgetFilmHeight() {\n\n\t\t// film not completely covered in landscape format (aspect \u003e 1)\n\t\treturn this.filmGauge / Math.max( this.aspect, 1 );\n\n\t}\n\n\t/**\n\t * Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction.\n\t * Sets `minTarget` and `maxTarget` to the coordinates of the lower-left and upper-right corners of the view rectangle.\n\t *\n\t * @param {number} distance - The viewing distance.\n\t * @param {Vector2} minTarget - The lower-left corner of the view rectangle is written into this vector.\n\t * @param {Vector2} maxTarget - The upper-right corner of the view rectangle is written into this vector.\n\t */\n\tgetViewBounds( distance, minTarget, maxTarget ) {\n\n\t\t_v3$1.set( -1, -1, 0.5 ).applyMatrix4( this.projectionMatrixInverse );\n\n\t\tminTarget.set( _v3$1.x, _v3$1.y ).multiplyScalar( - distance / _v3$1.z );\n\n\t\t_v3$1.set( 1, 1, 0.5 ).applyMatrix4( this.projectionMatrixInverse );\n\n\t\tmaxTarget.set( _v3$1.x, _v3$1.y ).multiplyScalar( - distance / _v3$1.z );\n\n\t}\n\n\t/**\n\t * Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction.\n\t *\n\t * @param {number} distance - The viewing distance.\n\t * @param {Vector2} target - The target vector that is used to store result where x is width and y is height.\n\t * @returns {Vector2} The view size.\n\t */\n\tgetViewSize( distance, target ) {\n\n\t\tthis.getViewBounds( distance, _minTarget, _maxTarget );\n\n\t\treturn target.subVectors( _maxTarget, _minTarget );\n\n\t}\n\n\t/**\n\t * Sets an offset in a larger frustum. This is useful for multi-window or\n\t * multi-monitor/multi-machine setups.\n\t *\n\t * For example, if you have 3x2 monitors and each monitor is 1920x1080 and\n\t * the monitors are in grid like this\n\t *```\n\t *   +---+---+---+\n\t *   | A | B | C |\n\t *   +---+---+---+\n\t *   | D | E | F |\n\t *   +---+---+---+\n\t *```\n\t * then for each monitor you would call it like this:\n\t *```js\n\t * const w = 1920;\n\t * const h = 1080;\n\t * const fullWidth = w * 3;\n\t * const fullHeight = h * 2;\n\t *\n\t * // --A--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );\n\t * // --B--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );\n\t * // --C--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );\n\t * // --D--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );\n\t * // --E--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );\n\t * // --F--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );\n\t * ```\n\t *\n\t * Note there is no reason monitors have to be the same size or in a grid.\n\t *\n\t * @param {number} fullWidth - The full width of multiview setup.\n\t * @param {number} fullHeight - The full height of multiview setup.\n\t * @param {number} x - The horizontal offset of the subcamera.\n\t * @param {number} y - The vertical offset of the subcamera.\n\t * @param {number} width - The width of subcamera.\n\t * @param {number} height - The height of subcamera.\n\t */\n\tsetViewOffset( fullWidth, fullHeight, x, y, width, height ) {\n\n\t\tthis.aspect = fullWidth / fullHeight;\n\n\t\tif ( this.view === null ) {\n\n\t\t\tthis.view = {\n\t\t\t\tenabled: true,\n\t\t\t\tfullWidth: 1,\n\t\t\t\tfullHeight: 1,\n\t\t\t\toffsetX: 0,\n\t\t\t\toffsetY: 0,\n\t\t\t\twidth: 1,\n\t\t\t\theight: 1\n\t\t\t};\n\n\t\t}\n\n\t\tthis.view.enabled = true;\n\t\tthis.view.fullWidth = fullWidth;\n\t\tthis.view.fullHeight = fullHeight;\n\t\tthis.view.offsetX = x;\n\t\tthis.view.offsetY = y;\n\t\tthis.view.width = width;\n\t\tthis.view.height = height;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\t/**\n\t * Removes the view offset from the projection matrix.\n\t */\n\tclearViewOffset() {\n\n\t\tif ( this.view !== null ) {\n\n\t\t\tthis.view.enabled = false;\n\n\t\t}\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\t/**\n\t * Updates the camera's projection matrix. Must be called after any change of\n\t * camera properties.\n\t */\n\tupdateProjectionMatrix() {\n\n\t\tconst near = this.near;\n\t\tlet top = near * Math.tan( DEG2RAD * 0.5 * this.fov ) / this.zoom;\n\t\tlet height = 2 * top;\n\t\tlet width = this.aspect * height;\n\t\tlet left = -0.5 * width;\n\t\tconst view = this.view;\n\n\t\tif ( this.view !== null \u0026\u0026 this.view.enabled ) {\n\n\t\t\tconst fullWidth = view.fullWidth,\n\t\t\t\tfullHeight = view.fullHeight;\n\n\t\t\tleft += view.offsetX * width / fullWidth;\n\t\t\ttop -= view.offsetY * height / fullHeight;\n\t\t\twidth *= view.width / fullWidth;\n\t\t\theight *= view.height / fullHeight;\n\n\t\t}\n\n\t\tconst skew = this.filmOffset;\n\t\tif ( skew !== 0 ) left += near * skew / this.getFilmWidth();\n\n\t\tthis.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem, this.reversedDepth );\n\n\t\tthis.projectionMatrixInverse.copy( this.projectionMatrix ).invert();\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.fov = this.fov;\n\t\tdata.object.zoom = this.zoom;\n\n\t\tdata.object.near = this.near;\n\t\tdata.object.far = this.far;\n\t\tdata.object.focus = this.focus;\n\n\t\tdata.object.aspect = this.aspect;\n\n\t\tif ( this.view !== null ) data.object.view = Object.assign( {}, this.view );\n\n\t\tdata.object.filmGauge = this.filmGauge;\n\t\tdata.object.filmOffset = this.filmOffset;\n\n\t\treturn data;\n\n\t}\n\n}\n\nconst fov = -90; // negative fov is not an error\nconst aspect = 1;\n\n/**\n * A special type of camera that is positioned in 3D space to render its surroundings into a\n * cube render target. The render target can then be used as an environment map for rendering\n * realtime reflections in your scene.\n *\n * ```js\n * // Create cube render target\n * const cubeRenderTarget = new THREE.WebGLCubeRenderTarget( 256, { generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter } );\n *\n * // Create cube camera\n * const cubeCamera = new THREE.CubeCamera( 1, 100000, cubeRenderTarget );\n * scene.add( cubeCamera );\n *\n * // Create car\n * const chromeMaterial = new THREE.MeshLambertMaterial( { color: 0xffffff, envMap: cubeRenderTarget.texture } );\n * const car = new THREE.Mesh( carGeometry, chromeMaterial );\n * scene.add( car );\n *\n * // Update the render target cube\n * car.visible = false;\n * cubeCamera.position.copy( car.position );\n * cubeCamera.update( renderer, scene );\n *\n * // Render the scene\n * car.visible = true;\n * renderer.render( scene, camera );\n * ```\n *\n * @augments Object3D\n */\nclass CubeCamera extends Object3D {\n\n\t/**\n\t * Constructs a new cube camera.\n\t *\n\t * @param {number} near - The camera's near plane.\n\t * @param {number} far - The camera's far plane.\n\t * @param {WebGLCubeRenderTarget} renderTarget - The cube render target.\n\t */\n\tconstructor( near, far, renderTarget ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CubeCamera';\n\n\t\t/**\n\t\t * A reference to the cube render target.\n\t\t *\n\t\t * @type {WebGLCubeRenderTarget}\n\t\t */\n\t\tthis.renderTarget = renderTarget;\n\n\t\t/**\n\t\t * The current active coordinate system.\n\t\t *\n\t\t * @type {?(WebGLCoordinateSystem|WebGPUCoordinateSystem)}\n\t\t * @default null\n\t\t */\n\t\tthis.coordinateSystem = null;\n\n\t\t/**\n\t\t * The current active mipmap level\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.activeMipmapLevel = 0;\n\n\t\tconst cameraPX = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraPX.layers = this.layers;\n\t\tthis.add( cameraPX );\n\n\t\tconst cameraNX = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraNX.layers = this.layers;\n\t\tthis.add( cameraNX );\n\n\t\tconst cameraPY = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraPY.layers = this.layers;\n\t\tthis.add( cameraPY );\n\n\t\tconst cameraNY = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraNY.layers = this.layers;\n\t\tthis.add( cameraNY );\n\n\t\tconst cameraPZ = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraPZ.layers = this.layers;\n\t\tthis.add( cameraPZ );\n\n\t\tconst cameraNZ = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraNZ.layers = this.layers;\n\t\tthis.add( cameraNZ );\n\n\t}\n\n\t/**\n\t * Must be called when the coordinate system of the cube camera is changed.\n\t */\n\tupdateCoordinateSystem() {\n\n\t\tconst coordinateSystem = this.coordinateSystem;\n\n\t\tconst cameras = this.children.concat();\n\n\t\tconst [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = cameras;\n\n\t\tfor ( const camera of cameras ) this.remove( camera );\n\n\t\tif ( coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\tcameraPX.up.set( 0, 1, 0 );\n\t\t\tcameraPX.lookAt( 1, 0, 0 );\n\n\t\t\tcameraNX.up.set( 0, 1, 0 );\n\t\t\tcameraNX.lookAt( -1, 0, 0 );\n\n\t\t\tcameraPY.up.set( 0, 0, -1 );\n\t\t\tcameraPY.lookAt( 0, 1, 0 );\n\n\t\t\tcameraNY.up.set( 0, 0, 1 );\n\t\t\tcameraNY.lookAt( 0, -1, 0 );\n\n\t\t\tcameraPZ.up.set( 0, 1, 0 );\n\t\t\tcameraPZ.lookAt( 0, 0, 1 );\n\n\t\t\tcameraNZ.up.set( 0, 1, 0 );\n\t\t\tcameraNZ.lookAt( 0, 0, -1 );\n\n\t\t} else if ( coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\tcameraPX.up.set( 0, -1, 0 );\n\t\t\tcameraPX.lookAt( -1, 0, 0 );\n\n\t\t\tcameraNX.up.set( 0, -1, 0 );\n\t\t\tcameraNX.lookAt( 1, 0, 0 );\n\n\t\t\tcameraPY.up.set( 0, 0, 1 );\n\t\t\tcameraPY.lookAt( 0, 1, 0 );\n\n\t\t\tcameraNY.up.set( 0, 0, -1 );\n\t\t\tcameraNY.lookAt( 0, -1, 0 );\n\n\t\t\tcameraPZ.up.set( 0, -1, 0 );\n\t\t\tcameraPZ.lookAt( 0, 0, 1 );\n\n\t\t\tcameraNZ.up.set( 0, -1, 0 );\n\t\t\tcameraNZ.lookAt( 0, 0, -1 );\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: ' + coordinateSystem );\n\n\t\t}\n\n\t\tfor ( const camera of cameras ) {\n\n\t\t\tthis.add( camera );\n\n\t\t\tcamera.updateMatrixWorld();\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Calling this method will render the given scene with the given renderer\n\t * into the cube render target of the camera.\n\t *\n\t * @param {(Renderer|WebGLRenderer)} renderer - The renderer.\n\t * @param {Scene} scene - The scene to render.\n\t */\n\tupdate( renderer, scene ) {\n\n\t\tif ( this.parent === null ) this.updateMatrixWorld();\n\n\t\tconst { renderTarget, activeMipmapLevel } = this;\n\n\t\tif ( this.coordinateSystem !== renderer.coordinateSystem ) {\n\n\t\t\tthis.coordinateSystem = renderer.coordinateSystem;\n\n\t\t\tthis.updateCoordinateSystem();\n\n\t\t}\n\n\t\tconst [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = this.children;\n\n\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\t\tconst currentActiveCubeFace = renderer.getActiveCubeFace();\n\t\tconst currentActiveMipmapLevel = renderer.getActiveMipmapLevel();\n\n\t\tconst currentXrEnabled = renderer.xr.enabled;\n\n\t\trenderer.xr.enabled = false;\n\n\t\tconst generateMipmaps = renderTarget.texture.generateMipmaps;\n\n\t\trenderTarget.texture.generateMipmaps = false;\n\n\t\trenderer.setRenderTarget( renderTarget, 0, activeMipmapLevel );\n\t\trenderer.render( scene, cameraPX );\n\n\t\trenderer.setRenderTarget( renderTarget, 1, activeMipmapLevel );\n\t\trenderer.render( scene, cameraNX );\n\n\t\trenderer.setRenderTarget( renderTarget, 2, activeMipmapLevel );\n\t\trenderer.render( scene, cameraPY );\n\n\t\trenderer.setRenderTarget( renderTarget, 3, activeMipmapLevel );\n\t\trenderer.render( scene, cameraNY );\n\n\t\trenderer.setRenderTarget( renderTarget, 4, activeMipmapLevel );\n\t\trenderer.render( scene, cameraPZ );\n\n\t\t// mipmaps are generated during the last call of render()\n\t\t// at this point, all sides of the cube render target are defined\n\n\t\trenderTarget.texture.generateMipmaps = generateMipmaps;\n\n\t\trenderer.setRenderTarget( renderTarget, 5, activeMipmapLevel );\n\t\trenderer.render( scene, cameraNZ );\n\n\t\trenderer.setRenderTarget( currentRenderTarget, currentActiveCubeFace, currentActiveMipmapLevel );\n\n\t\trenderer.xr.enabled = currentXrEnabled;\n\n\t\trenderTarget.texture.needsPMREMUpdate = true;\n\n\t}\n\n}\n\n/**\n * Creates a cube texture made up of six images.\n *\n * ```js\n * const loader = new THREE.CubeTextureLoader();\n * loader.setPath( 'textures/cube/pisa/' );\n *\n * const textureCube = loader.load( [\n * \t'px.png', 'nx.png', 'py.png', 'ny.png', 'pz.png', 'nz.png'\n * ] );\n *\n * const material = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube } );\n * ```\n *\n * @augments Texture\n */\nclass CubeTexture extends Texture {\n\n\t/**\n\t * Constructs a new cube texture.\n\t *\n\t * @param {Array\u003cImage\u003e} [images=[]] - An array holding a image for each side of a cube.\n\t * @param {number} [mapping=CubeReflectionMapping] - The texture mapping.\n\t * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n\t * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n\t * @param {number} [magFilter=LinearFilter] - The mag filter value.\n\t * @param {number} [minFilter=LinearMipmapLinearFilter] - The min filter value.\n\t * @param {number} [format=RGBAFormat] - The texture format.\n\t * @param {number} [type=UnsignedByteType] - The texture type.\n\t * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n\t * @param {string} [colorSpace=NoColorSpace] - The color space value.\n\t */\n\tconstructor( images = [], mapping = CubeReflectionMapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace ) {\n\n\t\tsuper( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCubeTexture = true;\n\n\t\t/**\n\t\t * If set to `true`, the texture is flipped along the vertical axis when\n\t\t * uploaded to the GPU.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flipY = false;\n\n\t}\n\n\t/**\n\t * Alias for {@link CubeTexture#image}.\n\t *\n\t * @type {Array\u003cImage\u003e}\n\t */\n\tget images() {\n\n\t\treturn this.image;\n\n\t}\n\n\tset images( value ) {\n\n\t\tthis.image = value;\n\n\t}\n\n}\n\n/**\n * A cube render target used in context of {@link WebGLRenderer}.\n *\n * @augments WebGLRenderTarget\n */\nclass WebGLCubeRenderTarget extends WebGLRenderTarget {\n\n\t/**\n\t * Constructs a new cube render target.\n\t *\n\t * @param {number} [size=1] - The size of the render target.\n\t * @param {RenderTarget~Options} [options] - The configuration object.\n\t */\n\tconstructor( size = 1, options = {} ) {\n\n\t\tsuper( size, size, options );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isWebGLCubeRenderTarget = true;\n\n\t\tconst image = { width: size, height: size, depth: 1 };\n\t\tconst images = [ image, image, image, image, image, image ];\n\n\t\t/**\n\t\t * Overwritten with a different texture type.\n\t\t *\n\t\t * @type {DataArrayTexture}\n\t\t */\n\t\tthis.texture = new CubeTexture( images );\n\t\tthis._setTextureOptions( options );\n\n\t\t// By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)\n\t\t// in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words,\n\t\t// in a left-handed coordinate system. By continuing this convention, preexisting cube maps continued to render correctly.\n\n\t\t// three.js uses a right-handed coordinate system. So environment maps used in three.js appear to have px and nx swapped\n\t\t// and the flag isRenderTargetTexture controls this conversion. The flip is not required when using WebGLCubeRenderTarget.texture\n\t\t// as a cube texture (this is detected when isRenderTargetTexture is set to true for cube textures).\n\n\t\tthis.texture.isRenderTargetTexture = true;\n\n\t}\n\n\t/**\n\t * Converts the given equirectangular texture to a cube map.\n\t *\n\t * @param {WebGLRenderer} renderer - The renderer.\n\t * @param {Texture} texture - The equirectangular texture.\n\t * @return {WebGLCubeRenderTarget} A reference to this cube render target.\n\t */\n\tfromEquirectangularTexture( renderer, texture ) {\n\n\t\tthis.texture.type = texture.type;\n\t\tthis.texture.colorSpace = texture.colorSpace;\n\n\t\tthis.texture.generateMipmaps = texture.generateMipmaps;\n\t\tthis.texture.minFilter = texture.minFilter;\n\t\tthis.texture.magFilter = texture.magFilter;\n\n\t\tconst shader = {\n\n\t\t\tuniforms: {\n\t\t\t\ttEquirect: { value: null },\n\t\t\t},\n\n\t\t\tvertexShader: /* glsl */`\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \u003cbegin_vertex\u003e\n\t\t\t\t\t#include \u003cproject_vertex\u003e\n\n\t\t\t\t}\n\t\t\t`,\n\n\t\t\tfragmentShader: /* glsl */`\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \u003ccommon\u003e\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t`\n\t\t};\n\n\t\tconst geometry = new BoxGeometry( 5, 5, 5 );\n\n\t\tconst material = new ShaderMaterial( {\n\n\t\t\tname: 'CubemapFromEquirect',\n\n\t\t\tuniforms: cloneUniforms( shader.uniforms ),\n\t\t\tvertexShader: shader.vertexShader,\n\t\t\tfragmentShader: shader.fragmentShader,\n\t\t\tside: BackSide,\n\t\t\tblending: NoBlending\n\n\t\t} );\n\n\t\tmaterial.uniforms.tEquirect.value = texture;\n\n\t\tconst mesh = new Mesh( geometry, material );\n\n\t\tconst currentMinFilter = texture.minFilter;\n\n\t\t// Avoid blurred poles\n\t\tif ( texture.minFilter === LinearMipmapLinearFilter ) texture.minFilter = LinearFilter;\n\n\t\tconst camera = new CubeCamera( 1, 10, this );\n\t\tcamera.update( renderer, mesh );\n\n\t\ttexture.minFilter = currentMinFilter;\n\n\t\tmesh.geometry.dispose();\n\t\tmesh.material.dispose();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Clears this cube render target.\n\t *\n\t * @param {WebGLRenderer} renderer - The renderer.\n\t * @param {boolean} [color=true] - Whether the color buffer should be cleared or not.\n\t * @param {boolean} [depth=true] - Whether the depth buffer should be cleared or not.\n\t * @param {boolean} [stencil=true] - Whether the stencil buffer should be cleared or not.\n\t */\n\tclear( renderer, color = true, depth = true, stencil = true ) {\n\n\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\n\t\tfor ( let i = 0; i \u003c 6; i ++ ) {\n\n\t\t\trenderer.setRenderTarget( this, i );\n\n\t\t\trenderer.clear( color, depth, stencil );\n\n\t\t}\n\n\t\trenderer.setRenderTarget( currentRenderTarget );\n\n\t}\n\n}\n\n/**\n * This is almost identical to an {@link Object3D}. Its purpose is to\n * make working with groups of objects syntactically clearer.\n *\n * ```js\n * // Create a group and add the two cubes.\n * // These cubes can now be rotated / scaled etc as a group.\n * const group = new THREE.Group();\n *\n * group.add( meshA );\n * group.add( meshB );\n *\n * scene.add( group );\n * ```\n *\n * @augments Object3D\n */\nclass Group extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isGroup = true;\n\n\t\tthis.type = 'Group';\n\n\t}\n\n}\n\nconst _moveEvent = { type: 'move' };\n\n/**\n * Class for representing a XR controller with its\n * different coordinate systems.\n *\n * @private\n */\nclass WebXRController {\n\n\t/**\n\t * Constructs a new XR controller.\n\t */\n\tconstructor() {\n\n\t\t/**\n\t\t * A group representing the target ray space\n\t\t * of the XR controller.\n\t\t *\n\t\t * @private\n\t\t * @type {?Group}\n\t\t * @default null\n\t\t */\n\t\tthis._targetRay = null;\n\n\t\t/**\n\t\t * A group representing the grip space\n\t\t * of the XR controller.\n\t\t *\n\t\t * @private\n\t\t * @type {?Group}\n\t\t * @default null\n\t\t */\n\t\tthis._grip = null;\n\n\t\t/**\n\t\t * A group representing the hand space\n\t\t * of the XR controller.\n\t\t *\n\t\t * @private\n\t\t * @type {?Group}\n\t\t * @default null\n\t\t */\n\t\tthis._hand = null;\n\n\t}\n\n\t/**\n\t * Returns a group representing the hand space of the XR controller.\n\t *\n\t * @return {Group} A group representing the hand space of the XR controller.\n\t */\n\tgetHandSpace() {\n\n\t\tif ( this._hand === null ) {\n\n\t\t\tthis._hand = new Group();\n\t\t\tthis._hand.matrixAutoUpdate = false;\n\t\t\tthis._hand.visible = false;\n\n\t\t\tthis._hand.joints = {};\n\t\t\tthis._hand.inputState = { pinching: false };\n\n\t\t}\n\n\t\treturn this._hand;\n\n\t}\n\n\t/**\n\t * Returns a group representing the target ray space of the XR controller.\n\t *\n\t * @return {Group} A group representing the target ray space of the XR controller.\n\t */\n\tgetTargetRaySpace() {\n\n\t\tif ( this._targetRay === null ) {\n\n\t\t\tthis._targetRay = new Group();\n\t\t\tthis._targetRay.matrixAutoUpdate = false;\n\t\t\tthis._targetRay.visible = false;\n\t\t\tthis._targetRay.hasLinearVelocity = false;\n\t\t\tthis._targetRay.linearVelocity = new Vector3();\n\t\t\tthis._targetRay.hasAngularVelocity = false;\n\t\t\tthis._targetRay.angularVelocity = new Vector3();\n\n\t\t}\n\n\t\treturn this._targetRay;\n\n\t}\n\n\t/**\n\t * Returns a group representing the grip space of the XR controller.\n\t *\n\t * @return {Group} A group representing the grip space of the XR controller.\n\t */\n\tgetGripSpace() {\n\n\t\tif ( this._grip === null ) {\n\n\t\t\tthis._grip = new Group();\n\t\t\tthis._grip.matrixAutoUpdate = false;\n\t\t\tthis._grip.visible = false;\n\t\t\tthis._grip.hasLinearVelocity = false;\n\t\t\tthis._grip.linearVelocity = new Vector3();\n\t\t\tthis._grip.hasAngularVelocity = false;\n\t\t\tthis._grip.angularVelocity = new Vector3();\n\n\t\t}\n\n\t\treturn this._grip;\n\n\t}\n\n\t/**\n\t * Dispatches the given event to the groups representing\n\t * the different coordinate spaces of the XR controller.\n\t *\n\t * @param {Object} event - The event to dispatch.\n\t * @return {WebXRController} A reference to this instance.\n\t */\n\tdispatchEvent( event ) {\n\n\t\tif ( this._targetRay !== null ) {\n\n\t\t\tthis._targetRay.dispatchEvent( event );\n\n\t\t}\n\n\t\tif ( this._grip !== null ) {\n\n\t\t\tthis._grip.dispatchEvent( event );\n\n\t\t}\n\n\t\tif ( this._hand !== null ) {\n\n\t\t\tthis._hand.dispatchEvent( event );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Connects the controller with the given XR input source.\n\t *\n\t * @param {XRInputSource} inputSource - The input source.\n\t * @return {WebXRController} A reference to this instance.\n\t */\n\tconnect( inputSource ) {\n\n\t\tif ( inputSource \u0026\u0026 inputSource.hand ) {\n\n\t\t\tconst hand = this._hand;\n\n\t\t\tif ( hand ) {\n\n\t\t\t\tfor ( const inputjoint of inputSource.hand.values() ) {\n\n\t\t\t\t\t// Initialize hand with joints when connected\n\t\t\t\t\tthis._getHandJoint( hand, inputjoint );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.dispatchEvent( { type: 'connected', data: inputSource } );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Disconnects the controller from the given XR input source.\n\t *\n\t * @param {XRInputSource} inputSource - The input source.\n\t * @return {WebXRController} A reference to this instance.\n\t */\n\tdisconnect( inputSource ) {\n\n\t\tthis.dispatchEvent( { type: 'disconnected', data: inputSource } );\n\n\t\tif ( this._targetRay !== null ) {\n\n\t\t\tthis._targetRay.visible = false;\n\n\t\t}\n\n\t\tif ( this._grip !== null ) {\n\n\t\t\tthis._grip.visible = false;\n\n\t\t}\n\n\t\tif ( this._hand !== null ) {\n\n\t\t\tthis._hand.visible = false;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Updates the controller with the given input source, XR frame and reference space.\n\t * This updates the transformations of the groups that represent the different\n\t * coordinate systems of the controller.\n\t *\n\t * @param {XRInputSource} inputSource - The input source.\n\t * @param {XRFrame} frame - The XR frame.\n\t * @param {XRReferenceSpace} referenceSpace - The reference space.\n\t * @return {WebXRController} A reference to this instance.\n\t */\n\tupdate( inputSource, frame, referenceSpace ) {\n\n\t\tlet inputPose = null;\n\t\tlet gripPose = null;\n\t\tlet handPose = null;\n\n\t\tconst targetRay = this._targetRay;\n\t\tconst grip = this._grip;\n\t\tconst hand = this._hand;\n\n\t\tif ( inputSource \u0026\u0026 frame.session.visibilityState !== 'visible-blurred' ) {\n\n\t\t\tif ( hand \u0026\u0026 inputSource.hand ) {\n\n\t\t\t\thandPose = true;\n\n\t\t\t\tfor ( const inputjoint of inputSource.hand.values() ) {\n\n\t\t\t\t\t// Update the joints groups with the XRJoint poses\n\t\t\t\t\tconst jointPose = frame.getJointPose( inputjoint, referenceSpace );\n\n\t\t\t\t\t// The transform of this joint will be updated with the joint pose on each frame\n\t\t\t\t\tconst joint = this._getHandJoint( hand, inputjoint );\n\n\t\t\t\t\tif ( jointPose !== null ) {\n\n\t\t\t\t\t\tjoint.matrix.fromArray( jointPose.transform.matrix );\n\t\t\t\t\t\tjoint.matrix.decompose( joint.position, joint.rotation, joint.scale );\n\t\t\t\t\t\tjoint.matrixWorldNeedsUpdate = true;\n\t\t\t\t\t\tjoint.jointRadius = jointPose.radius;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tjoint.visible = jointPose !== null;\n\n\t\t\t\t}\n\n\t\t\t\t// Custom events\n\n\t\t\t\t// Check pinchz\n\t\t\t\tconst indexTip = hand.joints[ 'index-finger-tip' ];\n\t\t\t\tconst thumbTip = hand.joints[ 'thumb-tip' ];\n\t\t\t\tconst distance = indexTip.position.distanceTo( thumbTip.position );\n\n\t\t\t\tconst distanceToPinch = 0.02;\n\t\t\t\tconst threshold = 0.005;\n\n\t\t\t\tif ( hand.inputState.pinching \u0026\u0026 distance \u003e distanceToPinch + threshold ) {\n\n\t\t\t\t\thand.inputState.pinching = false;\n\t\t\t\t\tthis.dispatchEvent( {\n\t\t\t\t\t\ttype: 'pinchend',\n\t\t\t\t\t\thandedness: inputSource.handedness,\n\t\t\t\t\t\ttarget: this\n\t\t\t\t\t} );\n\n\t\t\t\t} else if ( ! hand.inputState.pinching \u0026\u0026 distance \u003c= distanceToPinch - threshold ) {\n\n\t\t\t\t\thand.inputState.pinching = true;\n\t\t\t\t\tthis.dispatchEvent( {\n\t\t\t\t\t\ttype: 'pinchstart',\n\t\t\t\t\t\thandedness: inputSource.handedness,\n\t\t\t\t\t\ttarget: this\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( grip !== null \u0026\u0026 inputSource.gripSpace ) {\n\n\t\t\t\t\tgripPose = frame.getPose( inputSource.gripSpace, referenceSpace );\n\n\t\t\t\t\tif ( gripPose !== null ) {\n\n\t\t\t\t\t\tgrip.matrix.fromArray( gripPose.transform.matrix );\n\t\t\t\t\t\tgrip.matrix.decompose( grip.position, grip.rotation, grip.scale );\n\t\t\t\t\t\tgrip.matrixWorldNeedsUpdate = true;\n\n\t\t\t\t\t\tif ( gripPose.linearVelocity ) {\n\n\t\t\t\t\t\t\tgrip.hasLinearVelocity = true;\n\t\t\t\t\t\t\tgrip.linearVelocity.copy( gripPose.linearVelocity );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tgrip.hasLinearVelocity = false;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( gripPose.angularVelocity ) {\n\n\t\t\t\t\t\t\tgrip.hasAngularVelocity = true;\n\t\t\t\t\t\t\tgrip.angularVelocity.copy( gripPose.angularVelocity );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tgrip.hasAngularVelocity = false;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( targetRay !== null ) {\n\n\t\t\t\tinputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );\n\n\t\t\t\t// Some runtimes (namely Vive Cosmos with Vive OpenXR Runtime) have only grip space and ray space is equal to it\n\t\t\t\tif ( inputPose === null \u0026\u0026 gripPose !== null ) {\n\n\t\t\t\t\tinputPose = gripPose;\n\n\t\t\t\t}\n\n\t\t\t\tif ( inputPose !== null ) {\n\n\t\t\t\t\ttargetRay.matrix.fromArray( inputPose.transform.matrix );\n\t\t\t\t\ttargetRay.matrix.decompose( targetRay.position, targetRay.rotation, targetRay.scale );\n\t\t\t\t\ttargetRay.matrixWorldNeedsUpdate = true;\n\n\t\t\t\t\tif ( inputPose.linearVelocity ) {\n\n\t\t\t\t\t\ttargetRay.hasLinearVelocity = true;\n\t\t\t\t\t\ttargetRay.linearVelocity.copy( inputPose.linearVelocity );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttargetRay.hasLinearVelocity = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( inputPose.angularVelocity ) {\n\n\t\t\t\t\t\ttargetRay.hasAngularVelocity = true;\n\t\t\t\t\t\ttargetRay.angularVelocity.copy( inputPose.angularVelocity );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttargetRay.hasAngularVelocity = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.dispatchEvent( _moveEvent );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t}\n\n\t\tif ( targetRay !== null ) {\n\n\t\t\ttargetRay.visible = ( inputPose !== null );\n\n\t\t}\n\n\t\tif ( grip !== null ) {\n\n\t\t\tgrip.visible = ( gripPose !== null );\n\n\t\t}\n\n\t\tif ( hand !== null ) {\n\n\t\t\thand.visible = ( handPose !== null );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a group representing the hand joint for the given input joint.\n\t *\n\t * @private\n\t * @param {Group} hand - The group representing the hand space.\n\t * @param {XRJointSpace} inputjoint - The hand joint data.\n\t * @return {Group} A group representing the hand joint for the given input joint.\n\t */\n\t_getHandJoint( hand, inputjoint ) {\n\n\t\tif ( hand.joints[ inputjoint.jointName ] === undefined ) {\n\n\t\t\tconst joint = new Group();\n\t\t\tjoint.matrixAutoUpdate = false;\n\t\t\tjoint.visible = false;\n\t\t\thand.joints[ inputjoint.jointName ] = joint;\n\n\t\t\thand.add( joint );\n\n\t\t}\n\n\t\treturn hand.joints[ inputjoint.jointName ];\n\n\t}\n\n}\n\n/**\n * This class can be used to define an exponential squared fog,\n * which gives a clear view near the camera and a faster than exponentially\n * densening fog farther from the camera.\n *\n * ```js\n * const scene = new THREE.Scene();\n * scene.fog = new THREE.FogExp2( 0xcccccc, 0.002 );\n * ```\n */\nclass FogExp2 {\n\n\t/**\n\t * Constructs a new fog.\n\t *\n\t * @param {number|Color} color - The fog's color.\n\t * @param {number} [density=0.00025] - Defines how fast the fog will grow dense.\n\t */\n\tconstructor( color, density = 0.00025 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isFogExp2 = true;\n\n\t\t/**\n\t\t * The name of the fog.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\n\t\t/**\n\t\t * The fog's color.\n\t\t *\n\t\t * @type {Color}\n\t\t */\n\t\tthis.color = new Color( color );\n\n\t\t/**\n\t\t *  Defines how fast the fog will grow dense.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0.00025\n\t\t */\n\t\tthis.density = density;\n\n\t}\n\n\t/**\n\t * Returns a new fog with copied values from this instance.\n\t *\n\t * @return {FogExp2} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new FogExp2( this.color, this.density );\n\n\t}\n\n\t/**\n\t * Serializes the fog into JSON.\n\t *\n\t * @param {?(Object|string)} meta - An optional value holding meta information about the serialization.\n\t * @return {Object} A JSON object representing the serialized fog\n\t */\n\ttoJSON( /* meta */ ) {\n\n\t\treturn {\n\t\t\ttype: 'FogExp2',\n\t\t\tname: this.name,\n\t\t\tcolor: this.color.getHex(),\n\t\t\tdensity: this.density\n\t\t};\n\n\t}\n\n}\n\n/**\n * This class can be used to define a linear fog that grows linearly denser\n * with the distance.\n *\n * ```js\n * const scene = new THREE.Scene();\n * scene.fog = new THREE.Fog( 0xcccccc, 10, 15 );\n * ```\n */\nclass Fog {\n\n\t/**\n\t * Constructs a new fog.\n\t *\n\t * @param {number|Color} color - The fog's color.\n\t * @param {number} [near=1] - The minimum distance to start applying fog.\n\t * @param {number} [far=1000] - The maximum distance at which fog stops being calculated and applied.\n\t */\n\tconstructor( color, near = 1, far = 1000 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isFog = true;\n\n\t\t/**\n\t\t * The name of the fog.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\n\t\t/**\n\t\t * The fog's color.\n\t\t *\n\t\t * @type {Color}\n\t\t */\n\t\tthis.color = new Color( color );\n\n\t\t/**\n\t\t * The minimum distance to start applying fog. Objects that are less than\n\t\t * `near` units from the active camera won't be affected by fog.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.near = near;\n\n\t\t/**\n\t\t * The maximum distance at which fog stops being calculated and applied.\n\t\t * Objects that are more than `far` units away from the active camera won't\n\t\t * be affected by fog.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1000\n\t\t */\n\t\tthis.far = far;\n\n\t}\n\n\t/**\n\t * Returns a new fog with copied values from this instance.\n\t *\n\t * @return {Fog} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new Fog( this.color, this.near, this.far );\n\n\t}\n\n\t/**\n\t * Serializes the fog into JSON.\n\t *\n\t * @param {?(Object|string)} meta - An optional value holding meta information about the serialization.\n\t * @return {Object} A JSON object representing the serialized fog\n\t */\n\ttoJSON( /* meta */ ) {\n\n\t\treturn {\n\t\t\ttype: 'Fog',\n\t\t\tname: this.name,\n\t\t\tcolor: this.color.getHex(),\n\t\t\tnear: this.near,\n\t\t\tfar: this.far\n\t\t};\n\n\t}\n\n}\n\n/**\n * Scenes allow you to set up what is to be rendered and where by three.js.\n * This is where you place 3D objects like meshes, lines or lights.\n *\n * @augments Object3D\n */\nclass Scene extends Object3D {\n\n\t/**\n\t * Constructs a new scene.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isScene = true;\n\n\t\tthis.type = 'Scene';\n\n\t\t/**\n\t\t * Defines the background of the scene. Valid inputs are:\n\t\t *\n\t\t * - A color for defining a uniform colored background.\n\t\t * - A texture for defining a (flat) textured background.\n\t\t * - Cube textures or equirectangular textures for defining a skybox.\n\t\t *\n\t\t * @type {?(Color|Texture)}\n\t\t * @default null\n\t\t */\n\t\tthis.background = null;\n\n\t\t/**\n\t\t * Sets the environment map for all physical materials in the scene. However,\n\t\t * it's not possible to overwrite an existing texture assigned to the `envMap`\n\t\t * material property.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.environment = null;\n\n\t\t/**\n\t\t * A fog instance defining the type of fog that affects everything\n\t\t * rendered in the scene.\n\t\t *\n\t\t * @type {?(Fog|FogExp2)}\n\t\t * @default null\n\t\t */\n\t\tthis.fog = null;\n\n\t\t/**\n\t\t * Sets the blurriness of the background. Only influences environment maps\n\t\t * assigned to {@link Scene#background}. Valid input is a float between `0`\n\t\t * and `1`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.backgroundBlurriness = 0;\n\n\t\t/**\n\t\t * Attenuates the color of the background. Only applies to background textures.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.backgroundIntensity = 1;\n\n\t\t/**\n\t\t * The rotation of the background in radians. Only influences environment maps\n\t\t * assigned to {@link Scene#background}.\n\t\t *\n\t\t * @type {Euler}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.backgroundRotation = new Euler();\n\n\t\t/**\n\t\t * Attenuates the color of the environment. Only influences environment maps\n\t\t * assigned to {@link Scene#environment}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.environmentIntensity = 1;\n\n\t\t/**\n\t\t * The rotation of the environment map in radians. Only influences physical materials\n\t\t * in the scene when {@link Scene#environment} is used.\n\t\t *\n\t\t * @type {Euler}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.environmentRotation = new Euler();\n\n\t\t/**\n\t\t * Forces everything in the scene to be rendered with the defined material. It is possible\n\t\t * to exclude materials from override by setting {@link Material#allowOverride} to `false`.\n\t\t *\n\t\t * @type {?Material}\n\t\t * @default null\n\t\t */\n\t\tthis.overrideMaterial = null;\n\n\t\tif ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {\n\n\t\t\t__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) );\n\n\t\t}\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tif ( source.background !== null ) this.background = source.background.clone();\n\t\tif ( source.environment !== null ) this.environment = source.environment.clone();\n\t\tif ( source.fog !== null ) this.fog = source.fog.clone();\n\n\t\tthis.backgroundBlurriness = source.backgroundBlurriness;\n\t\tthis.backgroundIntensity = source.backgroundIntensity;\n\t\tthis.backgroundRotation.copy( source.backgroundRotation );\n\n\t\tthis.environmentIntensity = source.environmentIntensity;\n\t\tthis.environmentRotation.copy( source.environmentRotation );\n\n\t\tif ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone();\n\n\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tif ( this.fog !== null ) data.object.fog = this.fog.toJSON();\n\n\t\tif ( this.backgroundBlurriness \u003e 0 ) data.object.backgroundBlurriness = this.backgroundBlurriness;\n\t\tif ( this.backgroundIntensity !== 1 ) data.object.backgroundIntensity = this.backgroundIntensity;\n\t\tdata.object.backgroundRotation = this.backgroundRotation.toArray();\n\n\t\tif ( this.environmentIntensity !== 1 ) data.object.environmentIntensity = this.environmentIntensity;\n\t\tdata.object.environmentRotation = this.environmentRotation.toArray();\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * \"Interleaved\" means that multiple attributes, possibly of different types,\n * (e.g., position, normal, uv, color) are packed into a single array buffer.\n *\n * An introduction into interleaved arrays can be found here: [Interleaved array basics](https://blog.tojicode.com/2011/05/interleaved-array-basics.html)\n */\nclass InterleavedBuffer {\n\n\t/**\n\t * Constructs a new interleaved buffer.\n\t *\n\t * @param {TypedArray} array - A typed array with a shared buffer storing attribute data.\n\t * @param {number} stride - The number of typed-array elements per vertex.\n\t */\n\tconstructor( array, stride ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isInterleavedBuffer = true;\n\n\t\t/**\n\t\t * A typed array with a shared buffer storing attribute data.\n\t\t *\n\t\t * @type {TypedArray}\n\t\t */\n\t\tthis.array = array;\n\n\t\t/**\n\t\t * The number of typed-array elements per vertex.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.stride = stride;\n\n\t\t/**\n\t\t * The total number of elements in the array\n\t\t *\n\t\t * @type {number}\n\t\t * @readonly\n\t\t */\n\t\tthis.count = array !== undefined ? array.length / stride : 0;\n\n\t\t/**\n\t\t * Defines the intended usage pattern of the data store for optimization purposes.\n\t\t *\n\t\t * Note: After the initial use of a buffer, its usage cannot be changed. Instead,\n\t\t * instantiate a new one and set the desired usage before the next render.\n\t\t *\n\t\t * @type {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)}\n\t\t * @default StaticDrawUsage\n\t\t */\n\t\tthis.usage = StaticDrawUsage;\n\n\t\t/**\n\t\t * This can be used to only update some components of stored vectors (for example, just the\n\t\t * component related to color). Use the `addUpdateRange()` function to add ranges to this array.\n\t\t *\n\t\t * @type {Array\u003cObject\u003e}\n\t\t */\n\t\tthis.updateRanges = [];\n\n\t\t/**\n\t\t * A version number, incremented every time the `needsUpdate` is set to `true`.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.version = 0;\n\n\t\t/**\n\t\t * The UUID of the interleaved buffer.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.uuid = generateUUID();\n\n\t}\n\n\t/**\n\t * A callback function that is executed after the renderer has transferred the attribute array\n\t * data to the GPU.\n\t */\n\tonUploadCallback() {}\n\n\t/**\n\t * Flag to indicate that this attribute has changed and should be re-sent to\n\t * the GPU. Set this to `true` when you modify the value of the array.\n\t *\n\t * @type {number}\n\t * @default false\n\t * @param {boolean} value\n\t */\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\t/**\n\t * Sets the usage of this interleaved buffer.\n\t *\n\t * @param {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)} value - The usage to set.\n\t * @return {InterleavedBuffer} A reference to this interleaved buffer.\n\t */\n\tsetUsage( value ) {\n\n\t\tthis.usage = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds a range of data in the data array to be updated on the GPU.\n\t *\n\t * @param {number} start - Position at which to start update.\n\t * @param {number} count - The number of components to update.\n\t */\n\taddUpdateRange( start, count ) {\n\n\t\tthis.updateRanges.push( { start, count } );\n\n\t}\n\n\t/**\n\t * Clears the update ranges.\n\t */\n\tclearUpdateRanges() {\n\n\t\tthis.updateRanges.length = 0;\n\n\t}\n\n\t/**\n\t * Copies the values of the given interleaved buffer to this instance.\n\t *\n\t * @param {InterleavedBuffer} source - The interleaved buffer to copy.\n\t * @return {InterleavedBuffer} A reference to this instance.\n\t */\n\tcopy( source ) {\n\n\t\tthis.array = new source.array.constructor( source.array );\n\t\tthis.count = source.count;\n\t\tthis.stride = source.stride;\n\t\tthis.usage = source.usage;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies a vector from the given interleaved buffer to this one. The start\n\t * and destination position in the attribute buffers are represented by the\n\t * given indices.\n\t *\n\t * @param {number} index1 - The destination index into this interleaved buffer.\n\t * @param {InterleavedBuffer} interleavedBuffer - The interleaved buffer to copy from.\n\t * @param {number} index2 - The source index into the given interleaved buffer.\n\t * @return {InterleavedBuffer} A reference to this instance.\n\t */\n\tcopyAt( index1, interleavedBuffer, index2 ) {\n\n\t\tindex1 *= this.stride;\n\t\tindex2 *= interleavedBuffer.stride;\n\n\t\tfor ( let i = 0, l = this.stride; i \u003c l; i ++ ) {\n\n\t\t\tthis.array[ index1 + i ] = interleavedBuffer.array[ index2 + i ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given array data in the interleaved buffer.\n\t *\n\t * @param {(TypedArray|Array)} value - The array data to set.\n\t * @param {number} [offset=0] - The offset in this interleaved buffer's array.\n\t * @return {InterleavedBuffer} A reference to this instance.\n\t */\n\tset( value, offset = 0 ) {\n\n\t\tthis.array.set( value, offset );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new interleaved buffer with copied values from this instance.\n\t *\n\t * @param {Object} [data] - An object with shared array buffers that allows to retain shared structures.\n\t * @return {InterleavedBuffer} A clone of this instance.\n\t */\n\tclone( data ) {\n\n\t\tif ( data.arrayBuffers === undefined ) {\n\n\t\t\tdata.arrayBuffers = {};\n\n\t\t}\n\n\t\tif ( this.array.buffer._uuid === undefined ) {\n\n\t\t\tthis.array.buffer._uuid = generateUUID();\n\n\t\t}\n\n\t\tif ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) {\n\n\t\t\tdata.arrayBuffers[ this.array.buffer._uuid ] = this.array.slice( 0 ).buffer;\n\n\t\t}\n\n\t\tconst array = new this.array.constructor( data.arrayBuffers[ this.array.buffer._uuid ] );\n\n\t\tconst ib = new this.constructor( array, this.stride );\n\t\tib.setUsage( this.usage );\n\n\t\treturn ib;\n\n\t}\n\n\t/**\n\t * Sets the given callback function that is executed after the Renderer has transferred\n\t * the array data to the GPU. Can be used to perform clean-up operations after\n\t * the upload when data are not needed anymore on the CPU side.\n\t *\n\t * @param {Function} callback - The `onUpload()` callback.\n\t * @return {InterleavedBuffer} A reference to this instance.\n\t */\n\tonUpload( callback ) {\n\n\t\tthis.onUploadCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Serializes the interleaved buffer into JSON.\n\t *\n\t * @param {Object} [data] - An optional value holding meta information about the serialization.\n\t * @return {Object} A JSON object representing the serialized interleaved buffer.\n\t */\n\ttoJSON( data ) {\n\n\t\tif ( data.arrayBuffers === undefined ) {\n\n\t\t\tdata.arrayBuffers = {};\n\n\t\t}\n\n\t\t// generate UUID for array buffer if necessary\n\n\t\tif ( this.array.buffer._uuid === undefined ) {\n\n\t\t\tthis.array.buffer._uuid = generateUUID();\n\n\t\t}\n\n\t\tif ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) {\n\n\t\t\tdata.arrayBuffers[ this.array.buffer._uuid ] = Array.from( new Uint32Array( this.array.buffer ) );\n\n\t\t}\n\n\t\t//\n\n\t\treturn {\n\t\t\tuuid: this.uuid,\n\t\t\tbuffer: this.array.buffer._uuid,\n\t\t\ttype: this.array.constructor.name,\n\t\t\tstride: this.stride\n\t\t};\n\n\t}\n\n}\n\nconst _vector$7 = /*@__PURE__*/ new Vector3();\n\n/**\n * An alternative version of a buffer attribute with interleaved data. Interleaved\n * attributes share a common interleaved data storage ({@link InterleavedBuffer}) and refer with\n * different offsets into the buffer.\n */\nclass InterleavedBufferAttribute {\n\n\t/**\n\t * Constructs a new interleaved buffer attribute.\n\t *\n\t * @param {InterleavedBuffer} interleavedBuffer - The buffer holding the interleaved data.\n\t * @param {number} itemSize - The item size.\n\t * @param {number} offset - The attribute offset into the buffer.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( interleavedBuffer, itemSize, offset, normalized = false ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isInterleavedBufferAttribute = true;\n\n\t\t/**\n\t\t * The name of the buffer attribute.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\n\t\t/**\n\t\t * The buffer holding the interleaved data.\n\t\t *\n\t\t * @type {InterleavedBuffer}\n\t\t */\n\t\tthis.data = interleavedBuffer;\n\n\t\t/**\n\t\t * The item size, see {@link BufferAttribute#itemSize}.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.itemSize = itemSize;\n\n\t\t/**\n\t\t * The attribute offset into the buffer.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.offset = offset;\n\n\t\t/**\n\t\t * Whether the data are normalized or not, see {@link BufferAttribute#normalized}\n\t\t *\n\t\t * @type {InterleavedBuffer}\n\t\t */\n\t\tthis.normalized = normalized;\n\n\t}\n\n\t/**\n\t * The item count of this buffer attribute.\n\t *\n\t * @type {number}\n\t * @readonly\n\t */\n\tget count() {\n\n\t\treturn this.data.count;\n\n\t}\n\n\t/**\n\t * The array holding the interleaved buffer attribute data.\n\t *\n\t * @type {TypedArray}\n\t */\n\tget array() {\n\n\t\treturn this.data.array;\n\n\t}\n\n\t/**\n\t * Flag to indicate that this attribute has changed and should be re-sent to\n\t * the GPU. Set this to `true` when you modify the value of the array.\n\t *\n\t * @type {number}\n\t * @default false\n\t * @param {boolean} value\n\t */\n\tset needsUpdate( value ) {\n\n\t\tthis.data.needsUpdate = value;\n\n\t}\n\n\t/**\n\t * Applies the given 4x4 matrix to the given attribute. Only works with\n\t * item size `3`.\n\t *\n\t * @param {Matrix4} m - The matrix to apply.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tapplyMatrix4( m ) {\n\n\t\tfor ( let i = 0, l = this.data.count; i \u003c l; i ++ ) {\n\n\t\t\t_vector$7.fromBufferAttribute( this, i );\n\n\t\t\t_vector$7.applyMatrix4( m );\n\n\t\t\tthis.setXYZ( i, _vector$7.x, _vector$7.y, _vector$7.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Applies the given 3x3 normal matrix to the given attribute. Only works with\n\t * item size `3`.\n\t *\n\t * @param {Matrix3} m - The normal matrix to apply.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tapplyNormalMatrix( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i \u003c l; i ++ ) {\n\n\t\t\t_vector$7.fromBufferAttribute( this, i );\n\n\t\t\t_vector$7.applyNormalMatrix( m );\n\n\t\t\tthis.setXYZ( i, _vector$7.x, _vector$7.y, _vector$7.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Applies the given 4x4 matrix to the given attribute. Only works with\n\t * item size `3` and with direction vectors.\n\t *\n\t * @param {Matrix4} m - The matrix to apply.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\ttransformDirection( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i \u003c l; i ++ ) {\n\n\t\t\t_vector$7.fromBufferAttribute( this, i );\n\n\t\t\t_vector$7.transformDirection( m );\n\n\t\t\tthis.setXYZ( i, _vector$7.x, _vector$7.y, _vector$7.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the given component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} component - The component index.\n\t * @return {number} The returned value.\n\t */\n\tgetComponent( index, component ) {\n\n\t\tlet value = this.array[ index * this.data.stride + this.offset + component ];\n\n\t\tif ( this.normalized ) value = denormalize( value, this.array );\n\n\t\treturn value;\n\n\t}\n\n\t/**\n\t * Sets the given value to the given component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} component - The component index.\n\t * @param {number} value - The value to set.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tsetComponent( index, component, value ) {\n\n\t\tif ( this.normalized ) value = normalize( value, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + component ] = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the x component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} x - The value to set.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tsetX( index, x ) {\n\n\t\tif ( this.normalized ) x = normalize( x, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset ] = x;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the y component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} y - The value to set.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tsetY( index, y ) {\n\n\t\tif ( this.normalized ) y = normalize( y, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the z component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} z - The value to set.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tsetZ( index, z ) {\n\n\t\tif ( this.normalized ) z = normalize( z, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the w component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} w - The value to set.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tsetW( index, w ) {\n\n\t\tif ( this.normalized ) w = normalize( w, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the x component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @return {number} The x component.\n\t */\n\tgetX( index ) {\n\n\t\tlet x = this.data.array[ index * this.data.stride + this.offset ];\n\n\t\tif ( this.normalized ) x = denormalize( x, this.array );\n\n\t\treturn x;\n\n\t}\n\n\t/**\n\t * Returns the y component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @return {number} The y component.\n\t */\n\tgetY( index ) {\n\n\t\tlet y = this.data.array[ index * this.data.stride + this.offset + 1 ];\n\n\t\tif ( this.normalized ) y = denormalize( y, this.array );\n\n\t\treturn y;\n\n\t}\n\n\t/**\n\t * Returns the z component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @return {number} The z component.\n\t */\n\tgetZ( index ) {\n\n\t\tlet z = this.data.array[ index * this.data.stride + this.offset + 2 ];\n\n\t\tif ( this.normalized ) z = denormalize( z, this.array );\n\n\t\treturn z;\n\n\t}\n\n\t/**\n\t * Returns the w component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @return {number} The w component.\n\t */\n\tgetW( index ) {\n\n\t\tlet w = this.data.array[ index * this.data.stride + this.offset + 3 ];\n\n\t\tif ( this.normalized ) w = denormalize( w, this.array );\n\n\t\treturn w;\n\n\t}\n\n\t/**\n\t * Sets the x and y component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} x - The value for the x component to set.\n\t * @param {number} y - The value for the y component to set.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tsetXY( index, x, y ) {\n\n\t\tindex = index * this.data.stride + this.offset;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\n\t\t}\n\n\t\tthis.data.array[ index + 0 ] = x;\n\t\tthis.data.array[ index + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the x, y and z component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} x - The value for the x component to set.\n\t * @param {number} y - The value for the y component to set.\n\t * @param {number} z - The value for the z component to set.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tsetXYZ( index, x, y, z ) {\n\n\t\tindex = index * this.data.stride + this.offset;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\n\t\t}\n\n\t\tthis.data.array[ index + 0 ] = x;\n\t\tthis.data.array[ index + 1 ] = y;\n\t\tthis.data.array[ index + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the x, y, z and w component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} x - The value for the x component to set.\n\t * @param {number} y - The value for the y component to set.\n\t * @param {number} z - The value for the z component to set.\n\t * @param {number} w - The value for the w component to set.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tsetXYZW( index, x, y, z, w ) {\n\n\t\tindex = index * this.data.stride + this.offset;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\t\t\tw = normalize( w, this.array );\n\n\t\t}\n\n\t\tthis.data.array[ index + 0 ] = x;\n\t\tthis.data.array[ index + 1 ] = y;\n\t\tthis.data.array[ index + 2 ] = z;\n\t\tthis.data.array[ index + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new buffer attribute with copied values from this instance.\n\t *\n\t * If no parameter is provided, cloning an interleaved buffer attribute will de-interleave buffer data.\n\t *\n\t * @param {Object} [data] - An object with interleaved buffers that allows to retain the interleaved property.\n\t * @return {BufferAttribute|InterleavedBufferAttribute} A clone of this instance.\n\t */\n\tclone( data ) {\n\n\t\tif ( data === undefined ) {\n\n\t\t\tlog( 'InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.' );\n\n\t\t\tconst array = [];\n\n\t\t\tfor ( let i = 0; i \u003c this.count; i ++ ) {\n\n\t\t\t\tconst index = i * this.data.stride + this.offset;\n\n\t\t\t\tfor ( let j = 0; j \u003c this.itemSize; j ++ ) {\n\n\t\t\t\t\tarray.push( this.data.array[ index + j ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn new BufferAttribute( new this.array.constructor( array ), this.itemSize, this.normalized );\n\n\t\t} else {\n\n\t\t\tif ( data.interleavedBuffers === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers = {};\n\n\t\t\t}\n\n\t\t\tif ( data.interleavedBuffers[ this.data.uuid ] === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers[ this.data.uuid ] = this.data.clone( data );\n\n\t\t\t}\n\n\t\t\treturn new InterleavedBufferAttribute( data.interleavedBuffers[ this.data.uuid ], this.itemSize, this.offset, this.normalized );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Serializes the buffer attribute into JSON.\n\t *\n\t * If no parameter is provided, cloning an interleaved buffer attribute will de-interleave buffer data.\n\t *\n\t * @param {Object} [data] - An optional value holding meta information about the serialization.\n\t * @return {Object} A JSON object representing the serialized buffer attribute.\n\t */\n\ttoJSON( data ) {\n\n\t\tif ( data === undefined ) {\n\n\t\t\tlog( 'InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.' );\n\n\t\t\tconst array = [];\n\n\t\t\tfor ( let i = 0; i \u003c this.count; i ++ ) {\n\n\t\t\t\tconst index = i * this.data.stride + this.offset;\n\n\t\t\t\tfor ( let j = 0; j \u003c this.itemSize; j ++ ) {\n\n\t\t\t\t\tarray.push( this.data.array[ index + j ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// de-interleave data and save it as an ordinary buffer attribute for now\n\n\t\t\treturn {\n\t\t\t\titemSize: this.itemSize,\n\t\t\t\ttype: this.array.constructor.name,\n\t\t\t\tarray: array,\n\t\t\t\tnormalized: this.normalized\n\t\t\t};\n\n\t\t} else {\n\n\t\t\t// save as true interleaved attribute\n\n\t\t\tif ( data.interleavedBuffers === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers = {};\n\n\t\t\t}\n\n\t\t\tif ( data.interleavedBuffers[ this.data.uuid ] === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers[ this.data.uuid ] = this.data.toJSON( data );\n\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tisInterleavedBufferAttribute: true,\n\t\t\t\titemSize: this.itemSize,\n\t\t\t\tdata: this.data.uuid,\n\t\t\t\toffset: this.offset,\n\t\t\t\tnormalized: this.normalized\n\t\t\t};\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * A material for rendering instances of {@link Sprite}.\n *\n * ```js\n * const map = new THREE.TextureLoader().load( 'textures/sprite.png' );\n * const material = new THREE.SpriteMaterial( { map: map, color: 0xffffff } );\n *\n * const sprite = new THREE.Sprite( material );\n * sprite.scale.set(200, 200, 1)\n * scene.add( sprite );\n * ```\n *\n * @augments Material\n */\nclass SpriteMaterial extends Material {\n\n\t/**\n\t * Constructs a new sprite material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSpriteMaterial = true;\n\n\t\tthis.type = 'SpriteMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff );\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * The rotation of the sprite in radians.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.rotation = 0;\n\n\t\t/**\n\t\t * Specifies whether size of the sprite is attenuated by the camera depth (perspective camera only).\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.sizeAttenuation = true;\n\n\t\t/**\n\t\t * Overwritten since sprite materials are transparent\n\t\t * by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.transparent = true;\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.rotation = source.rotation;\n\n\t\tthis.sizeAttenuation = source.sizeAttenuation;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nlet _geometry;\n\nconst _intersectPoint = /*@__PURE__*/ new Vector3();\nconst _worldScale = /*@__PURE__*/ new Vector3();\nconst _mvPosition = /*@__PURE__*/ new Vector3();\n\nconst _alignedPosition = /*@__PURE__*/ new Vector2();\nconst _rotatedPosition = /*@__PURE__*/ new Vector2();\nconst _viewWorldMatrix = /*@__PURE__*/ new Matrix4();\n\nconst _vA = /*@__PURE__*/ new Vector3();\nconst _vB = /*@__PURE__*/ new Vector3();\nconst _vC = /*@__PURE__*/ new Vector3();\n\nconst _uvA = /*@__PURE__*/ new Vector2();\nconst _uvB = /*@__PURE__*/ new Vector2();\nconst _uvC = /*@__PURE__*/ new Vector2();\n\n/**\n * A sprite is a plane that always faces towards the camera, generally with a\n * partially transparent texture applied.\n *\n * Sprites do not cast shadows, setting {@link Object3D#castShadow} to `true` will\n * have no effect.\n *\n * ```js\n * const map = new THREE.TextureLoader().load( 'sprite.png' );\n * const material = new THREE.SpriteMaterial( { map: map } );\n *\n * const sprite = new THREE.Sprite( material );\n * scene.add( sprite );\n * ```\n *\n * @augments Object3D\n */\nclass Sprite extends Object3D {\n\n\t/**\n\t * Constructs a new sprite.\n\t *\n\t * @param {(SpriteMaterial|SpriteNodeMaterial)} [material] - The sprite material.\n\t */\n\tconstructor( material = new SpriteMaterial() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSprite = true;\n\n\t\tthis.type = 'Sprite';\n\n\t\tif ( _geometry === undefined ) {\n\n\t\t\t_geometry = new BufferGeometry();\n\n\t\t\tconst float32Array = new Float32Array( [\n\t\t\t\t-0.5, -0.5, 0, 0, 0,\n\t\t\t\t0.5, -0.5, 0, 1, 0,\n\t\t\t\t0.5, 0.5, 0, 1, 1,\n\t\t\t\t-0.5, 0.5, 0, 0, 1\n\t\t\t] );\n\n\t\t\tconst interleavedBuffer = new InterleavedBuffer( float32Array, 5 );\n\n\t\t\t_geometry.setIndex( [ 0, 1, 2,\t0, 2, 3 ] );\n\t\t\t_geometry.setAttribute( 'position', new InterleavedBufferAttribute( interleavedBuffer, 3, 0, false ) );\n\t\t\t_geometry.setAttribute( 'uv', new InterleavedBufferAttribute( interleavedBuffer, 2, 3, false ) );\n\n\t\t}\n\n\t\t/**\n\t\t * The sprite geometry.\n\t\t *\n\t\t * @type {BufferGeometry}\n\t\t */\n\t\tthis.geometry = _geometry;\n\n\t\t/**\n\t\t * The sprite material.\n\t\t *\n\t\t * @type {(SpriteMaterial|SpriteNodeMaterial)}\n\t\t */\n\t\tthis.material = material;\n\n\t\t/**\n\t\t * The sprite's anchor point, and the point around which the sprite rotates.\n\t\t * A value of `(0.5, 0.5)` corresponds to the midpoint of the sprite. A value\n\t\t * of `(0, 0)` corresponds to the lower left corner of the sprite.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (0.5,0.5)\n\t\t */\n\t\tthis.center = new Vector2( 0.5, 0.5 );\n\n\t\t/**\n\t\t * The number of instances of this sprite.\n\t\t * Can only be used with {@link WebGPURenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.count = 1;\n\n\t}\n\n\t/**\n\t * Computes intersection points between a casted ray and this sprite.\n\t *\n\t * @param {Raycaster} raycaster - The raycaster.\n\t * @param {Array\u003cObject\u003e} intersects - The target array that holds the intersection points.\n\t */\n\traycast( raycaster, intersects ) {\n\n\t\tif ( raycaster.camera === null ) {\n\n\t\t\terror( 'Sprite: \"Raycaster.camera\" needs to be set in order to raycast against sprites.' );\n\n\t\t}\n\n\t\t_worldScale.setFromMatrixScale( this.matrixWorld );\n\n\t\t_viewWorldMatrix.copy( raycaster.camera.matrixWorld );\n\t\tthis.modelViewMatrix.multiplyMatrices( raycaster.camera.matrixWorldInverse, this.matrixWorld );\n\n\t\t_mvPosition.setFromMatrixPosition( this.modelViewMatrix );\n\n\t\tif ( raycaster.camera.isPerspectiveCamera \u0026\u0026 this.material.sizeAttenuation === false ) {\n\n\t\t\t_worldScale.multiplyScalar( - _mvPosition.z );\n\n\t\t}\n\n\t\tconst rotation = this.material.rotation;\n\t\tlet sin, cos;\n\n\t\tif ( rotation !== 0 ) {\n\n\t\t\tcos = Math.cos( rotation );\n\t\t\tsin = Math.sin( rotation );\n\n\t\t}\n\n\t\tconst center = this.center;\n\n\t\ttransformVertex( _vA.set( -0.5, -0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\t\ttransformVertex( _vB.set( 0.5, -0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\t\ttransformVertex( _vC.set( 0.5, 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\n\t\t_uvA.set( 0, 0 );\n\t\t_uvB.set( 1, 0 );\n\t\t_uvC.set( 1, 1 );\n\n\t\t// check first triangle\n\t\tlet intersect = raycaster.ray.intersectTriangle( _vA, _vB, _vC, false, _intersectPoint );\n\n\t\tif ( intersect === null ) {\n\n\t\t\t// check second triangle\n\t\t\ttransformVertex( _vB.set( -0.5, 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\t\t\t_uvB.set( 0, 1 );\n\n\t\t\tintersect = raycaster.ray.intersectTriangle( _vA, _vC, _vB, false, _intersectPoint );\n\t\t\tif ( intersect === null ) {\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst distance = raycaster.ray.origin.distanceTo( _intersectPoint );\n\n\t\tif ( distance \u003c raycaster.near || distance \u003e raycaster.far ) return;\n\n\t\tintersects.push( {\n\n\t\t\tdistance: distance,\n\t\t\tpoint: _intersectPoint.clone(),\n\t\t\tuv: Triangle.getInterpolation( _intersectPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2() ),\n\t\t\tface: null,\n\t\t\tobject: this\n\n\t\t} );\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tif ( source.center !== undefined ) this.center.copy( source.center );\n\n\t\tthis.material = source.material;\n\n\t\treturn this;\n\n\t}\n\n}\n\nfunction transformVertex( vertexPosition, mvPosition, center, scale, sin, cos ) {\n\n\t// compute position in camera space\n\t_alignedPosition.subVectors( vertexPosition, center ).addScalar( 0.5 ).multiply( scale );\n\n\t// to check if rotation is not zero\n\tif ( sin !== undefined ) {\n\n\t\t_rotatedPosition.x = ( cos * _alignedPosition.x ) - ( sin * _alignedPosition.y );\n\t\t_rotatedPosition.y = ( sin * _alignedPosition.x ) + ( cos * _alignedPosition.y );\n\n\t} else {\n\n\t\t_rotatedPosition.copy( _alignedPosition );\n\n\t}\n\n\n\tvertexPosition.copy( mvPosition );\n\tvertexPosition.x += _rotatedPosition.x;\n\tvertexPosition.y += _rotatedPosition.y;\n\n\t// transform to world space\n\tvertexPosition.applyMatrix4( _viewWorldMatrix );\n\n}\n\nconst _v1$2 = /*@__PURE__*/ new Vector3();\nconst _v2$1 = /*@__PURE__*/ new Vector3();\n\n/**\n * A component for providing a basic Level of Detail (LOD) mechanism.\n *\n * Every LOD level is associated with an object, and rendering can be switched\n * between them at the distances specified. Typically you would create, say,\n * three meshes, one for far away (low detail), one for mid range (medium\n * detail) and one for close up (high detail).\n *\n * ```js\n * const lod = new THREE.LOD();\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n *\n * //Create spheres with 3 levels of detail and create new LOD levels for them\n * for( let i = 0; i \u003c 3; i++ ) {\n *\n * \tconst geometry = new THREE.IcosahedronGeometry( 10, 3 - i );\n * \tconst mesh = new THREE.Mesh( geometry, material );\n * \tlod.addLevel( mesh, i * 75 );\n *\n * }\n *\n * scene.add( lod );\n * ```\n *\n * @augments Object3D\n */\nclass LOD extends Object3D {\n\n\t/**\n\t * Constructs a new LOD.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLOD = true;\n\n\t\t/**\n\t\t * The current LOD index.\n\t\t *\n\t\t * @private\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis._currentLevel = 0;\n\n\t\tthis.type = 'LOD';\n\n\t\tObject.defineProperties( this, {\n\t\t\t/**\n\t\t\t * This array holds the LOD levels.\n\t\t\t *\n\t\t\t * @name LOD#levels\n\t\t\t * @type {Array\u003c{object:Object3D,distance:number,hysteresis:number}\u003e}\n\t\t\t */\n\t\t\tlevels: {\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: []\n\t\t\t}\n\t\t} );\n\n\t\t/**\n\t\t * Whether the LOD object is updated automatically by the renderer per frame\n\t\t * or not. If set to `false`, you have to call {@link LOD#update} in the\n\t\t * render loop by yourself.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.autoUpdate = true;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source, false );\n\n\t\tconst levels = source.levels;\n\n\t\tfor ( let i = 0, l = levels.length; i \u003c l; i ++ ) {\n\n\t\t\tconst level = levels[ i ];\n\n\t\t\tthis.addLevel( level.object.clone(), level.distance, level.hysteresis );\n\n\t\t}\n\n\t\tthis.autoUpdate = source.autoUpdate;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds a mesh that will display at a certain distance and greater. Typically\n\t * the further away the distance, the lower the detail on the mesh.\n\t *\n\t * @param {Object3D} object - The 3D object to display at this level.\n\t * @param {number} [distance=0] - The distance at which to display this level of detail.\n\t * @param {number} [hysteresis=0] - Threshold used to avoid flickering at LOD boundaries, as a fraction of distance.\n\t * @return {LOD} A reference to this instance.\n\t */\n\taddLevel( object, distance = 0, hysteresis = 0 ) {\n\n\t\tdistance = Math.abs( distance );\n\n\t\tconst levels = this.levels;\n\n\t\tlet l;\n\n\t\tfor ( l = 0; l \u003c levels.length; l ++ ) {\n\n\t\t\tif ( distance \u003c levels[ l ].distance ) {\n\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tlevels.splice( l, 0, { distance: distance, hysteresis: hysteresis, object: object } );\n\n\t\tthis.add( object );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Removes an existing level, based on the distance from the camera.\n\t * Returns `true` when the level has been removed. Otherwise `false`.\n\t *\n\t * @param {number} distance - Distance of the level to remove.\n\t * @return {boolean} Whether the level has been removed or not.\n\t */\n\tremoveLevel( distance ) {\n\n\t\tconst levels = this.levels;\n\n\t\tfor ( let i = 0; i \u003c levels.length; i ++ ) {\n\n\t\t\tif ( levels[ i ].distance === distance ) {\n\n\t\t\t\tconst removedElements = levels.splice( i, 1 );\n\t\t\t\tthis.remove( removedElements[ 0 ].object );\n\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\t/**\n\t * Returns the currently active LOD level index.\n\t *\n\t * @return {number} The current active LOD level index.\n\t */\n\tgetCurrentLevel() {\n\n\t\treturn this._currentLevel;\n\n\t}\n\n\t/**\n\t * Returns a reference to the first 3D object that is greater than\n\t * the given distance.\n\t *\n\t * @param {number} distance - The LOD distance.\n\t * @return {?Object3D} The found 3D object. `null` if no 3D object has been found.\n\t */\n\tgetObjectForDistance( distance ) {\n\n\t\tconst levels = this.levels;\n\n\t\tif ( levels.length \u003e 0 ) {\n\n\t\t\tlet i, l;\n\n\t\t\tfor ( i = 1, l = levels.length; i \u003c l; i ++ ) {\n\n\t\t\t\tlet levelDistance = levels[ i ].distance;\n\n\t\t\t\tif ( levels[ i ].object.visible ) {\n\n\t\t\t\t\tlevelDistance -= levelDistance * levels[ i ].hysteresis;\n\n\t\t\t\t}\n\n\t\t\t\tif ( distance \u003c levelDistance ) {\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn levels[ i - 1 ].object;\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\t/**\n\t * Computes intersection points between a casted ray and this LOD.\n\t *\n\t * @param {Raycaster} raycaster - The raycaster.\n\t * @param {Array\u003cObject\u003e} intersects - The target array that holds the intersection points.\n\t */\n\traycast( raycaster, intersects ) {\n\n\t\tconst levels = this.levels;\n\n\t\tif ( levels.length \u003e 0 ) {\n\n\t\t\t_v1$2.setFromMatrixPosition( this.matrixWorld );\n\n\t\t\tconst distance = raycaster.ray.origin.distanceTo( _v1$2 );\n\n\t\t\tthis.getObjectForDistance( distance ).raycast( raycaster, intersects );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Updates the LOD by computing which LOD level should be visible according\n\t * to the current distance of the given camera.\n\t *\n\t * @param {Camera} camera - The camera the scene is rendered with.\n\t */\n\tupdate( camera ) {\n\n\t\tconst levels = this.levels;\n\n\t\tif ( levels.length \u003e 1 ) {\n\n\t\t\t_v1$2.setFromMatrixPosition( camera.matrixWorld );\n\t\t\t_v2$1.setFromMatrixPosition( this.matrixWorld );\n\n\t\t\tconst distance = _v1$2.distanceTo( _v2$1 ) / camera.zoom;\n\n\t\t\tlevels[ 0 ].object.visible = true;\n\n\t\t\tlet i, l;\n\n\t\t\tfor ( i = 1, l = levels.length; i \u003c l; i ++ ) {\n\n\t\t\t\tlet levelDistance = levels[ i ].distance;\n\n\t\t\t\tif ( levels[ i ].object.visible ) {\n\n\t\t\t\t\tlevelDistance -= levelDistance * levels[ i ].hysteresis;\n\n\t\t\t\t}\n\n\t\t\t\tif ( distance \u003e= levelDistance ) {\n\n\t\t\t\t\tlevels[ i - 1 ].object.visible = false;\n\t\t\t\t\tlevels[ i ].object.visible = true;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis._currentLevel = i - 1;\n\n\t\t\tfor ( ; i \u003c l; i ++ ) {\n\n\t\t\t\tlevels[ i ].object.visible = false;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tif ( this.autoUpdate === false ) data.object.autoUpdate = false;\n\n\t\tdata.object.levels = [];\n\n\t\tconst levels = this.levels;\n\n\t\tfor ( let i = 0, l = levels.length; i \u003c l; i ++ ) {\n\n\t\t\tconst level = levels[ i ];\n\n\t\t\tdata.object.levels.push( {\n\t\t\t\tobject: level.object.uuid,\n\t\t\t\tdistance: level.distance,\n\t\t\t\thysteresis: level.hysteresis\n\t\t\t} );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n}\n\nconst _basePosition = /*@__PURE__*/ new Vector3();\n\nconst _skinIndex = /*@__PURE__*/ new Vector4();\nconst _skinWeight = /*@__PURE__*/ new Vector4();\n\nconst _vector3 = /*@__PURE__*/ new Vector3();\nconst _matrix4 = /*@__PURE__*/ new Matrix4();\nconst _vertex = /*@__PURE__*/ new Vector3();\n\nconst _sphere$5 = /*@__PURE__*/ new Sphere();\nconst _inverseMatrix$2 = /*@__PURE__*/ new Matrix4();\nconst _ray$2 = /*@__PURE__*/ new Ray();\n\n/**\n * A mesh that has a {@link Skeleton} that can then be used to animate the\n * vertices of the geometry with skinning/skeleton animation.\n *\n * Next to a valid skeleton, the skinned mesh requires skin indices and weights\n * as buffer attributes in its geometry. These attribute define which bones affect a single\n * vertex to a certain extend.\n *\n * Typically skinned meshes are not created manually but loaders like {@link GLTFLoader}\n * or {@link FBXLoader } import respective models.\n *\n * @augments Mesh\n * @demo scenes/bones-browser.html\n */\nclass SkinnedMesh extends Mesh {\n\n\t/**\n\t * Constructs a new skinned mesh.\n\t *\n\t * @param {BufferGeometry} [geometry] - The mesh geometry.\n\t * @param {Material|Array\u003cMaterial\u003e} [material] - The mesh material.\n\t */\n\tconstructor( geometry, material ) {\n\n\t\tsuper( geometry, material );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSkinnedMesh = true;\n\n\t\tthis.type = 'SkinnedMesh';\n\n\t\t/**\n\t\t * `AttachedBindMode` means the skinned mesh shares the same world space as the skeleton.\n\t\t * This is not true when using `DetachedBindMode` which is useful when sharing a skeleton\n\t\t * across multiple skinned meshes.\n\t\t *\n\t\t * @type {(AttachedBindMode|DetachedBindMode)}\n\t\t * @default AttachedBindMode\n\t\t */\n\t\tthis.bindMode = AttachedBindMode;\n\n\t\t/**\n\t\t * The base matrix that is used for the bound bone transforms.\n\t\t *\n\t\t * @type {Matrix4}\n\t\t */\n\t\tthis.bindMatrix = new Matrix4();\n\n\t\t/**\n\t\t * The base matrix that is used for resetting the bound bone transforms.\n\t\t *\n\t\t * @type {Matrix4}\n\t\t */\n\t\tthis.bindMatrixInverse = new Matrix4();\n\n\t\t/**\n\t\t * The bounding box of the skinned mesh. Can be computed via {@link SkinnedMesh#computeBoundingBox}.\n\t\t *\n\t\t * @type {?Box3}\n\t\t * @default null\n\t\t */\n\t\tthis.boundingBox = null;\n\n\t\t/**\n\t\t * The bounding sphere of the skinned mesh. Can be computed via {@link SkinnedMesh#computeBoundingSphere}.\n\t\t *\n\t\t * @type {?Sphere}\n\t\t * @default null\n\t\t */\n\t\tthis.boundingSphere = null;\n\n\t}\n\n\t/**\n\t * Computes the bounding box of the skinned mesh, and updates {@link SkinnedMesh#boundingBox}.\n\t * The bounding box is not automatically computed by the engine; this method must be called by your app.\n\t * If the skinned mesh is animated, the bounding box should be recomputed per frame in order to reflect\n\t * the current animation state.\n\t */\n\tcomputeBoundingBox() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tif ( this.boundingBox === null ) {\n\n\t\t\tthis.boundingBox = new Box3();\n\n\t\t}\n\n\t\tthis.boundingBox.makeEmpty();\n\n\t\tconst positionAttribute = geometry.getAttribute( 'position' );\n\n\t\tfor ( let i = 0; i \u003c positionAttribute.count; i ++ ) {\n\n\t\t\tthis.getVertexPosition( i, _vertex );\n\t\t\tthis.boundingBox.expandByPoint( _vertex );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Computes the bounding sphere of the skinned mesh, and updates {@link SkinnedMesh#boundingSphere}.\n\t * The bounding sphere is automatically computed by the engine once when it is needed, e.g., for ray casting\n\t * and view frustum culling. If the skinned mesh is animated, the bounding sphere should be recomputed\n\t * per frame in order to reflect the current animation state.\n\t */\n\tcomputeBoundingSphere() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tif ( this.boundingSphere === null ) {\n\n\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tthis.boundingSphere.makeEmpty();\n\n\t\tconst positionAttribute = geometry.getAttribute( 'position' );\n\n\t\tfor ( let i = 0; i \u003c positionAttribute.count; i ++ ) {\n\n\t\t\tthis.getVertexPosition( i, _vertex );\n\t\t\tthis.boundingSphere.expandByPoint( _vertex );\n\n\t\t}\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.bindMode = source.bindMode;\n\t\tthis.bindMatrix.copy( source.bindMatrix );\n\t\tthis.bindMatrixInverse.copy( source.bindMatrixInverse );\n\n\t\tthis.skeleton = source.skeleton;\n\n\t\tif ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();\n\t\tif ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();\n\n\t\treturn this;\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst material = this.material;\n\t\tconst matrixWorld = this.matrixWorld;\n\n\t\tif ( material === undefined ) return;\n\n\t\t// test with bounding sphere in world space\n\n\t\tif ( this.boundingSphere === null ) this.computeBoundingSphere();\n\n\t\t_sphere$5.copy( this.boundingSphere );\n\t\t_sphere$5.applyMatrix4( matrixWorld );\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere$5 ) === false ) return;\n\n\t\t// convert ray to local space of skinned mesh\n\n\t\t_inverseMatrix$2.copy( matrixWorld ).invert();\n\t\t_ray$2.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$2 );\n\n\t\t// test with bounding box in local space\n\n\t\tif ( this.boundingBox !== null ) {\n\n\t\t\tif ( _ray$2.intersectsBox( this.boundingBox ) === false ) return;\n\n\t\t}\n\n\t\t// test for intersections with geometry\n\n\t\tthis._computeIntersections( raycaster, intersects, _ray$2 );\n\n\t}\n\n\tgetVertexPosition( index, target ) {\n\n\t\tsuper.getVertexPosition( index, target );\n\n\t\tthis.applyBoneTransform( index, target );\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Binds the given skeleton to the skinned mesh.\n\t *\n\t * @param {Skeleton} skeleton - The skeleton to bind.\n\t * @param {Matrix4} [bindMatrix] - The bind matrix. If no bind matrix is provided,\n\t * the skinned mesh's world matrix will be used instead.\n\t */\n\tbind( skeleton, bindMatrix ) {\n\n\t\tthis.skeleton = skeleton;\n\n\t\tif ( bindMatrix === undefined ) {\n\n\t\t\tthis.updateMatrixWorld( true );\n\n\t\t\tthis.skeleton.calculateInverses();\n\n\t\t\tbindMatrix = this.matrixWorld;\n\n\t\t}\n\n\t\tthis.bindMatrix.copy( bindMatrix );\n\t\tthis.bindMatrixInverse.copy( bindMatrix ).invert();\n\n\t}\n\n\t/**\n\t * This method sets the skinned mesh in the rest pose).\n\t */\n\tpose() {\n\n\t\tthis.skeleton.pose();\n\n\t}\n\n\t/**\n\t * Normalizes the skin weights which are defined as a buffer attribute\n\t * in the skinned mesh's geometry.\n\t */\n\tnormalizeSkinWeights() {\n\n\t\tconst vector = new Vector4();\n\n\t\tconst skinWeight = this.geometry.attributes.skinWeight;\n\n\t\tfor ( let i = 0, l = skinWeight.count; i \u003c l; i ++ ) {\n\n\t\t\tvector.fromBufferAttribute( skinWeight, i );\n\n\t\t\tconst scale = 1.0 / vector.manhattanLength();\n\n\t\t\tif ( scale !== Infinity ) {\n\n\t\t\t\tvector.multiplyScalar( scale );\n\n\t\t\t} else {\n\n\t\t\t\tvector.set( 1, 0, 0, 0 ); // do something reasonable\n\n\t\t\t}\n\n\t\t\tskinWeight.setXYZW( i, vector.x, vector.y, vector.z, vector.w );\n\n\t\t}\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tif ( this.bindMode === AttachedBindMode ) {\n\n\t\t\tthis.bindMatrixInverse.copy( this.matrixWorld ).invert();\n\n\t\t} else if ( this.bindMode === DetachedBindMode ) {\n\n\t\t\tthis.bindMatrixInverse.copy( this.bindMatrix ).invert();\n\n\t\t} else {\n\n\t\t\twarn( 'SkinnedMesh: Unrecognized bindMode: ' + this.bindMode );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Applies the bone transform associated with the given index to the given\n\t * vertex position. Returns the updated vector.\n\t *\n\t * @param {number} index - The vertex index.\n\t * @param {Vector3} target - The target object that is used to store the method's result.\n\t * the skinned mesh's world matrix will be used instead.\n\t * @return {Vector3} The updated vertex position.\n\t */\n\tapplyBoneTransform( index, target ) {\n\n\t\tconst skeleton = this.skeleton;\n\t\tconst geometry = this.geometry;\n\n\t\t_skinIndex.fromBufferAttribute( geometry.attributes.skinIndex, index );\n\t\t_skinWeight.fromBufferAttribute( geometry.attributes.skinWeight, index );\n\n\t\t_basePosition.copy( target ).applyMatrix4( this.bindMatrix );\n\n\t\ttarget.set( 0, 0, 0 );\n\n\t\tfor ( let i = 0; i \u003c 4; i ++ ) {\n\n\t\t\tconst weight = _skinWeight.getComponent( i );\n\n\t\t\tif ( weight !== 0 ) {\n\n\t\t\t\tconst boneIndex = _skinIndex.getComponent( i );\n\n\t\t\t\t_matrix4.multiplyMatrices( skeleton.bones[ boneIndex ].matrixWorld, skeleton.boneInverses[ boneIndex ] );\n\n\t\t\t\ttarget.addScaledVector( _vector3.copy( _basePosition ).applyMatrix4( _matrix4 ), weight );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn target.applyMatrix4( this.bindMatrixInverse );\n\n\t}\n\n}\n\n/**\n * A bone which is part of a {@link Skeleton}. The skeleton in turn is used by\n * the {@link SkinnedMesh}.\n *\n * ```js\n * const root = new THREE.Bone();\n * const child = new THREE.Bone();\n *\n * root.add( child );\n * child.position.y = 5;\n * ```\n *\n * @augments Object3D\n */\nclass Bone extends Object3D {\n\n\t/**\n\t * Constructs a new bone.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isBone = true;\n\n\t\tthis.type = 'Bone';\n\n\t}\n\n}\n\n/**\n * Creates a texture directly from raw buffer data.\n *\n * The interpretation of the data depends on type and format: If the type is\n * `UnsignedByteType`, a `Uint8Array` will be useful for addressing the\n * texel data. If the format is `RGBAFormat`, data needs four values for\n * one texel; Red, Green, Blue and Alpha (typically the opacity).\n *\n * @augments Texture\n */\nclass DataTexture extends Texture {\n\n\t/**\n\t * Constructs a new data texture.\n\t *\n\t * @param {?TypedArray} [data=null] - The buffer data.\n\t * @param {number} [width=1] - The width of the texture.\n\t * @param {number} [height=1] - The height of the texture.\n\t * @param {number} [format=RGBAFormat] - The texture format.\n\t * @param {number} [type=UnsignedByteType] - The texture type.\n\t * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.\n\t * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n\t * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n\t * @param {number} [magFilter=NearestFilter] - The mag filter value.\n\t * @param {number} [minFilter=NearestFilter] - The min filter value.\n\t * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n\t * @param {string} [colorSpace=NoColorSpace] - The color space.\n\t */\n\tconstructor( data = null, width = 1, height = 1, format, type, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, colorSpace ) {\n\n\t\tsuper( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isDataTexture = true;\n\n\t\t/**\n\t\t * The image definition of a data texture.\n\t\t *\n\t\t * @type {{data:TypedArray,width:number,height:number}}\n\t\t */\n\t\tthis.image = { data: data, width: width, height: height };\n\n\t\t/**\n\t\t * Whether to generate mipmaps (if possible) for a texture.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.generateMipmaps = false;\n\n\t\t/**\n\t\t * If set to `true`, the texture is flipped along the vertical axis when\n\t\t * uploaded to the GPU.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flipY = false;\n\n\t\t/**\n\t\t * Specifies the alignment requirements for the start of each pixel row in memory.\n\t\t *\n\t\t * Overwritten and set to `1` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default 1\n\t\t */\n\t\tthis.unpackAlignment = 1;\n\n\t}\n\n}\n\nconst _offsetMatrix = /*@__PURE__*/ new Matrix4();\nconst _identityMatrix = /*@__PURE__*/ new Matrix4();\n\n/**\n * Class for representing the armatures in `three.js`. The skeleton\n * is defined by a hierarchy of bones.\n *\n * ```js\n * const bones = [];\n *\n * const shoulder = new THREE.Bone();\n * const elbow = new THREE.Bone();\n * const hand = new THREE.Bone();\n *\n * shoulder.add( elbow );\n * elbow.add( hand );\n *\n * bones.push( shoulder , elbow, hand);\n *\n * shoulder.position.y = -5;\n * elbow.position.y = 0;\n * hand.position.y = 5;\n *\n * const armSkeleton = new THREE.Skeleton( bones );\n * ```\n */\nclass Skeleton {\n\n\t/**\n\t * Constructs a new skeleton.\n\t *\n\t * @param {Array\u003cBone\u003e} [bones] - An array of bones.\n\t * @param {Array\u003cMatrix4\u003e} [boneInverses] - An array of bone inverse matrices.\n\t * If not provided, these matrices will be computed automatically via {@link Skeleton#calculateInverses}.\n\t */\n\tconstructor( bones = [], boneInverses = [] ) {\n\n\t\tthis.uuid = generateUUID();\n\n\t\t/**\n\t\t * An array of bones defining the skeleton.\n\t\t *\n\t\t * @type {Array\u003cBone\u003e}\n\t\t */\n\t\tthis.bones = bones.slice( 0 );\n\n\t\t/**\n\t\t * An array of bone inverse matrices.\n\t\t *\n\t\t * @type {Array\u003cMatrix4\u003e}\n\t\t */\n\t\tthis.boneInverses = boneInverses;\n\n\t\t/**\n\t\t * An array buffer holding the bone data.\n\t\t * Input data for {@link Skeleton#boneTexture}.\n\t\t *\n\t\t * @type {?Float32Array}\n\t\t * @default null\n\t\t */\n\t\tthis.boneMatrices = null;\n\n\t\t/**\n\t\t * An array buffer holding the bone data of the previous frame.\n\t\t * Required for computing velocity. Maintained in {@link SkinningNode}.\n\t\t *\n\t\t * @type {?Float32Array}\n\t\t * @default null\n\t\t */\n\t\tthis.previousBoneMatrices = null;\n\n\t\t/**\n\t\t * A texture holding the bone data for use\n\t\t * in the vertex shader.\n\t\t *\n\t\t * @type {?DataTexture}\n\t\t * @default null\n\t\t */\n\t\tthis.boneTexture = null;\n\n\t\tthis.init();\n\n\t}\n\n\t/**\n\t * Initializes the skeleton. This method gets automatically called by the constructor\n\t * but depending on how the skeleton is created it might be necessary to call this method\n\t * manually.\n\t */\n\tinit() {\n\n\t\tconst bones = this.bones;\n\t\tconst boneInverses = this.boneInverses;\n\n\t\tthis.boneMatrices = new Float32Array( bones.length * 16 );\n\n\t\t// calculate inverse bone matrices if necessary\n\n\t\tif ( boneInverses.length === 0 ) {\n\n\t\t\tthis.calculateInverses();\n\n\t\t} else {\n\n\t\t\t// handle special case\n\n\t\t\tif ( bones.length !== boneInverses.length ) {\n\n\t\t\t\twarn( 'Skeleton: Number of inverse bone matrices does not match amount of bones.' );\n\n\t\t\t\tthis.boneInverses = [];\n\n\t\t\t\tfor ( let i = 0, il = this.bones.length; i \u003c il; i ++ ) {\n\n\t\t\t\t\tthis.boneInverses.push( new Matrix4() );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Computes the bone inverse matrices. This method resets {@link Skeleton#boneInverses}\n\t * and fills it with new matrices.\n\t */\n\tcalculateInverses() {\n\n\t\tthis.boneInverses.length = 0;\n\n\t\tfor ( let i = 0, il = this.bones.length; i \u003c il; i ++ ) {\n\n\t\t\tconst inverse = new Matrix4();\n\n\t\t\tif ( this.bones[ i ] ) {\n\n\t\t\t\tinverse.copy( this.bones[ i ].matrixWorld ).invert();\n\n\t\t\t}\n\n\t\t\tthis.boneInverses.push( inverse );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Resets the skeleton to the base pose.\n\t */\n\tpose() {\n\n\t\t// recover the bind-time world matrices\n\n\t\tfor ( let i = 0, il = this.bones.length; i \u003c il; i ++ ) {\n\n\t\t\tconst bone = this.bones[ i ];\n\n\t\t\tif ( bone ) {\n\n\t\t\t\tbone.matrixWorld.copy( this.boneInverses[ i ] ).invert();\n\n\t\t\t}\n\n\t\t}\n\n\t\t// compute the local matrices, positions, rotations and scales\n\n\t\tfor ( let i = 0, il = this.bones.length; i \u003c il; i ++ ) {\n\n\t\t\tconst bone = this.bones[ i ];\n\n\t\t\tif ( bone ) {\n\n\t\t\t\tif ( bone.parent \u0026\u0026 bone.parent.isBone ) {\n\n\t\t\t\t\tbone.matrix.copy( bone.parent.matrixWorld ).invert();\n\t\t\t\t\tbone.matrix.multiply( bone.matrixWorld );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tbone.matrix.copy( bone.matrixWorld );\n\n\t\t\t\t}\n\n\t\t\t\tbone.matrix.decompose( bone.position, bone.quaternion, bone.scale );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Resets the skeleton to the base pose.\n\t */\n\tupdate() {\n\n\t\tconst bones = this.bones;\n\t\tconst boneInverses = this.boneInverses;\n\t\tconst boneMatrices = this.boneMatrices;\n\t\tconst boneTexture = this.boneTexture;\n\n\t\t// flatten bone matrices to array\n\n\t\tfor ( let i = 0, il = bones.length; i \u003c il; i ++ ) {\n\n\t\t\t// compute the offset between the current and the original transform\n\n\t\t\tconst matrix = bones[ i ] ? bones[ i ].matrixWorld : _identityMatrix;\n\n\t\t\t_offsetMatrix.multiplyMatrices( matrix, boneInverses[ i ] );\n\t\t\t_offsetMatrix.toArray( boneMatrices, i * 16 );\n\n\t\t}\n\n\t\tif ( boneTexture !== null ) {\n\n\t\t\tboneTexture.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns a new skeleton with copied values from this instance.\n\t *\n\t * @return {Skeleton} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new Skeleton( this.bones, this.boneInverses );\n\n\t}\n\n\t/**\n\t * Computes a data texture for passing bone data to the vertex shader.\n\t *\n\t * @return {Skeleton} A reference of this instance.\n\t */\n\tcomputeBoneTexture() {\n\n\t\t// layout (1 matrix = 4 pixels)\n\t\t//      RGBA RGBA RGBA RGBA (=\u003e column1, column2, column3, column4)\n\t\t//  with  8x8  pixel texture max   16 bones * 4 pixels =  (8 * 8)\n\t\t//       16x16 pixel texture max   64 bones * 4 pixels = (16 * 16)\n\t\t//       32x32 pixel texture max  256 bones * 4 pixels = (32 * 32)\n\t\t//       64x64 pixel texture max 1024 bones * 4 pixels = (64 * 64)\n\n\t\tlet size = Math.sqrt( this.bones.length * 4 ); // 4 pixels needed for 1 matrix\n\t\tsize = Math.ceil( size / 4 ) * 4;\n\t\tsize = Math.max( size, 4 );\n\n\t\tconst boneMatrices = new Float32Array( size * size * 4 ); // 4 floats per RGBA pixel\n\t\tboneMatrices.set( this.boneMatrices ); // copy current values\n\n\t\tconst boneTexture = new DataTexture( boneMatrices, size, size, RGBAFormat, FloatType );\n\t\tboneTexture.needsUpdate = true;\n\n\t\tthis.boneMatrices = boneMatrices;\n\t\tthis.boneTexture = boneTexture;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Searches through the skeleton's bone array and returns the first with a\n\t * matching name.\n\t *\n\t * @param {string} name - The name of the bone.\n\t * @return {Bone|undefined} The found bone. `undefined` if no bone has been found.\n\t */\n\tgetBoneByName( name ) {\n\n\t\tfor ( let i = 0, il = this.bones.length; i \u003c il; i ++ ) {\n\n\t\t\tconst bone = this.bones[ i ];\n\n\t\t\tif ( bone.name === name ) {\n\n\t\t\t\treturn bone;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn undefined;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose( ) {\n\n\t\tif ( this.boneTexture !== null ) {\n\n\t\t\tthis.boneTexture.dispose();\n\n\t\t\tthis.boneTexture = null;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Setups the skeleton by the given JSON and bones.\n\t *\n\t * @param {Object} json - The skeleton as serialized JSON.\n\t * @param {Object\u003cstring, Bone\u003e} bones - An array of bones.\n\t * @return {Skeleton} A reference of this instance.\n\t */\n\tfromJSON( json, bones ) {\n\n\t\tthis.uuid = json.uuid;\n\n\t\tfor ( let i = 0, l = json.bones.length; i \u003c l; i ++ ) {\n\n\t\t\tconst uuid = json.bones[ i ];\n\t\t\tlet bone = bones[ uuid ];\n\n\t\t\tif ( bone === undefined ) {\n\n\t\t\t\twarn( 'Skeleton: No bone found with UUID:', uuid );\n\t\t\t\tbone = new Bone();\n\n\t\t\t}\n\n\t\t\tthis.bones.push( bone );\n\t\t\tthis.boneInverses.push( new Matrix4().fromArray( json.boneInverses[ i ] ) );\n\n\t\t}\n\n\t\tthis.init();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Serializes the skeleton into JSON.\n\t *\n\t * @return {Object} A JSON object representing the serialized skeleton.\n\t * @see {@link ObjectLoader#parse}\n\t */\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.7,\n\t\t\t\ttype: 'Skeleton',\n\t\t\t\tgenerator: 'Skeleton.toJSON'\n\t\t\t},\n\t\t\tbones: [],\n\t\t\tboneInverses: []\n\t\t};\n\n\t\tdata.uuid = this.uuid;\n\n\t\tconst bones = this.bones;\n\t\tconst boneInverses = this.boneInverses;\n\n\t\tfor ( let i = 0, l = bones.length; i \u003c l; i ++ ) {\n\n\t\t\tconst bone = bones[ i ];\n\t\t\tdata.bones.push( bone.uuid );\n\n\t\t\tconst boneInverse = boneInverses[ i ];\n\t\t\tdata.boneInverses.push( boneInverse.toArray() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * An instanced version of a buffer attribute.\n *\n * @augments BufferAttribute\n */\nclass InstancedBufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new instanced buffer attribute.\n\t *\n\t * @param {TypedArray} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t * @param {number} [meshPerAttribute=1] - How often a value of this buffer attribute should be repeated.\n\t */\n\tconstructor( array, itemSize, normalized, meshPerAttribute = 1 ) {\n\n\t\tsuper( array, itemSize, normalized );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isInstancedBufferAttribute = true;\n\n\t\t/**\n\t\t * Defines how often a value of this buffer attribute should be repeated. A\n\t\t * value of one means that each value of the instanced attribute is used for\n\t\t * a single instance. A value of two means that each value is used for two\n\t\t * consecutive instances (and so on).\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.meshPerAttribute = meshPerAttribute;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.meshPerAttribute = source.meshPerAttribute;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.meshPerAttribute = this.meshPerAttribute;\n\n\t\tdata.isInstancedBufferAttribute = true;\n\n\t\treturn data;\n\n\t}\n\n}\n\nconst _instanceLocalMatrix = /*@__PURE__*/ new Matrix4();\nconst _instanceWorldMatrix = /*@__PURE__*/ new Matrix4();\n\nconst _instanceIntersects = [];\n\nconst _box3 = /*@__PURE__*/ new Box3();\nconst _identity = /*@__PURE__*/ new Matrix4();\nconst _mesh$1 = /*@__PURE__*/ new Mesh();\nconst _sphere$4 = /*@__PURE__*/ new Sphere();\n\n/**\n * A special version of a mesh with instanced rendering support. Use\n * this class if you have to render a large number of objects with the same\n * geometry and material(s) but with different world transformations. The usage\n * of 'InstancedMesh' will help you to reduce the number of draw calls and thus\n * improve the overall rendering performance in your application.\n *\n * @augments Mesh\n */\nclass InstancedMesh extends Mesh {\n\n\t/**\n\t * Constructs a new instanced mesh.\n\t *\n\t * @param {BufferGeometry} [geometry] - The mesh geometry.\n\t * @param {Material|Array\u003cMaterial\u003e} [material] - The mesh material.\n\t * @param {number} count - The number of instances.\n\t */\n\tconstructor( geometry, material, count ) {\n\n\t\tsuper( geometry, material );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isInstancedMesh = true;\n\n\t\t/**\n\t\t * Represents the local transformation of all instances. You have to set its\n\t\t * {@link BufferAttribute#needsUpdate} flag to true if you modify instanced data\n\t\t * via {@link InstancedMesh#setMatrixAt}.\n\t\t *\n\t\t * @type {InstancedBufferAttribute}\n\t\t */\n\t\tthis.instanceMatrix = new InstancedBufferAttribute( new Float32Array( count * 16 ), 16 );\n\n\t\t/**\n\t\t * Represents the color of all instances. You have to set its\n\t\t * {@link BufferAttribute#needsUpdate} flag to true if you modify instanced data\n\t\t * via {@link InstancedMesh#setColorAt}.\n\t\t *\n\t\t * @type {?InstancedBufferAttribute}\n\t\t * @default null\n\t\t */\n\t\tthis.instanceColor = null;\n\n\t\t/**\n\t\t * Represents the morph target weights of all instances. You have to set its\n\t\t * {@link Texture#needsUpdate} flag to true if you modify instanced data\n\t\t * via {@link InstancedMesh#setMorphAt}.\n\t\t *\n\t\t * @type {?DataTexture}\n\t\t * @default null\n\t\t */\n\t\tthis.morphTexture = null;\n\n\t\t/**\n\t\t * The number of instances.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.count = count;\n\n\t\t/**\n\t\t * The bounding box of the instanced mesh. Can be computed via {@link InstancedMesh#computeBoundingBox}.\n\t\t *\n\t\t * @type {?Box3}\n\t\t * @default null\n\t\t */\n\t\tthis.boundingBox = null;\n\n\t\t/**\n\t\t * The bounding sphere of the instanced mesh. Can be computed via {@link InstancedMesh#computeBoundingSphere}.\n\t\t *\n\t\t * @type {?Sphere}\n\t\t * @default null\n\t\t */\n\t\tthis.boundingSphere = null;\n\n\t\tfor ( let i = 0; i \u003c count; i ++ ) {\n\n\t\t\tthis.setMatrixAt( i, _identity );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Computes the bounding box of the instanced mesh, and updates {@link InstancedMesh#boundingBox}.\n\t * The bounding box is not automatically computed by the engine; this method must be called by your app.\n\t * You may need to recompute the bounding box if an instance is transformed via {@link InstancedMesh#setMatrixAt}.\n\t */\n\tcomputeBoundingBox() {\n\n\t\tconst geometry = this.geometry;\n\t\tconst count = this.count;\n\n\t\tif ( this.boundingBox === null ) {\n\n\t\t\tthis.boundingBox = new Box3();\n\n\t\t}\n\n\t\tif ( geometry.boundingBox === null ) {\n\n\t\t\tgeometry.computeBoundingBox();\n\n\t\t}\n\n\t\tthis.boundingBox.makeEmpty();\n\n\t\tfor ( let i = 0; i \u003c count; i ++ ) {\n\n\t\t\tthis.getMatrixAt( i, _instanceLocalMatrix );\n\n\t\t\t_box3.copy( geometry.boundingBox ).applyMatrix4( _instanceLocalMatrix );\n\n\t\t\tthis.boundingBox.union( _box3 );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Computes the bounding sphere of the instanced mesh, and updates {@link InstancedMesh#boundingSphere}\n\t * The engine automatically computes the bounding sphere when it is needed, e.g., for ray casting or view frustum culling.\n\t * You may need to recompute the bounding sphere if an instance is transformed via {@link InstancedMesh#setMatrixAt}.\n\t */\n\tcomputeBoundingSphere() {\n\n\t\tconst geometry = this.geometry;\n\t\tconst count = this.count;\n\n\t\tif ( this.boundingSphere === null ) {\n\n\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tif ( geometry.boundingSphere === null ) {\n\n\t\t\tgeometry.computeBoundingSphere();\n\n\t\t}\n\n\t\tthis.boundingSphere.makeEmpty();\n\n\t\tfor ( let i = 0; i \u003c count; i ++ ) {\n\n\t\t\tthis.getMatrixAt( i, _instanceLocalMatrix );\n\n\t\t\t_sphere$4.copy( geometry.boundingSphere ).applyMatrix4( _instanceLocalMatrix );\n\n\t\t\tthis.boundingSphere.union( _sphere$4 );\n\n\t\t}\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.instanceMatrix.copy( source.instanceMatrix );\n\n\t\tif ( source.morphTexture !== null ) this.morphTexture = source.morphTexture.clone();\n\t\tif ( source.instanceColor !== null ) this.instanceColor = source.instanceColor.clone();\n\n\t\tthis.count = source.count;\n\n\t\tif ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();\n\t\tif ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Gets the color of the defined instance.\n\t *\n\t * @param {number} index - The instance index.\n\t * @param {Color} color - The target object that is used to store the method's result.\n\t */\n\tgetColorAt( index, color ) {\n\n\t\tcolor.fromArray( this.instanceColor.array, index * 3 );\n\n\t}\n\n\t/**\n\t * Gets the local transformation matrix of the defined instance.\n\t *\n\t * @param {number} index - The instance index.\n\t * @param {Matrix4} matrix - The target object that is used to store the method's result.\n\t */\n\tgetMatrixAt( index, matrix ) {\n\n\t\tmatrix.fromArray( this.instanceMatrix.array, index * 16 );\n\n\t}\n\n\t/**\n\t * Gets the morph target weights of the defined instance.\n\t *\n\t * @param {number} index - The instance index.\n\t * @param {Mesh} object - The target object that is used to store the method's result.\n\t */\n\tgetMorphAt( index, object ) {\n\n\t\tconst objectInfluences = object.morphTargetInfluences;\n\n\t\tconst array = this.morphTexture.source.data.data;\n\n\t\tconst len = objectInfluences.length + 1; // All influences + the baseInfluenceSum\n\n\t\tconst dataIndex = index * len + 1; // Skip the baseInfluenceSum at the beginning\n\n\t\tfor ( let i = 0; i \u003c objectInfluences.length; i ++ ) {\n\n\t\t\tobjectInfluences[ i ] = array[ dataIndex + i ];\n\n\t\t}\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst raycastTimes = this.count;\n\n\t\t_mesh$1.geometry = this.geometry;\n\t\t_mesh$1.material = this.material;\n\n\t\tif ( _mesh$1.material === undefined ) return;\n\n\t\t// test with bounding sphere first\n\n\t\tif ( this.boundingSphere === null ) this.computeBoundingSphere();\n\n\t\t_sphere$4.copy( this.boundingSphere );\n\t\t_sphere$4.applyMatrix4( matrixWorld );\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere$4 ) === false ) return;\n\n\t\t// now test each instance\n\n\t\tfor ( let instanceId = 0; instanceId \u003c raycastTimes; instanceId ++ ) {\n\n\t\t\t// calculate the world matrix for each instance\n\n\t\t\tthis.getMatrixAt( instanceId, _instanceLocalMatrix );\n\n\t\t\t_instanceWorldMatrix.multiplyMatrices( matrixWorld, _instanceLocalMatrix );\n\n\t\t\t// the mesh represents this single instance\n\n\t\t\t_mesh$1.matrixWorld = _instanceWorldMatrix;\n\n\t\t\t_mesh$1.raycast( raycaster, _instanceIntersects );\n\n\t\t\t// process the result of raycast\n\n\t\t\tfor ( let i = 0, l = _instanceIntersects.length; i \u003c l; i ++ ) {\n\n\t\t\t\tconst intersect = _instanceIntersects[ i ];\n\t\t\t\tintersect.instanceId = instanceId;\n\t\t\t\tintersect.object = this;\n\t\t\t\tintersects.push( intersect );\n\n\t\t\t}\n\n\t\t\t_instanceIntersects.length = 0;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Sets the given color to the defined instance. Make sure you set the `needsUpdate` flag of\n\t * {@link InstancedMesh#instanceColor} to `true` after updating all the colors.\n\t *\n\t * @param {number} index - The instance index.\n\t * @param {Color} color - The instance color.\n\t */\n\tsetColorAt( index, color ) {\n\n\t\tif ( this.instanceColor === null ) {\n\n\t\t\tthis.instanceColor = new InstancedBufferAttribute( new Float32Array( this.instanceMatrix.count * 3 ).fill( 1 ), 3 );\n\n\t\t}\n\n\t\tcolor.toArray( this.instanceColor.array, index * 3 );\n\n\t}\n\n\t/**\n\t * Sets the given local transformation matrix to the defined instance. Make sure you set the `needsUpdate` flag of\n\t * {@link InstancedMesh#instanceMatrix} to `true` after updating all the colors.\n\t *\n\t * @param {number} index - The instance index.\n\t * @param {Matrix4} matrix - The local transformation.\n\t */\n\tsetMatrixAt( index, matrix ) {\n\n\t\tmatrix.toArray( this.instanceMatrix.array, index * 16 );\n\n\t}\n\n\t/**\n\t * Sets the morph target weights to the defined instance. Make sure you set the `needsUpdate` flag of\n\t * {@link InstancedMesh#morphTexture} to `true` after updating all the influences.\n\t *\n\t * @param {number} index - The instance index.\n\t * @param {Mesh} object -  A mesh which `morphTargetInfluences` property containing the morph target weights\n\t * of a single instance.\n\t */\n\tsetMorphAt( index, object ) {\n\n\t\tconst objectInfluences = object.morphTargetInfluences;\n\n\t\tconst len = objectInfluences.length + 1; // morphBaseInfluence + all influences\n\n\t\tif ( this.morphTexture === null ) {\n\n\t\t\tthis.morphTexture = new DataTexture( new Float32Array( len * this.count ), len, this.count, RedFormat, FloatType );\n\n\t\t}\n\n\t\tconst array = this.morphTexture.source.data.data;\n\n\t\tlet morphInfluencesSum = 0;\n\n\t\tfor ( let i = 0; i \u003c objectInfluences.length; i ++ ) {\n\n\t\t\tmorphInfluencesSum += objectInfluences[ i ];\n\n\t\t}\n\n\t\tconst morphBaseInfluence = this.geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;\n\n\t\tconst dataIndex = len * index;\n\n\t\tarray[ dataIndex ] = morphBaseInfluence;\n\n\t\tarray.set( objectInfluences, dataIndex + 1 );\n\n\t}\n\n\tupdateMorphTargets() {\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t\tif ( this.morphTexture !== null ) {\n\n\t\t\tthis.morphTexture.dispose();\n\t\t\tthis.morphTexture = null;\n\n\t\t}\n\n\t}\n\n}\n\nconst _vector1 = /*@__PURE__*/ new Vector3();\nconst _vector2 = /*@__PURE__*/ new Vector3();\nconst _normalMatrix = /*@__PURE__*/ new Matrix3();\n\n/**\n * A two dimensional surface that extends infinitely in 3D space, represented\n * in [Hessian normal form](http://mathworld.wolfram.com/HessianNormalForm.html)\n * by a unit length normal vector and a constant.\n */\nclass Plane {\n\n\t/**\n\t * Constructs a new plane.\n\t *\n\t * @param {Vector3} [normal=(1,0,0)] - A unit length vector defining the normal of the plane.\n\t * @param {number} [constant=0] - The signed distance from the origin to the plane.\n\t */\n\tconstructor( normal = new Vector3( 1, 0, 0 ), constant = 0 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isPlane = true;\n\n\t\t/**\n\t\t * A unit length vector defining the normal of the plane.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.normal = normal;\n\n\t\t/**\n\t\t * The signed distance from the origin to the plane.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.constant = constant;\n\n\t}\n\n\t/**\n\t * Sets the plane components by copying the given values.\n\t *\n\t * @param {Vector3} normal - The normal.\n\t * @param {number} constant - The constant.\n\t * @return {Plane} A reference to this plane.\n\t */\n\tset( normal, constant ) {\n\n\t\tthis.normal.copy( normal );\n\t\tthis.constant = constant;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the plane components by defining `x`, `y`, `z` as the\n\t * plane normal and `w` as the constant.\n\t *\n\t * @param {number} x - The value for the normal's x component.\n\t * @param {number} y - The value for the normal's y component.\n\t * @param {number} z - The value for the normal's z component.\n\t * @param {number} w - The constant value.\n\t * @return {Plane} A reference to this plane.\n\t */\n\tsetComponents( x, y, z, w ) {\n\n\t\tthis.normal.set( x, y, z );\n\t\tthis.constant = w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the plane from the given normal and coplanar point (that is a point\n\t * that lies onto the plane).\n\t *\n\t * @param {Vector3} normal - The normal.\n\t * @param {Vector3} point - A coplanar point.\n\t * @return {Plane} A reference to this plane.\n\t */\n\tsetFromNormalAndCoplanarPoint( normal, point ) {\n\n\t\tthis.normal.copy( normal );\n\t\tthis.constant = - point.dot( this.normal );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the plane from three coplanar points. The winding order is\n\t * assumed to be counter-clockwise, and determines the direction of\n\t * the plane normal.\n\t *\n\t * @param {Vector3} a - The first coplanar point.\n\t * @param {Vector3} b - The second coplanar point.\n\t * @param {Vector3} c - The third coplanar point.\n\t * @return {Plane} A reference to this plane.\n\t */\n\tsetFromCoplanarPoints( a, b, c ) {\n\n\t\tconst normal = _vector1.subVectors( c, b ).cross( _vector2.subVectors( a, b ) ).normalize();\n\n\t\t// Q: should an error be thrown if normal is zero (e.g. degenerate plane)?\n\n\t\tthis.setFromNormalAndCoplanarPoint( normal, a );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the values of the given plane to this instance.\n\t *\n\t * @param {Plane} plane - The plane to copy.\n\t * @return {Plane} A reference to this plane.\n\t */\n\tcopy( plane ) {\n\n\t\tthis.normal.copy( plane.normal );\n\t\tthis.constant = plane.constant;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Normalizes the plane normal and adjusts the constant accordingly.\n\t *\n\t * @return {Plane} A reference to this plane.\n\t */\n\tnormalize() {\n\n\t\t// Note: will lead to a divide by zero if the plane is invalid.\n\n\t\tconst inverseNormalLength = 1.0 / this.normal.length();\n\t\tthis.normal.multiplyScalar( inverseNormalLength );\n\t\tthis.constant *= inverseNormalLength;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Negates both the plane normal and the constant.\n\t *\n\t * @return {Plane} A reference to this plane.\n\t */\n\tnegate() {\n\n\t\tthis.constant *= -1;\n\t\tthis.normal.negate();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the signed distance from the given point to this plane.\n\t *\n\t * @param {Vector3} point - The point to compute the distance for.\n\t * @return {number} The signed distance.\n\t */\n\tdistanceToPoint( point ) {\n\n\t\treturn this.normal.dot( point ) + this.constant;\n\n\t}\n\n\t/**\n\t * Returns the signed distance from the given sphere to this plane.\n\t *\n\t * @param {Sphere} sphere - The sphere to compute the distance for.\n\t * @return {number} The signed distance.\n\t */\n\tdistanceToSphere( sphere ) {\n\n\t\treturn this.distanceToPoint( sphere.center ) - sphere.radius;\n\n\t}\n\n\t/**\n\t * Projects a the given point onto the plane.\n\t *\n\t * @param {Vector3} point - The point to project.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The projected point on the plane.\n\t */\n\tprojectPoint( point, target ) {\n\n\t\treturn target.copy( point ).addScaledVector( this.normal, - this.distanceToPoint( point ) );\n\n\t}\n\n\t/**\n\t * Returns the intersection point of the passed line and the plane. Returns\n\t * `null` if the line does not intersect. Returns the line's starting point if\n\t * the line is coplanar with the plane.\n\t *\n\t * @param {Line3} line - The line to compute the intersection for.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The intersection point.\n\t */\n\tintersectLine( line, target ) {\n\n\t\tconst direction = line.delta( _vector1 );\n\n\t\tconst denominator = this.normal.dot( direction );\n\n\t\tif ( denominator === 0 ) {\n\n\t\t\t// line is coplanar, return origin\n\t\t\tif ( this.distanceToPoint( line.start ) === 0 ) {\n\n\t\t\t\treturn target.copy( line.start );\n\n\t\t\t}\n\n\t\t\t// Unsure if this is the correct method to handle this case.\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst t = - ( line.start.dot( this.normal ) + this.constant ) / denominator;\n\n\t\tif ( t \u003c 0 || t \u003e 1 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\treturn target.copy( line.start ).addScaledVector( direction, t );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given line segment intersects with (passes through) the plane.\n\t *\n\t * @param {Line3} line - The line to test.\n\t * @return {boolean} Whether the given line segment intersects with the plane or not.\n\t */\n\tintersectsLine( line ) {\n\n\t\t// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.\n\n\t\tconst startSign = this.distanceToPoint( line.start );\n\t\tconst endSign = this.distanceToPoint( line.end );\n\n\t\treturn ( startSign \u003c 0 \u0026\u0026 endSign \u003e 0 ) || ( endSign \u003c 0 \u0026\u0026 startSign \u003e 0 );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given bounding box intersects with the plane.\n\t *\n\t * @param {Box3} box - The bounding box to test.\n\t * @return {boolean} Whether the given bounding box intersects with the plane or not.\n\t */\n\tintersectsBox( box ) {\n\n\t\treturn box.intersectsPlane( this );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given bounding sphere intersects with the plane.\n\t *\n\t * @param {Sphere} sphere - The bounding sphere to test.\n\t * @return {boolean} Whether the given bounding sphere intersects with the plane or not.\n\t */\n\tintersectsSphere( sphere ) {\n\n\t\treturn sphere.intersectsPlane( this );\n\n\t}\n\n\t/**\n\t * Returns a coplanar vector to the plane, by calculating the\n\t * projection of the normal at the origin onto the plane.\n\t *\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The coplanar point.\n\t */\n\tcoplanarPoint( target ) {\n\n\t\treturn target.copy( this.normal ).multiplyScalar( - this.constant );\n\n\t}\n\n\t/**\n\t * Apply a 4x4 matrix to the plane. The matrix must be an affine, homogeneous transform.\n\t *\n\t * The optional normal matrix can be pre-computed like so:\n\t * ```js\n\t * const optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix );\n\t * ```\n\t *\n\t * @param {Matrix4} matrix - The transformation matrix.\n\t * @param {Matrix4} [optionalNormalMatrix] - A pre-computed normal matrix.\n\t * @return {Plane} A reference to this plane.\n\t */\n\tapplyMatrix4( matrix, optionalNormalMatrix ) {\n\n\t\tconst normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix( matrix );\n\n\t\tconst referencePoint = this.coplanarPoint( _vector1 ).applyMatrix4( matrix );\n\n\t\tconst normal = this.normal.applyMatrix3( normalMatrix ).normalize();\n\n\t\tthis.constant = - referencePoint.dot( normal );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Translates the plane by the distance defined by the given offset vector.\n\t * Note that this only affects the plane constant and will not affect the normal vector.\n\t *\n\t * @param {Vector3} offset - The offset vector.\n\t * @return {Plane} A reference to this plane.\n\t */\n\ttranslate( offset ) {\n\n\t\tthis.constant -= offset.dot( this.normal );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this plane is equal with the given one.\n\t *\n\t * @param {Plane} plane - The plane to test for equality.\n\t * @return {boolean} Whether this plane is equal with the given one.\n\t */\n\tequals( plane ) {\n\n\t\treturn plane.normal.equals( this.normal ) \u0026\u0026 ( plane.constant === this.constant );\n\n\t}\n\n\t/**\n\t * Returns a new plane with copied values from this instance.\n\t *\n\t * @return {Plane} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _sphere$3 = /*@__PURE__*/ new Sphere();\nconst _defaultSpriteCenter = /*@__PURE__*/ new Vector2( 0.5, 0.5 );\nconst _vector$6 = /*@__PURE__*/ new Vector3();\n\n/**\n * Frustums are used to determine what is inside the camera's field of view.\n * They help speed up the rendering process - objects which lie outside a camera's\n * frustum can safely be excluded from rendering.\n *\n * This class is mainly intended for use internally by a renderer.\n */\nclass Frustum {\n\n\t/**\n\t * Constructs a new frustum.\n\t *\n\t * @param {Plane} [p0] - The first plane that encloses the frustum.\n\t * @param {Plane} [p1] - The second plane that encloses the frustum.\n\t * @param {Plane} [p2] - The third plane that encloses the frustum.\n\t * @param {Plane} [p3] - The fourth plane that encloses the frustum.\n\t * @param {Plane} [p4] - The fifth plane that encloses the frustum.\n\t * @param {Plane} [p5] - The sixth plane that encloses the frustum.\n\t */\n\tconstructor( p0 = new Plane(), p1 = new Plane(), p2 = new Plane(), p3 = new Plane(), p4 = new Plane(), p5 = new Plane() ) {\n\n\t\t/**\n\t\t * This array holds the planes that enclose the frustum.\n\t\t *\n\t\t * @type {Array\u003cPlane\u003e}\n\t\t */\n\t\tthis.planes = [ p0, p1, p2, p3, p4, p5 ];\n\n\t}\n\n\t/**\n\t * Sets the frustum planes by copying the given planes.\n\t *\n\t * @param {Plane} [p0] - The first plane that encloses the frustum.\n\t * @param {Plane} [p1] - The second plane that encloses the frustum.\n\t * @param {Plane} [p2] - The third plane that encloses the frustum.\n\t * @param {Plane} [p3] - The fourth plane that encloses the frustum.\n\t * @param {Plane} [p4] - The fifth plane that encloses the frustum.\n\t * @param {Plane} [p5] - The sixth plane that encloses the frustum.\n\t * @return {Frustum} A reference to this frustum.\n\t */\n\tset( p0, p1, p2, p3, p4, p5 ) {\n\n\t\tconst planes = this.planes;\n\n\t\tplanes[ 0 ].copy( p0 );\n\t\tplanes[ 1 ].copy( p1 );\n\t\tplanes[ 2 ].copy( p2 );\n\t\tplanes[ 3 ].copy( p3 );\n\t\tplanes[ 4 ].copy( p4 );\n\t\tplanes[ 5 ].copy( p5 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the values of the given frustum to this instance.\n\t *\n\t * @param {Frustum} frustum - The frustum to copy.\n\t * @return {Frustum} A reference to this frustum.\n\t */\n\tcopy( frustum ) {\n\n\t\tconst planes = this.planes;\n\n\t\tfor ( let i = 0; i \u003c 6; i ++ ) {\n\n\t\t\tplanes[ i ].copy( frustum.planes[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the frustum planes from the given projection matrix.\n\t *\n\t * @param {Matrix4} m - The projection matrix.\n\t * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} coordinateSystem - The coordinate system.\n\t * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.\n\t * @return {Frustum} A reference to this frustum.\n\t */\n\tsetFromProjectionMatrix( m, coordinateSystem = WebGLCoordinateSystem, reversedDepth = false ) {\n\n\t\tconst planes = this.planes;\n\t\tconst me = m.elements;\n\t\tconst me0 = me[ 0 ], me1 = me[ 1 ], me2 = me[ 2 ], me3 = me[ 3 ];\n\t\tconst me4 = me[ 4 ], me5 = me[ 5 ], me6 = me[ 6 ], me7 = me[ 7 ];\n\t\tconst me8 = me[ 8 ], me9 = me[ 9 ], me10 = me[ 10 ], me11 = me[ 11 ];\n\t\tconst me12 = me[ 12 ], me13 = me[ 13 ], me14 = me[ 14 ], me15 = me[ 15 ];\n\n\t\tplanes[ 0 ].setComponents( me3 - me0, me7 - me4, me11 - me8, me15 - me12 ).normalize();\n\t\tplanes[ 1 ].setComponents( me3 + me0, me7 + me4, me11 + me8, me15 + me12 ).normalize();\n\t\tplanes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize();\n\t\tplanes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize();\n\n\t\tif ( reversedDepth ) {\n\n\t\t\tplanes[ 4 ].setComponents( me2, me6, me10, me14 ).normalize(); // far\n\t\t\tplanes[ 5 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize(); // near\n\n\t\t} else {\n\n\t\t\tplanes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize(); // far\n\n\t\t\tif ( coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\t\tplanes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize(); // near\n\n\t\t\t} else if ( coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\t\tplanes[ 5 ].setComponents( me2, me6, me10, me14 ).normalize(); // near\n\n\t\t\t} else {\n\n\t\t\t\tthrow new Error( 'THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: ' + coordinateSystem );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if the 3D object's bounding sphere is intersecting this frustum.\n\t *\n\t * Note that the 3D object must have a geometry so that the bounding sphere can be calculated.\n\t *\n\t * @param {Object3D} object - The 3D object to test.\n\t * @return {boolean} Whether the 3D object's bounding sphere is intersecting this frustum or not.\n\t */\n\tintersectsObject( object ) {\n\n\t\tif ( object.boundingSphere !== undefined ) {\n\n\t\t\tif ( object.boundingSphere === null ) object.computeBoundingSphere();\n\n\t\t\t_sphere$3.copy( object.boundingSphere ).applyMatrix4( object.matrixWorld );\n\n\t\t} else {\n\n\t\t\tconst geometry = object.geometry;\n\n\t\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t\t_sphere$3.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld );\n\n\t\t}\n\n\t\treturn this.intersectsSphere( _sphere$3 );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given sprite is intersecting this frustum.\n\t *\n\t * @param {Sprite} sprite - The sprite to test.\n\t * @return {boolean} Whether the sprite is intersecting this frustum or not.\n\t */\n\tintersectsSprite( sprite ) {\n\n\t\t_sphere$3.center.set( 0, 0, 0 );\n\n\t\tconst offset = _defaultSpriteCenter.distanceTo( sprite.center );\n\n\t\t_sphere$3.radius = 0.7071067811865476 + offset;\n\t\t_sphere$3.applyMatrix4( sprite.matrixWorld );\n\n\t\treturn this.intersectsSphere( _sphere$3 );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given bounding sphere is intersecting this frustum.\n\t *\n\t * @param {Sphere} sphere - The bounding sphere to test.\n\t * @return {boolean} Whether the bounding sphere is intersecting this frustum or not.\n\t */\n\tintersectsSphere( sphere ) {\n\n\t\tconst planes = this.planes;\n\t\tconst center = sphere.center;\n\t\tconst negRadius = - sphere.radius;\n\n\t\tfor ( let i = 0; i \u003c 6; i ++ ) {\n\n\t\t\tconst distance = planes[ i ].distanceToPoint( center );\n\n\t\t\tif ( distance \u003c negRadius ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\t/**\n\t * Returns `true` if the given bounding box is intersecting this frustum.\n\t *\n\t * @param {Box3} box - The bounding box to test.\n\t * @return {boolean} Whether the bounding box is intersecting this frustum or not.\n\t */\n\tintersectsBox( box ) {\n\n\t\tconst planes = this.planes;\n\n\t\tfor ( let i = 0; i \u003c 6; i ++ ) {\n\n\t\t\tconst plane = planes[ i ];\n\n\t\t\t// corner at max distance\n\n\t\t\t_vector$6.x = plane.normal.x \u003e 0 ? box.max.x : box.min.x;\n\t\t\t_vector$6.y = plane.normal.y \u003e 0 ? box.max.y : box.min.y;\n\t\t\t_vector$6.z = plane.normal.z \u003e 0 ? box.max.z : box.min.z;\n\n\t\t\tif ( plane.distanceToPoint( _vector$6 ) \u003c 0 ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\t/**\n\t * Returns `true` if the given point lies within the frustum.\n\t *\n\t * @param {Vector3} point - The point to test.\n\t * @return {boolean} Whether the point lies within this frustum or not.\n\t */\n\tcontainsPoint( point ) {\n\n\t\tconst planes = this.planes;\n\n\t\tfor ( let i = 0; i \u003c 6; i ++ ) {\n\n\t\t\tif ( planes[ i ].distanceToPoint( point ) \u003c 0 ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\t/**\n\t * Returns a new frustum with copied values from this instance.\n\t *\n\t * @return {Frustum} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _projScreenMatrix$1 = /*@__PURE__*/ new Matrix4();\nconst _frustum$1 = /*@__PURE__*/ new Frustum();\n\n/**\n * FrustumArray is used to determine if an object is visible in at least one camera\n * from an array of cameras. This is particularly useful for multi-view renderers.\n*/\nclass FrustumArray {\n\n\t/**\n\t * Constructs a new frustum array.\n\t *\n\t */\n\tconstructor() {\n\n\t\t/**\n\t\t * The coordinate system to use.\n\t\t *\n\t\t * @type {WebGLCoordinateSystem|WebGPUCoordinateSystem}\n\t\t * @default WebGLCoordinateSystem\n\t\t */\n\t\tthis.coordinateSystem = WebGLCoordinateSystem;\n\n\t}\n\n\t/**\n\t * Returns `true` if the 3D object's bounding sphere is intersecting any frustum\n\t * from the camera array.\n\t *\n\t * @param {Object3D} object - The 3D object to test.\n\t * @param {Object} cameraArray - An object with a cameras property containing an array of cameras.\n\t * @return {boolean} Whether the 3D object is visible in any camera.\n\t */\n\tintersectsObject( object, cameraArray ) {\n\n\t\tif ( ! cameraArray.isArrayCamera || cameraArray.cameras.length === 0 ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\tfor ( let i = 0; i \u003c cameraArray.cameras.length; i ++ ) {\n\n\t\t\tconst camera = cameraArray.cameras[ i ];\n\n\t\t\t_projScreenMatrix$1.multiplyMatrices(\n\t\t\t\tcamera.projectionMatrix,\n\t\t\t\tcamera.matrixWorldInverse\n\t\t\t);\n\n\t\t\t_frustum$1.setFromProjectionMatrix(\n\t\t\t\t_projScreenMatrix$1,\n\t\t\t\tcamera.coordinateSystem,\n\t\t\t\tcamera.reversedDepth\n\t\t\t);\n\n\t\t\tif ( _frustum$1.intersectsObject( object ) ) {\n\n\t\t\t\treturn true; // Object is visible in at least one camera\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false; // Not visible in any camera\n\n\t}\n\n\t/**\n\t * Returns `true` if the given sprite is intersecting any frustum\n\t * from the camera array.\n\t *\n\t * @param {Sprite} sprite - The sprite to test.\n\t * @param {Object} cameraArray - An object with a cameras property containing an array of cameras.\n\t * @return {boolean} Whether the sprite is visible in any camera.\n\t */\n\tintersectsSprite( sprite, cameraArray ) {\n\n\t\tif ( ! cameraArray || ! cameraArray.cameras || cameraArray.cameras.length === 0 ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\tfor ( let i = 0; i \u003c cameraArray.cameras.length; i ++ ) {\n\n\t\t\tconst camera = cameraArray.cameras[ i ];\n\n\t\t\t_projScreenMatrix$1.multiplyMatrices(\n\t\t\t\tcamera.projectionMatrix,\n\t\t\t\tcamera.matrixWorldInverse\n\t\t\t);\n\n\t\t\t_frustum$1.setFromProjectionMatrix(\n\t\t\t\t_projScreenMatrix$1,\n\t\t\t\tcamera.coordinateSystem,\n\t\t\t\tcamera.reversedDepth\n\t\t\t);\n\n\t\t\tif ( _frustum$1.intersectsSprite( sprite ) ) {\n\n\t\t\t\treturn true; // Sprite is visible in at least one camera\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false; // Not visible in any camera\n\n\t}\n\n\t/**\n\t * Returns `true` if the given bounding sphere is intersecting any frustum\n\t * from the camera array.\n\t *\n\t * @param {Sphere} sphere - The bounding sphere to test.\n\t * @param {Object} cameraArray - An object with a cameras property containing an array of cameras.\n\t * @return {boolean} Whether the sphere is visible in any camera.\n\t */\n\tintersectsSphere( sphere, cameraArray ) {\n\n\t\tif ( ! cameraArray || ! cameraArray.cameras || cameraArray.cameras.length === 0 ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\tfor ( let i = 0; i \u003c cameraArray.cameras.length; i ++ ) {\n\n\t\t\tconst camera = cameraArray.cameras[ i ];\n\n\t\t\t_projScreenMatrix$1.multiplyMatrices(\n\t\t\t\tcamera.projectionMatrix,\n\t\t\t\tcamera.matrixWorldInverse\n\t\t\t);\n\n\t\t\t_frustum$1.setFromProjectionMatrix(\n\t\t\t\t_projScreenMatrix$1,\n\t\t\t\tcamera.coordinateSystem,\n\t\t\t\tcamera.reversedDepth\n\t\t\t);\n\n\t\t\tif ( _frustum$1.intersectsSphere( sphere ) ) {\n\n\t\t\t\treturn true; // Sphere is visible in at least one camera\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false; // Not visible in any camera\n\n\t}\n\n\t/**\n\t * Returns `true` if the given bounding box is intersecting any frustum\n\t * from the camera array.\n\t *\n\t * @param {Box3} box - The bounding box to test.\n\t * @param {Object} cameraArray - An object with a cameras property containing an array of cameras.\n\t * @return {boolean} Whether the box is visible in any camera.\n\t */\n\tintersectsBox( box, cameraArray ) {\n\n\t\tif ( ! cameraArray || ! cameraArray.cameras || cameraArray.cameras.length === 0 ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\tfor ( let i = 0; i \u003c cameraArray.cameras.length; i ++ ) {\n\n\t\t\tconst camera = cameraArray.cameras[ i ];\n\n\t\t\t_projScreenMatrix$1.multiplyMatrices(\n\t\t\t\tcamera.projectionMatrix,\n\t\t\t\tcamera.matrixWorldInverse\n\t\t\t);\n\n\t\t\t_frustum$1.setFromProjectionMatrix(\n\t\t\t\t_projScreenMatrix$1,\n\t\t\t\tcamera.coordinateSystem,\n\t\t\t\tcamera.reversedDepth\n\t\t\t);\n\n\t\t\tif ( _frustum$1.intersectsBox( box ) ) {\n\n\t\t\t\treturn true; // Box is visible in at least one camera\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false; // Not visible in any camera\n\n\t}\n\n\t/**\n\t * Returns `true` if the given point lies within any frustum\n\t * from the camera array.\n\t *\n\t * @param {Vector3} point - The point to test.\n\t * @param {Object} cameraArray - An object with a cameras property containing an array of cameras.\n\t * @return {boolean} Whether the point is visible in any camera.\n\t */\n\tcontainsPoint( point, cameraArray ) {\n\n\t\tif ( ! cameraArray || ! cameraArray.cameras || cameraArray.cameras.length === 0 ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\tfor ( let i = 0; i \u003c cameraArray.cameras.length; i ++ ) {\n\n\t\t\tconst camera = cameraArray.cameras[ i ];\n\n\t\t\t_projScreenMatrix$1.multiplyMatrices(\n\t\t\t\tcamera.projectionMatrix,\n\t\t\t\tcamera.matrixWorldInverse\n\t\t\t);\n\n\t\t\t_frustum$1.setFromProjectionMatrix(\n\t\t\t\t_projScreenMatrix$1,\n\t\t\t\tcamera.coordinateSystem,\n\t\t\t\tcamera.reversedDepth\n\t\t\t);\n\n\t\t\tif ( _frustum$1.containsPoint( point ) ) {\n\n\t\t\t\treturn true; // Point is visible in at least one camera\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false; // Not visible in any camera\n\n\t}\n\n\t/**\n\t * Returns a new frustum array with copied values from this instance.\n\t *\n\t * @return {FrustumArray} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new FrustumArray();\n\n\t}\n\n}\n\nfunction ascIdSort( a, b ) {\n\n\treturn a - b;\n\n}\n\nfunction sortOpaque( a, b ) {\n\n\treturn a.z - b.z;\n\n}\n\nfunction sortTransparent( a, b ) {\n\n\treturn b.z - a.z;\n\n}\n\nclass MultiDrawRenderList {\n\n\tconstructor() {\n\n\t\tthis.index = 0;\n\t\tthis.pool = [];\n\t\tthis.list = [];\n\n\t}\n\n\tpush( start, count, z, index ) {\n\n\t\tconst pool = this.pool;\n\t\tconst list = this.list;\n\t\tif ( this.index \u003e= pool.length ) {\n\n\t\t\tpool.push( {\n\n\t\t\t\tstart: -1,\n\t\t\t\tcount: -1,\n\t\t\t\tz: -1,\n\t\t\t\tindex: -1,\n\n\t\t\t} );\n\n\t\t}\n\n\t\tconst item = pool[ this.index ];\n\t\tlist.push( item );\n\t\tthis.index ++;\n\n\t\titem.start = start;\n\t\titem.count = count;\n\t\titem.z = z;\n\t\titem.index = index;\n\n\t}\n\n\treset() {\n\n\t\tthis.list.length = 0;\n\t\tthis.index = 0;\n\n\t}\n\n}\n\nconst _matrix$1 = /*@__PURE__*/ new Matrix4();\nconst _whiteColor = /*@__PURE__*/ new Color( 1, 1, 1 );\nconst _frustum = /*@__PURE__*/ new Frustum();\nconst _frustumArray = /*@__PURE__*/ new FrustumArray();\nconst _box$1 = /*@__PURE__*/ new Box3();\nconst _sphere$2 = /*@__PURE__*/ new Sphere();\nconst _vector$5 = /*@__PURE__*/ new Vector3();\nconst _forward$1 = /*@__PURE__*/ new Vector3();\nconst _temp = /*@__PURE__*/ new Vector3();\nconst _renderList = /*@__PURE__*/ new MultiDrawRenderList();\nconst _mesh = /*@__PURE__*/ new Mesh();\nconst _batchIntersects = [];\n\n// copies data from attribute \"src\" into \"target\" starting at \"targetOffset\"\nfunction copyAttributeData( src, target, targetOffset = 0 ) {\n\n\tconst itemSize = target.itemSize;\n\tif ( src.isInterleavedBufferAttribute || src.array.constructor !== target.array.constructor ) {\n\n\t\t// use the component getters and setters if the array data cannot\n\t\t// be copied directly\n\t\tconst vertexCount = src.count;\n\t\tfor ( let i = 0; i \u003c vertexCount; i ++ ) {\n\n\t\t\tfor ( let c = 0; c \u003c itemSize; c ++ ) {\n\n\t\t\t\ttarget.setComponent( i + targetOffset, c, src.getComponent( i, c ) );\n\n\t\t\t}\n\n\t\t}\n\n\t} else {\n\n\t\t// faster copy approach using typed array set function\n\t\ttarget.array.set( src.array, targetOffset * itemSize );\n\n\t}\n\n\ttarget.needsUpdate = true;\n\n}\n\n// safely copies array contents to a potentially smaller array\nfunction copyArrayContents( src, target ) {\n\n\tif ( src.constructor !== target.constructor ) {\n\n\t\t// if arrays are of a different type (eg due to index size increasing) then data must be per-element copied\n\t\tconst len = Math.min( src.length, target.length );\n\t\tfor ( let i = 0; i \u003c len; i ++ ) {\n\n\t\t\ttarget[ i ] = src[ i ];\n\n\t\t}\n\n\t} else {\n\n\t\t// if the arrays use the same data layout we can use a fast block copy\n\t\tconst len = Math.min( src.length, target.length );\n\t\ttarget.set( new src.constructor( src.buffer, 0, len ) );\n\n\t}\n\n}\n\n/**\n * A special version of a mesh with multi draw batch rendering support. Use\n * this class if you have to render a large number of objects with the same\n * material but with different geometries or world transformations. The usage of\n * `BatchedMesh` will help you to reduce the number of draw calls and thus improve the overall\n * rendering performance in your application.\n *\n * ```js\n * const box = new THREE.BoxGeometry( 1, 1, 1 );\n * const sphere = new THREE.SphereGeometry( 1, 12, 12 );\n * const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );\n *\n * // initialize and add geometries into the batched mesh\n * const batchedMesh = new BatchedMesh( 10, 5000, 10000, material );\n * const boxGeometryId = batchedMesh.addGeometry( box );\n * const sphereGeometryId = batchedMesh.addGeometry( sphere );\n *\n * // create instances of those geometries\n * const boxInstancedId1 = batchedMesh.addInstance( boxGeometryId );\n * const boxInstancedId2 = batchedMesh.addInstance( boxGeometryId );\n *\n * const sphereInstancedId1 = batchedMesh.addInstance( sphereGeometryId );\n * const sphereInstancedId2 = batchedMesh.addInstance( sphereGeometryId );\n *\n * // position the geometries\n * batchedMesh.setMatrixAt( boxInstancedId1, boxMatrix1 );\n * batchedMesh.setMatrixAt( boxInstancedId2, boxMatrix2 );\n *\n * batchedMesh.setMatrixAt( sphereInstancedId1, sphereMatrix1 );\n * batchedMesh.setMatrixAt( sphereInstancedId2, sphereMatrix2 );\n *\n * scene.add( batchedMesh );\n * ```\n *\n * @augments Mesh\n */\nclass BatchedMesh extends Mesh {\n\n\t/**\n\t * Constructs a new batched mesh.\n\t *\n\t * @param {number} maxInstanceCount - The maximum number of individual instances planned to be added and rendered.\n\t * @param {number} maxVertexCount - The maximum number of vertices to be used by all unique geometries.\n\t * @param {number} [maxIndexCount=maxVertexCount*2] - The maximum number of indices to be used by all unique geometries\n\t * @param {Material|Array\u003cMaterial\u003e} [material] - The mesh material.\n\t */\n\tconstructor( maxInstanceCount, maxVertexCount, maxIndexCount = maxVertexCount * 2, material ) {\n\n\t\tsuper( new BufferGeometry(), material );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isBatchedMesh = true;\n\n\t\t/**\n\t\t * When set ot `true`, the individual objects of a batch are frustum culled.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.perObjectFrustumCulled = true;\n\n\t\t/**\n\t\t * When set to `true`, the individual objects of a batch are sorted to improve overdraw-related artifacts.\n\t\t * If the material is marked as \"transparent\" objects are rendered back to front and if not then they are\n\t\t * rendered front to back.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.sortObjects = true;\n\n\t\t/**\n\t\t * The bounding box of the batched mesh. Can be computed via {@link BatchedMesh#computeBoundingBox}.\n\t\t *\n\t\t * @type {?Box3}\n\t\t * @default null\n\t\t */\n\t\tthis.boundingBox = null;\n\n\t\t/**\n\t\t * The bounding sphere of the batched mesh. Can be computed via {@link BatchedMesh#computeBoundingSphere}.\n\t\t *\n\t\t * @type {?Sphere}\n\t\t * @default null\n\t\t */\n\t\tthis.boundingSphere = null;\n\n\t\t/**\n\t\t * Takes a sort a function that is run before render. The function takes a list of instances to\n\t\t * sort and a camera. The objects in the list include a \"z\" field to perform a depth-ordered\n\t\t * sort with.\n\t\t *\n\t\t * @type {?Function}\n\t\t * @default null\n\t\t */\n\t\tthis.customSort = null;\n\n\t\t// stores visible, active, and geometry id per instance and reserved buffer ranges for geometries\n\t\tthis._instanceInfo = [];\n\t\tthis._geometryInfo = [];\n\n\t\t// instance, geometry ids that have been set as inactive, and are available to be overwritten\n\t\tthis._availableInstanceIds = [];\n\t\tthis._availableGeometryIds = [];\n\n\t\t// used to track where the next point is that geometry should be inserted\n\t\tthis._nextIndexStart = 0;\n\t\tthis._nextVertexStart = 0;\n\t\tthis._geometryCount = 0;\n\n\t\t// flags\n\t\tthis._visibilityChanged = true;\n\t\tthis._geometryInitialized = false;\n\n\t\t// cached user options\n\t\tthis._maxInstanceCount = maxInstanceCount;\n\t\tthis._maxVertexCount = maxVertexCount;\n\t\tthis._maxIndexCount = maxIndexCount;\n\n\t\t// buffers for multi draw\n\t\tthis._multiDrawCounts = new Int32Array( maxInstanceCount );\n\t\tthis._multiDrawStarts = new Int32Array( maxInstanceCount );\n\t\tthis._multiDrawCount = 0;\n\t\tthis._multiDrawInstances = null;\n\n\t\t// Local matrix per geometry by using data texture\n\t\tthis._matricesTexture = null;\n\t\tthis._indirectTexture = null;\n\t\tthis._colorsTexture = null;\n\n\t\tthis._initMatricesTexture();\n\t\tthis._initIndirectTexture();\n\n\t}\n\n\t/**\n\t * The maximum number of individual instances that can be stored in the batch.\n\t *\n\t * @type {number}\n\t * @readonly\n\t */\n\tget maxInstanceCount() {\n\n\t\treturn this._maxInstanceCount;\n\n\t}\n\n\t/**\n\t * The instance count.\n\t *\n\t * @type {number}\n\t * @readonly\n\t */\n\tget instanceCount() {\n\n\t\treturn this._instanceInfo.length - this._availableInstanceIds.length;\n\n\t}\n\n\t/**\n\t * The number of unused vertices.\n\t *\n\t * @type {number}\n\t * @readonly\n\t */\n\tget unusedVertexCount() {\n\n\t\treturn this._maxVertexCount - this._nextVertexStart;\n\n\t}\n\n\t/**\n\t * The number of unused indices.\n\t *\n\t * @type {number}\n\t * @readonly\n\t */\n\tget unusedIndexCount() {\n\n\t\treturn this._maxIndexCount - this._nextIndexStart;\n\n\t}\n\n\t_initMatricesTexture() {\n\n\t\t// layout (1 matrix = 4 pixels)\n\t\t//      RGBA RGBA RGBA RGBA (=\u003e column1, column2, column3, column4)\n\t\t//  with  8x8  pixel texture max   16 matrices * 4 pixels =  (8 * 8)\n\t\t//       16x16 pixel texture max   64 matrices * 4 pixels = (16 * 16)\n\t\t//       32x32 pixel texture max  256 matrices * 4 pixels = (32 * 32)\n\t\t//       64x64 pixel texture max 1024 matrices * 4 pixels = (64 * 64)\n\n\t\tlet size = Math.sqrt( this._maxInstanceCount * 4 ); // 4 pixels needed for 1 matrix\n\t\tsize = Math.ceil( size / 4 ) * 4;\n\t\tsize = Math.max( size, 4 );\n\n\t\tconst matricesArray = new Float32Array( size * size * 4 ); // 4 floats per RGBA pixel\n\t\tconst matricesTexture = new DataTexture( matricesArray, size, size, RGBAFormat, FloatType );\n\n\t\tthis._matricesTexture = matricesTexture;\n\n\t}\n\n\t_initIndirectTexture() {\n\n\t\tlet size = Math.sqrt( this._maxInstanceCount );\n\t\tsize = Math.ceil( size );\n\n\t\tconst indirectArray = new Uint32Array( size * size );\n\t\tconst indirectTexture = new DataTexture( indirectArray, size, size, RedIntegerFormat, UnsignedIntType );\n\n\t\tthis._indirectTexture = indirectTexture;\n\n\t}\n\n\t_initColorsTexture() {\n\n\t\tlet size = Math.sqrt( this._maxInstanceCount );\n\t\tsize = Math.ceil( size );\n\n\t\t// 4 floats per RGBA pixel initialized to white\n\t\tconst colorsArray = new Float32Array( size * size * 4 ).fill( 1 );\n\t\tconst colorsTexture = new DataTexture( colorsArray, size, size, RGBAFormat, FloatType );\n\t\tcolorsTexture.colorSpace = ColorManagement.workingColorSpace;\n\n\t\tthis._colorsTexture = colorsTexture;\n\n\t}\n\n\t_initializeGeometry( reference ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst maxVertexCount = this._maxVertexCount;\n\t\tconst maxIndexCount = this._maxIndexCount;\n\t\tif ( this._geometryInitialized === false ) {\n\n\t\t\tfor ( const attributeName in reference.attributes ) {\n\n\t\t\t\tconst srcAttribute = reference.getAttribute( attributeName );\n\t\t\t\tconst { array, itemSize, normalized } = srcAttribute;\n\n\t\t\t\tconst dstArray = new array.constructor( maxVertexCount * itemSize );\n\t\t\t\tconst dstAttribute = new BufferAttribute( dstArray, itemSize, normalized );\n\n\t\t\t\tgeometry.setAttribute( attributeName, dstAttribute );\n\n\t\t\t}\n\n\t\t\tif ( reference.getIndex() !== null ) {\n\n\t\t\t\t// Reserve last u16 index for primitive restart.\n\t\t\t\tconst indexArray = maxVertexCount \u003e 65535\n\t\t\t\t\t? new Uint32Array( maxIndexCount )\n\t\t\t\t\t: new Uint16Array( maxIndexCount );\n\n\t\t\t\tgeometry.setIndex( new BufferAttribute( indexArray, 1 ) );\n\n\t\t\t}\n\n\t\t\tthis._geometryInitialized = true;\n\n\t\t}\n\n\t}\n\n\t// Make sure the geometry is compatible with the existing combined geometry attributes\n\t_validateGeometry( geometry ) {\n\n\t\t// check to ensure the geometries are using consistent attributes and indices\n\t\tconst batchGeometry = this.geometry;\n\t\tif ( Boolean( geometry.getIndex() ) !== Boolean( batchGeometry.getIndex() ) ) {\n\n\t\t\tthrow new Error( 'THREE.BatchedMesh: All geometries must consistently have \"index\".' );\n\n\t\t}\n\n\t\tfor ( const attributeName in batchGeometry.attributes ) {\n\n\t\t\tif ( ! geometry.hasAttribute( attributeName ) ) {\n\n\t\t\t\tthrow new Error( `THREE.BatchedMesh: Added geometry missing \"${ attributeName }\". All geometries must have consistent attributes.` );\n\n\t\t\t}\n\n\t\t\tconst srcAttribute = geometry.getAttribute( attributeName );\n\t\t\tconst dstAttribute = batchGeometry.getAttribute( attributeName );\n\t\t\tif ( srcAttribute.itemSize !== dstAttribute.itemSize || srcAttribute.normalized !== dstAttribute.normalized ) {\n\n\t\t\t\tthrow new Error( 'THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.' );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Validates the instance defined by the given ID.\n\t *\n\t * @param {number} instanceId - The instance to validate.\n\t */\n\tvalidateInstanceId( instanceId ) {\n\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tif ( instanceId \u003c 0 || instanceId \u003e= instanceInfo.length || instanceInfo[ instanceId ].active === false ) {\n\n\t\t\tthrow new Error( `THREE.BatchedMesh: Invalid instanceId ${instanceId}. Instance is either out of range or has been deleted.` );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Validates the geometry defined by the given ID.\n\t *\n\t * @param {number} geometryId - The geometry to validate.\n\t */\n\tvalidateGeometryId( geometryId ) {\n\n\t\tconst geometryInfoList = this._geometryInfo;\n\t\tif ( geometryId \u003c 0 || geometryId \u003e= geometryInfoList.length || geometryInfoList[ geometryId ].active === false ) {\n\n\t\t\tthrow new Error( `THREE.BatchedMesh: Invalid geometryId ${geometryId}. Geometry is either out of range or has been deleted.` );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Takes a sort a function that is run before render. The function takes a list of instances to\n\t * sort and a camera. The objects in the list include a \"z\" field to perform a depth-ordered sort with.\n\t *\n\t * @param {Function} func - The custom sort function.\n\t * @return {BatchedMesh} A reference to this batched mesh.\n\t */\n\tsetCustomSort( func ) {\n\n\t\tthis.customSort = func;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes the bounding box, updating {@link BatchedMesh#boundingBox}.\n\t * Bounding boxes aren't computed by default. They need to be explicitly computed,\n\t * otherwise they are `null`.\n\t */\n\tcomputeBoundingBox() {\n\n\t\tif ( this.boundingBox === null ) {\n\n\t\t\tthis.boundingBox = new Box3();\n\n\t\t}\n\n\t\tconst boundingBox = this.boundingBox;\n\t\tconst instanceInfo = this._instanceInfo;\n\n\t\tboundingBox.makeEmpty();\n\t\tfor ( let i = 0, l = instanceInfo.length; i \u003c l; i ++ ) {\n\n\t\t\tif ( instanceInfo[ i ].active === false ) continue;\n\n\t\t\tconst geometryId = instanceInfo[ i ].geometryIndex;\n\t\t\tthis.getMatrixAt( i, _matrix$1 );\n\t\t\tthis.getBoundingBoxAt( geometryId, _box$1 ).applyMatrix4( _matrix$1 );\n\t\t\tboundingBox.union( _box$1 );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Computes the bounding sphere, updating {@link BatchedMesh#boundingSphere}.\n\t * Bounding spheres aren't computed by default. They need to be explicitly computed,\n\t * otherwise they are `null`.\n\t */\n\tcomputeBoundingSphere() {\n\n\t\tif ( this.boundingSphere === null ) {\n\n\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tconst boundingSphere = this.boundingSphere;\n\t\tconst instanceInfo = this._instanceInfo;\n\n\t\tboundingSphere.makeEmpty();\n\t\tfor ( let i = 0, l = instanceInfo.length; i \u003c l; i ++ ) {\n\n\t\t\tif ( instanceInfo[ i ].active === false ) continue;\n\n\t\t\tconst geometryId = instanceInfo[ i ].geometryIndex;\n\t\t\tthis.getMatrixAt( i, _matrix$1 );\n\t\t\tthis.getBoundingSphereAt( geometryId, _sphere$2 ).applyMatrix4( _matrix$1 );\n\t\t\tboundingSphere.union( _sphere$2 );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Adds a new instance to the batch using the geometry of the given ID and returns\n\t * a new id referring to the new instance to be used by other functions.\n\t *\n\t * @param {number} geometryId - The ID of a previously added geometry via {@link BatchedMesh#addGeometry}.\n\t * @return {number} The instance ID.\n\t */\n\taddInstance( geometryId ) {\n\n\t\tconst atCapacity = this._instanceInfo.length \u003e= this.maxInstanceCount;\n\n\t\t// ensure we're not over geometry\n\t\tif ( atCapacity \u0026\u0026 this._availableInstanceIds.length === 0 ) {\n\n\t\t\tthrow new Error( 'THREE.BatchedMesh: Maximum item count reached.' );\n\n\t\t}\n\n\t\tconst instanceInfo = {\n\t\t\tvisible: true,\n\t\t\tactive: true,\n\t\t\tgeometryIndex: geometryId,\n\t\t};\n\n\t\tlet drawId = null;\n\n\t\t// Prioritize using previously freed instance ids\n\t\tif ( this._availableInstanceIds.length \u003e 0 ) {\n\n\t\t\tthis._availableInstanceIds.sort( ascIdSort );\n\n\t\t\tdrawId = this._availableInstanceIds.shift();\n\t\t\tthis._instanceInfo[ drawId ] = instanceInfo;\n\n\t\t} else {\n\n\t\t\tdrawId = this._instanceInfo.length;\n\t\t\tthis._instanceInfo.push( instanceInfo );\n\n\t\t}\n\n\t\tconst matricesTexture = this._matricesTexture;\n\t\t_matrix$1.identity().toArray( matricesTexture.image.data, drawId * 16 );\n\t\tmatricesTexture.needsUpdate = true;\n\n\t\tconst colorsTexture = this._colorsTexture;\n\t\tif ( colorsTexture ) {\n\n\t\t\t_whiteColor.toArray( colorsTexture.image.data, drawId * 4 );\n\t\t\tcolorsTexture.needsUpdate = true;\n\n\t\t}\n\n\t\tthis._visibilityChanged = true;\n\t\treturn drawId;\n\n\t}\n\n\t/**\n\t * Adds the given geometry to the batch and returns the associated\n\t * geometry id referring to it to be used in other functions.\n\t *\n\t * @param {BufferGeometry} geometry - The geometry to add.\n\t * @param {number} [reservedVertexCount=-1] - Optional parameter specifying the amount of\n\t * vertex buffer space to reserve for the added geometry. This is necessary if it is planned\n\t * to set a new geometry at this index at a later time that is larger than the original geometry.\n\t * Defaults to the length of the given geometry vertex buffer.\n\t * @param {number} [reservedIndexCount=-1] - Optional parameter specifying the amount of index\n\t * buffer space to reserve for the added geometry. This is necessary if it is planned to set a\n\t * new geometry at this index at a later time that is larger than the original geometry. Defaults to\n\t * the length of the given geometry index buffer.\n\t * @return {number} The geometry ID.\n\t */\n\taddGeometry( geometry, reservedVertexCount = -1, reservedIndexCount = -1 ) {\n\n\t\tthis._initializeGeometry( geometry );\n\n\t\tthis._validateGeometry( geometry );\n\n\t\tconst geometryInfo = {\n\t\t\t// geometry information\n\t\t\tvertexStart: -1,\n\t\t\tvertexCount: -1,\n\t\t\treservedVertexCount: -1,\n\n\t\t\tindexStart: -1,\n\t\t\tindexCount: -1,\n\t\t\treservedIndexCount: -1,\n\n\t\t\t// draw range information\n\t\t\tstart: -1,\n\t\t\tcount: -1,\n\n\t\t\t// state\n\t\t\tboundingBox: null,\n\t\t\tboundingSphere: null,\n\t\t\tactive: true,\n\t\t};\n\n\t\tconst geometryInfoList = this._geometryInfo;\n\t\tgeometryInfo.vertexStart = this._nextVertexStart;\n\t\tgeometryInfo.reservedVertexCount = reservedVertexCount === -1 ? geometry.getAttribute( 'position' ).count : reservedVertexCount;\n\n\t\tconst index = geometry.getIndex();\n\t\tconst hasIndex = index !== null;\n\t\tif ( hasIndex ) {\n\n\t\t\tgeometryInfo.indexStart = this._nextIndexStart;\n\t\t\tgeometryInfo.reservedIndexCount = reservedIndexCount === -1 ? index.count : reservedIndexCount;\n\n\t\t}\n\n\t\tif (\n\t\t\tgeometryInfo.indexStart !== -1 \u0026\u0026\n\t\t\tgeometryInfo.indexStart + geometryInfo.reservedIndexCount \u003e this._maxIndexCount ||\n\t\t\tgeometryInfo.vertexStart + geometryInfo.reservedVertexCount \u003e this._maxVertexCount\n\t\t) {\n\n\t\t\tthrow new Error( 'THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.' );\n\n\t\t}\n\n\t\t// update id\n\t\tlet geometryId;\n\t\tif ( this._availableGeometryIds.length \u003e 0 ) {\n\n\t\t\tthis._availableGeometryIds.sort( ascIdSort );\n\n\t\t\tgeometryId = this._availableGeometryIds.shift();\n\t\t\tgeometryInfoList[ geometryId ] = geometryInfo;\n\n\n\t\t} else {\n\n\t\t\tgeometryId = this._geometryCount;\n\t\t\tthis._geometryCount ++;\n\t\t\tgeometryInfoList.push( geometryInfo );\n\n\t\t}\n\n\t\t// update the geometry\n\t\tthis.setGeometryAt( geometryId, geometry );\n\n\t\t// increment the next geometry position\n\t\tthis._nextIndexStart = geometryInfo.indexStart + geometryInfo.reservedIndexCount;\n\t\tthis._nextVertexStart = geometryInfo.vertexStart + geometryInfo.reservedVertexCount;\n\n\t\treturn geometryId;\n\n\t}\n\n\t/**\n\t * Replaces the geometry at the given ID with the provided geometry. Throws an error if there\n\t * is not enough space reserved for geometry. Calling this will change all instances that are\n\t * rendering that geometry.\n\t *\n\t * @param {number} geometryId - The ID of the geometry that should be replaced with the given geometry.\n\t * @param {BufferGeometry} geometry - The new geometry.\n\t * @return {number} The geometry ID.\n\t */\n\tsetGeometryAt( geometryId, geometry ) {\n\n\t\tif ( geometryId \u003e= this._geometryCount ) {\n\n\t\t\tthrow new Error( 'THREE.BatchedMesh: Maximum geometry count reached.' );\n\n\t\t}\n\n\t\tthis._validateGeometry( geometry );\n\n\t\tconst batchGeometry = this.geometry;\n\t\tconst hasIndex = batchGeometry.getIndex() !== null;\n\t\tconst dstIndex = batchGeometry.getIndex();\n\t\tconst srcIndex = geometry.getIndex();\n\t\tconst geometryInfo = this._geometryInfo[ geometryId ];\n\t\tif (\n\t\t\thasIndex \u0026\u0026\n\t\t\tsrcIndex.count \u003e geometryInfo.reservedIndexCount ||\n\t\t\tgeometry.attributes.position.count \u003e geometryInfo.reservedVertexCount\n\t\t) {\n\n\t\t\tthrow new Error( 'THREE.BatchedMesh: Reserved space not large enough for provided geometry.' );\n\n\t\t}\n\n\t\t// copy geometry buffer data over\n\t\tconst vertexStart = geometryInfo.vertexStart;\n\t\tconst reservedVertexCount = geometryInfo.reservedVertexCount;\n\t\tgeometryInfo.vertexCount = geometry.getAttribute( 'position' ).count;\n\n\t\tfor ( const attributeName in batchGeometry.attributes ) {\n\n\t\t\t// copy attribute data\n\t\t\tconst srcAttribute = geometry.getAttribute( attributeName );\n\t\t\tconst dstAttribute = batchGeometry.getAttribute( attributeName );\n\t\t\tcopyAttributeData( srcAttribute, dstAttribute, vertexStart );\n\n\t\t\t// fill the rest in with zeroes\n\t\t\tconst itemSize = srcAttribute.itemSize;\n\t\t\tfor ( let i = srcAttribute.count, l = reservedVertexCount; i \u003c l; i ++ ) {\n\n\t\t\t\tconst index = vertexStart + i;\n\t\t\t\tfor ( let c = 0; c \u003c itemSize; c ++ ) {\n\n\t\t\t\t\tdstAttribute.setComponent( index, c, 0 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tdstAttribute.needsUpdate = true;\n\t\t\tdstAttribute.addUpdateRange( vertexStart * itemSize, reservedVertexCount * itemSize );\n\n\t\t}\n\n\t\t// copy index\n\t\tif ( hasIndex ) {\n\n\t\t\tconst indexStart = geometryInfo.indexStart;\n\t\t\tconst reservedIndexCount = geometryInfo.reservedIndexCount;\n\t\t\tgeometryInfo.indexCount = geometry.getIndex().count;\n\n\t\t\t// copy index data over\n\t\t\tfor ( let i = 0; i \u003c srcIndex.count; i ++ ) {\n\n\t\t\t\tdstIndex.setX( indexStart + i, vertexStart + srcIndex.getX( i ) );\n\n\t\t\t}\n\n\t\t\t// fill the rest in with zeroes\n\t\t\tfor ( let i = srcIndex.count, l = reservedIndexCount; i \u003c l; i ++ ) {\n\n\t\t\t\tdstIndex.setX( indexStart + i, vertexStart );\n\n\t\t\t}\n\n\t\t\tdstIndex.needsUpdate = true;\n\t\t\tdstIndex.addUpdateRange( indexStart, geometryInfo.reservedIndexCount );\n\n\t\t}\n\n\t\t// update the draw range\n\t\tgeometryInfo.start = hasIndex ? geometryInfo.indexStart : geometryInfo.vertexStart;\n\t\tgeometryInfo.count = hasIndex ? geometryInfo.indexCount : geometryInfo.vertexCount;\n\n\t\t// store the bounding boxes\n\t\tgeometryInfo.boundingBox = null;\n\t\tif ( geometry.boundingBox !== null ) {\n\n\t\t\tgeometryInfo.boundingBox = geometry.boundingBox.clone();\n\n\t\t}\n\n\t\tgeometryInfo.boundingSphere = null;\n\t\tif ( geometry.boundingSphere !== null ) {\n\n\t\t\tgeometryInfo.boundingSphere = geometry.boundingSphere.clone();\n\n\t\t}\n\n\t\tthis._visibilityChanged = true;\n\t\treturn geometryId;\n\n\t}\n\n\t/**\n\t * Deletes the geometry defined by the given ID from this batch. Any instances referencing\n\t * this geometry will also be removed as a side effect.\n\t *\n\t * @param {number} geometryId - The ID of the geometry to remove from the batch.\n\t * @return {BatchedMesh} A reference to this batched mesh.\n\t */\n\tdeleteGeometry( geometryId ) {\n\n\t\tconst geometryInfoList = this._geometryInfo;\n\t\tif ( geometryId \u003e= geometryInfoList.length || geometryInfoList[ geometryId ].active === false ) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\t// delete any instances associated with this geometry\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tfor ( let i = 0, l = instanceInfo.length; i \u003c l; i ++ ) {\n\n\t\t\tif ( instanceInfo[ i ].active \u0026\u0026 instanceInfo[ i ].geometryIndex === geometryId ) {\n\n\t\t\t\tthis.deleteInstance( i );\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometryInfoList[ geometryId ].active = false;\n\t\tthis._availableGeometryIds.push( geometryId );\n\t\tthis._visibilityChanged = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Deletes an existing instance from the batch using the given ID.\n\t *\n\t * @param {number} instanceId - The ID of the instance to remove from the batch.\n\t * @return {BatchedMesh} A reference to this batched mesh.\n\t */\n\tdeleteInstance( instanceId ) {\n\n\t\tthis.validateInstanceId( instanceId );\n\n\t\tthis._instanceInfo[ instanceId ].active = false;\n\t\tthis._availableInstanceIds.push( instanceId );\n\t\tthis._visibilityChanged = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Repacks the sub geometries in BatchedMesh to remove any unused space remaining from\n\t * previously deleted geometry, freeing up space to add new geometry.\n\t *\n\t * @return {BatchedMesh} A reference to this batched mesh.\n\t */\n\toptimize() {\n\n\t\t// track the next indices to copy data to\n\t\tlet nextVertexStart = 0;\n\t\tlet nextIndexStart = 0;\n\n\t\t// Iterate over all geometry ranges in order sorted from earliest in the geometry buffer to latest\n\t\t// in the geometry buffer. Because draw range objects can be reused there is no guarantee of their order.\n\t\tconst geometryInfoList = this._geometryInfo;\n\t\tconst indices = geometryInfoList\n\t\t\t.map( ( e, i ) =\u003e i )\n\t\t\t.sort( ( a, b ) =\u003e {\n\n\t\t\t\treturn geometryInfoList[ a ].vertexStart - geometryInfoList[ b ].vertexStart;\n\n\t\t\t} );\n\n\t\tconst geometry = this.geometry;\n\t\tfor ( let i = 0, l = geometryInfoList.length; i \u003c l; i ++ ) {\n\n\t\t\t// if a geometry range is inactive then don't copy anything\n\t\t\tconst index = indices[ i ];\n\t\t\tconst geometryInfo = geometryInfoList[ index ];\n\t\t\tif ( geometryInfo.active === false ) {\n\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\t// if a geometry contains an index buffer then shift it, as well\n\t\t\tif ( geometry.index !== null ) {\n\n\t\t\t\tif ( geometryInfo.indexStart !== nextIndexStart ) {\n\n\t\t\t\t\tconst { indexStart, vertexStart, reservedIndexCount } = geometryInfo;\n\t\t\t\t\tconst index = geometry.index;\n\t\t\t\t\tconst array = index.array;\n\n\t\t\t\t\t// shift the index pointers based on how the vertex data will shift\n\t\t\t\t\t// adjusting the index must happen first so the original vertex start value is available\n\t\t\t\t\tconst elementDelta = nextVertexStart - vertexStart;\n\t\t\t\t\tfor ( let j = indexStart; j \u003c indexStart + reservedIndexCount; j ++ ) {\n\n\t\t\t\t\t\tarray[ j ] = array[ j ] + elementDelta;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tindex.array.copyWithin( nextIndexStart, indexStart, indexStart + reservedIndexCount );\n\t\t\t\t\tindex.addUpdateRange( nextIndexStart, reservedIndexCount );\n\t\t\t\t\tindex.needsUpdate = true;\n\n\t\t\t\t\tgeometryInfo.indexStart = nextIndexStart;\n\n\t\t\t\t}\n\n\t\t\t\tnextIndexStart += geometryInfo.reservedIndexCount;\n\n\t\t\t}\n\n\t\t\t// if a geometry needs to be moved then copy attribute data to overwrite unused space\n\t\t\tif ( geometryInfo.vertexStart !== nextVertexStart ) {\n\n\t\t\t\tconst { vertexStart, reservedVertexCount } = geometryInfo;\n\t\t\t\tconst attributes = geometry.attributes;\n\t\t\t\tfor ( const key in attributes ) {\n\n\t\t\t\t\tconst attribute = attributes[ key ];\n\t\t\t\t\tconst { array, itemSize } = attribute;\n\t\t\t\t\tarray.copyWithin( nextVertexStart * itemSize, vertexStart * itemSize, ( vertexStart + reservedVertexCount ) * itemSize );\n\t\t\t\t\tattribute.addUpdateRange( nextVertexStart * itemSize, reservedVertexCount * itemSize );\n\t\t\t\t\tattribute.needsUpdate = true;\n\n\t\t\t\t}\n\n\t\t\t\tgeometryInfo.vertexStart = nextVertexStart;\n\n\t\t\t}\n\n\t\t\tnextVertexStart += geometryInfo.reservedVertexCount;\n\t\t\tgeometryInfo.start = geometry.index ? geometryInfo.indexStart : geometryInfo.vertexStart;\n\n\t\t\t// step the next geometry points to the shifted position\n\t\t\tthis._nextIndexStart = geometry.index ? geometryInfo.indexStart + geometryInfo.reservedIndexCount : 0;\n\t\t\tthis._nextVertexStart = geometryInfo.vertexStart + geometryInfo.reservedVertexCount;\n\n\t\t}\n\n\t\tthis._visibilityChanged = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the bounding box for the given geometry.\n\t *\n\t * @param {number} geometryId - The ID of the geometry to return the bounding box for.\n\t * @param {Box3} target - The target object that is used to store the method's result.\n\t * @return {?Box3} The geometry's bounding box. Returns `null` if no geometry has been found for the given ID.\n\t */\n\tgetBoundingBoxAt( geometryId, target ) {\n\n\t\tif ( geometryId \u003e= this._geometryCount ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// compute bounding box\n\t\tconst geometry = this.geometry;\n\t\tconst geometryInfo = this._geometryInfo[ geometryId ];\n\t\tif ( geometryInfo.boundingBox === null ) {\n\n\t\t\tconst box = new Box3();\n\t\t\tconst index = geometry.index;\n\t\t\tconst position = geometry.attributes.position;\n\t\t\tfor ( let i = geometryInfo.start, l = geometryInfo.start + geometryInfo.count; i \u003c l; i ++ ) {\n\n\t\t\t\tlet iv = i;\n\t\t\t\tif ( index ) {\n\n\t\t\t\t\tiv = index.getX( iv );\n\n\t\t\t\t}\n\n\t\t\t\tbox.expandByPoint( _vector$5.fromBufferAttribute( position, iv ) );\n\n\t\t\t}\n\n\t\t\tgeometryInfo.boundingBox = box;\n\n\t\t}\n\n\t\ttarget.copy( geometryInfo.boundingBox );\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Returns the bounding sphere for the given geometry.\n\t *\n\t * @param {number} geometryId - The ID of the geometry to return the bounding sphere for.\n\t * @param {Sphere} target - The target object that is used to store the method's result.\n\t * @return {?Sphere} The geometry's bounding sphere. Returns `null` if no geometry has been found for the given ID.\n\t */\n\tgetBoundingSphereAt( geometryId, target ) {\n\n\t\tif ( geometryId \u003e= this._geometryCount ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// compute bounding sphere\n\t\tconst geometry = this.geometry;\n\t\tconst geometryInfo = this._geometryInfo[ geometryId ];\n\t\tif ( geometryInfo.boundingSphere === null ) {\n\n\t\t\tconst sphere = new Sphere();\n\t\t\tthis.getBoundingBoxAt( geometryId, _box$1 );\n\t\t\t_box$1.getCenter( sphere.center );\n\n\t\t\tconst index = geometry.index;\n\t\t\tconst position = geometry.attributes.position;\n\n\t\t\tlet maxRadiusSq = 0;\n\t\t\tfor ( let i = geometryInfo.start, l = geometryInfo.start + geometryInfo.count; i \u003c l; i ++ ) {\n\n\t\t\t\tlet iv = i;\n\t\t\t\tif ( index ) {\n\n\t\t\t\t\tiv = index.getX( iv );\n\n\t\t\t\t}\n\n\t\t\t\t_vector$5.fromBufferAttribute( position, iv );\n\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, sphere.center.distanceToSquared( _vector$5 ) );\n\n\t\t\t}\n\n\t\t\tsphere.radius = Math.sqrt( maxRadiusSq );\n\t\t\tgeometryInfo.boundingSphere = sphere;\n\n\t\t}\n\n\t\ttarget.copy( geometryInfo.boundingSphere );\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Sets the given local transformation matrix to the defined instance.\n\t * Negatively scaled matrices are not supported.\n\t *\n\t * @param {number} instanceId - The ID of an instance to set the matrix of.\n\t * @param {Matrix4} matrix - A 4x4 matrix representing the local transformation of a single instance.\n\t * @return {BatchedMesh} A reference to this batched mesh.\n\t */\n\tsetMatrixAt( instanceId, matrix ) {\n\n\t\tthis.validateInstanceId( instanceId );\n\n\t\tconst matricesTexture = this._matricesTexture;\n\t\tconst matricesArray = this._matricesTexture.image.data;\n\t\tmatrix.toArray( matricesArray, instanceId * 16 );\n\t\tmatricesTexture.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the local transformation matrix of the defined instance.\n\t *\n\t * @param {number} instanceId - The ID of an instance to get the matrix of.\n\t * @param {Matrix4} matrix - The target object that is used to store the method's result.\n\t * @return {Matrix4} The instance's local transformation matrix.\n\t */\n\tgetMatrixAt( instanceId, matrix ) {\n\n\t\tthis.validateInstanceId( instanceId );\n\t\treturn matrix.fromArray( this._matricesTexture.image.data, instanceId * 16 );\n\n\t}\n\n\t/**\n\t * Sets the given color to the defined instance.\n\t *\n\t * @param {number} instanceId - The ID of an instance to set the color of.\n\t * @param {Color} color - The color to set the instance to.\n\t * @return {BatchedMesh} A reference to this batched mesh.\n\t */\n\tsetColorAt( instanceId, color ) {\n\n\t\tthis.validateInstanceId( instanceId );\n\n\t\tif ( this._colorsTexture === null ) {\n\n\t\t\tthis._initColorsTexture();\n\n\t\t}\n\n\t\tcolor.toArray( this._colorsTexture.image.data, instanceId * 4 );\n\t\tthis._colorsTexture.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the color of the defined instance.\n\t *\n\t * @param {number} instanceId - The ID of an instance to get the color of.\n\t * @param {Color} color - The target object that is used to store the method's result.\n\t * @return {Color} The instance's color.\n\t */\n\tgetColorAt( instanceId, color ) {\n\n\t\tthis.validateInstanceId( instanceId );\n\t\treturn color.fromArray( this._colorsTexture.image.data, instanceId * 4 );\n\n\t}\n\n\t/**\n\t * Sets the visibility of the instance.\n\t *\n\t * @param {number} instanceId - The id of the instance to set the visibility of.\n\t * @param {boolean} visible - Whether the instance is visible or not.\n\t * @return {BatchedMesh} A reference to this batched mesh.\n\t */\n\tsetVisibleAt( instanceId, visible ) {\n\n\t\tthis.validateInstanceId( instanceId );\n\n\t\tif ( this._instanceInfo[ instanceId ].visible === visible ) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tthis._instanceInfo[ instanceId ].visible = visible;\n\t\tthis._visibilityChanged = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the visibility state of the defined instance.\n\t *\n\t * @param {number} instanceId - The ID of an instance to get the visibility state of.\n\t * @return {boolean} Whether the instance is visible or not.\n\t */\n\tgetVisibleAt( instanceId ) {\n\n\t\tthis.validateInstanceId( instanceId );\n\n\t\treturn this._instanceInfo[ instanceId ].visible;\n\n\t}\n\n\t/**\n\t * Sets the geometry ID of the instance at the given index.\n\t *\n\t * @param {number} instanceId - The ID of the instance to set the geometry ID of.\n\t * @param {number} geometryId - The geometry ID to be use by the instance.\n\t * @return {BatchedMesh} A reference to this batched mesh.\n\t */\n\tsetGeometryIdAt( instanceId, geometryId ) {\n\n\t\tthis.validateInstanceId( instanceId );\n\t\tthis.validateGeometryId( geometryId );\n\n\t\tthis._instanceInfo[ instanceId ].geometryIndex = geometryId;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the geometry ID of the defined instance.\n\t *\n\t * @param {number} instanceId - The ID of an instance to get the geometry ID of.\n\t * @return {number} The instance's geometry ID.\n\t */\n\tgetGeometryIdAt( instanceId ) {\n\n\t\tthis.validateInstanceId( instanceId );\n\n\t\treturn this._instanceInfo[ instanceId ].geometryIndex;\n\n\t}\n\n\t/**\n\t * Get the range representing the subset of triangles related to the attached geometry,\n\t * indicating the starting offset and count, or `null` if invalid.\n\t *\n\t * @param {number} geometryId - The id of the geometry to get the range of.\n\t * @param {Object} [target] - The target object that is used to store the method's result.\n\t * @return {{\n\t * \tvertexStart:number,vertexCount:number,reservedVertexCount:number,\n\t * \tindexStart:number,indexCount:number,reservedIndexCount:number,\n\t * \tstart:number,count:number\n\t * }} The result object with range data.\n\t */\n\tgetGeometryRangeAt( geometryId, target = {} ) {\n\n\t\tthis.validateGeometryId( geometryId );\n\n\t\tconst geometryInfo = this._geometryInfo[ geometryId ];\n\t\ttarget.vertexStart = geometryInfo.vertexStart;\n\t\ttarget.vertexCount = geometryInfo.vertexCount;\n\t\ttarget.reservedVertexCount = geometryInfo.reservedVertexCount;\n\n\t\ttarget.indexStart = geometryInfo.indexStart;\n\t\ttarget.indexCount = geometryInfo.indexCount;\n\t\ttarget.reservedIndexCount = geometryInfo.reservedIndexCount;\n\n\t\ttarget.start = geometryInfo.start;\n\t\ttarget.count = geometryInfo.count;\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Resizes the necessary buffers to support the provided number of instances.\n\t * If the provided arguments shrink the number of instances but there are not enough\n\t * unused Ids at the end of the list then an error is thrown.\n\t *\n\t * @param {number} maxInstanceCount - The max number of individual instances that can be added and rendered by the batch.\n\t*/\n\tsetInstanceCount( maxInstanceCount ) {\n\n\t\t// shrink the available instances as much as possible\n\t\tconst availableInstanceIds = this._availableInstanceIds;\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tavailableInstanceIds.sort( ascIdSort );\n\t\twhile ( availableInstanceIds[ availableInstanceIds.length - 1 ] === instanceInfo.length - 1 ) {\n\n\t\t\tinstanceInfo.pop();\n\t\t\tavailableInstanceIds.pop();\n\n\t\t}\n\n\t\t// throw an error if it can't be shrunk to the desired size\n\t\tif ( maxInstanceCount \u003c instanceInfo.length ) {\n\n\t\t\tthrow new Error( `BatchedMesh: Instance ids outside the range ${ maxInstanceCount } are being used. Cannot shrink instance count.` );\n\n\t\t}\n\n\t\t// copy the multi draw counts\n\t\tconst multiDrawCounts = new Int32Array( maxInstanceCount );\n\t\tconst multiDrawStarts = new Int32Array( maxInstanceCount );\n\t\tcopyArrayContents( this._multiDrawCounts, multiDrawCounts );\n\t\tcopyArrayContents( this._multiDrawStarts, multiDrawStarts );\n\n\t\tthis._multiDrawCounts = multiDrawCounts;\n\t\tthis._multiDrawStarts = multiDrawStarts;\n\t\tthis._maxInstanceCount = maxInstanceCount;\n\n\t\t// update texture data for instance sampling\n\t\tconst indirectTexture = this._indirectTexture;\n\t\tconst matricesTexture = this._matricesTexture;\n\t\tconst colorsTexture = this._colorsTexture;\n\n\t\tindirectTexture.dispose();\n\t\tthis._initIndirectTexture();\n\t\tcopyArrayContents( indirectTexture.image.data, this._indirectTexture.image.data );\n\n\t\tmatricesTexture.dispose();\n\t\tthis._initMatricesTexture();\n\t\tcopyArrayContents( matricesTexture.image.data, this._matricesTexture.image.data );\n\n\t\tif ( colorsTexture ) {\n\n\t\t\tcolorsTexture.dispose();\n\t\t\tthis._initColorsTexture();\n\t\t\tcopyArrayContents( colorsTexture.image.data, this._colorsTexture.image.data );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Resizes the available space in the batch's vertex and index buffer attributes to the provided sizes.\n\t * If the provided arguments shrink the geometry buffers but there is not enough unused space at the\n\t * end of the geometry attributes then an error is thrown.\n\t *\n\t * @param {number} maxVertexCount - The maximum number of vertices to be used by all unique geometries to resize to.\n\t * @param {number} maxIndexCount - The maximum number of indices to be used by all unique geometries to resize to.\n\t*/\n\tsetGeometrySize( maxVertexCount, maxIndexCount ) {\n\n\t\t// Check if we can shrink to the requested vertex attribute size\n\t\tconst validRanges = [ ...this._geometryInfo ].filter( info =\u003e info.active );\n\t\tconst requiredVertexLength = Math.max( ...validRanges.map( range =\u003e range.vertexStart + range.reservedVertexCount ) );\n\t\tif ( requiredVertexLength \u003e maxVertexCount ) {\n\n\t\t\tthrow new Error( `BatchedMesh: Geometry vertex values are being used outside the range ${ maxIndexCount }. Cannot shrink further.` );\n\n\t\t}\n\n\t\t// Check if we can shrink to the requested index attribute size\n\t\tif ( this.geometry.index ) {\n\n\t\t\tconst requiredIndexLength = Math.max( ...validRanges.map( range =\u003e range.indexStart + range.reservedIndexCount ) );\n\t\t\tif ( requiredIndexLength \u003e maxIndexCount ) {\n\n\t\t\t\tthrow new Error( `BatchedMesh: Geometry index values are being used outside the range ${ maxIndexCount }. Cannot shrink further.` );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\t// dispose of the previous geometry\n\t\tconst oldGeometry = this.geometry;\n\t\toldGeometry.dispose();\n\n\t\t// recreate the geometry needed based on the previous variant\n\t\tthis._maxVertexCount = maxVertexCount;\n\t\tthis._maxIndexCount = maxIndexCount;\n\n\t\tif ( this._geometryInitialized ) {\n\n\t\t\tthis._geometryInitialized = false;\n\t\t\tthis.geometry = new BufferGeometry();\n\t\t\tthis._initializeGeometry( oldGeometry );\n\n\t\t}\n\n\t\t// copy data from the previous geometry\n\t\tconst geometry = this.geometry;\n\t\tif ( oldGeometry.index ) {\n\n\t\t\tcopyArrayContents( oldGeometry.index.array, geometry.index.array );\n\n\t\t}\n\n\t\tfor ( const key in oldGeometry.attributes ) {\n\n\t\t\tcopyArrayContents( oldGeometry.attributes[ key ].array, geometry.attributes[ key ].array );\n\n\t\t}\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tconst geometryInfoList = this._geometryInfo;\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst batchGeometry = this.geometry;\n\n\t\t// iterate over each geometry\n\t\t_mesh.material = this.material;\n\t\t_mesh.geometry.index = batchGeometry.index;\n\t\t_mesh.geometry.attributes = batchGeometry.attributes;\n\t\tif ( _mesh.geometry.boundingBox === null ) {\n\n\t\t\t_mesh.geometry.boundingBox = new Box3();\n\n\t\t}\n\n\t\tif ( _mesh.geometry.boundingSphere === null ) {\n\n\t\t\t_mesh.geometry.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tfor ( let i = 0, l = instanceInfo.length; i \u003c l; i ++ ) {\n\n\t\t\tif ( ! instanceInfo[ i ].visible || ! instanceInfo[ i ].active ) {\n\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tconst geometryId = instanceInfo[ i ].geometryIndex;\n\t\t\tconst geometryInfo = geometryInfoList[ geometryId ];\n\t\t\t_mesh.geometry.setDrawRange( geometryInfo.start, geometryInfo.count );\n\n\t\t\t// get the intersects\n\t\t\tthis.getMatrixAt( i, _mesh.matrixWorld ).premultiply( matrixWorld );\n\t\t\tthis.getBoundingBoxAt( geometryId, _mesh.geometry.boundingBox );\n\t\t\tthis.getBoundingSphereAt( geometryId, _mesh.geometry.boundingSphere );\n\t\t\t_mesh.raycast( raycaster, _batchIntersects );\n\n\t\t\t// add batch id to the intersects\n\t\t\tfor ( let j = 0, l = _batchIntersects.length; j \u003c l; j ++ ) {\n\n\t\t\t\tconst intersect = _batchIntersects[ j ];\n\t\t\t\tintersect.object = this;\n\t\t\t\tintersect.batchId = i;\n\t\t\t\tintersects.push( intersect );\n\n\t\t\t}\n\n\t\t\t_batchIntersects.length = 0;\n\n\t\t}\n\n\t\t_mesh.material = null;\n\t\t_mesh.geometry.index = null;\n\t\t_mesh.geometry.attributes = {};\n\t\t_mesh.geometry.setDrawRange( 0, Infinity );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.geometry = source.geometry.clone();\n\t\tthis.perObjectFrustumCulled = source.perObjectFrustumCulled;\n\t\tthis.sortObjects = source.sortObjects;\n\t\tthis.boundingBox = source.boundingBox !== null ? source.boundingBox.clone() : null;\n\t\tthis.boundingSphere = source.boundingSphere !== null ? source.boundingSphere.clone() : null;\n\n\t\tthis._geometryInfo = source._geometryInfo.map( info =\u003e ( {\n\t\t\t...info,\n\n\t\t\tboundingBox: info.boundingBox !== null ? info.boundingBox.clone() : null,\n\t\t\tboundingSphere: info.boundingSphere !== null ? info.boundingSphere.clone() : null,\n\t\t} ) );\n\t\tthis._instanceInfo = source._instanceInfo.map( info =\u003e ( { ...info } ) );\n\n\t\tthis._availableInstanceIds = source._availableInstanceIds.slice();\n\t\tthis._availableGeometryIds = source._availableGeometryIds.slice();\n\n\t\tthis._nextIndexStart = source._nextIndexStart;\n\t\tthis._nextVertexStart = source._nextVertexStart;\n\t\tthis._geometryCount = source._geometryCount;\n\n\t\tthis._maxInstanceCount = source._maxInstanceCount;\n\t\tthis._maxVertexCount = source._maxVertexCount;\n\t\tthis._maxIndexCount = source._maxIndexCount;\n\n\t\tthis._geometryInitialized = source._geometryInitialized;\n\t\tthis._multiDrawCounts = source._multiDrawCounts.slice();\n\t\tthis._multiDrawStarts = source._multiDrawStarts.slice();\n\n\t\tthis._indirectTexture = source._indirectTexture.clone();\n\t\tthis._indirectTexture.image.data = this._indirectTexture.image.data.slice();\n\n\t\tthis._matricesTexture = source._matricesTexture.clone();\n\t\tthis._matricesTexture.image.data = this._matricesTexture.image.data.slice();\n\n\t\tif ( this._colorsTexture !== null ) {\n\n\t\t\tthis._colorsTexture = source._colorsTexture.clone();\n\t\t\tthis._colorsTexture.image.data = this._colorsTexture.image.data.slice();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\t// Assuming the geometry is not shared with other meshes\n\t\tthis.geometry.dispose();\n\n\t\tthis._matricesTexture.dispose();\n\t\tthis._matricesTexture = null;\n\n\t\tthis._indirectTexture.dispose();\n\t\tthis._indirectTexture = null;\n\n\t\tif ( this._colorsTexture !== null ) {\n\n\t\t\tthis._colorsTexture.dispose();\n\t\t\tthis._colorsTexture = null;\n\n\t\t}\n\n\t}\n\n\tonBeforeRender( renderer, scene, camera, geometry, material/*, _group*/ ) {\n\n\t\t// if visibility has not changed and frustum culling and object sorting is not required\n\t\t// then skip iterating over all items\n\t\tif ( ! this._visibilityChanged \u0026\u0026 ! this.perObjectFrustumCulled \u0026\u0026 ! this.sortObjects ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t// the indexed version of the multi draw function requires specifying the start\n\t\t// offset in bytes.\n\t\tconst index = geometry.getIndex();\n\t\tconst bytesPerElement = index === null ? 1 : index.array.BYTES_PER_ELEMENT;\n\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tconst multiDrawStarts = this._multiDrawStarts;\n\t\tconst multiDrawCounts = this._multiDrawCounts;\n\t\tconst geometryInfoList = this._geometryInfo;\n\t\tconst perObjectFrustumCulled = this.perObjectFrustumCulled;\n\t\tconst indirectTexture = this._indirectTexture;\n\t\tconst indirectArray = indirectTexture.image.data;\n\n\t\tconst frustum = camera.isArrayCamera ? _frustumArray : _frustum;\n\t\t// prepare the frustum in the local frame\n\t\tif ( perObjectFrustumCulled \u0026\u0026 ! camera.isArrayCamera ) {\n\n\t\t\t_matrix$1\n\t\t\t\t.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse )\n\t\t\t\t.multiply( this.matrixWorld );\n\n\t\t\t_frustum.setFromProjectionMatrix(\n\t\t\t\t_matrix$1,\n\t\t\t\tcamera.coordinateSystem,\n\t\t\t\tcamera.reversedDepth\n\t\t\t);\n\n\t\t}\n\n\t\tlet multiDrawCount = 0;\n\t\tif ( this.sortObjects ) {\n\n\t\t\t// get the camera position in the local frame\n\t\t\t_matrix$1.copy( this.matrixWorld ).invert();\n\t\t\t_vector$5.setFromMatrixPosition( camera.matrixWorld ).applyMatrix4( _matrix$1 );\n\t\t\t_forward$1.set( 0, 0, -1 ).transformDirection( camera.matrixWorld ).transformDirection( _matrix$1 );\n\n\t\t\tfor ( let i = 0, l = instanceInfo.length; i \u003c l; i ++ ) {\n\n\t\t\t\tif ( instanceInfo[ i ].visible \u0026\u0026 instanceInfo[ i ].active ) {\n\n\t\t\t\t\tconst geometryId = instanceInfo[ i ].geometryIndex;\n\n\t\t\t\t\t// get the bounds in world space\n\t\t\t\t\tthis.getMatrixAt( i, _matrix$1 );\n\t\t\t\t\tthis.getBoundingSphereAt( geometryId, _sphere$2 ).applyMatrix4( _matrix$1 );\n\n\t\t\t\t\t// determine whether the batched geometry is within the frustum\n\t\t\t\t\tlet culled = false;\n\t\t\t\t\tif ( perObjectFrustumCulled ) {\n\n\t\t\t\t\t\tculled = ! frustum.intersectsSphere( _sphere$2, camera );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! culled ) {\n\n\t\t\t\t\t\t// get the distance from camera used for sorting\n\t\t\t\t\t\tconst geometryInfo = geometryInfoList[ geometryId ];\n\t\t\t\t\t\tconst z = _temp.subVectors( _sphere$2.center, _vector$5 ).dot( _forward$1 );\n\t\t\t\t\t\t_renderList.push( geometryInfo.start, geometryInfo.count, z, i );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Sort the draw ranges and prep for rendering\n\t\t\tconst list = _renderList.list;\n\t\t\tconst customSort = this.customSort;\n\t\t\tif ( customSort === null ) {\n\n\t\t\t\tlist.sort( material.transparent ? sortTransparent : sortOpaque );\n\n\t\t\t} else {\n\n\t\t\t\tcustomSort.call( this, list, camera );\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0, l = list.length; i \u003c l; i ++ ) {\n\n\t\t\t\tconst item = list[ i ];\n\t\t\t\tmultiDrawStarts[ multiDrawCount ] = item.start * bytesPerElement;\n\t\t\t\tmultiDrawCounts[ multiDrawCount ] = item.count;\n\t\t\t\tindirectArray[ multiDrawCount ] = item.index;\n\t\t\t\tmultiDrawCount ++;\n\n\t\t\t}\n\n\t\t\t_renderList.reset();\n\n\t\t} else {\n\n\t\t\tfor ( let i = 0, l = instanceInfo.length; i \u003c l; i ++ ) {\n\n\t\t\t\tif ( instanceInfo[ i ].visible \u0026\u0026 instanceInfo[ i ].active ) {\n\n\t\t\t\t\tconst geometryId = instanceInfo[ i ].geometryIndex;\n\n\t\t\t\t\t// determine whether the batched geometry is within the frustum\n\t\t\t\t\tlet culled = false;\n\t\t\t\t\tif ( perObjectFrustumCulled ) {\n\n\t\t\t\t\t\t// get the bounds in world space\n\t\t\t\t\t\tthis.getMatrixAt( i, _matrix$1 );\n\t\t\t\t\t\tthis.getBoundingSphereAt( geometryId, _sphere$2 ).applyMatrix4( _matrix$1 );\n\t\t\t\t\t\tculled = ! frustum.intersectsSphere( _sphere$2, camera );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! culled ) {\n\n\t\t\t\t\t\tconst geometryInfo = geometryInfoList[ geometryId ];\n\t\t\t\t\t\tmultiDrawStarts[ multiDrawCount ] = geometryInfo.start * bytesPerElement;\n\t\t\t\t\t\tmultiDrawCounts[ multiDrawCount ] = geometryInfo.count;\n\t\t\t\t\t\tindirectArray[ multiDrawCount ] = i;\n\t\t\t\t\t\tmultiDrawCount ++;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tindirectTexture.needsUpdate = true;\n\t\tthis._multiDrawCount = multiDrawCount;\n\t\tthis._visibilityChanged = false;\n\n\t}\n\n\tonBeforeShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial/* , group */ ) {\n\n\t\tthis.onBeforeRender( renderer, null, shadowCamera, geometry, depthMaterial );\n\n\t}\n\n}\n\n/**\n * A material for rendering line primitives.\n *\n * Materials define the appearance of renderable 3D objects.\n *\n * ```js\n * const material = new THREE.LineBasicMaterial( { color: 0xffffff } );\n * ```\n *\n * @augments Material\n */\nclass LineBasicMaterial extends Material {\n\n\t/**\n\t * Constructs a new line basic material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLineBasicMaterial = true;\n\n\t\tthis.type = 'LineBasicMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff );\n\n\t\t/**\n\t\t * Sets the color of the lines using data from a texture. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * Controls line thickness or lines.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}. WebGL and WebGPU\n\t\t * ignore this setting and always render line primitives with a\n\t\t * width of one pixel.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.linewidth = 1;\n\n\t\t/**\n\t\t * Defines appearance of line ends.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('butt'|'round'|'square')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.linecap = 'round';\n\n\t\t/**\n\t\t * Defines appearance of line joints.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.linejoin = 'round';\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.linewidth = source.linewidth;\n\t\tthis.linecap = source.linecap;\n\t\tthis.linejoin = source.linejoin;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _vStart = /*@__PURE__*/ new Vector3();\nconst _vEnd = /*@__PURE__*/ new Vector3();\n\nconst _inverseMatrix$1 = /*@__PURE__*/ new Matrix4();\nconst _ray$1 = /*@__PURE__*/ new Ray();\nconst _sphere$1 = /*@__PURE__*/ new Sphere();\n\nconst _intersectPointOnRay = /*@__PURE__*/ new Vector3();\nconst _intersectPointOnSegment = /*@__PURE__*/ new Vector3();\n\n/**\n * A continuous line. The line are rendered by connecting consecutive\n * vertices with straight lines.\n *\n * ```js\n * const material = new THREE.LineBasicMaterial( { color: 0x0000ff } );\n *\n * const points = [];\n * points.push( new THREE.Vector3( - 10, 0, 0 ) );\n * points.push( new THREE.Vector3( 0, 10, 0 ) );\n * points.push( new THREE.Vector3( 10, 0, 0 ) );\n *\n * const geometry = new THREE.BufferGeometry().setFromPoints( points );\n *\n * const line = new THREE.Line( geometry, material );\n * scene.add( line );\n * ```\n *\n * @augments Object3D\n */\nclass Line extends Object3D {\n\n\t/**\n\t * Constructs a new line.\n\t *\n\t * @param {BufferGeometry} [geometry] - The line geometry.\n\t * @param {Material|Array\u003cMaterial\u003e} [material] - The line material.\n\t */\n\tconstructor( geometry = new BufferGeometry(), material = new LineBasicMaterial() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLine = true;\n\n\t\tthis.type = 'Line';\n\n\t\t/**\n\t\t * The line geometry.\n\t\t *\n\t\t * @type {BufferGeometry}\n\t\t */\n\t\tthis.geometry = geometry;\n\n\t\t/**\n\t\t * The line material.\n\t\t *\n\t\t * @type {Material|Array\u003cMaterial\u003e}\n\t\t * @default LineBasicMaterial\n\t\t */\n\t\tthis.material = material;\n\n\t\t/**\n\t\t * A dictionary representing the morph targets in the geometry. The key is the\n\t\t * morph targets name, the value its attribute index. This member is `undefined`\n\t\t * by default and only set when morph targets are detected in the geometry.\n\t\t *\n\t\t * @type {Object\u003cstring,number\u003e|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.morphTargetDictionary = undefined;\n\n\t\t/**\n\t\t * An array of weights typically in the range `[0,1]` that specify how much of the morph\n\t\t * is applied. This member is `undefined` by default and only set when morph targets are\n\t\t * detected in the geometry.\n\t\t *\n\t\t * @type {Array\u003cnumber\u003e|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.morphTargetInfluences = undefined;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.material = Array.isArray( source.material ) ? source.material.slice() : source.material;\n\t\tthis.geometry = source.geometry;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes an array of distance values which are necessary for rendering dashed lines.\n\t * For each vertex in the geometry, the method calculates the cumulative length from the\n\t * current point to the very beginning of the line.\n\t *\n\t * @return {Line} A reference to this line.\n\t */\n\tcomputeLineDistances() {\n\n\t\tconst geometry = this.geometry;\n\n\t\t// we assume non-indexed geometry\n\n\t\tif ( geometry.index === null ) {\n\n\t\t\tconst positionAttribute = geometry.attributes.position;\n\t\t\tconst lineDistances = [ 0 ];\n\n\t\t\tfor ( let i = 1, l = positionAttribute.count; i \u003c l; i ++ ) {\n\n\t\t\t\t_vStart.fromBufferAttribute( positionAttribute, i - 1 );\n\t\t\t\t_vEnd.fromBufferAttribute( positionAttribute, i );\n\n\t\t\t\tlineDistances[ i ] = lineDistances[ i - 1 ];\n\t\t\t\tlineDistances[ i ] += _vStart.distanceTo( _vEnd );\n\n\t\t\t}\n\n\t\t\tgeometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );\n\n\t\t} else {\n\n\t\t\twarn( 'Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes intersection points between a casted ray and this line.\n\t *\n\t * @param {Raycaster} raycaster - The raycaster.\n\t * @param {Array\u003cObject\u003e} intersects - The target array that holds the intersection points.\n\t */\n\traycast( raycaster, intersects ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst threshold = raycaster.params.Line.threshold;\n\t\tconst drawRange = geometry.drawRange;\n\n\t\t// Checking boundingSphere distance to ray\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere$1.copy( geometry.boundingSphere );\n\t\t_sphere$1.applyMatrix4( matrixWorld );\n\t\t_sphere$1.radius += threshold;\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere$1 ) === false ) return;\n\n\t\t//\n\n\t\t_inverseMatrix$1.copy( matrixWorld ).invert();\n\t\t_ray$1.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$1 );\n\n\t\tconst localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 );\n\t\tconst localThresholdSq = localThreshold * localThreshold;\n\n\t\tconst step = this.isLineSegments ? 2 : 1;\n\n\t\tconst index = geometry.index;\n\t\tconst attributes = geometry.attributes;\n\t\tconst positionAttribute = attributes.position;\n\n\t\tif ( index !== null ) {\n\n\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\tconst end = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( let i = start, l = end - 1; i \u003c l; i += step ) {\n\n\t\t\t\tconst a = index.getX( i );\n\t\t\t\tconst b = index.getX( i + 1 );\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray$1, localThresholdSq, a, b, i );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.isLineLoop ) {\n\n\t\t\t\tconst a = index.getX( end - 1 );\n\t\t\t\tconst b = index.getX( start );\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray$1, localThresholdSq, a, b, end - 1 );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\tconst end = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( let i = start, l = end - 1; i \u003c l; i += step ) {\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray$1, localThresholdSq, i, i + 1, i );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.isLineLoop ) {\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray$1, localThresholdSq, end - 1, start, end - 1 );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Sets the values of {@link Line#morphTargetDictionary} and {@link Line#morphTargetInfluences}\n\t * to make sure existing morph targets can influence this 3D object.\n\t */\n\tupdateMorphTargets() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst morphAttributes = geometry.morphAttributes;\n\t\tconst keys = Object.keys( morphAttributes );\n\n\t\tif ( keys.length \u003e 0 ) {\n\n\t\t\tconst morphAttribute = morphAttributes[ keys[ 0 ] ];\n\n\t\t\tif ( morphAttribute !== undefined ) {\n\n\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\tfor ( let m = 0, ml = morphAttribute.length; m \u003c ml; m ++ ) {\n\n\t\t\t\t\tconst name = morphAttribute[ m ].name || String( m );\n\n\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\tthis.morphTargetDictionary[ name ] = m;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nfunction checkIntersection( object, raycaster, ray, thresholdSq, a, b, i ) {\n\n\tconst positionAttribute = object.geometry.attributes.position;\n\n\t_vStart.fromBufferAttribute( positionAttribute, a );\n\t_vEnd.fromBufferAttribute( positionAttribute, b );\n\n\tconst distSq = ray.distanceSqToSegment( _vStart, _vEnd, _intersectPointOnRay, _intersectPointOnSegment );\n\n\tif ( distSq \u003e thresholdSq ) return;\n\n\t_intersectPointOnRay.applyMatrix4( object.matrixWorld ); // Move back to world space for distance calculation\n\n\tconst distance = raycaster.ray.origin.distanceTo( _intersectPointOnRay );\n\n\tif ( distance \u003c raycaster.near || distance \u003e raycaster.far ) return;\n\n\treturn {\n\n\t\tdistance: distance,\n\t\t// What do we want? intersection point on the ray or on the segment??\n\t\t// point: raycaster.ray.at( distance ),\n\t\tpoint: _intersectPointOnSegment.clone().applyMatrix4( object.matrixWorld ),\n\t\tindex: i,\n\t\tface: null,\n\t\tfaceIndex: null,\n\t\tbarycoord: null,\n\t\tobject: object\n\n\t};\n\n}\n\nconst _start = /*@__PURE__*/ new Vector3();\nconst _end = /*@__PURE__*/ new Vector3();\n\n/**\n * A series of lines drawn between pairs of vertices.\n *\n * @augments Line\n */\nclass LineSegments extends Line {\n\n\t/**\n\t * Constructs a new line segments.\n\t *\n\t * @param {BufferGeometry} [geometry] - The line geometry.\n\t * @param {Material|Array\u003cMaterial\u003e} [material] - The line material.\n\t */\n\tconstructor( geometry, material ) {\n\n\t\tsuper( geometry, material );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLineSegments = true;\n\n\t\tthis.type = 'LineSegments';\n\n\t}\n\n\tcomputeLineDistances() {\n\n\t\tconst geometry = this.geometry;\n\n\t\t// we assume non-indexed geometry\n\n\t\tif ( geometry.index === null ) {\n\n\t\t\tconst positionAttribute = geometry.attributes.position;\n\t\t\tconst lineDistances = [];\n\n\t\t\tfor ( let i = 0, l = positionAttribute.count; i \u003c l; i += 2 ) {\n\n\t\t\t\t_start.fromBufferAttribute( positionAttribute, i );\n\t\t\t\t_end.fromBufferAttribute( positionAttribute, i + 1 );\n\n\t\t\t\tlineDistances[ i ] = ( i === 0 ) ? 0 : lineDistances[ i - 1 ];\n\t\t\t\tlineDistances[ i + 1 ] = lineDistances[ i ] + _start.distanceTo( _end );\n\n\t\t\t}\n\n\t\t\tgeometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );\n\n\t\t} else {\n\n\t\t\twarn( 'LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A continuous line. This is nearly the same as {@link Line} the only difference\n * is that the last vertex is connected with the first vertex in order to close\n * the line to form a loop.\n *\n * @augments Line\n */\nclass LineLoop extends Line {\n\n\t/**\n\t * Constructs a new line loop.\n\t *\n\t * @param {BufferGeometry} [geometry] - The line geometry.\n\t * @param {Material|Array\u003cMaterial\u003e} [material] - The line material.\n\t */\n\tconstructor( geometry, material ) {\n\n\t\tsuper( geometry, material );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLineLoop = true;\n\n\t\tthis.type = 'LineLoop';\n\n\t}\n\n}\n\n/**\n * A material for rendering point primitives.\n *\n * Materials define the appearance of renderable 3D objects.\n *\n * ```js\n * const vertices = [];\n *\n * for ( let i = 0; i \u003c 10000; i ++ ) {\n * \tconst x = THREE.MathUtils.randFloatSpread( 2000 );\n * \tconst y = THREE.MathUtils.randFloatSpread( 2000 );\n * \tconst z = THREE.MathUtils.randFloatSpread( 2000 );\n *\n * \tvertices.push( x, y, z );\n * }\n *\n * const geometry = new THREE.BufferGeometry();\n * geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) );\n * const material = new THREE.PointsMaterial( { color: 0x888888 } );\n * const points = new THREE.Points( geometry, material );\n * scene.add( points );\n * ```\n *\n * @augments Material\n */\nclass PointsMaterial extends Material {\n\n\t/**\n\t * Constructs a new points material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isPointsMaterial = true;\n\n\t\tthis.type = 'PointsMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff );\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * Defines the size of the points in pixels.\n\t\t *\n\t\t * Might be capped if the value exceeds hardware dependent parameters like [gl.ALIASED_POINT_SIZE_RANGE](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParamete).\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.size = 1;\n\n\t\t/**\n\t\t * Specifies whether size of individual points is attenuated by the camera depth (perspective camera only).\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.sizeAttenuation = true;\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.size = source.size;\n\t\tthis.sizeAttenuation = source.sizeAttenuation;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _inverseMatrix = /*@__PURE__*/ new Matrix4();\nconst _ray = /*@__PURE__*/ new Ray();\nconst _sphere = /*@__PURE__*/ new Sphere();\nconst _position$2 = /*@__PURE__*/ new Vector3();\n\n/**\n * A class for displaying points or point clouds.\n *\n * @augments Object3D\n */\nclass Points extends Object3D {\n\n\t/**\n\t * Constructs a new point cloud.\n\t *\n\t * @param {BufferGeometry} [geometry] - The points geometry.\n\t * @param {Material|Array\u003cMaterial\u003e} [material] - The points material.\n\t */\n\tconstructor( geometry = new BufferGeometry(), material = new PointsMaterial() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isPoints = true;\n\n\t\tthis.type = 'Points';\n\n\t\t/**\n\t\t * The points geometry.\n\t\t *\n\t\t * @type {BufferGeometry}\n\t\t */\n\t\tthis.geometry = geometry;\n\n\t\t/**\n\t\t * The line material.\n\t\t *\n\t\t * @type {Material|Array\u003cMaterial\u003e}\n\t\t * @default PointsMaterial\n\t\t */\n\t\tthis.material = material;\n\n\t\t/**\n\t\t * A dictionary representing the morph targets in the geometry. The key is the\n\t\t * morph targets name, the value its attribute index. This member is `undefined`\n\t\t * by default and only set when morph targets are detected in the geometry.\n\t\t *\n\t\t * @type {Object\u003cstring,number\u003e|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.morphTargetDictionary = undefined;\n\n\t\t/**\n\t\t * An array of weights typically in the range `[0,1]` that specify how much of the morph\n\t\t * is applied. This member is `undefined` by default and only set when morph targets are\n\t\t * detected in the geometry.\n\t\t *\n\t\t * @type {Array\u003cnumber\u003e|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.morphTargetInfluences = undefined;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.material = Array.isArray( source.material ) ? source.material.slice() : source.material;\n\t\tthis.geometry = source.geometry;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes intersection points between a casted ray and this point cloud.\n\t *\n\t * @param {Raycaster} raycaster - The raycaster.\n\t * @param {Array\u003cObject\u003e} intersects - The target array that holds the intersection points.\n\t */\n\traycast( raycaster, intersects ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst threshold = raycaster.params.Points.threshold;\n\t\tconst drawRange = geometry.drawRange;\n\n\t\t// Checking boundingSphere distance to ray\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere.copy( geometry.boundingSphere );\n\t\t_sphere.applyMatrix4( matrixWorld );\n\t\t_sphere.radius += threshold;\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere ) === false ) return;\n\n\t\t//\n\n\t\t_inverseMatrix.copy( matrixWorld ).invert();\n\t\t_ray.copy( raycaster.ray ).applyMatrix4( _inverseMatrix );\n\n\t\tconst localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 );\n\t\tconst localThresholdSq = localThreshold * localThreshold;\n\n\t\tconst index = geometry.index;\n\t\tconst attributes = geometry.attributes;\n\t\tconst positionAttribute = attributes.position;\n\n\t\tif ( index !== null ) {\n\n\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\tconst end = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( let i = start, il = end; i \u003c il; i ++ ) {\n\n\t\t\t\tconst a = index.getX( i );\n\n\t\t\t\t_position$2.fromBufferAttribute( positionAttribute, a );\n\n\t\t\t\ttestPoint( _position$2, a, localThresholdSq, matrixWorld, raycaster, intersects, this );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\tconst end = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( let i = start, l = end; i \u003c l; i ++ ) {\n\n\t\t\t\t_position$2.fromBufferAttribute( positionAttribute, i );\n\n\t\t\t\ttestPoint( _position$2, i, localThresholdSq, matrixWorld, raycaster, intersects, this );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Sets the values of {@link Points#morphTargetDictionary} and {@link Points#morphTargetInfluences}\n\t * to make sure existing morph targets can influence this 3D object.\n\t */\n\tupdateMorphTargets() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst morphAttributes = geometry.morphAttributes;\n\t\tconst keys = Object.keys( morphAttributes );\n\n\t\tif ( keys.length \u003e 0 ) {\n\n\t\t\tconst morphAttribute = morphAttributes[ keys[ 0 ] ];\n\n\t\t\tif ( morphAttribute !== undefined ) {\n\n\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\tfor ( let m = 0, ml = morphAttribute.length; m \u003c ml; m ++ ) {\n\n\t\t\t\t\tconst name = morphAttribute[ m ].name || String( m );\n\n\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\tthis.morphTargetDictionary[ name ] = m;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nfunction testPoint( point, index, localThresholdSq, matrixWorld, raycaster, intersects, object ) {\n\n\tconst rayPointDistanceSq = _ray.distanceSqToPoint( point );\n\n\tif ( rayPointDistanceSq \u003c localThresholdSq ) {\n\n\t\tconst intersectPoint = new Vector3();\n\n\t\t_ray.closestPointToPoint( point, intersectPoint );\n\t\tintersectPoint.applyMatrix4( matrixWorld );\n\n\t\tconst distance = raycaster.ray.origin.distanceTo( intersectPoint );\n\n\t\tif ( distance \u003c raycaster.near || distance \u003e raycaster.far ) return;\n\n\t\tintersects.push( {\n\n\t\t\tdistance: distance,\n\t\t\tdistanceToRay: Math.sqrt( rayPointDistanceSq ),\n\t\t\tpoint: intersectPoint,\n\t\t\tindex: index,\n\t\t\tface: null,\n\t\t\tfaceIndex: null,\n\t\t\tbarycoord: null,\n\t\t\tobject: object\n\n\t\t} );\n\n\t}\n\n}\n\n/**\n * A texture for use with a video.\n *\n * ```js\n * // assuming you have created a HTML video element with id=\"video\"\n * const video = document.getElementById( 'video' );\n * const texture = new THREE.VideoTexture( video );\n * ```\n *\n * Note: When using video textures with {@link WebGPURenderer}, {@link Texture#colorSpace} must be\n * set to THREE.SRGBColorSpace.\n *\n * Note: After the initial use of a texture, its dimensions, format, and type\n * cannot be changed. Instead, call {@link Texture#dispose} on the texture and instantiate a new one.\n *\n * @augments Texture\n */\nclass VideoTexture extends Texture {\n\n\t/**\n\t * Constructs a new video texture.\n\t *\n\t * @param {HTMLVideoElement} video - The video element to use as a data source for the texture.\n\t * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.\n\t * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n\t * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n\t * @param {number} [magFilter=LinearFilter] - The mag filter value.\n\t * @param {number} [minFilter=LinearFilter] - The min filter value.\n\t * @param {number} [format=RGBAFormat] - The texture format.\n\t * @param {number} [type=UnsignedByteType] - The texture type.\n\t * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n\t */\n\tconstructor( video, mapping, wrapS, wrapT, magFilter = LinearFilter, minFilter = LinearFilter, format, type, anisotropy ) {\n\n\t\tsuper( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isVideoTexture = true;\n\n\t\t/**\n\t\t * Whether to generate mipmaps (if possible) for a texture.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.generateMipmaps = false;\n\n\t\t/**\n\t\t * The video frame request callback identifier, which is a positive integer.\n\t\t *\n\t\t * Value of 0 represents no scheduled rVFC.\n\t\t *\n\t\t * @private\n\t\t * @type {number}\n\t\t */\n\t\tthis._requestVideoFrameCallbackId = 0;\n\n\t\tconst scope = this;\n\n\t\tfunction updateVideo() {\n\n\t\t\tscope.needsUpdate = true;\n\t\t\tscope._requestVideoFrameCallbackId = video.requestVideoFrameCallback( updateVideo );\n\n\t\t}\n\n\t\tif ( 'requestVideoFrameCallback' in video ) {\n\n\t\t\tthis._requestVideoFrameCallbackId = video.requestVideoFrameCallback( updateVideo );\n\n\t\t}\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.image ).copy( this );\n\n\t}\n\n\t/**\n\t * This method is called automatically by the renderer and sets {@link Texture#needsUpdate}\n\t * to `true` every time a new frame is available.\n\t *\n\t * Only relevant if `requestVideoFrameCallback` is not supported in the browser.\n\t */\n\tupdate() {\n\n\t\tconst video = this.image;\n\t\tconst hasVideoFrameCallback = 'requestVideoFrameCallback' in video;\n\n\t\tif ( hasVideoFrameCallback === false \u0026\u0026 video.readyState \u003e= video.HAVE_CURRENT_DATA ) {\n\n\t\t\tthis.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n\tdispose() {\n\n\t\tif ( this._requestVideoFrameCallbackId !== 0 ) {\n\n\t\t\tthis.source.data.cancelVideoFrameCallback( this._requestVideoFrameCallbackId );\n\n\t\t\tthis._requestVideoFrameCallbackId = 0;\n\n\t\t}\n\n\t\tsuper.dispose();\n\n\t}\n\n}\n\n/**\n * This class can be used as an alternative way to define video data. Instead of using\n * an instance of `HTMLVideoElement` like with `VideoTexture`, `VideoFrameTexture` expects each frame is\n * defined manually via {@link VideoFrameTexture#setFrame}. A typical use case for this module is when\n * video frames are decoded with the WebCodecs API.\n *\n * ```js\n * const texture = new THREE.VideoFrameTexture();\n * texture.setFrame( frame );\n * ```\n *\n * @augments VideoTexture\n */\nclass VideoFrameTexture extends VideoTexture {\n\n\t/**\n\t * Constructs a new video frame texture.\n\t *\n\t * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.\n\t * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n\t * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n\t * @param {number} [magFilter=LinearFilter] - The mag filter value.\n\t * @param {number} [minFilter=LinearFilter] - The min filter value.\n\t * @param {number} [format=RGBAFormat] - The texture format.\n\t * @param {number} [type=UnsignedByteType] - The texture type.\n\t * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n\t */\n\tconstructor( mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {\n\n\t\tsuper( {}, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isVideoFrameTexture = true;\n\n\t}\n\n\t/**\n\t * This method overwritten with an empty implementation since\n\t * this type of texture is updated via `setFrame()`.\n\t */\n\tupdate() {}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this ); // restoring Texture.clone()\n\n\t}\n\n\t/**\n\t * Sets the current frame of the video. This will automatically update the texture\n\t * so the data can be used for rendering.\n\t *\n\t * @param {VideoFrame} frame - The video frame.\n\t */\n\tsetFrame( frame ) {\n\n\t\tthis.image = frame;\n\t\tthis.needsUpdate = true;\n\n\t}\n\n}\n\n/**\n * This class can only be used in combination with `copyFramebufferToTexture()` methods\n * of renderers. It extracts the contents of the current bound framebuffer and provides it\n * as a texture for further usage.\n *\n * ```js\n * const pixelRatio = window.devicePixelRatio;\n * const textureSize = 128 * pixelRatio;\n *\n * const frameTexture = new FramebufferTexture( textureSize, textureSize );\n *\n * // calculate start position for copying part of the frame data\n * const vector = new Vector2();\n * vector.x = ( window.innerWidth * pixelRatio / 2 ) - ( textureSize / 2 );\n * vector.y = ( window.innerHeight * pixelRatio / 2 ) - ( textureSize / 2 );\n *\n * renderer.render( scene, camera );\n *\n * // copy part of the rendered frame into the framebuffer texture\n * renderer.copyFramebufferToTexture( frameTexture, vector );\n * ```\n *\n * @augments Texture\n */\nclass FramebufferTexture extends Texture {\n\n\t/**\n\t * Constructs a new framebuffer texture.\n\t *\n\t * @param {number} [width] - The width of the texture.\n\t * @param {number} [height] - The height of the texture.\n\t */\n\tconstructor( width, height ) {\n\n\t\tsuper( { width, height } );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isFramebufferTexture = true;\n\n\t\t/**\n\t\t * How the texture is sampled when a texel covers more than one pixel.\n\t\t *\n\t\t * Overwritten and set to `NearestFilter` by default to disable filtering.\n\t\t *\n\t\t * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)}\n\t\t * @default NearestFilter\n\t\t */\n\t\tthis.magFilter = NearestFilter;\n\n\t\t/**\n\t\t * How the texture is sampled when a texel covers less than one pixel.\n\t\t *\n\t\t * Overwritten and set to `NearestFilter` by default to disable filtering.\n\t\t *\n\t\t * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)}\n\t\t * @default NearestFilter\n\t\t */\n\t\tthis.minFilter = NearestFilter;\n\n\t\t/**\n\t\t * Whether to generate mipmaps (if possible) for a texture.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.generateMipmaps = false;\n\n\t\tthis.needsUpdate = true;\n\n\t}\n\n}\n\n/**\n * Creates a texture based on data in compressed form.\n *\n * These texture are usually loaded with {@link CompressedTextureLoader}.\n *\n * @augments Texture\n */\nclass CompressedTexture extends Texture {\n\n\t/**\n\t * Constructs a new compressed texture.\n\t *\n\t * @param {Array\u003cObject\u003e} mipmaps - This array holds for all mipmaps (including the bases mip)\n\t * the data and dimensions.\n\t * @param {number} width - The width of the texture.\n\t * @param {number} height - The height of the texture.\n\t * @param {number} [format=RGBAFormat] - The texture format.\n\t * @param {number} [type=UnsignedByteType] - The texture type.\n\t * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.\n\t * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n\t * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n\t * @param {number} [magFilter=LinearFilter] - The mag filter value.\n\t * @param {number} [minFilter=LinearMipmapLinearFilter] - The min filter value.\n\t * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n\t * @param {string} [colorSpace=NoColorSpace] - The color space.\n\t */\n\tconstructor( mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, colorSpace ) {\n\n\t\tsuper( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCompressedTexture = true;\n\n\t\t/**\n\t\t * The image property of a compressed texture just defines its dimensions.\n\t\t *\n\t\t * @type {{width:number,height:number}}\n\t\t */\n\t\tthis.image = { width: width, height: height };\n\n\t\t/**\n\t\t * This array holds for all mipmaps (including the bases mip) the data and dimensions.\n\t\t *\n\t\t * @type {Array\u003cObject\u003e}\n\t\t */\n\t\tthis.mipmaps = mipmaps;\n\n\t\t/**\n\t\t * If set to `true`, the texture is flipped along the vertical axis when\n\t\t * uploaded to the GPU.\n\t\t *\n\t\t * Overwritten and set to `false` by default since it is not possible to\n\t\t * flip compressed textures.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t * @readonly\n\t\t */\n\t\tthis.flipY = false;\n\n\t\t/**\n\t\t * Whether to generate mipmaps (if possible) for a texture.\n\t\t *\n\t\t * Overwritten and set to `false` by default since it is not\n\t\t * possible to generate mipmaps for compressed data. Mipmaps\n\t\t * must be embedded in the compressed texture file.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t * @readonly\n\t\t */\n\t\tthis.generateMipmaps = false;\n\n\t}\n\n}\n\n/**\n * Creates a texture 2D array based on data in compressed form.\n *\n * These texture are usually loaded with {@link CompressedTextureLoader}.\n *\n * @augments CompressedTexture\n */\nclass CompressedArrayTexture extends CompressedTexture {\n\n\t/**\n\t * Constructs a new compressed array texture.\n\t *\n\t * @param {Array\u003cObject\u003e} mipmaps - This array holds for all mipmaps (including the bases mip)\n\t * the data and dimensions.\n\t * @param {number} width - The width of the texture.\n\t * @param {number} height - The height of the texture.\n\t * @param {number} depth - The depth of the texture.\n\t * @param {number} [format=RGBAFormat] - The min filter value.\n\t * @param {number} [type=UnsignedByteType] - The min filter value.\n\t */\n\tconstructor( mipmaps, width, height, depth, format, type ) {\n\n\t\tsuper( mipmaps, width, height, format, type );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCompressedArrayTexture = true;\n\n\t\t/**\n\t\t * The image property of a compressed texture just defines its dimensions.\n\t\t *\n\t\t * @name CompressedArrayTexture#image\n\t\t * @type {{width:number,height:number,depth:number}}\n\t\t */\n\t\tthis.image.depth = depth;\n\n\t\t/**\n\t\t * This defines how the texture is wrapped in the depth and corresponds to\n\t\t * *W* in UVW mapping.\n\t\t *\n\t\t * @type {(RepeatWrapping|ClampToEdgeWrapping|MirroredRepeatWrapping)}\n\t\t * @default ClampToEdgeWrapping\n\t\t */\n\t\tthis.wrapR = ClampToEdgeWrapping;\n\n\t\t/**\n\t\t * A set of all layers which need to be updated in the texture.\n\t\t *\n\t\t * @type {Set\u003cnumber\u003e}\n\t\t */\n\t\tthis.layerUpdates = new Set();\n\n\t}\n\n\t/**\n\t * Describes that a specific layer of the texture needs to be updated.\n\t * Normally when {@link Texture#needsUpdate} is set to `true`, the\n\t * entire compressed texture array is sent to the GPU. Marking specific\n\t * layers will only transmit subsets of all mipmaps associated with a\n\t * specific depth in the array which is often much more performant.\n\t *\n\t * @param {number} layerIndex - The layer index that should be updated.\n\t */\n\taddLayerUpdate( layerIndex ) {\n\n\t\tthis.layerUpdates.add( layerIndex );\n\n\t}\n\n\t/**\n\t * Resets the layer updates registry.\n\t */\n\tclearLayerUpdates() {\n\n\t\tthis.layerUpdates.clear();\n\n\t}\n\n}\n\n/**\n * Creates a cube texture based on data in compressed form.\n *\n * These texture are usually loaded with {@link CompressedTextureLoader}.\n *\n * @augments CompressedTexture\n */\nclass CompressedCubeTexture extends CompressedTexture {\n\n\t/**\n\t * Constructs a new compressed texture.\n\t *\n\t * @param {Array\u003cCompressedTexture\u003e} images - An array of compressed textures.\n\t * @param {number} [format=RGBAFormat] - The texture format.\n\t * @param {number} [type=UnsignedByteType] - The texture type.\n\t */\n\tconstructor( images, format, type ) {\n\n\t\tsuper( undefined, images[ 0 ].width, images[ 0 ].height, format, type, CubeReflectionMapping );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCompressedCubeTexture = true;\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCubeTexture = true;\n\n\t\tthis.image = images;\n\n\t}\n\n}\n\n/**\n * Creates a texture from a canvas element.\n *\n * This is almost the same as the base texture class, except that it sets {@link Texture#needsUpdate}\n * to `true` immediately since a canvas can directly be used for rendering.\n *\n * @augments Texture\n */\nclass CanvasTexture extends Texture {\n\n\t/**\n\t * Constructs a new texture.\n\t *\n\t * @param {HTMLCanvasElement} [canvas] - The HTML canvas element.\n\t * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.\n\t * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n\t * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n\t * @param {number} [magFilter=LinearFilter] - The mag filter value.\n\t * @param {number} [minFilter=LinearMipmapLinearFilter] - The min filter value.\n\t * @param {number} [format=RGBAFormat] - The texture format.\n\t * @param {number} [type=UnsignedByteType] - The texture type.\n\t * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n\t */\n\tconstructor( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {\n\n\t\tsuper( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCanvasTexture = true;\n\n\t\tthis.needsUpdate = true;\n\n\t}\n\n}\n\n/**\n * This class can be used to automatically save the depth information of a\n * rendering into a texture.\n *\n * @augments Texture\n */\nclass DepthTexture extends Texture {\n\n\t/**\n\t * Constructs a new depth texture.\n\t *\n\t * @param {number} width - The width of the texture.\n\t * @param {number} height - The height of the texture.\n\t * @param {number} [type=UnsignedIntType] - The texture type.\n\t * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.\n\t * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n\t * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n\t * @param {number} [magFilter=LinearFilter] - The mag filter value.\n\t * @param {number} [minFilter=LinearFilter] - The min filter value.\n\t * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n\t * @param {number} [format=DepthFormat] - The texture format.\n\t * @param {number} [depth=1] - The depth of the texture.\n\t */\n\tconstructor( width, height, type = UnsignedIntType, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, format = DepthFormat, depth = 1 ) {\n\n\t\tif ( format !== DepthFormat \u0026\u0026 format !== DepthStencilFormat ) {\n\n\t\t\tthrow new Error( 'DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat' );\n\n\t\t}\n\n\t\tconst image = { width: width, height: height, depth: depth };\n\n\t\tsuper( image, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isDepthTexture = true;\n\n\t\t/**\n\t\t * If set to `true`, the texture is flipped along the vertical axis when\n\t\t * uploaded to the GPU.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flipY = false;\n\n\t\t/**\n\t\t * Whether to generate mipmaps (if possible) for a texture.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.generateMipmaps = false;\n\n\t\t/**\n\t\t * Code corresponding to the depth compare function.\n\t\t *\n\t\t * @type {?(NeverCompare|LessCompare|EqualCompare|LessEqualCompare|GreaterCompare|NotEqualCompare|GreaterEqualCompare|AlwaysCompare)}\n\t\t * @default null\n\t\t */\n\t\tthis.compareFunction = null;\n\n\t}\n\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.source = new Source( Object.assign( {}, source.image ) ); // see #30540\n\t\tthis.compareFunction = source.compareFunction;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tif ( this.compareFunction !== null ) data.compareFunction = this.compareFunction;\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * This class can be used to automatically save the depth information of a\n * cube rendering into a cube texture with depth format. Used for PointLight shadows.\n *\n * @augments DepthTexture\n */\nclass CubeDepthTexture extends DepthTexture {\n\n\t/**\n\t * Constructs a new cube depth texture.\n\t *\n\t * @param {number} size - The size (width and height) of each cube face.\n\t * @param {number} [type=UnsignedIntType] - The texture type.\n\t * @param {number} [mapping=CubeReflectionMapping] - The texture mapping.\n\t * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n\t * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n\t * @param {number} [magFilter=NearestFilter] - The mag filter value.\n\t * @param {number} [minFilter=NearestFilter] - The min filter value.\n\t * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n\t * @param {number} [format=DepthFormat] - The texture format.\n\t */\n\tconstructor( size, type = UnsignedIntType, mapping = CubeReflectionMapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, format = DepthFormat ) {\n\n\t\t// Create 6 identical image descriptors for the cube faces\n\t\tconst image = { width: size, height: size, depth: 1 };\n\t\tconst images = [ image, image, image, image, image, image ];\n\n\t\t// Call DepthTexture constructor with width, height\n\t\tsuper( size, size, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format );\n\n\t\t// Replace the single image with the array of 6 images\n\t\tthis.image = images;\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCubeDepthTexture = true;\n\n\t\t/**\n\t\t * Set to true for cube texture handling in WebGLTextures.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCubeTexture = true;\n\n\t}\n\n\t/**\n\t * Alias for {@link CubeDepthTexture#image}.\n\t *\n\t * @type {Array\u003cImage\u003e}\n\t */\n\tget images() {\n\n\t\treturn this.image;\n\n\t}\n\n\tset images( value ) {\n\n\t\tthis.image = value;\n\n\t}\n\n}\n\n/**\n * Represents a texture created externally with the same renderer context.\n *\n * This may be a texture from a protected media stream, device camera feed,\n * or other data feeds like a depth sensor.\n *\n * Note that this class is only supported in {@link WebGLRenderer}, and in\n * the {@link WebGPURenderer} WebGPU backend.\n *\n * @augments Texture\n */\nclass ExternalTexture extends Texture {\n\n\t/**\n\t * Creates a new raw texture.\n\t *\n\t * @param {?(WebGLTexture|GPUTexture)} [sourceTexture=null] - The external texture.\n\t */\n\tconstructor( sourceTexture = null ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * The external source texture.\n\t\t *\n\t\t * @type {?(WebGLTexture|GPUTexture)}\n\t\t * @default null\n\t\t */\n\t\tthis.sourceTexture = sourceTexture;\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isExternalTexture = true;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.sourceTexture = source.sourceTexture;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A geometry class for representing a capsule.\n *\n * ```js\n * const geometry = new THREE.CapsuleGeometry( 1, 1, 4, 8, 1 );\n * const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );\n * const capsule = new THREE.Mesh( geometry, material );\n * scene.add( capsule );\n * ```\n *\n * @augments BufferGeometry\n * @demo scenes/geometry-browser.html#CapsuleGeometry\n */\nclass CapsuleGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new capsule geometry.\n\t *\n\t * @param {number} [radius=1] - Radius of the capsule.\n\t * @param {number} [height=1] - Height of the middle section.\n\t * @param {number} [capSegments=4] - Number of curve segments used to build each cap.\n\t * @param {number} [radialSegments=8] - Number of segmented faces around the circumference of the capsule. Must be an integer \u003e= 3.\n\t * @param {number} [heightSegments=1] - Number of rows of faces along the height of the middle section. Must be an integer \u003e= 1.\n\t */\n\tconstructor( radius = 1, height = 1, capSegments = 4, radialSegments = 8, heightSegments = 1 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CapsuleGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\theight: height,\n\t\t\tcapSegments: capSegments,\n\t\t\tradialSegments: radialSegments,\n\t\t\theightSegments: heightSegments,\n\t\t};\n\n\t\theight = Math.max( 0, height );\n\t\tcapSegments = Math.max( 1, Math.floor( capSegments ) );\n\t\tradialSegments = Math.max( 3, Math.floor( radialSegments ) );\n\t\theightSegments = Math.max( 1, Math.floor( heightSegments ) );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tconst halfHeight = height / 2;\n\t\tconst capArcLength = ( Math.PI / 2 ) * radius;\n\t\tconst cylinderPartLength = height;\n\t\tconst totalArcLength = 2 * capArcLength + cylinderPartLength;\n\n\t\tconst numVerticalSegments = capSegments * 2 + heightSegments;\n\t\tconst verticesPerRow = radialSegments + 1;\n\n\t\tconst normal = new Vector3();\n\t\tconst vertex = new Vector3();\n\n\t\t// generate vertices, normals, and uvs\n\n\t\tfor ( let iy = 0; iy \u003c= numVerticalSegments; iy ++ ) {\n\n\t\t\tlet currentArcLength = 0;\n\t\t\tlet profileY = 0;\n\t\t\tlet profileRadius = 0;\n\t\t\tlet normalYComponent = 0;\n\n\t\t\tif ( iy \u003c= capSegments ) {\n\n\t\t\t\t// bottom cap\n\t\t\t\tconst segmentProgress = iy / capSegments;\n\t\t\t\tconst angle = ( segmentProgress * Math.PI ) / 2;\n\t\t\t\tprofileY = - halfHeight - radius * Math.cos( angle );\n\t\t\t\tprofileRadius = radius * Math.sin( angle );\n\t\t\t\tnormalYComponent = - radius * Math.cos( angle );\n\t\t\t\tcurrentArcLength = segmentProgress * capArcLength;\n\n\t\t\t} else if ( iy \u003c= capSegments + heightSegments ) {\n\n\t\t\t\t// middle section\n\t\t\t\tconst segmentProgress = ( iy - capSegments ) / heightSegments;\n\t\t\t\tprofileY = - halfHeight + segmentProgress * height;\n\t\t\t\tprofileRadius = radius;\n\t\t\t\tnormalYComponent = 0;\n\t\t\t\tcurrentArcLength = capArcLength + segmentProgress * cylinderPartLength;\n\n\t\t\t} else {\n\n\t\t\t\t// top cap\n\t\t\t\tconst segmentProgress =\n\t\t\t\t\t( iy - capSegments - heightSegments ) / capSegments;\n\t\t\t\tconst angle = ( segmentProgress * Math.PI ) / 2;\n\t\t\t\tprofileY = halfHeight + radius * Math.sin( angle );\n\t\t\t\tprofileRadius = radius * Math.cos( angle );\n\t\t\t\tnormalYComponent = radius * Math.sin( angle );\n\t\t\t\tcurrentArcLength =\n\t\t\t\t\tcapArcLength + cylinderPartLength + segmentProgress * capArcLength;\n\n\t\t\t}\n\n\t\t\tconst v = Math.max( 0, Math.min( 1, currentArcLength / totalArcLength ) );\n\n\n\t\t\t// special case for the poles\n\n\t\t\tlet uOffset = 0;\n\n\t\t\tif ( iy === 0 ) {\n\n\t\t\t\tuOffset = 0.5 / radialSegments;\n\n\t\t\t} else if ( iy === numVerticalSegments ) {\n\n\t\t\t\tuOffset = -0.5 / radialSegments;\n\n\t\t\t}\n\n\t\t\tfor ( let ix = 0; ix \u003c= radialSegments; ix ++ ) {\n\n\t\t\t\tconst u = ix / radialSegments;\n\t\t\t\tconst theta = u * Math.PI * 2;\n\n\t\t\t\tconst sinTheta = Math.sin( theta );\n\t\t\t\tconst cosTheta = Math.cos( theta );\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = - profileRadius * cosTheta;\n\t\t\t\tvertex.y = profileY;\n\t\t\t\tvertex.z = profileRadius * sinTheta;\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormal.set(\n\t\t\t\t\t- profileRadius * cosTheta,\n\t\t\t\t\tnormalYComponent,\n\t\t\t\t\tprofileRadius * sinTheta\n\t\t\t\t);\n\t\t\t\tnormal.normalize();\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( u + uOffset, v );\n\n\t\t\t}\n\n\t\t\tif ( iy \u003e 0 ) {\n\n\t\t\t\tconst prevIndexRow = ( iy - 1 ) * verticesPerRow;\n\t\t\t\tfor ( let ix = 0; ix \u003c radialSegments; ix ++ ) {\n\n\t\t\t\t\tconst i1 = prevIndexRow + ix;\n\t\t\t\t\tconst i2 = prevIndexRow + ix + 1;\n\t\t\t\t\tconst i3 = iy * verticesPerRow + ix;\n\t\t\t\t\tconst i4 = iy * verticesPerRow + ix + 1;\n\n\t\t\t\t\tindices.push( i1, i2, i3 );\n\t\t\t\t\tindices.push( i2, i4, i3 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {CapsuleGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new CapsuleGeometry( data.radius, data.height, data.capSegments, data.radialSegments, data.heightSegments );\n\n\t}\n\n}\n\n/**\n * A simple shape of Euclidean geometry. It is constructed from a\n * number of triangular segments that are oriented around a central point and\n * extend as far out as a given radius. It is built counter-clockwise from a\n * start angle and a given central angle. It can also be used to create\n * regular polygons, where the number of segments determines the number of\n * sides.\n *\n * ```js\n * const geometry = new THREE.CircleGeometry( 5, 32 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const circle = new THREE.Mesh( geometry, material );\n * scene.add( circle )\n * ```\n *\n * @augments BufferGeometry\n * @demo scenes/geometry-browser.html#CircleGeometry\n */\nclass CircleGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new circle geometry.\n\t *\n\t * @param {number} [radius=1] - Radius of the circle.\n\t * @param {number} [segments=32] - Number of segments (triangles), minimum = `3`.\n\t * @param {number} [thetaStart=0] - Start angle for first segment in radians.\n\t * @param {number} [thetaLength=Math.PI*2] - The central angle, often called theta,\n\t * of the circular sector in radians. The default value results in a complete circle.\n\t */\n\tconstructor( radius = 1, segments = 32, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CircleGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tsegments: segments,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tsegments = Math.max( 3, segments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tconst vertex = new Vector3();\n\t\tconst uv = new Vector2();\n\n\t\t// center point\n\n\t\tvertices.push( 0, 0, 0 );\n\t\tnormals.push( 0, 0, 1 );\n\t\tuvs.push( 0.5, 0.5 );\n\n\t\tfor ( let s = 0, i = 3; s \u003c= segments; s ++, i += 3 ) {\n\n\t\t\tconst segment = thetaStart + s / segments * thetaLength;\n\n\t\t\t// vertex\n\n\t\t\tvertex.x = radius * Math.cos( segment );\n\t\t\tvertex.y = radius * Math.sin( segment );\n\n\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t// normal\n\n\t\t\tnormals.push( 0, 0, 1 );\n\n\t\t\t// uvs\n\n\t\t\tuv.x = ( vertices[ i ] / radius + 1 ) / 2;\n\t\t\tuv.y = ( vertices[ i + 1 ] / radius + 1 ) / 2;\n\n\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let i = 1; i \u003c= segments; i ++ ) {\n\n\t\t\tindices.push( i, i + 1, 0 );\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {CircleGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new CircleGeometry( data.radius, data.segments, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\n/**\n * A geometry class for representing a cylinder.\n *\n * ```js\n * const geometry = new THREE.CylinderGeometry( 5, 5, 20, 32 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const cylinder = new THREE.Mesh( geometry, material );\n * scene.add( cylinder );\n * ```\n *\n * @augments BufferGeometry\n * @demo scenes/geometry-browser.html#CylinderGeometry\n */\nclass CylinderGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new cylinder geometry.\n\t *\n\t * @param {number} [radiusTop=1] - Radius of the cylinder at the top.\n\t * @param {number} [radiusBottom=1] - Radius of the cylinder at the bottom.\n\t * @param {number} [height=1] - Height of the cylinder.\n\t * @param {number} [radialSegments=32] - Number of segmented faces around the circumference of the cylinder.\n\t * @param {number} [heightSegments=1] - Number of rows of faces along the height of the cylinder.\n\t * @param {boolean} [openEnded=false] - Whether the base of the cylinder is open or capped.\n\t * @param {number} [thetaStart=0] - Start angle for first segment, in radians.\n\t * @param {number} [thetaLength=Math.PI*2] - The central angle, often called theta, of the circular sector, in radians.\n\t * The default value results in a complete cylinder.\n\t */\n\tconstructor( radiusTop = 1, radiusBottom = 1, height = 1, radialSegments = 32, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CylinderGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradiusTop: radiusTop,\n\t\t\tradiusBottom: radiusBottom,\n\t\t\theight: height,\n\t\t\tradialSegments: radialSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\topenEnded: openEnded,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tconst scope = this;\n\n\t\tradialSegments = Math.floor( radialSegments );\n\t\theightSegments = Math.floor( heightSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tlet index = 0;\n\t\tconst indexArray = [];\n\t\tconst halfHeight = height / 2;\n\t\tlet groupStart = 0;\n\n\t\t// generate geometry\n\n\t\tgenerateTorso();\n\n\t\tif ( openEnded === false ) {\n\n\t\t\tif ( radiusTop \u003e 0 ) generateCap( true );\n\t\t\tif ( radiusBottom \u003e 0 ) generateCap( false );\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\tfunction generateTorso() {\n\n\t\t\tconst normal = new Vector3();\n\t\t\tconst vertex = new Vector3();\n\n\t\t\tlet groupCount = 0;\n\n\t\t\t// this will be used to calculate the normal\n\t\t\tconst slope = ( radiusBottom - radiusTop ) / height;\n\n\t\t\t// generate vertices, normals and uvs\n\n\t\t\tfor ( let y = 0; y \u003c= heightSegments; y ++ ) {\n\n\t\t\t\tconst indexRow = [];\n\n\t\t\t\tconst v = y / heightSegments;\n\n\t\t\t\t// calculate the radius of the current row\n\n\t\t\t\tconst radius = v * ( radiusBottom - radiusTop ) + radiusTop;\n\n\t\t\t\tfor ( let x = 0; x \u003c= radialSegments; x ++ ) {\n\n\t\t\t\t\tconst u = x / radialSegments;\n\n\t\t\t\t\tconst theta = u * thetaLength + thetaStart;\n\n\t\t\t\t\tconst sinTheta = Math.sin( theta );\n\t\t\t\t\tconst cosTheta = Math.cos( theta );\n\n\t\t\t\t\t// vertex\n\n\t\t\t\t\tvertex.x = radius * sinTheta;\n\t\t\t\t\tvertex.y = - v * height + halfHeight;\n\t\t\t\t\tvertex.z = radius * cosTheta;\n\t\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t\t// normal\n\n\t\t\t\t\tnormal.set( sinTheta, slope, cosTheta ).normalize();\n\t\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t\t// uv\n\n\t\t\t\t\tuvs.push( u, 1 - v );\n\n\t\t\t\t\t// save index of vertex in respective row\n\n\t\t\t\t\tindexRow.push( index ++ );\n\n\t\t\t\t}\n\n\t\t\t\t// now save vertices of the row in our index array\n\n\t\t\t\tindexArray.push( indexRow );\n\n\t\t\t}\n\n\t\t\t// generate indices\n\n\t\t\tfor ( let x = 0; x \u003c radialSegments; x ++ ) {\n\n\t\t\t\tfor ( let y = 0; y \u003c heightSegments; y ++ ) {\n\n\t\t\t\t\t// we use the index array to access the correct indices\n\n\t\t\t\t\tconst a = indexArray[ y ][ x ];\n\t\t\t\t\tconst b = indexArray[ y + 1 ][ x ];\n\t\t\t\t\tconst c = indexArray[ y + 1 ][ x + 1 ];\n\t\t\t\t\tconst d = indexArray[ y ][ x + 1 ];\n\n\t\t\t\t\t// faces\n\n\t\t\t\t\tif ( radiusTop \u003e 0 || y !== 0 ) {\n\n\t\t\t\t\t\tindices.push( a, b, d );\n\t\t\t\t\t\tgroupCount += 3;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( radiusBottom \u003e 0 || y !== heightSegments - 1 ) {\n\n\t\t\t\t\t\tindices.push( b, c, d );\n\t\t\t\t\t\tgroupCount += 3;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// add a group to the geometry. this will ensure multi material support\n\n\t\t\tscope.addGroup( groupStart, groupCount, 0 );\n\n\t\t\t// calculate new start value for groups\n\n\t\t\tgroupStart += groupCount;\n\n\t\t}\n\n\t\tfunction generateCap( top ) {\n\n\t\t\t// save the index of the first center vertex\n\t\t\tconst centerIndexStart = index;\n\n\t\t\tconst uv = new Vector2();\n\t\t\tconst vertex = new Vector3();\n\n\t\t\tlet groupCount = 0;\n\n\t\t\tconst radius = ( top === true ) ? radiusTop : radiusBottom;\n\t\t\tconst sign = ( top === true ) ? 1 : -1;\n\n\t\t\t// first we generate the center vertex data of the cap.\n\t\t\t// because the geometry needs one set of uvs per face,\n\t\t\t// we must generate a center vertex per face/segment\n\n\t\t\tfor ( let x = 1; x \u003c= radialSegments; x ++ ) {\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertices.push( 0, halfHeight * sign, 0 );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormals.push( 0, sign, 0 );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( 0.5, 0.5 );\n\n\t\t\t\t// increase index\n\n\t\t\t\tindex ++;\n\n\t\t\t}\n\n\t\t\t// save the index of the last center vertex\n\t\t\tconst centerIndexEnd = index;\n\n\t\t\t// now we generate the surrounding vertices, normals and uvs\n\n\t\t\tfor ( let x = 0; x \u003c= radialSegments; x ++ ) {\n\n\t\t\t\tconst u = x / radialSegments;\n\t\t\t\tconst theta = u * thetaLength + thetaStart;\n\n\t\t\t\tconst cosTheta = Math.cos( theta );\n\t\t\t\tconst sinTheta = Math.sin( theta );\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = radius * sinTheta;\n\t\t\t\tvertex.y = halfHeight * sign;\n\t\t\t\tvertex.z = radius * cosTheta;\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormals.push( 0, sign, 0 );\n\n\t\t\t\t// uv\n\n\t\t\t\tuv.x = ( cosTheta * 0.5 ) + 0.5;\n\t\t\t\tuv.y = ( sinTheta * 0.5 * sign ) + 0.5;\n\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t\t// increase index\n\n\t\t\t\tindex ++;\n\n\t\t\t}\n\n\t\t\t// generate indices\n\n\t\t\tfor ( let x = 0; x \u003c radialSegments; x ++ ) {\n\n\t\t\t\tconst c = centerIndexStart + x;\n\t\t\t\tconst i = centerIndexEnd + x;\n\n\t\t\t\tif ( top === true ) {\n\n\t\t\t\t\t// face top\n\n\t\t\t\t\tindices.push( i, i + 1, c );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// face bottom\n\n\t\t\t\t\tindices.push( i + 1, i, c );\n\n\t\t\t\t}\n\n\t\t\t\tgroupCount += 3;\n\n\t\t\t}\n\n\t\t\t// add a group to the geometry. this will ensure multi material support\n\n\t\t\tscope.addGroup( groupStart, groupCount, top === true ? 1 : 2 );\n\n\t\t\t// calculate new start value for groups\n\n\t\t\tgroupStart += groupCount;\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {CylinderGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new CylinderGeometry( data.radiusTop, data.radiusBottom, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\n/**\n * A geometry class for representing a cone.\n *\n * ```js\n * const geometry = new THREE.ConeGeometry( 5, 20, 32 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const cone = new THREE.Mesh(geometry, material );\n * scene.add( cone );\n * ```\n *\n * @augments CylinderGeometry\n * @demo scenes/geometry-browser.html#ConeGeometry\n */\nclass ConeGeometry extends CylinderGeometry {\n\n\t/**\n\t * Constructs a new cone geometry.\n\t *\n\t * @param {number} [radius=1] - Radius of the cone base.\n\t * @param {number} [height=1] - Height of the cone.\n\t * @param {number} [radialSegments=32] - Number of segmented faces around the circumference of the cone.\n\t * @param {number} [heightSegments=1] - Number of rows of faces along the height of the cone.\n\t * @param {boolean} [openEnded=false] - Whether the base of the cone is open or capped.\n\t * @param {number} [thetaStart=0] - Start angle for first segment, in radians.\n\t * @param {number} [thetaLength=Math.PI*2] - The central angle, often called theta, of the circular sector, in radians.\n\t * The default value results in a complete cone.\n\t */\n\tconstructor( radius = 1, height = 1, radialSegments = 32, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper( 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength );\n\n\t\tthis.type = 'ConeGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\theight: height,\n\t\t\tradialSegments: radialSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\topenEnded: openEnded,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {ConeGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new ConeGeometry( data.radius, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\n/**\n * A polyhedron is a solid in three dimensions with flat faces. This class\n * will take an array of vertices, project them onto a sphere, and then\n * divide them up to the desired level of detail.\n *\n * @augments BufferGeometry\n */\nclass PolyhedronGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new polyhedron geometry.\n\t *\n\t * @param {Array\u003cnumber\u003e} [vertices] - A flat array of vertices describing the base shape.\n\t * @param {Array\u003cnumber\u003e} [indices] - A flat array of indices describing the base shape.\n\t * @param {number} [radius=1] - The radius of the shape.\n\t * @param {number} [detail=0] - How many levels to subdivide the geometry. The more detail, the smoother the shape.\n\t */\n\tconstructor( vertices = [], indices = [], radius = 1, detail = 0 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'PolyhedronGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tvertices: vertices,\n\t\t\tindices: indices,\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t\t// default buffer data\n\n\t\tconst vertexBuffer = [];\n\t\tconst uvBuffer = [];\n\n\t\t// the subdivision creates the vertex buffer data\n\n\t\tsubdivide( detail );\n\n\t\t// all vertices should lie on a conceptual sphere with a given radius\n\n\t\tapplyRadius( radius );\n\n\t\t// finally, create the uv data\n\n\t\tgenerateUVs();\n\n\t\t// build non-indexed geometry\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertexBuffer, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( vertexBuffer.slice(), 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvBuffer, 2 ) );\n\n\t\tif ( detail === 0 ) {\n\n\t\t\tthis.computeVertexNormals(); // flat normals\n\n\t\t} else {\n\n\t\t\tthis.normalizeNormals(); // smooth normals\n\n\t\t}\n\n\t\t// helper functions\n\n\t\tfunction subdivide( detail ) {\n\n\t\t\tconst a = new Vector3();\n\t\t\tconst b = new Vector3();\n\t\t\tconst c = new Vector3();\n\n\t\t\t// iterate over all faces and apply a subdivision with the given detail value\n\n\t\t\tfor ( let i = 0; i \u003c indices.length; i += 3 ) {\n\n\t\t\t\t// get the vertices of the face\n\n\t\t\t\tgetVertexByIndex( indices[ i + 0 ], a );\n\t\t\t\tgetVertexByIndex( indices[ i + 1 ], b );\n\t\t\t\tgetVertexByIndex( indices[ i + 2 ], c );\n\n\t\t\t\t// perform subdivision\n\n\t\t\t\tsubdivideFace( a, b, c, detail );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction subdivideFace( a, b, c, detail ) {\n\n\t\t\tconst cols = detail + 1;\n\n\t\t\t// we use this multidimensional array as a data structure for creating the subdivision\n\n\t\t\tconst v = [];\n\n\t\t\t// construct all of the vertices for this subdivision\n\n\t\t\tfor ( let i = 0; i \u003c= cols; i ++ ) {\n\n\t\t\t\tv[ i ] = [];\n\n\t\t\t\tconst aj = a.clone().lerp( c, i / cols );\n\t\t\t\tconst bj = b.clone().lerp( c, i / cols );\n\n\t\t\t\tconst rows = cols - i;\n\n\t\t\t\tfor ( let j = 0; j \u003c= rows; j ++ ) {\n\n\t\t\t\t\tif ( j === 0 \u0026\u0026 i === cols ) {\n\n\t\t\t\t\t\tv[ i ][ j ] = aj;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tv[ i ][ j ] = aj.clone().lerp( bj, j / rows );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// construct all of the faces\n\n\t\t\tfor ( let i = 0; i \u003c cols; i ++ ) {\n\n\t\t\t\tfor ( let j = 0; j \u003c 2 * ( cols - i ) - 1; j ++ ) {\n\n\t\t\t\t\tconst k = Math.floor( j / 2 );\n\n\t\t\t\t\tif ( j % 2 === 0 ) {\n\n\t\t\t\t\t\tpushVertex( v[ i ][ k + 1 ] );\n\t\t\t\t\t\tpushVertex( v[ i + 1 ][ k ] );\n\t\t\t\t\t\tpushVertex( v[ i ][ k ] );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tpushVertex( v[ i ][ k + 1 ] );\n\t\t\t\t\t\tpushVertex( v[ i + 1 ][ k + 1 ] );\n\t\t\t\t\t\tpushVertex( v[ i + 1 ][ k ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction applyRadius( radius ) {\n\n\t\t\tconst vertex = new Vector3();\n\n\t\t\t// iterate over the entire buffer and apply the radius to each vertex\n\n\t\t\tfor ( let i = 0; i \u003c vertexBuffer.length; i += 3 ) {\n\n\t\t\t\tvertex.x = vertexBuffer[ i + 0 ];\n\t\t\t\tvertex.y = vertexBuffer[ i + 1 ];\n\t\t\t\tvertex.z = vertexBuffer[ i + 2 ];\n\n\t\t\t\tvertex.normalize().multiplyScalar( radius );\n\n\t\t\t\tvertexBuffer[ i + 0 ] = vertex.x;\n\t\t\t\tvertexBuffer[ i + 1 ] = vertex.y;\n\t\t\t\tvertexBuffer[ i + 2 ] = vertex.z;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction generateUVs() {\n\n\t\t\tconst vertex = new Vector3();\n\n\t\t\tfor ( let i = 0; i \u003c vertexBuffer.length; i += 3 ) {\n\n\t\t\t\tvertex.x = vertexBuffer[ i + 0 ];\n\t\t\t\tvertex.y = vertexBuffer[ i + 1 ];\n\t\t\t\tvertex.z = vertexBuffer[ i + 2 ];\n\n\t\t\t\tconst u = azimuth( vertex ) / 2 / Math.PI + 0.5;\n\t\t\t\tconst v = inclination( vertex ) / Math.PI + 0.5;\n\t\t\t\tuvBuffer.push( u, 1 - v );\n\n\t\t\t}\n\n\t\t\tcorrectUVs();\n\n\t\t\tcorrectSeam();\n\n\t\t}\n\n\t\tfunction correctSeam() {\n\n\t\t\t// handle case when face straddles the seam, see #3269\n\n\t\t\tfor ( let i = 0; i \u003c uvBuffer.length; i += 6 ) {\n\n\t\t\t\t// uv data of a single face\n\n\t\t\t\tconst x0 = uvBuffer[ i + 0 ];\n\t\t\t\tconst x1 = uvBuffer[ i + 2 ];\n\t\t\t\tconst x2 = uvBuffer[ i + 4 ];\n\n\t\t\t\tconst max = Math.max( x0, x1, x2 );\n\t\t\t\tconst min = Math.min( x0, x1, x2 );\n\n\t\t\t\t// 0.9 is somewhat arbitrary\n\n\t\t\t\tif ( max \u003e 0.9 \u0026\u0026 min \u003c 0.1 ) {\n\n\t\t\t\t\tif ( x0 \u003c 0.2 ) uvBuffer[ i + 0 ] += 1;\n\t\t\t\t\tif ( x1 \u003c 0.2 ) uvBuffer[ i + 2 ] += 1;\n\t\t\t\t\tif ( x2 \u003c 0.2 ) uvBuffer[ i + 4 ] += 1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction pushVertex( vertex ) {\n\n\t\t\tvertexBuffer.push( vertex.x, vertex.y, vertex.z );\n\n\t\t}\n\n\t\tfunction getVertexByIndex( index, vertex ) {\n\n\t\t\tconst stride = index * 3;\n\n\t\t\tvertex.x = vertices[ stride + 0 ];\n\t\t\tvertex.y = vertices[ stride + 1 ];\n\t\t\tvertex.z = vertices[ stride + 2 ];\n\n\t\t}\n\n\t\tfunction correctUVs() {\n\n\t\t\tconst a = new Vector3();\n\t\t\tconst b = new Vector3();\n\t\t\tconst c = new Vector3();\n\n\t\t\tconst centroid = new Vector3();\n\n\t\t\tconst uvA = new Vector2();\n\t\t\tconst uvB = new Vector2();\n\t\t\tconst uvC = new Vector2();\n\n\t\t\tfor ( let i = 0, j = 0; i \u003c vertexBuffer.length; i += 9, j += 6 ) {\n\n\t\t\t\ta.set( vertexBuffer[ i + 0 ], vertexBuffer[ i + 1 ], vertexBuffer[ i + 2 ] );\n\t\t\t\tb.set( vertexBuffer[ i + 3 ], vertexBuffer[ i + 4 ], vertexBuffer[ i + 5 ] );\n\t\t\t\tc.set( vertexBuffer[ i + 6 ], vertexBuffer[ i + 7 ], vertexBuffer[ i + 8 ] );\n\n\t\t\t\tuvA.set( uvBuffer[ j + 0 ], uvBuffer[ j + 1 ] );\n\t\t\t\tuvB.set( uvBuffer[ j + 2 ], uvBuffer[ j + 3 ] );\n\t\t\t\tuvC.set( uvBuffer[ j + 4 ], uvBuffer[ j + 5 ] );\n\n\t\t\t\tcentroid.copy( a ).add( b ).add( c ).divideScalar( 3 );\n\n\t\t\t\tconst azi = azimuth( centroid );\n\n\t\t\t\tcorrectUV( uvA, j + 0, a, azi );\n\t\t\t\tcorrectUV( uvB, j + 2, b, azi );\n\t\t\t\tcorrectUV( uvC, j + 4, c, azi );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction correctUV( uv, stride, vector, azimuth ) {\n\n\t\t\tif ( ( azimuth \u003c 0 ) \u0026\u0026 ( uv.x === 1 ) ) {\n\n\t\t\t\tuvBuffer[ stride ] = uv.x - 1;\n\n\t\t\t}\n\n\t\t\tif ( ( vector.x === 0 ) \u0026\u0026 ( vector.z === 0 ) ) {\n\n\t\t\t\tuvBuffer[ stride ] = azimuth / 2 / Math.PI + 0.5;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Angle around the Y axis, counter-clockwise when looking from above.\n\n\t\tfunction azimuth( vector ) {\n\n\t\t\treturn Math.atan2( vector.z, - vector.x );\n\n\t\t}\n\n\n\t\t// Angle above the XZ plane.\n\n\t\tfunction inclination( vector ) {\n\n\t\t\treturn Math.atan2( - vector.y, Math.sqrt( ( vector.x * vector.x ) + ( vector.z * vector.z ) ) );\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {PolyhedronGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new PolyhedronGeometry( data.vertices, data.indices, data.radius, data.detail );\n\n\t}\n\n}\n\n/**\n * A geometry class for representing a dodecahedron.\n *\n * ```js\n * const geometry = new THREE.DodecahedronGeometry();\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const dodecahedron = new THREE.Mesh( geometry, material );\n * scene.add( dodecahedron );\n * ```\n *\n * @augments PolyhedronGeometry\n * @demo scenes/geometry-browser.html#DodecahedronGeometry\n */\nclass DodecahedronGeometry extends PolyhedronGeometry {\n\n\t/**\n\t * Constructs a new dodecahedron geometry.\n\t *\n\t * @param {number} [radius=1] - Radius of the dodecahedron.\n\t * @param {number} [detail=0] - Setting this to a value greater than `0` adds vertices making it no longer a dodecahedron.\n\t */\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst t = ( 1 + Math.sqrt( 5 ) ) / 2;\n\t\tconst r = 1 / t;\n\n\t\tconst vertices = [\n\n\t\t\t// (±1, ±1, ±1)\n\t\t\t-1, -1, -1,\t-1, -1, 1,\n\t\t\t-1, 1, -1, -1, 1, 1,\n\t\t\t1, -1, -1, 1, -1, 1,\n\t\t\t1, 1, -1, 1, 1, 1,\n\n\t\t\t// (0, ±1/φ, ±φ)\n\t\t\t0, - r, - t, 0, - r, t,\n\t\t\t0, r, - t, 0, r, t,\n\n\t\t\t// (±1/φ, ±φ, 0)\n\t\t\t- r, - t, 0, - r, t, 0,\n\t\t\tr, - t, 0, r, t, 0,\n\n\t\t\t// (±φ, 0, ±1/φ)\n\t\t\t- t, 0, - r, t, 0, - r,\n\t\t\t- t, 0, r, t, 0, r\n\t\t];\n\n\t\tconst indices = [\n\t\t\t3, 11, 7, \t3, 7, 15, \t3, 15, 13,\n\t\t\t7, 19, 17, \t7, 17, 6, \t7, 6, 15,\n\t\t\t17, 4, 8, \t17, 8, 10, \t17, 10, 6,\n\t\t\t8, 0, 16, \t8, 16, 2, \t8, 2, 10,\n\t\t\t0, 12, 1, \t0, 1, 18, \t0, 18, 16,\n\t\t\t6, 10, 2, \t6, 2, 13, \t6, 13, 15,\n\t\t\t2, 16, 18, \t2, 18, 3, \t2, 3, 13,\n\t\t\t18, 1, 9, \t18, 9, 11, \t18, 11, 3,\n\t\t\t4, 14, 12, \t4, 12, 0, \t4, 0, 8,\n\t\t\t11, 9, 5, \t11, 5, 19, \t11, 19, 7,\n\t\t\t19, 5, 14, \t19, 14, 4, \t19, 4, 17,\n\t\t\t1, 12, 14, \t1, 14, 5, \t1, 5, 9\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'DodecahedronGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {DodecahedronGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new DodecahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\nconst _v0 = /*@__PURE__*/ new Vector3();\nconst _v1$1 = /*@__PURE__*/ new Vector3();\nconst _normal = /*@__PURE__*/ new Vector3();\nconst _triangle = /*@__PURE__*/ new Triangle();\n\n/**\n * Can be used as a helper object to view the edges of a geometry.\n *\n * ```js\n * const geometry = new THREE.BoxGeometry();\n * const edges = new THREE.EdgesGeometry( geometry );\n * const line = new THREE.LineSegments( edges );\n * scene.add( line );\n * ```\n *\n * Note: It is not yet possible to serialize/deserialize instances of this class.\n *\n * @augments BufferGeometry\n */\nclass EdgesGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new edges geometry.\n\t *\n\t * @param {?BufferGeometry} [geometry=null] - The geometry.\n\t * @param {number} [thresholdAngle=1] - An edge is only rendered if the angle (in degrees)\n\t * between the face normals of the adjoining faces exceeds this value.\n\t */\n\tconstructor( geometry = null, thresholdAngle = 1 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'EdgesGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tgeometry: geometry,\n\t\t\tthresholdAngle: thresholdAngle\n\t\t};\n\n\t\tif ( geometry !== null ) {\n\n\t\t\tconst precisionPoints = 4;\n\t\t\tconst precision = Math.pow( 10, precisionPoints );\n\t\t\tconst thresholdDot = Math.cos( DEG2RAD * thresholdAngle );\n\n\t\t\tconst indexAttr = geometry.getIndex();\n\t\t\tconst positionAttr = geometry.getAttribute( 'position' );\n\t\t\tconst indexCount = indexAttr ? indexAttr.count : positionAttr.count;\n\n\t\t\tconst indexArr = [ 0, 0, 0 ];\n\t\t\tconst vertKeys = [ 'a', 'b', 'c' ];\n\t\t\tconst hashes = new Array( 3 );\n\n\t\t\tconst edgeData = {};\n\t\t\tconst vertices = [];\n\t\t\tfor ( let i = 0; i \u003c indexCount; i += 3 ) {\n\n\t\t\t\tif ( indexAttr ) {\n\n\t\t\t\t\tindexArr[ 0 ] = indexAttr.getX( i );\n\t\t\t\t\tindexArr[ 1 ] = indexAttr.getX( i + 1 );\n\t\t\t\t\tindexArr[ 2 ] = indexAttr.getX( i + 2 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tindexArr[ 0 ] = i;\n\t\t\t\t\tindexArr[ 1 ] = i + 1;\n\t\t\t\t\tindexArr[ 2 ] = i + 2;\n\n\t\t\t\t}\n\n\t\t\t\tconst { a, b, c } = _triangle;\n\t\t\t\ta.fromBufferAttribute( positionAttr, indexArr[ 0 ] );\n\t\t\t\tb.fromBufferAttribute( positionAttr, indexArr[ 1 ] );\n\t\t\t\tc.fromBufferAttribute( positionAttr, indexArr[ 2 ] );\n\t\t\t\t_triangle.getNormal( _normal );\n\n\t\t\t\t// create hashes for the edge from the vertices\n\t\t\t\thashes[ 0 ] = `${ Math.round( a.x * precision ) },${ Math.round( a.y * precision ) },${ Math.round( a.z * precision ) }`;\n\t\t\t\thashes[ 1 ] = `${ Math.round( b.x * precision ) },${ Math.round( b.y * precision ) },${ Math.round( b.z * precision ) }`;\n\t\t\t\thashes[ 2 ] = `${ Math.round( c.x * precision ) },${ Math.round( c.y * precision ) },${ Math.round( c.z * precision ) }`;\n\n\t\t\t\t// skip degenerate triangles\n\t\t\t\tif ( hashes[ 0 ] === hashes[ 1 ] || hashes[ 1 ] === hashes[ 2 ] || hashes[ 2 ] === hashes[ 0 ] ) {\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\t// iterate over every edge\n\t\t\t\tfor ( let j = 0; j \u003c 3; j ++ ) {\n\n\t\t\t\t\t// get the first and next vertex making up the edge\n\t\t\t\t\tconst jNext = ( j + 1 ) % 3;\n\t\t\t\t\tconst vecHash0 = hashes[ j ];\n\t\t\t\t\tconst vecHash1 = hashes[ jNext ];\n\t\t\t\t\tconst v0 = _triangle[ vertKeys[ j ] ];\n\t\t\t\t\tconst v1 = _triangle[ vertKeys[ jNext ] ];\n\n\t\t\t\t\tconst hash = `${ vecHash0 }_${ vecHash1 }`;\n\t\t\t\t\tconst reverseHash = `${ vecHash1 }_${ vecHash0 }`;\n\n\t\t\t\t\tif ( reverseHash in edgeData \u0026\u0026 edgeData[ reverseHash ] ) {\n\n\t\t\t\t\t\t// if we found a sibling edge add it into the vertex array if\n\t\t\t\t\t\t// it meets the angle threshold and delete the edge from the map.\n\t\t\t\t\t\tif ( _normal.dot( edgeData[ reverseHash ].normal ) \u003c= thresholdDot ) {\n\n\t\t\t\t\t\t\tvertices.push( v0.x, v0.y, v0.z );\n\t\t\t\t\t\t\tvertices.push( v1.x, v1.y, v1.z );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tedgeData[ reverseHash ] = null;\n\n\t\t\t\t\t} else if ( ! ( hash in edgeData ) ) {\n\n\t\t\t\t\t\t// if we've already got an edge here then skip adding a new one\n\t\t\t\t\t\tedgeData[ hash ] = {\n\n\t\t\t\t\t\t\tindex0: indexArr[ j ],\n\t\t\t\t\t\t\tindex1: indexArr[ jNext ],\n\t\t\t\t\t\t\tnormal: _normal.clone(),\n\n\t\t\t\t\t\t};\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// iterate over all remaining, unmatched edges and add them to the vertex array\n\t\t\tfor ( const key in edgeData ) {\n\n\t\t\t\tif ( edgeData[ key ] ) {\n\n\t\t\t\t\tconst { index0, index1 } = edgeData[ key ];\n\t\t\t\t\t_v0.fromBufferAttribute( positionAttr, index0 );\n\t\t\t\t\t_v1$1.fromBufferAttribute( positionAttr, index1 );\n\n\t\t\t\t\tvertices.push( _v0.x, _v0.y, _v0.z );\n\t\t\t\t\tvertices.push( _v1$1.x, _v1$1.y, _v1$1.z );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * An abstract base class for creating an analytic curve object that contains methods\n * for interpolation.\n *\n * @abstract\n */\nclass Curve {\n\n\t/**\n\t * Constructs a new curve.\n\t */\n\tconstructor() {\n\n\t\t/**\n\t\t * The type property is used for detecting the object type\n\t\t * in context of serialization/deserialization.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.type = 'Curve';\n\n\t\t/**\n\t\t * This value determines the amount of divisions when calculating the\n\t\t * cumulative segment lengths of a curve via {@link Curve#getLengths}. To ensure\n\t\t * precision when using methods like {@link Curve#getSpacedPoints}, it is\n\t\t * recommended to increase the value of this property if the curve is very large.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 200\n\t\t */\n\t\tthis.arcLengthDivisions = 200;\n\n\t\t/**\n\t\t * Must be set to `true` if the curve parameters have changed.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.needsUpdate = false;\n\n\t\t/**\n\t\t * An internal cache that holds precomputed curve length values.\n\t\t *\n\t\t * @private\n\t\t * @type {?Array\u003cnumber\u003e}\n\t\t * @default null\n\t\t */\n\t\tthis.cacheArcLengths = null;\n\n\t}\n\n\t/**\n\t * This method returns a vector in 2D or 3D space (depending on the curve definition)\n\t * for the given interpolation factor.\n\t *\n\t * @abstract\n\t * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {(Vector2|Vector3)} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {(Vector2|Vector3)} The position on the curve. It can be a 2D or 3D vector depending on the curve definition.\n\t */\n\tgetPoint( /* t, optionalTarget */ ) {\n\n\t\twarn( 'Curve: .getPoint() not implemented.' );\n\n\t}\n\n\t/**\n\t * This method returns a vector in 2D or 3D space (depending on the curve definition)\n\t * for the given interpolation factor. Unlike {@link Curve#getPoint}, this method honors the length\n\t * of the curve which equidistant samples.\n\t *\n\t * @param {number} u - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {(Vector2|Vector3)} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {(Vector2|Vector3)} The position on the curve. It can be a 2D or 3D vector depending on the curve definition.\n\t */\n\tgetPointAt( u, optionalTarget ) {\n\n\t\tconst t = this.getUtoTmapping( u );\n\t\treturn this.getPoint( t, optionalTarget );\n\n\t}\n\n\t/**\n\t * This method samples the curve via {@link Curve#getPoint} and returns an array of points representing\n\t * the curve shape.\n\t *\n\t * @param {number} [divisions=5] - The number of divisions.\n\t * @return {Array\u003c(Vector2|Vector3)\u003e} An array holding the sampled curve values. The number of points is `divisions + 1`.\n\t */\n\tgetPoints( divisions = 5 ) {\n\n\t\tconst points = [];\n\n\t\tfor ( let d = 0; d \u003c= divisions; d ++ ) {\n\n\t\t\tpoints.push( this.getPoint( d / divisions ) );\n\n\t\t}\n\n\t\treturn points;\n\n\t}\n\n\t// Get sequence of points using getPointAt( u )\n\n\t/**\n\t * This method samples the curve via {@link Curve#getPointAt} and returns an array of points representing\n\t * the curve shape. Unlike {@link Curve#getPoints}, this method returns equi-spaced points across the entire\n\t * curve.\n\t *\n\t * @param {number} [divisions=5] - The number of divisions.\n\t * @return {Array\u003c(Vector2|Vector3)\u003e} An array holding the sampled curve values. The number of points is `divisions + 1`.\n\t */\n\tgetSpacedPoints( divisions = 5 ) {\n\n\t\tconst points = [];\n\n\t\tfor ( let d = 0; d \u003c= divisions; d ++ ) {\n\n\t\t\tpoints.push( this.getPointAt( d / divisions ) );\n\n\t\t}\n\n\t\treturn points;\n\n\t}\n\n\t/**\n\t * Returns the total arc length of the curve.\n\t *\n\t * @return {number} The length of the curve.\n\t */\n\tgetLength() {\n\n\t\tconst lengths = this.getLengths();\n\t\treturn lengths[ lengths.length - 1 ];\n\n\t}\n\n\t/**\n\t * Returns an array of cumulative segment lengths of the curve.\n\t *\n\t * @param {number} [divisions=this.arcLengthDivisions] - The number of divisions.\n\t * @return {Array\u003cnumber\u003e} An array holding the cumulative segment lengths.\n\t */\n\tgetLengths( divisions = this.arcLengthDivisions ) {\n\n\t\tif ( this.cacheArcLengths \u0026\u0026\n\t\t\t( this.cacheArcLengths.length === divisions + 1 ) \u0026\u0026\n\t\t\t! this.needsUpdate ) {\n\n\t\t\treturn this.cacheArcLengths;\n\n\t\t}\n\n\t\tthis.needsUpdate = false;\n\n\t\tconst cache = [];\n\t\tlet current, last = this.getPoint( 0 );\n\t\tlet sum = 0;\n\n\t\tcache.push( 0 );\n\n\t\tfor ( let p = 1; p \u003c= divisions; p ++ ) {\n\n\t\t\tcurrent = this.getPoint( p / divisions );\n\t\t\tsum += current.distanceTo( last );\n\t\t\tcache.push( sum );\n\t\t\tlast = current;\n\n\t\t}\n\n\t\tthis.cacheArcLengths = cache;\n\n\t\treturn cache; // { sums: cache, sum: sum }; Sum is in the last element.\n\n\t}\n\n\t/**\n\t * Update the cumulative segment distance cache. The method must be called\n\t * every time curve parameters are changed. If an updated curve is part of a\n\t * composed curve like {@link CurvePath}, this method must be called on the\n\t * composed curve, too.\n\t */\n\tupdateArcLengths() {\n\n\t\tthis.needsUpdate = true;\n\t\tthis.getLengths();\n\n\t}\n\n\t/**\n\t * Given an interpolation factor in the range `[0,1]`, this method returns an updated\n\t * interpolation factor in the same range that can be ued to sample equidistant points\n\t * from a curve.\n\t *\n\t * @param {number} u - The interpolation factor.\n\t * @param {?number} distance - An optional distance on the curve.\n\t * @return {number} The updated interpolation factor.\n\t */\n\tgetUtoTmapping( u, distance = null ) {\n\n\t\tconst arcLengths = this.getLengths();\n\n\t\tlet i = 0;\n\t\tconst il = arcLengths.length;\n\n\t\tlet targetArcLength; // The targeted u distance value to get\n\n\t\tif ( distance ) {\n\n\t\t\ttargetArcLength = distance;\n\n\t\t} else {\n\n\t\t\ttargetArcLength = u * arcLengths[ il - 1 ];\n\n\t\t}\n\n\t\t// binary search for the index with largest value smaller than target u distance\n\n\t\tlet low = 0, high = il - 1, comparison;\n\n\t\twhile ( low \u003c= high ) {\n\n\t\t\ti = Math.floor( low + ( high - low ) / 2 ); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats\n\n\t\t\tcomparison = arcLengths[ i ] - targetArcLength;\n\n\t\t\tif ( comparison \u003c 0 ) {\n\n\t\t\t\tlow = i + 1;\n\n\t\t\t} else if ( comparison \u003e 0 ) {\n\n\t\t\t\thigh = i - 1;\n\n\t\t\t} else {\n\n\t\t\t\thigh = i;\n\t\t\t\tbreak;\n\n\t\t\t\t// DONE\n\n\t\t\t}\n\n\t\t}\n\n\t\ti = high;\n\n\t\tif ( arcLengths[ i ] === targetArcLength ) {\n\n\t\t\treturn i / ( il - 1 );\n\n\t\t}\n\n\t\t// we could get finer grain at lengths, or use simple interpolation between two points\n\n\t\tconst lengthBefore = arcLengths[ i ];\n\t\tconst lengthAfter = arcLengths[ i + 1 ];\n\n\t\tconst segmentLength = lengthAfter - lengthBefore;\n\n\t\t// determine where we are between the 'before' and 'after' points\n\n\t\tconst segmentFraction = ( targetArcLength - lengthBefore ) / segmentLength;\n\n\t\t// add that fractional amount to t\n\n\t\tconst t = ( i + segmentFraction ) / ( il - 1 );\n\n\t\treturn t;\n\n\t}\n\n\t/**\n\t * Returns a unit vector tangent for the given interpolation factor.\n\t * If the derived curve does not implement its tangent derivation,\n\t * two points a small delta apart will be used to find its gradient\n\t * which seems to give a reasonable approximation.\n\t *\n\t * @param {number} t - The interpolation factor.\n\t * @param {(Vector2|Vector3)} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {(Vector2|Vector3)} The tangent vector.\n\t */\n\tgetTangent( t, optionalTarget ) {\n\n\t\tconst delta = 0.0001;\n\t\tlet t1 = t - delta;\n\t\tlet t2 = t + delta;\n\n\t\t// Capping in case of danger\n\n\t\tif ( t1 \u003c 0 ) t1 = 0;\n\t\tif ( t2 \u003e 1 ) t2 = 1;\n\n\t\tconst pt1 = this.getPoint( t1 );\n\t\tconst pt2 = this.getPoint( t2 );\n\n\t\tconst tangent = optionalTarget || ( ( pt1.isVector2 ) ? new Vector2() : new Vector3() );\n\n\t\ttangent.copy( pt2 ).sub( pt1 ).normalize();\n\n\t\treturn tangent;\n\n\t}\n\n\t/**\n\t * Same as {@link Curve#getTangent} but with equidistant samples.\n\t *\n\t * @param {number} u - The interpolation factor.\n\t * @param {(Vector2|Vector3)} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {(Vector2|Vector3)} The tangent vector.\n\t * @see {@link Curve#getPointAt}\n\t */\n\tgetTangentAt( u, optionalTarget ) {\n\n\t\tconst t = this.getUtoTmapping( u );\n\t\treturn this.getTangent( t, optionalTarget );\n\n\t}\n\n\t/**\n\t * Generates the Frenet Frames. Requires a curve definition in 3D space. Used\n\t * in geometries like {@link TubeGeometry} or {@link ExtrudeGeometry}.\n\t *\n\t * @param {number} segments - The number of segments.\n\t * @param {boolean} [closed=false] - Whether the curve is closed or not.\n\t * @return {{tangents: Array\u003cVector3\u003e, normals: Array\u003cVector3\u003e, binormals: Array\u003cVector3\u003e}} The Frenet Frames.\n\t */\n\tcomputeFrenetFrames( segments, closed = false ) {\n\n\t\t// see http://www.cs.indiana.edu/pub/techreports/TR425.pdf\n\n\t\tconst normal = new Vector3();\n\n\t\tconst tangents = [];\n\t\tconst normals = [];\n\t\tconst binormals = [];\n\n\t\tconst vec = new Vector3();\n\t\tconst mat = new Matrix4();\n\n\t\t// compute the tangent vectors for each segment on the curve\n\n\t\tfor ( let i = 0; i \u003c= segments; i ++ ) {\n\n\t\t\tconst u = i / segments;\n\n\t\t\ttangents[ i ] = this.getTangentAt( u, new Vector3() );\n\n\t\t}\n\n\t\t// select an initial normal vector perpendicular to the first tangent vector,\n\t\t// and in the direction of the minimum tangent xyz component\n\n\t\tnormals[ 0 ] = new Vector3();\n\t\tbinormals[ 0 ] = new Vector3();\n\t\tlet min = Number.MAX_VALUE;\n\t\tconst tx = Math.abs( tangents[ 0 ].x );\n\t\tconst ty = Math.abs( tangents[ 0 ].y );\n\t\tconst tz = Math.abs( tangents[ 0 ].z );\n\n\t\tif ( tx \u003c= min ) {\n\n\t\t\tmin = tx;\n\t\t\tnormal.set( 1, 0, 0 );\n\n\t\t}\n\n\t\tif ( ty \u003c= min ) {\n\n\t\t\tmin = ty;\n\t\t\tnormal.set( 0, 1, 0 );\n\n\t\t}\n\n\t\tif ( tz \u003c= min ) {\n\n\t\t\tnormal.set( 0, 0, 1 );\n\n\t\t}\n\n\t\tvec.crossVectors( tangents[ 0 ], normal ).normalize();\n\n\t\tnormals[ 0 ].crossVectors( tangents[ 0 ], vec );\n\t\tbinormals[ 0 ].crossVectors( tangents[ 0 ], normals[ 0 ] );\n\n\n\t\t// compute the slowly-varying normal and binormal vectors for each segment on the curve\n\n\t\tfor ( let i = 1; i \u003c= segments; i ++ ) {\n\n\t\t\tnormals[ i ] = normals[ i - 1 ].clone();\n\n\t\t\tbinormals[ i ] = binormals[ i - 1 ].clone();\n\n\t\t\tvec.crossVectors( tangents[ i - 1 ], tangents[ i ] );\n\n\t\t\tif ( vec.length() \u003e Number.EPSILON ) {\n\n\t\t\t\tvec.normalize();\n\n\t\t\t\tconst theta = Math.acos( clamp( tangents[ i - 1 ].dot( tangents[ i ] ), -1, 1 ) ); // clamp for floating pt errors\n\n\t\t\t\tnormals[ i ].applyMatrix4( mat.makeRotationAxis( vec, theta ) );\n\n\t\t\t}\n\n\t\t\tbinormals[ i ].crossVectors( tangents[ i ], normals[ i ] );\n\n\t\t}\n\n\t\t// if the curve is closed, postprocess the vectors so the first and last normal vectors are the same\n\n\t\tif ( closed === true ) {\n\n\t\t\tlet theta = Math.acos( clamp( normals[ 0 ].dot( normals[ segments ] ), -1, 1 ) );\n\t\t\ttheta /= segments;\n\n\t\t\tif ( tangents[ 0 ].dot( vec.crossVectors( normals[ 0 ], normals[ segments ] ) ) \u003e 0 ) {\n\n\t\t\t\ttheta = - theta;\n\n\t\t\t}\n\n\t\t\tfor ( let i = 1; i \u003c= segments; i ++ ) {\n\n\t\t\t\t// twist a little...\n\t\t\t\tnormals[ i ].applyMatrix4( mat.makeRotationAxis( tangents[ i ], theta * i ) );\n\t\t\t\tbinormals[ i ].crossVectors( tangents[ i ], normals[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn {\n\t\t\ttangents: tangents,\n\t\t\tnormals: normals,\n\t\t\tbinormals: binormals\n\t\t};\n\n\t}\n\n\t/**\n\t * Returns a new curve with copied values from this instance.\n\t *\n\t * @return {Curve} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Copies the values of the given curve to this instance.\n\t *\n\t * @param {Curve} source - The curve to copy.\n\t * @return {Curve} A reference to this curve.\n\t */\n\tcopy( source ) {\n\n\t\tthis.arcLengthDivisions = source.arcLengthDivisions;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Serializes the curve into JSON.\n\t *\n\t * @return {Object} A JSON object representing the serialized curve.\n\t * @see {@link ObjectLoader#parse}\n\t */\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.7,\n\t\t\t\ttype: 'Curve',\n\t\t\t\tgenerator: 'Curve.toJSON'\n\t\t\t}\n\t\t};\n\n\t\tdata.arcLengthDivisions = this.arcLengthDivisions;\n\t\tdata.type = this.type;\n\n\t\treturn data;\n\n\t}\n\n\t/**\n\t * Deserializes the curve from the given JSON.\n\t *\n\t * @param {Object} json - The JSON holding the serialized curve.\n\t * @return {Curve} A reference to this curve.\n\t */\n\tfromJSON( json ) {\n\n\t\tthis.arcLengthDivisions = json.arcLengthDivisions;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A curve representing an ellipse.\n *\n * ```js\n * const curve = new THREE.EllipseCurve(\n * \t0, 0,\n * \t10, 10,\n * \t0, 2 * Math.PI,\n * \tfalse,\n * \t0\n * );\n *\n * const points = curve.getPoints( 50 );\n * const geometry = new THREE.BufferGeometry().setFromPoints( points );\n *\n * const material = new THREE.LineBasicMaterial( { color: 0xff0000 } );\n *\n * // Create the final object to add to the scene\n * const ellipse = new THREE.Line( geometry, material );\n * ```\n *\n * @augments Curve\n */\nclass EllipseCurve extends Curve {\n\n\t/**\n\t * Constructs a new ellipse curve.\n\t *\n\t * @param {number} [aX=0] - The X center of the ellipse.\n\t * @param {number} [aY=0] - The Y center of the ellipse.\n\t * @param {number} [xRadius=1] - The radius of the ellipse in the x direction.\n\t * @param {number} [yRadius=1] - The radius of the ellipse in the y direction.\n\t * @param {number} [aStartAngle=0] - The start angle of the curve in radians starting from the positive X axis.\n\t * @param {number} [aEndAngle=Math.PI*2] - The end angle of the curve in radians starting from the positive X axis.\n\t * @param {boolean} [aClockwise=false] - Whether the ellipse is drawn clockwise or not.\n\t * @param {number} [aRotation=0] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.\n\t */\n\tconstructor( aX = 0, aY = 0, xRadius = 1, yRadius = 1, aStartAngle = 0, aEndAngle = Math.PI * 2, aClockwise = false, aRotation = 0 ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isEllipseCurve = true;\n\n\t\tthis.type = 'EllipseCurve';\n\n\t\t/**\n\t\t * The X center of the ellipse.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.aX = aX;\n\n\t\t/**\n\t\t * The Y center of the ellipse.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.aY = aY;\n\n\t\t/**\n\t\t * The radius of the ellipse in the x direction.\n\t\t * Setting the this value equal to the {@link EllipseCurve#yRadius} will result in a circle.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.xRadius = xRadius;\n\n\t\t/**\n\t\t * The radius of the ellipse in the y direction.\n\t\t * Setting the this value equal to the {@link EllipseCurve#xRadius} will result in a circle.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.yRadius = yRadius;\n\n\t\t/**\n\t\t * The start angle of the curve in radians starting from the positive X axis.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.aStartAngle = aStartAngle;\n\n\t\t/**\n\t\t * The end angle of the curve in radians starting from the positive X axis.\n\t\t *\n\t\t * @type {number}\n\t\t * @default Math.PI*2\n\t\t */\n\t\tthis.aEndAngle = aEndAngle;\n\n\t\t/**\n\t\t * Whether the ellipse is drawn clockwise or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.aClockwise = aClockwise;\n\n\t\t/**\n\t\t * The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.aRotation = aRotation;\n\n\t}\n\n\t/**\n\t * Returns a point on the curve.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {Vector2} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {Vector2} The position on the curve.\n\t */\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst twoPi = Math.PI * 2;\n\t\tlet deltaAngle = this.aEndAngle - this.aStartAngle;\n\t\tconst samePoints = Math.abs( deltaAngle ) \u003c Number.EPSILON;\n\n\t\t// ensures that deltaAngle is 0 .. 2 PI\n\t\twhile ( deltaAngle \u003c 0 ) deltaAngle += twoPi;\n\t\twhile ( deltaAngle \u003e twoPi ) deltaAngle -= twoPi;\n\n\t\tif ( deltaAngle \u003c Number.EPSILON ) {\n\n\t\t\tif ( samePoints ) {\n\n\t\t\t\tdeltaAngle = 0;\n\n\t\t\t} else {\n\n\t\t\t\tdeltaAngle = twoPi;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.aClockwise === true \u0026\u0026 ! samePoints ) {\n\n\t\t\tif ( deltaAngle === twoPi ) {\n\n\t\t\t\tdeltaAngle = - twoPi;\n\n\t\t\t} else {\n\n\t\t\t\tdeltaAngle = deltaAngle - twoPi;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst angle = this.aStartAngle + t * deltaAngle;\n\t\tlet x = this.aX + this.xRadius * Math.cos( angle );\n\t\tlet y = this.aY + this.yRadius * Math.sin( angle );\n\n\t\tif ( this.aRotation !== 0 ) {\n\n\t\t\tconst cos = Math.cos( this.aRotation );\n\t\t\tconst sin = Math.sin( this.aRotation );\n\n\t\t\tconst tx = x - this.aX;\n\t\t\tconst ty = y - this.aY;\n\n\t\t\t// Rotate the point about the center of the ellipse.\n\t\t\tx = tx * cos - ty * sin + this.aX;\n\t\t\ty = tx * sin + ty * cos + this.aY;\n\n\t\t}\n\n\t\treturn point.set( x, y );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.aX = source.aX;\n\t\tthis.aY = source.aY;\n\n\t\tthis.xRadius = source.xRadius;\n\t\tthis.yRadius = source.yRadius;\n\n\t\tthis.aStartAngle = source.aStartAngle;\n\t\tthis.aEndAngle = source.aEndAngle;\n\n\t\tthis.aClockwise = source.aClockwise;\n\n\t\tthis.aRotation = source.aRotation;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.aX = this.aX;\n\t\tdata.aY = this.aY;\n\n\t\tdata.xRadius = this.xRadius;\n\t\tdata.yRadius = this.yRadius;\n\n\t\tdata.aStartAngle = this.aStartAngle;\n\t\tdata.aEndAngle = this.aEndAngle;\n\n\t\tdata.aClockwise = this.aClockwise;\n\n\t\tdata.aRotation = this.aRotation;\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.aX = json.aX;\n\t\tthis.aY = json.aY;\n\n\t\tthis.xRadius = json.xRadius;\n\t\tthis.yRadius = json.yRadius;\n\n\t\tthis.aStartAngle = json.aStartAngle;\n\t\tthis.aEndAngle = json.aEndAngle;\n\n\t\tthis.aClockwise = json.aClockwise;\n\n\t\tthis.aRotation = json.aRotation;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A curve representing an arc.\n *\n * @augments EllipseCurve\n */\nclass ArcCurve extends EllipseCurve {\n\n\t/**\n\t * Constructs a new arc curve.\n\t *\n\t * @param {number} [aX=0] - The X center of the ellipse.\n\t * @param {number} [aY=0] - The Y center of the ellipse.\n\t * @param {number} [aRadius=1] - The radius of the ellipse in the x direction.\n\t * @param {number} [aStartAngle=0] - The start angle of the curve in radians starting from the positive X axis.\n\t * @param {number} [aEndAngle=Math.PI*2] - The end angle of the curve in radians starting from the positive X axis.\n\t * @param {boolean} [aClockwise=false] - Whether the ellipse is drawn clockwise or not.\n\t */\n\tconstructor( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {\n\n\t\tsuper( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isArcCurve = true;\n\n\t\tthis.type = 'ArcCurve';\n\n\t}\n\n}\n\nfunction CubicPoly() {\n\n\t/**\n\t * Centripetal CatmullRom Curve - which is useful for avoiding\n\t* cusps and self-intersections in non-uniform catmull rom curves.\n\t* http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf\n\t*\n\t* curve.type accepts centripetal(default), chordal and catmullrom\n\t* curve.tension is used for catmullrom which defaults to 0.5\n\t*/\n\n\t/*\n\tBased on an optimized c++ solution in\n\t- http://stackoverflow.com/questions/9489736/catmull-rom-curve-with-no-cusps-and-no-self-intersections/\n\t- http://ideone.com/NoEbVM\n\n\tThis CubicPoly class could be used for reusing some variables and calculations,\n\tbut for three.js curve use, it could be possible inlined and flatten into a single function call\n\twhich can be placed in CurveUtils.\n\t*/\n\n\tlet c0 = 0, c1 = 0, c2 = 0, c3 = 0;\n\n\t/*\n\t * Compute coefficients for a cubic polynomial\n\t *   p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n\t * such that\n\t *   p(0) = x0, p(1) = x1\n\t *  and\n\t *   p'(0) = t0, p'(1) = t1.\n\t */\n\tfunction init( x0, x1, t0, t1 ) {\n\n\t\tc0 = x0;\n\t\tc1 = t0;\n\t\tc2 = -3 * x0 + 3 * x1 - 2 * t0 - t1;\n\t\tc3 = 2 * x0 - 2 * x1 + t0 + t1;\n\n\t}\n\n\treturn {\n\n\t\tinitCatmullRom: function ( x0, x1, x2, x3, tension ) {\n\n\t\t\tinit( x1, x2, tension * ( x2 - x0 ), tension * ( x3 - x1 ) );\n\n\t\t},\n\n\t\tinitNonuniformCatmullRom: function ( x0, x1, x2, x3, dt0, dt1, dt2 ) {\n\n\t\t\t// compute tangents when parameterized in [t1,t2]\n\t\t\tlet t1 = ( x1 - x0 ) / dt0 - ( x2 - x0 ) / ( dt0 + dt1 ) + ( x2 - x1 ) / dt1;\n\t\t\tlet t2 = ( x2 - x1 ) / dt1 - ( x3 - x1 ) / ( dt1 + dt2 ) + ( x3 - x2 ) / dt2;\n\n\t\t\t// rescale tangents for parametrization in [0,1]\n\t\t\tt1 *= dt1;\n\t\t\tt2 *= dt1;\n\n\t\t\tinit( x1, x2, t1, t2 );\n\n\t\t},\n\n\t\tcalc: function ( t ) {\n\n\t\t\tconst t2 = t * t;\n\t\t\tconst t3 = t2 * t;\n\t\t\treturn c0 + c1 * t + c2 * t2 + c3 * t3;\n\n\t\t}\n\n\t};\n\n}\n\n//\n\nconst tmp = /*@__PURE__*/ new Vector3();\nconst px = /*@__PURE__*/ new CubicPoly();\nconst py = /*@__PURE__*/ new CubicPoly();\nconst pz = /*@__PURE__*/ new CubicPoly();\n\n/**\n * A curve representing a Catmull-Rom spline.\n *\n * ```js\n * //Create a closed wavey loop\n * const curve = new THREE.CatmullRomCurve3( [\n * \tnew THREE.Vector3( -10, 0, 10 ),\n * \tnew THREE.Vector3( -5, 5, 5 ),\n * \tnew THREE.Vector3( 0, 0, 0 ),\n * \tnew THREE.Vector3( 5, -5, 5 ),\n * \tnew THREE.Vector3( 10, 0, 10 )\n * ] );\n *\n * const points = curve.getPoints( 50 );\n * const geometry = new THREE.BufferGeometry().setFromPoints( points );\n *\n * const material = new THREE.LineBasicMaterial( { color: 0xff0000 } );\n *\n * // Create the final object to add to the scene\n * const curveObject = new THREE.Line( geometry, material );\n * ```\n *\n * @augments Curve\n */\nclass CatmullRomCurve3 extends Curve {\n\n\t/**\n\t * Constructs a new Catmull-Rom curve.\n\t *\n\t * @param {Array\u003cVector3\u003e} [points] - An array of 3D points defining the curve.\n\t * @param {boolean} [closed=false] - Whether the curve is closed or not.\n\t * @param {('centripetal'|'chordal'|'catmullrom')} [curveType='centripetal'] - The curve type.\n\t * @param {number} [tension=0.5] - Tension of the curve.\n\t */\n\tconstructor( points = [], closed = false, curveType = 'centripetal', tension = 0.5 ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCatmullRomCurve3 = true;\n\n\t\tthis.type = 'CatmullRomCurve3';\n\n\t\t/**\n\t\t * An array of 3D points defining the curve.\n\t\t *\n\t\t * @type {Array\u003cVector3\u003e}\n\t\t */\n\t\tthis.points = points;\n\n\t\t/**\n\t\t * Whether the curve is closed or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.closed = closed;\n\n\t\t/**\n\t\t * The curve type.\n\t\t *\n\t\t * @type {('centripetal'|'chordal'|'catmullrom')}\n\t\t * @default 'centripetal'\n\t\t */\n\t\tthis.curveType = curveType;\n\n\t\t/**\n\t\t * Tension of the curve.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0.5\n\t\t */\n\t\tthis.tension = tension;\n\n\t}\n\n\t/**\n\t * Returns a point on the curve.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {Vector3} The position on the curve.\n\t */\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst points = this.points;\n\t\tconst l = points.length;\n\n\t\tconst p = ( l - ( this.closed ? 0 : 1 ) ) * t;\n\t\tlet intPoint = Math.floor( p );\n\t\tlet weight = p - intPoint;\n\n\t\tif ( this.closed ) {\n\n\t\t\tintPoint += intPoint \u003e 0 ? 0 : ( Math.floor( Math.abs( intPoint ) / l ) + 1 ) * l;\n\n\t\t} else if ( weight === 0 \u0026\u0026 intPoint === l - 1 ) {\n\n\t\t\tintPoint = l - 2;\n\t\t\tweight = 1;\n\n\t\t}\n\n\t\tlet p0, p3; // 4 points (p1 \u0026 p2 defined below)\n\n\t\tif ( this.closed || intPoint \u003e 0 ) {\n\n\t\t\tp0 = points[ ( intPoint - 1 ) % l ];\n\n\t\t} else {\n\n\t\t\t// extrapolate first point\n\t\t\ttmp.subVectors( points[ 0 ], points[ 1 ] ).add( points[ 0 ] );\n\t\t\tp0 = tmp;\n\n\t\t}\n\n\t\tconst p1 = points[ intPoint % l ];\n\t\tconst p2 = points[ ( intPoint + 1 ) % l ];\n\n\t\tif ( this.closed || intPoint + 2 \u003c l ) {\n\n\t\t\tp3 = points[ ( intPoint + 2 ) % l ];\n\n\t\t} else {\n\n\t\t\t// extrapolate last point\n\t\t\ttmp.subVectors( points[ l - 1 ], points[ l - 2 ] ).add( points[ l - 1 ] );\n\t\t\tp3 = tmp;\n\n\t\t}\n\n\t\tif ( this.curveType === 'centripetal' || this.curveType === 'chordal' ) {\n\n\t\t\t// init Centripetal / Chordal Catmull-Rom\n\t\t\tconst pow = this.curveType === 'chordal' ? 0.5 : 0.25;\n\t\t\tlet dt0 = Math.pow( p0.distanceToSquared( p1 ), pow );\n\t\t\tlet dt1 = Math.pow( p1.distanceToSquared( p2 ), pow );\n\t\t\tlet dt2 = Math.pow( p2.distanceToSquared( p3 ), pow );\n\n\t\t\t// safety check for repeated points\n\t\t\tif ( dt1 \u003c 1e-4 ) dt1 = 1.0;\n\t\t\tif ( dt0 \u003c 1e-4 ) dt0 = dt1;\n\t\t\tif ( dt2 \u003c 1e-4 ) dt2 = dt1;\n\n\t\t\tpx.initNonuniformCatmullRom( p0.x, p1.x, p2.x, p3.x, dt0, dt1, dt2 );\n\t\t\tpy.initNonuniformCatmullRom( p0.y, p1.y, p2.y, p3.y, dt0, dt1, dt2 );\n\t\t\tpz.initNonuniformCatmullRom( p0.z, p1.z, p2.z, p3.z, dt0, dt1, dt2 );\n\n\t\t} else if ( this.curveType === 'catmullrom' ) {\n\n\t\t\tpx.initCatmullRom( p0.x, p1.x, p2.x, p3.x, this.tension );\n\t\t\tpy.initCatmullRom( p0.y, p1.y, p2.y, p3.y, this.tension );\n\t\t\tpz.initCatmullRom( p0.z, p1.z, p2.z, p3.z, this.tension );\n\n\t\t}\n\n\t\tpoint.set(\n\t\t\tpx.calc( weight ),\n\t\t\tpy.calc( weight ),\n\t\t\tpz.calc( weight )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = source.points.length; i \u003c l; i ++ ) {\n\n\t\t\tconst point = source.points[ i ];\n\n\t\t\tthis.points.push( point.clone() );\n\n\t\t}\n\n\t\tthis.closed = source.closed;\n\t\tthis.curveType = source.curveType;\n\t\tthis.tension = source.tension;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.points = [];\n\n\t\tfor ( let i = 0, l = this.points.length; i \u003c l; i ++ ) {\n\n\t\t\tconst point = this.points[ i ];\n\t\t\tdata.points.push( point.toArray() );\n\n\t\t}\n\n\t\tdata.closed = this.closed;\n\t\tdata.curveType = this.curveType;\n\t\tdata.tension = this.tension;\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = json.points.length; i \u003c l; i ++ ) {\n\n\t\t\tconst point = json.points[ i ];\n\t\t\tthis.points.push( new Vector3().fromArray( point ) );\n\n\t\t}\n\n\t\tthis.closed = json.closed;\n\t\tthis.curveType = json.curveType;\n\t\tthis.tension = json.tension;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * Interpolations contains spline and Bézier functions internally used by concrete curve classes.\n *\n * Bezier Curves formulas obtained from: https://en.wikipedia.org/wiki/B%C3%A9zier_curve\n *\n * @module Interpolations\n */\n\n/**\n * Computes a point on a Catmull-Rom spline.\n *\n * @param {number} t - The interpolation factor.\n * @param {number} p0 - The first control point.\n * @param {number} p1 - The second control point.\n * @param {number} p2 - The third control point.\n * @param {number} p3 - The fourth control point.\n * @return {number} The calculated point on a Catmull-Rom spline.\n */\nfunction CatmullRom( t, p0, p1, p2, p3 ) {\n\n\tconst v0 = ( p2 - p0 ) * 0.5;\n\tconst v1 = ( p3 - p1 ) * 0.5;\n\tconst t2 = t * t;\n\tconst t3 = t * t2;\n\treturn ( 2 * p1 - 2 * p2 + v0 + v1 ) * t3 + ( -3 * p1 + 3 * p2 - 2 * v0 - v1 ) * t2 + v0 * t + p1;\n\n}\n\n//\n\nfunction QuadraticBezierP0( t, p ) {\n\n\tconst k = 1 - t;\n\treturn k * k * p;\n\n}\n\nfunction QuadraticBezierP1( t, p ) {\n\n\treturn 2 * ( 1 - t ) * t * p;\n\n}\n\nfunction QuadraticBezierP2( t, p ) {\n\n\treturn t * t * p;\n\n}\n\n/**\n * Computes a point on a Quadratic Bezier curve.\n *\n * @param {number} t - The interpolation factor.\n * @param {number} p0 - The first control point.\n * @param {number} p1 - The second control point.\n * @param {number} p2 - The third control point.\n * @return {number} The calculated point on a Quadratic Bezier curve.\n */\nfunction QuadraticBezier( t, p0, p1, p2 ) {\n\n\treturn QuadraticBezierP0( t, p0 ) + QuadraticBezierP1( t, p1 ) +\n\t\tQuadraticBezierP2( t, p2 );\n\n}\n\n//\n\nfunction CubicBezierP0( t, p ) {\n\n\tconst k = 1 - t;\n\treturn k * k * k * p;\n\n}\n\nfunction CubicBezierP1( t, p ) {\n\n\tconst k = 1 - t;\n\treturn 3 * k * k * t * p;\n\n}\n\nfunction CubicBezierP2( t, p ) {\n\n\treturn 3 * ( 1 - t ) * t * t * p;\n\n}\n\nfunction CubicBezierP3( t, p ) {\n\n\treturn t * t * t * p;\n\n}\n\n/**\n * Computes a point on a Cubic Bezier curve.\n *\n * @param {number} t - The interpolation factor.\n * @param {number} p0 - The first control point.\n * @param {number} p1 - The second control point.\n * @param {number} p2 - The third control point.\n * @param {number} p3 - The fourth control point.\n * @return {number} The calculated point on a Cubic Bezier curve.\n */\nfunction CubicBezier( t, p0, p1, p2, p3 ) {\n\n\treturn CubicBezierP0( t, p0 ) + CubicBezierP1( t, p1 ) + CubicBezierP2( t, p2 ) +\n\t\tCubicBezierP3( t, p3 );\n\n}\n\n/**\n * A curve representing a 2D Cubic Bezier curve.\n *\n * ```js\n * const curve = new THREE.CubicBezierCurve(\n * \tnew THREE.Vector2( - 0, 0 ),\n * \tnew THREE.Vector2( - 5, 15 ),\n * \tnew THREE.Vector2( 20, 15 ),\n * \tnew THREE.Vector2( 10, 0 )\n * );\n *\n * const points = curve.getPoints( 50 );\n * const geometry = new THREE.BufferGeometry().setFromPoints( points );\n *\n * const material = new THREE.LineBasicMaterial( { color: 0xff0000 } );\n *\n * // Create the final object to add to the scene\n * const curveObject = new THREE.Line( geometry, material );\n * ```\n *\n * @augments Curve\n */\nclass CubicBezierCurve extends Curve {\n\n\t/**\n\t * Constructs a new Cubic Bezier curve.\n\t *\n\t * @param {Vector2} [v0] - The start point.\n\t * @param {Vector2} [v1] - The first control point.\n\t * @param {Vector2} [v2] - The second control point.\n\t * @param {Vector2} [v3] - The end point.\n\t */\n\tconstructor( v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2(), v3 = new Vector2() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCubicBezierCurve = true;\n\n\t\tthis.type = 'CubicBezierCurve';\n\n\t\t/**\n\t\t * The start point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v0 = v0;\n\n\t\t/**\n\t\t * The first control point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v1 = v1;\n\n\t\t/**\n\t\t * The second control point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v2 = v2;\n\n\t\t/**\n\t\t * The end point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v3 = v3;\n\n\t}\n\n\t/**\n\t * Returns a point on the curve.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {Vector2} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {Vector2} The position on the curve.\n\t */\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;\n\n\t\tpoint.set(\n\t\t\tCubicBezier( t, v0.x, v1.x, v2.x, v3.x ),\n\t\t\tCubicBezier( t, v0.y, v1.y, v2.y, v3.y )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\t\tthis.v3.copy( source.v3 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\t\tdata.v3 = this.v3.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\t\tthis.v3.fromArray( json.v3 );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A curve representing a 3D Cubic Bezier curve.\n *\n * @augments Curve\n */\nclass CubicBezierCurve3 extends Curve {\n\n\t/**\n\t * Constructs a new Cubic Bezier curve.\n\t *\n\t * @param {Vector3} [v0] - The start point.\n\t * @param {Vector3} [v1] - The first control point.\n\t * @param {Vector3} [v2] - The second control point.\n\t * @param {Vector3} [v3] - The end point.\n\t */\n\tconstructor( v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3(), v3 = new Vector3() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCubicBezierCurve3 = true;\n\n\t\tthis.type = 'CubicBezierCurve3';\n\n\t\t/**\n\t\t * The start point.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.v0 = v0;\n\n\t\t/**\n\t\t * The first control point.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.v1 = v1;\n\n\t\t/**\n\t\t * The second control point.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.v2 = v2;\n\n\t\t/**\n\t\t * The end point.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.v3 = v3;\n\n\t}\n\n\t/**\n\t * Returns a point on the curve.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {Vector3} The position on the curve.\n\t */\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;\n\n\t\tpoint.set(\n\t\t\tCubicBezier( t, v0.x, v1.x, v2.x, v3.x ),\n\t\t\tCubicBezier( t, v0.y, v1.y, v2.y, v3.y ),\n\t\t\tCubicBezier( t, v0.z, v1.z, v2.z, v3.z )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\t\tthis.v3.copy( source.v3 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\t\tdata.v3 = this.v3.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\t\tthis.v3.fromArray( json.v3 );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A curve representing a 2D line segment.\n *\n * @augments Curve\n */\nclass LineCurve extends Curve {\n\n\t/**\n\t * Constructs a new line curve.\n\t *\n\t * @param {Vector2} [v1] - The start point.\n\t * @param {Vector2} [v2] - The end point.\n\t */\n\tconstructor( v1 = new Vector2(), v2 = new Vector2() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLineCurve = true;\n\n\t\tthis.type = 'LineCurve';\n\n\t\t/**\n\t\t * The start point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v1 = v1;\n\n\t\t/**\n\t\t * The end point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v2 = v2;\n\n\t}\n\n\t/**\n\t * Returns a point on the line.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the line. Must be in the range `[0,1]`.\n\t * @param {Vector2} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {Vector2} The position on the line.\n\t */\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tif ( t === 1 ) {\n\n\t\t\tpoint.copy( this.v2 );\n\n\t\t} else {\n\n\t\t\tpoint.copy( this.v2 ).sub( this.v1 );\n\t\t\tpoint.multiplyScalar( t ).add( this.v1 );\n\n\t\t}\n\n\t\treturn point;\n\n\t}\n\n\t// Line curve is linear, so we can overwrite default getPointAt\n\tgetPointAt( u, optionalTarget ) {\n\n\t\treturn this.getPoint( u, optionalTarget );\n\n\t}\n\n\tgetTangent( t, optionalTarget = new Vector2() ) {\n\n\t\treturn optionalTarget.subVectors( this.v2, this.v1 ).normalize();\n\n\t}\n\n\tgetTangentAt( u, optionalTarget ) {\n\n\t\treturn this.getTangent( u, optionalTarget );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A curve representing a 3D line segment.\n *\n * @augments Curve\n */\nclass LineCurve3 extends Curve {\n\n\t/**\n\t * Constructs a new line curve.\n\t *\n\t * @param {Vector3} [v1] - The start point.\n\t * @param {Vector3} [v2] - The end point.\n\t */\n\tconstructor( v1 = new Vector3(), v2 = new Vector3() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLineCurve3 = true;\n\n\t\tthis.type = 'LineCurve3';\n\n\t\t/**\n\t\t * The start point.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.v1 = v1;\n\n\t\t/**\n\t\t * The end point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v2 = v2;\n\n\t}\n\n\t/**\n\t * Returns a point on the line.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the line. Must be in the range `[0,1]`.\n\t * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {Vector3} The position on the line.\n\t */\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tif ( t === 1 ) {\n\n\t\t\tpoint.copy( this.v2 );\n\n\t\t} else {\n\n\t\t\tpoint.copy( this.v2 ).sub( this.v1 );\n\t\t\tpoint.multiplyScalar( t ).add( this.v1 );\n\n\t\t}\n\n\t\treturn point;\n\n\t}\n\n\t// Line curve is linear, so we can overwrite default getPointAt\n\tgetPointAt( u, optionalTarget ) {\n\n\t\treturn this.getPoint( u, optionalTarget );\n\n\t}\n\n\tgetTangent( t, optionalTarget = new Vector3() ) {\n\n\t\treturn optionalTarget.subVectors( this.v2, this.v1 ).normalize();\n\n\t}\n\n\tgetTangentAt( u, optionalTarget ) {\n\n\t\treturn this.getTangent( u, optionalTarget );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A curve representing a 2D Quadratic Bezier curve.\n *\n * ```js\n * const curve = new THREE.QuadraticBezierCurve(\n * \tnew THREE.Vector2( - 10, 0 ),\n * \tnew THREE.Vector2( 20, 15 ),\n * \tnew THREE.Vector2( 10, 0 )\n * )\n *\n * const points = curve.getPoints( 50 );\n * const geometry = new THREE.BufferGeometry().setFromPoints( points );\n *\n * const material = new THREE.LineBasicMaterial( { color: 0xff0000 } );\n *\n * // Create the final object to add to the scene\n * const curveObject = new THREE.Line( geometry, material );\n * ```\n *\n * @augments Curve\n */\nclass QuadraticBezierCurve extends Curve {\n\n\t/**\n\t * Constructs a new Quadratic Bezier curve.\n\t *\n\t * @param {Vector2} [v0] - The start point.\n\t * @param {Vector2} [v1] - The control point.\n\t * @param {Vector2} [v2] - The end point.\n\t */\n\tconstructor( v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isQuadraticBezierCurve = true;\n\n\t\tthis.type = 'QuadraticBezierCurve';\n\n\t\t/**\n\t\t * The start point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v0 = v0;\n\n\t\t/**\n\t\t * The control point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v1 = v1;\n\n\t\t/**\n\t\t * The end point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v2 = v2;\n\n\t}\n\n\t/**\n\t * Returns a point on the curve.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {Vector2} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {Vector2} The position on the curve.\n\t */\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2;\n\n\t\tpoint.set(\n\t\t\tQuadraticBezier( t, v0.x, v1.x, v2.x ),\n\t\t\tQuadraticBezier( t, v0.y, v1.y, v2.y )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A curve representing a 3D Quadratic Bezier curve.\n *\n * @augments Curve\n */\nclass QuadraticBezierCurve3 extends Curve {\n\n\t/**\n\t * Constructs a new Quadratic Bezier curve.\n\t *\n\t * @param {Vector3} [v0] - The start point.\n\t * @param {Vector3} [v1] - The control point.\n\t * @param {Vector3} [v2] - The end point.\n\t */\n\tconstructor( v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isQuadraticBezierCurve3 = true;\n\n\t\tthis.type = 'QuadraticBezierCurve3';\n\n\t\t/**\n\t\t * The start point.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.v0 = v0;\n\n\t\t/**\n\t\t * The control point.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.v1 = v1;\n\n\t\t/**\n\t\t * The end point.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.v2 = v2;\n\n\t}\n\n\t/**\n\t * Returns a point on the curve.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {Vector3} The position on the curve.\n\t */\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2;\n\n\t\tpoint.set(\n\t\t\tQuadraticBezier( t, v0.x, v1.x, v2.x ),\n\t\t\tQuadraticBezier( t, v0.y, v1.y, v2.y ),\n\t\t\tQuadraticBezier( t, v0.z, v1.z, v2.z )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A curve representing a 2D spline curve.\n *\n * ```js\n * // Create a sine-like wave\n * const curve = new THREE.SplineCurve( [\n * \tnew THREE.Vector2( -10, 0 ),\n * \tnew THREE.Vector2( -5, 5 ),\n * \tnew THREE.Vector2( 0, 0 ),\n * \tnew THREE.Vector2( 5, -5 ),\n * \tnew THREE.Vector2( 10, 0 )\n * ] );\n *\n * const points = curve.getPoints( 50 );\n * const geometry = new THREE.BufferGeometry().setFromPoints( points );\n *\n * const material = new THREE.LineBasicMaterial( { color: 0xff0000 } );\n *\n * // Create the final object to add to the scene\n * const splineObject = new THREE.Line( geometry, material );\n * ```\n *\n * @augments Curve\n */\nclass SplineCurve extends Curve {\n\n\t/**\n\t * Constructs a new 2D spline curve.\n\t *\n\t * @param {Array\u003cVector2\u003e} [points] -  An array of 2D points defining the curve.\n\t */\n\tconstructor( points = [] ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSplineCurve = true;\n\n\t\tthis.type = 'SplineCurve';\n\n\t\t/**\n\t\t * An array of 2D points defining the curve.\n\t\t *\n\t\t * @type {Array\u003cVector2\u003e}\n\t\t */\n\t\tthis.points = points;\n\n\t}\n\n\t/**\n\t * Returns a point on the curve.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {Vector2} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {Vector2} The position on the curve.\n\t */\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst points = this.points;\n\t\tconst p = ( points.length - 1 ) * t;\n\n\t\tconst intPoint = Math.floor( p );\n\t\tconst weight = p - intPoint;\n\n\t\tconst p0 = points[ intPoint === 0 ? intPoint : intPoint - 1 ];\n\t\tconst p1 = points[ intPoint ];\n\t\tconst p2 = points[ intPoint \u003e points.length - 2 ? points.length - 1 : intPoint + 1 ];\n\t\tconst p3 = points[ intPoint \u003e points.length - 3 ? points.length - 1 : intPoint + 2 ];\n\n\t\tpoint.set(\n\t\t\tCatmullRom( weight, p0.x, p1.x, p2.x, p3.x ),\n\t\t\tCatmullRom( weight, p0.y, p1.y, p2.y, p3.y )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = source.points.length; i \u003c l; i ++ ) {\n\n\t\t\tconst point = source.points[ i ];\n\n\t\t\tthis.points.push( point.clone() );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.points = [];\n\n\t\tfor ( let i = 0, l = this.points.length; i \u003c l; i ++ ) {\n\n\t\t\tconst point = this.points[ i ];\n\t\t\tdata.points.push( point.toArray() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = json.points.length; i \u003c l; i ++ ) {\n\n\t\t\tconst point = json.points[ i ];\n\t\t\tthis.points.push( new Vector2().fromArray( point ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nvar Curves = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tArcCurve: ArcCurve,\n\tCatmullRomCurve3: CatmullRomCurve3,\n\tCubicBezierCurve: CubicBezierCurve,\n\tCubicBezierCurve3: CubicBezierCurve3,\n\tEllipseCurve: EllipseCurve,\n\tLineCurve: LineCurve,\n\tLineCurve3: LineCurve3,\n\tQuadraticBezierCurve: QuadraticBezierCurve,\n\tQuadraticBezierCurve3: QuadraticBezierCurve3,\n\tSplineCurve: SplineCurve\n});\n\n/**\n * A base class extending {@link Curve}. `CurvePath` is simply an\n * array of connected curves, but retains the API of a curve.\n *\n * @augments Curve\n */\nclass CurvePath extends Curve {\n\n\t/**\n\t * Constructs a new curve path.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.type = 'CurvePath';\n\n\t\t/**\n\t\t * An array of curves defining the\n\t\t * path.\n\t\t *\n\t\t * @type {Array\u003cCurve\u003e}\n\t\t */\n\t\tthis.curves = [];\n\n\t\t/**\n\t\t * Whether the path should automatically be closed\n\t\t * by a line curve.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.autoClose = false;\n\n\t}\n\n\t/**\n\t * Adds a curve to this curve path.\n\t *\n\t * @param {Curve} curve - The curve to add.\n\t */\n\tadd( curve ) {\n\n\t\tthis.curves.push( curve );\n\n\t}\n\n\t/**\n\t * Adds a line curve to close the path.\n\t *\n\t * @return {CurvePath} A reference to this curve path.\n\t */\n\tclosePath() {\n\n\t\t// Add a line curve if start and end of lines are not connected\n\t\tconst startPoint = this.curves[ 0 ].getPoint( 0 );\n\t\tconst endPoint = this.curves[ this.curves.length - 1 ].getPoint( 1 );\n\n\t\tif ( ! startPoint.equals( endPoint ) ) {\n\n\t\t\tconst lineType = ( startPoint.isVector2 === true ) ? 'LineCurve' : 'LineCurve3';\n\t\t\tthis.curves.push( new Curves[ lineType ]( endPoint, startPoint ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * This method returns a vector in 2D or 3D space (depending on the curve definitions)\n\t * for the given interpolation factor.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {(Vector2|Vector3)} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {?(Vector2|Vector3)} The position on the curve. It can be a 2D or 3D vector depending on the curve definition.\n\t */\n\tgetPoint( t, optionalTarget ) {\n\n\t\t// To get accurate point with reference to\n\t\t// entire path distance at time t,\n\t\t// following has to be done:\n\n\t\t// 1. Length of each sub path have to be known\n\t\t// 2. Locate and identify type of curve\n\t\t// 3. Get t for the curve\n\t\t// 4. Return curve.getPointAt(t')\n\n\t\tconst d = t * this.getLength();\n\t\tconst curveLengths = this.getCurveLengths();\n\t\tlet i = 0;\n\n\t\t// To think about boundaries points.\n\n\t\twhile ( i \u003c curveLengths.length ) {\n\n\t\t\tif ( curveLengths[ i ] \u003e= d ) {\n\n\t\t\t\tconst diff = curveLengths[ i ] - d;\n\t\t\t\tconst curve = this.curves[ i ];\n\n\t\t\t\tconst segmentLength = curve.getLength();\n\t\t\t\tconst u = segmentLength === 0 ? 0 : 1 - diff / segmentLength;\n\n\t\t\t\treturn curve.getPointAt( u, optionalTarget );\n\n\t\t\t}\n\n\t\t\ti ++;\n\n\t\t}\n\n\t\treturn null;\n\n\t\t// loop where sum != 0, sum \u003e d , sum+1 \u003cd\n\n\t}\n\n\tgetLength() {\n\n\t\t// We cannot use the default THREE.Curve getPoint() with getLength() because in\n\t\t// THREE.Curve, getLength() depends on getPoint() but in THREE.CurvePath\n\t\t// getPoint() depends on getLength\n\n\t\tconst lens = this.getCurveLengths();\n\t\treturn lens[ lens.length - 1 ];\n\n\t}\n\n\tupdateArcLengths() {\n\n\t\t// cacheLengths must be recalculated.\n\n\t\tthis.needsUpdate = true;\n\t\tthis.cacheLengths = null;\n\t\tthis.getCurveLengths();\n\n\t}\n\n\t/**\n\t * Returns list of cumulative curve lengths of the defined curves.\n\t *\n\t * @return {Array\u003cnumber\u003e} The curve lengths.\n\t */\n\tgetCurveLengths() {\n\n\t\t// Compute lengths and cache them\n\t\t// We cannot overwrite getLengths() because UtoT mapping uses it.\n\t\t// We use cache values if curves and cache array are same length\n\n\t\tif ( this.cacheLengths \u0026\u0026 this.cacheLengths.length === this.curves.length ) {\n\n\t\t\treturn this.cacheLengths;\n\n\t\t}\n\n\t\t// Get length of sub-curve\n\t\t// Push sums into cached array\n\n\t\tconst lengths = [];\n\t\tlet sums = 0;\n\n\t\tfor ( let i = 0, l = this.curves.length; i \u003c l; i ++ ) {\n\n\t\t\tsums += this.curves[ i ].getLength();\n\t\t\tlengths.push( sums );\n\n\t\t}\n\n\t\tthis.cacheLengths = lengths;\n\n\t\treturn lengths;\n\n\t}\n\n\tgetSpacedPoints( divisions = 40 ) {\n\n\t\tconst points = [];\n\n\t\tfor ( let i = 0; i \u003c= divisions; i ++ ) {\n\n\t\t\tpoints.push( this.getPoint( i / divisions ) );\n\n\t\t}\n\n\t\tif ( this.autoClose ) {\n\n\t\t\tpoints.push( points[ 0 ] );\n\n\t\t}\n\n\t\treturn points;\n\n\t}\n\n\tgetPoints( divisions = 12 ) {\n\n\t\tconst points = [];\n\t\tlet last;\n\n\t\tfor ( let i = 0, curves = this.curves; i \u003c curves.length; i ++ ) {\n\n\t\t\tconst curve = curves[ i ];\n\t\t\tconst resolution = curve.isEllipseCurve ? divisions * 2\n\t\t\t\t: ( curve.isLineCurve || curve.isLineCurve3 ) ? 1\n\t\t\t\t\t: curve.isSplineCurve ? divisions * curve.points.length\n\t\t\t\t\t\t: divisions;\n\n\t\t\tconst pts = curve.getPoints( resolution );\n\n\t\t\tfor ( let j = 0; j \u003c pts.length; j ++ ) {\n\n\t\t\t\tconst point = pts[ j ];\n\n\t\t\t\tif ( last \u0026\u0026 last.equals( point ) ) continue; // ensures no consecutive points are duplicates\n\n\t\t\t\tpoints.push( point );\n\t\t\t\tlast = point;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.autoClose \u0026\u0026 points.length \u003e 1 \u0026\u0026 ! points[ points.length - 1 ].equals( points[ 0 ] ) ) {\n\n\t\t\tpoints.push( points[ 0 ] );\n\n\t\t}\n\n\t\treturn points;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.curves = [];\n\n\t\tfor ( let i = 0, l = source.curves.length; i \u003c l; i ++ ) {\n\n\t\t\tconst curve = source.curves[ i ];\n\n\t\t\tthis.curves.push( curve.clone() );\n\n\t\t}\n\n\t\tthis.autoClose = source.autoClose;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.autoClose = this.autoClose;\n\t\tdata.curves = [];\n\n\t\tfor ( let i = 0, l = this.curves.length; i \u003c l; i ++ ) {\n\n\t\t\tconst curve = this.curves[ i ];\n\t\t\tdata.curves.push( curve.toJSON() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.autoClose = json.autoClose;\n\t\tthis.curves = [];\n\n\t\tfor ( let i = 0, l = json.curves.length; i \u003c l; i ++ ) {\n\n\t\t\tconst curve = json.curves[ i ];\n\t\t\tthis.curves.push( new Curves[ curve.type ]().fromJSON( curve ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A 2D path representation. The class provides methods for creating paths\n * and contours of 2D shapes similar to the 2D Canvas API.\n *\n * ```js\n * const path = new THREE.Path();\n *\n * path.lineTo( 0, 0.8 );\n * path.quadraticCurveTo( 0, 1, 0.2, 1 );\n * path.lineTo( 1, 1 );\n *\n * const points = path.getPoints();\n *\n * const geometry = new THREE.BufferGeometry().setFromPoints( points );\n * const material = new THREE.LineBasicMaterial( { color: 0xffffff } );\n *\n * const line = new THREE.Line( geometry, material );\n * scene.add( line );\n * ```\n *\n * @augments CurvePath\n */\nclass Path extends CurvePath {\n\n\t/**\n\t * Constructs a new path.\n\t *\n\t * @param {Array\u003cVector2\u003e} [points] - An array of 2D points defining the path.\n\t */\n\tconstructor( points ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'Path';\n\n\t\t/**\n\t\t * The current offset of the path. Any new curve added will start here.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.currentPoint = new Vector2();\n\n\t\tif ( points ) {\n\n\t\t\tthis.setFromPoints( points );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Creates a path from the given list of points. The points are added\n\t * to the path as instances of {@link LineCurve}.\n\t *\n\t * @param {Array\u003cVector2\u003e} points - An array of 2D points.\n\t * @return {Path} A reference to this path.\n\t */\n\tsetFromPoints( points ) {\n\n\t\tthis.moveTo( points[ 0 ].x, points[ 0 ].y );\n\n\t\tfor ( let i = 1, l = points.length; i \u003c l; i ++ ) {\n\n\t\t\tthis.lineTo( points[ i ].x, points[ i ].y );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Moves {@link Path#currentPoint} to the given point.\n\t *\n\t * @param {number} x - The x coordinate.\n\t * @param {number} y - The y coordinate.\n\t * @return {Path} A reference to this path.\n\t */\n\tmoveTo( x, y ) {\n\n\t\tthis.currentPoint.set( x, y ); // TODO consider referencing vectors instead of copying?\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an instance of {@link LineCurve} to the path by connecting\n\t * the current point with the given one.\n\t *\n\t * @param {number} x - The x coordinate of the end point.\n\t * @param {number} y - The y coordinate of the end point.\n\t * @return {Path} A reference to this path.\n\t */\n\tlineTo( x, y ) {\n\n\t\tconst curve = new LineCurve( this.currentPoint.clone(), new Vector2( x, y ) );\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.set( x, y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an instance of {@link QuadraticBezierCurve} to the path by connecting\n\t * the current point with the given one.\n\t *\n\t * @param {number} aCPx - The x coordinate of the control point.\n\t * @param {number} aCPy - The y coordinate of the control point.\n\t * @param {number} aX - The x coordinate of the end point.\n\t * @param {number} aY - The y coordinate of the end point.\n\t * @return {Path} A reference to this path.\n\t */\n\tquadraticCurveTo( aCPx, aCPy, aX, aY ) {\n\n\t\tconst curve = new QuadraticBezierCurve(\n\t\t\tthis.currentPoint.clone(),\n\t\t\tnew Vector2( aCPx, aCPy ),\n\t\t\tnew Vector2( aX, aY )\n\t\t);\n\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.set( aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an instance of {@link CubicBezierCurve} to the path by connecting\n\t * the current point with the given one.\n\t *\n\t * @param {number} aCP1x - The x coordinate of the first control point.\n\t * @param {number} aCP1y - The y coordinate of the first control point.\n\t * @param {number} aCP2x - The x coordinate of the second control point.\n\t * @param {number} aCP2y - The y coordinate of the second control point.\n\t * @param {number} aX - The x coordinate of the end point.\n\t * @param {number} aY - The y coordinate of the end point.\n\t * @return {Path} A reference to this path.\n\t */\n\tbezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) {\n\n\t\tconst curve = new CubicBezierCurve(\n\t\t\tthis.currentPoint.clone(),\n\t\t\tnew Vector2( aCP1x, aCP1y ),\n\t\t\tnew Vector2( aCP2x, aCP2y ),\n\t\t\tnew Vector2( aX, aY )\n\t\t);\n\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.set( aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an instance of {@link SplineCurve} to the path by connecting\n\t * the current point with the given list of points.\n\t *\n\t * @param {Array\u003cVector2\u003e} pts - An array of points in 2D space.\n\t * @return {Path} A reference to this path.\n\t */\n\tsplineThru( pts ) {\n\n\t\tconst npts = [ this.currentPoint.clone() ].concat( pts );\n\n\t\tconst curve = new SplineCurve( npts );\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.copy( pts[ pts.length - 1 ] );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an arc as an instance of {@link EllipseCurve} to the path, positioned relative\n\t * to the current point.\n\t *\n\t * @param {number} [aX=0] - The x coordinate of the center of the arc offsetted from the previous curve.\n\t * @param {number} [aY=0] - The y coordinate of the center of the arc offsetted from the previous curve.\n\t * @param {number} [aRadius=1] - The radius of the arc.\n\t * @param {number} [aStartAngle=0] - The start angle in radians.\n\t * @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.\n\t * @param {boolean} [aClockwise=false] - Whether to sweep the arc clockwise or not.\n\t * @return {Path} A reference to this path.\n\t */\n\tarc( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {\n\n\t\tconst x0 = this.currentPoint.x;\n\t\tconst y0 = this.currentPoint.y;\n\n\t\tthis.absarc( aX + x0, aY + y0, aRadius,\n\t\t\taStartAngle, aEndAngle, aClockwise );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an absolutely positioned arc as an instance of {@link EllipseCurve} to the path.\n\t *\n\t * @param {number} [aX=0] - The x coordinate of the center of the arc.\n\t * @param {number} [aY=0] - The y coordinate of the center of the arc.\n\t * @param {number} [aRadius=1] - The radius of the arc.\n\t * @param {number} [aStartAngle=0] - The start angle in radians.\n\t * @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.\n\t * @param {boolean} [aClockwise=false] - Whether to sweep the arc clockwise or not.\n\t * @return {Path} A reference to this path.\n\t */\n\tabsarc( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {\n\n\t\tthis.absellipse( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an ellipse as an instance of {@link EllipseCurve} to the path, positioned relative\n\t * to the current point\n\t *\n\t * @param {number} [aX=0] - The x coordinate of the center of the ellipse offsetted from the previous curve.\n\t * @param {number} [aY=0] - The y coordinate of the center of the ellipse offsetted from the previous curve.\n\t * @param {number} [xRadius=1] - The radius of the ellipse in the x axis.\n\t * @param {number} [yRadius=1] - The radius of the ellipse in the y axis.\n\t * @param {number} [aStartAngle=0] - The start angle in radians.\n\t * @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.\n\t * @param {boolean} [aClockwise=false] - Whether to sweep the ellipse clockwise or not.\n\t * @param {number} [aRotation=0] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.\n\t * @return {Path} A reference to this path.\n\t */\n\tellipse( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) {\n\n\t\tconst x0 = this.currentPoint.x;\n\t\tconst y0 = this.currentPoint.y;\n\n\t\tthis.absellipse( aX + x0, aY + y0, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an absolutely positioned ellipse as an instance of {@link EllipseCurve} to the path.\n\t *\n\t * @param {number} [aX=0] - The x coordinate of the absolute center of the ellipse.\n\t * @param {number} [aY=0] - The y coordinate of the absolute center of the ellipse.\n\t * @param {number} [xRadius=1] - The radius of the ellipse in the x axis.\n\t * @param {number} [yRadius=1] - The radius of the ellipse in the y axis.\n\t * @param {number} [aStartAngle=0] - The start angle in radians.\n\t * @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.\n\t * @param {boolean} [aClockwise=false] - Whether to sweep the ellipse clockwise or not.\n\t * @param {number} [aRotation=0] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.\n\t * @return {Path} A reference to this path.\n\t */\n\tabsellipse( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) {\n\n\t\tconst curve = new EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation );\n\n\t\tif ( this.curves.length \u003e 0 ) {\n\n\t\t\t// if a previous curve is present, attempt to join\n\t\t\tconst firstPoint = curve.getPoint( 0 );\n\n\t\t\tif ( ! firstPoint.equals( this.currentPoint ) ) {\n\n\t\t\t\tthis.lineTo( firstPoint.x, firstPoint.y );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.curves.push( curve );\n\n\t\tconst lastPoint = curve.getPoint( 1 );\n\t\tthis.currentPoint.copy( lastPoint );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.currentPoint.copy( source.currentPoint );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.currentPoint = this.currentPoint.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.currentPoint.fromArray( json.currentPoint );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * Defines an arbitrary 2d shape plane using paths with optional holes. It\n * can be used with {@link ExtrudeGeometry}, {@link ShapeGeometry}, to get\n * points, or to get triangulated faces.\n *\n * ```js\n * const heartShape = new THREE.Shape();\n *\n * heartShape.moveTo( 25, 25 );\n * heartShape.bezierCurveTo( 25, 25, 20, 0, 0, 0 );\n * heartShape.bezierCurveTo( - 30, 0, - 30, 35, - 30, 35 );\n * heartShape.bezierCurveTo( - 30, 55, - 10, 77, 25, 95 );\n * heartShape.bezierCurveTo( 60, 77, 80, 55, 80, 35 );\n * heartShape.bezierCurveTo( 80, 35, 80, 0, 50, 0 );\n * heartShape.bezierCurveTo( 35, 0, 25, 25, 25, 25 );\n *\n * const extrudeSettings = {\n * \tdepth: 8,\n * \tbevelEnabled: true,\n * \tbevelSegments: 2,\n * \tsteps: 2,\n * \tbevelSize: 1,\n * \tbevelThickness: 1\n * };\n *\n * const geometry = new THREE.ExtrudeGeometry( heartShape, extrudeSettings );\n * const mesh = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial() );\n * ```\n *\n * @augments Path\n */\nclass Shape extends Path {\n\n\t/**\n\t * Constructs a new shape.\n\t *\n\t * @param {Array\u003cVector2\u003e} [points] - An array of 2D points defining the shape.\n\t */\n\tconstructor( points ) {\n\n\t\tsuper( points );\n\n\t\t/**\n\t\t * The UUID of the shape.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.type = 'Shape';\n\n\t\t/**\n\t\t * Defines the holes in the shape. Hole definitions must use the\n\t\t * opposite winding order (CW/CCW) than the outer shape.\n\t\t *\n\t\t * @type {Array\u003cPath\u003e}\n\t\t * @readonly\n\t\t */\n\t\tthis.holes = [];\n\n\t}\n\n\t/**\n\t * Returns an array representing each contour of the holes\n\t * as a list of 2D points.\n\t *\n\t * @param {number} divisions - The fineness of the result.\n\t * @return {Array\u003cArray\u003cVector2\u003e\u003e} The holes as a series of 2D points.\n\t */\n\tgetPointsHoles( divisions ) {\n\n\t\tconst holesPts = [];\n\n\t\tfor ( let i = 0, l = this.holes.length; i \u003c l; i ++ ) {\n\n\t\t\tholesPts[ i ] = this.holes[ i ].getPoints( divisions );\n\n\t\t}\n\n\t\treturn holesPts;\n\n\t}\n\n\t// get points of shape and holes (keypoints based on segments parameter)\n\n\t/**\n\t * Returns an object that holds contour data for the shape and its holes as\n\t * arrays of 2D points.\n\t *\n\t * @param {number} divisions - The fineness of the result.\n\t * @return {{shape:Array\u003cVector2\u003e,holes:Array\u003cArray\u003cVector2\u003e\u003e}} An object with contour data.\n\t */\n\textractPoints( divisions ) {\n\n\t\treturn {\n\n\t\t\tshape: this.getPoints( divisions ),\n\t\t\tholes: this.getPointsHoles( divisions )\n\n\t\t};\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.holes = [];\n\n\t\tfor ( let i = 0, l = source.holes.length; i \u003c l; i ++ ) {\n\n\t\t\tconst hole = source.holes[ i ];\n\n\t\t\tthis.holes.push( hole.clone() );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.uuid = this.uuid;\n\t\tdata.holes = [];\n\n\t\tfor ( let i = 0, l = this.holes.length; i \u003c l; i ++ ) {\n\n\t\t\tconst hole = this.holes[ i ];\n\t\t\tdata.holes.push( hole.toJSON() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.uuid = json.uuid;\n\t\tthis.holes = [];\n\n\t\tfor ( let i = 0, l = json.holes.length; i \u003c l; i ++ ) {\n\n\t\t\tconst hole = json.holes[ i ];\n\t\t\tthis.holes.push( new Path().fromJSON( hole ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\n/* eslint-disable */\n// copy of mapbox/earcut version 3.0.2\n// https://github.com/mapbox/earcut/tree/v3.0.2\n\nfunction earcut(data, holeIndices, dim = 2) {\n\n    const hasHoles = holeIndices \u0026\u0026 holeIndices.length;\n    const outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n    let outerNode = linkedList(data, 0, outerLen, dim, true);\n    const triangles = [];\n\n    if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n    let minX, minY, invSize;\n\n    if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n    // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n    if (data.length \u003e 80 * dim) {\n        minX = data[0];\n        minY = data[1];\n        let maxX = minX;\n        let maxY = minY;\n\n        for (let i = dim; i \u003c outerLen; i += dim) {\n            const x = data[i];\n            const y = data[i + 1];\n            if (x \u003c minX) minX = x;\n            if (y \u003c minY) minY = y;\n            if (x \u003e maxX) maxX = x;\n            if (y \u003e maxY) maxY = y;\n        }\n\n        // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n        invSize = Math.max(maxX - minX, maxY - minY);\n        invSize = invSize !== 0 ? 32767 / invSize : 0;\n    }\n\n    earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);\n\n    return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n    let last;\n\n    if (clockwise === (signedArea(data, start, end, dim) \u003e 0)) {\n        for (let i = start; i \u003c end; i += dim) last = insertNode(i / dim | 0, data[i], data[i + 1], last);\n    } else {\n        for (let i = end - dim; i \u003e= start; i -= dim) last = insertNode(i / dim | 0, data[i], data[i + 1], last);\n    }\n\n    if (last \u0026\u0026 equals(last, last.next)) {\n        removeNode(last);\n        last = last.next;\n    }\n\n    return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n    if (!start) return start;\n    if (!end) end = start;\n\n    let p = start,\n        again;\n    do {\n        again = false;\n\n        if (!p.steiner \u0026\u0026 (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n            removeNode(p);\n            p = end = p.prev;\n            if (p === p.next) break;\n            again = true;\n\n        } else {\n            p = p.next;\n        }\n    } while (again || p !== end);\n\n    return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n    if (!ear) return;\n\n    // interlink polygon nodes in z-order\n    if (!pass \u0026\u0026 invSize) indexCurve(ear, minX, minY, invSize);\n\n    let stop = ear;\n\n    // iterate through ears, slicing them one by one\n    while (ear.prev !== ear.next) {\n        const prev = ear.prev;\n        const next = ear.next;\n\n        if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n            triangles.push(prev.i, ear.i, next.i); // cut off the triangle\n\n            removeNode(ear);\n\n            // skipping the next vertex leads to less sliver triangles\n            ear = next.next;\n            stop = next.next;\n\n            continue;\n        }\n\n        ear = next;\n\n        // if we looped through the whole remaining polygon and can't find any more ears\n        if (ear === stop) {\n            // try filtering points and slicing again\n            if (!pass) {\n                earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\n\n            // if this didn't work, try curing all small self-intersections locally\n            } else if (pass === 1) {\n                ear = cureLocalIntersections(filterPoints(ear), triangles);\n                earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\n\n            // as a last resort, try splitting the remaining polygon into two\n            } else if (pass === 2) {\n                splitEarcut(ear, triangles, dim, minX, minY, invSize);\n            }\n\n            break;\n        }\n    }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n    const a = ear.prev,\n        b = ear,\n        c = ear.next;\n\n    if (area(a, b, c) \u003e= 0) return false; // reflex, can't be an ear\n\n    // now make sure we don't have other points inside the potential ear\n    const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n    // triangle bbox\n    const x0 = Math.min(ax, bx, cx),\n        y0 = Math.min(ay, by, cy),\n        x1 = Math.max(ax, bx, cx),\n        y1 = Math.max(ay, by, cy);\n\n    let p = c.next;\n    while (p !== a) {\n        if (p.x \u003e= x0 \u0026\u0026 p.x \u003c= x1 \u0026\u0026 p.y \u003e= y0 \u0026\u0026 p.y \u003c= y1 \u0026\u0026\n            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) \u0026\u0026\n            area(p.prev, p, p.next) \u003e= 0) return false;\n        p = p.next;\n    }\n\n    return true;\n}\n\nfunction isEarHashed(ear, minX, minY, invSize) {\n    const a = ear.prev,\n        b = ear,\n        c = ear.next;\n\n    if (area(a, b, c) \u003e= 0) return false; // reflex, can't be an ear\n\n    const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n    // triangle bbox\n    const x0 = Math.min(ax, bx, cx),\n        y0 = Math.min(ay, by, cy),\n        x1 = Math.max(ax, bx, cx),\n        y1 = Math.max(ay, by, cy);\n\n    // z-order range for the current triangle bbox;\n    const minZ = zOrder(x0, y0, minX, minY, invSize),\n        maxZ = zOrder(x1, y1, minX, minY, invSize);\n\n    let p = ear.prevZ,\n        n = ear.nextZ;\n\n    // look for points inside the triangle in both directions\n    while (p \u0026\u0026 p.z \u003e= minZ \u0026\u0026 n \u0026\u0026 n.z \u003c= maxZ) {\n        if (p.x \u003e= x0 \u0026\u0026 p.x \u003c= x1 \u0026\u0026 p.y \u003e= y0 \u0026\u0026 p.y \u003c= y1 \u0026\u0026 p !== a \u0026\u0026 p !== c \u0026\u0026\n            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) \u0026\u0026 area(p.prev, p, p.next) \u003e= 0) return false;\n        p = p.prevZ;\n\n        if (n.x \u003e= x0 \u0026\u0026 n.x \u003c= x1 \u0026\u0026 n.y \u003e= y0 \u0026\u0026 n.y \u003c= y1 \u0026\u0026 n !== a \u0026\u0026 n !== c \u0026\u0026\n            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, n.x, n.y) \u0026\u0026 area(n.prev, n, n.next) \u003e= 0) return false;\n        n = n.nextZ;\n    }\n\n    // look for remaining points in decreasing z-order\n    while (p \u0026\u0026 p.z \u003e= minZ) {\n        if (p.x \u003e= x0 \u0026\u0026 p.x \u003c= x1 \u0026\u0026 p.y \u003e= y0 \u0026\u0026 p.y \u003c= y1 \u0026\u0026 p !== a \u0026\u0026 p !== c \u0026\u0026\n            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) \u0026\u0026 area(p.prev, p, p.next) \u003e= 0) return false;\n        p = p.prevZ;\n    }\n\n    // look for remaining points in increasing z-order\n    while (n \u0026\u0026 n.z \u003c= maxZ) {\n        if (n.x \u003e= x0 \u0026\u0026 n.x \u003c= x1 \u0026\u0026 n.y \u003e= y0 \u0026\u0026 n.y \u003c= y1 \u0026\u0026 n !== a \u0026\u0026 n !== c \u0026\u0026\n            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, n.x, n.y) \u0026\u0026 area(n.prev, n, n.next) \u003e= 0) return false;\n        n = n.nextZ;\n    }\n\n    return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles) {\n    let p = start;\n    do {\n        const a = p.prev,\n            b = p.next.next;\n\n        if (!equals(a, b) \u0026\u0026 intersects(a, p, p.next, b) \u0026\u0026 locallyInside(a, b) \u0026\u0026 locallyInside(b, a)) {\n\n            triangles.push(a.i, p.i, b.i);\n\n            // remove two nodes involved\n            removeNode(p);\n            removeNode(p.next);\n\n            p = start = b;\n        }\n        p = p.next;\n    } while (p !== start);\n\n    return filterPoints(p);\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n    // look for a valid diagonal that divides the polygon into two\n    let a = start;\n    do {\n        let b = a.next.next;\n        while (b !== a.prev) {\n            if (a.i !== b.i \u0026\u0026 isValidDiagonal(a, b)) {\n                // split the polygon in two by the diagonal\n                let c = splitPolygon(a, b);\n\n                // filter colinear points around the cuts\n                a = filterPoints(a, a.next);\n                c = filterPoints(c, c.next);\n\n                // run earcut on each half\n                earcutLinked(a, triangles, dim, minX, minY, invSize, 0);\n                earcutLinked(c, triangles, dim, minX, minY, invSize, 0);\n                return;\n            }\n            b = b.next;\n        }\n        a = a.next;\n    } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n    const queue = [];\n\n    for (let i = 0, len = holeIndices.length; i \u003c len; i++) {\n        const start = holeIndices[i] * dim;\n        const end = i \u003c len - 1 ? holeIndices[i + 1] * dim : data.length;\n        const list = linkedList(data, start, end, dim, false);\n        if (list === list.next) list.steiner = true;\n        queue.push(getLeftmost(list));\n    }\n\n    queue.sort(compareXYSlope);\n\n    // process holes from left to right\n    for (let i = 0; i \u003c queue.length; i++) {\n        outerNode = eliminateHole(queue[i], outerNode);\n    }\n\n    return outerNode;\n}\n\nfunction compareXYSlope(a, b) {\n    let result = a.x - b.x;\n    // when the left-most point of 2 holes meet at a vertex, sort the holes counterclockwise so that when we find\n    // the bridge to the outer shell is always the point that they meet at.\n    if (result === 0) {\n        result = a.y - b.y;\n        if (result === 0) {\n            const aSlope = (a.next.y - a.y) / (a.next.x - a.x);\n            const bSlope = (b.next.y - b.y) / (b.next.x - b.x);\n            result = aSlope - bSlope;\n        }\n    }\n    return result;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and link it\nfunction eliminateHole(hole, outerNode) {\n    const bridge = findHoleBridge(hole, outerNode);\n    if (!bridge) {\n        return outerNode;\n    }\n\n    const bridgeReverse = splitPolygon(bridge, hole);\n\n    // filter collinear points around the cuts\n    filterPoints(bridgeReverse, bridgeReverse.next);\n    return filterPoints(bridge, bridge.next);\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n    let p = outerNode;\n    const hx = hole.x;\n    const hy = hole.y;\n    let qx = -Infinity;\n    let m;\n\n    // find a segment intersected by a ray from the hole's leftmost point to the left;\n    // segment's endpoint with lesser x will be potential connection point\n    // unless they intersect at a vertex, then choose the vertex\n    if (equals(hole, p)) return p;\n    do {\n        if (equals(hole, p.next)) return p.next;\n        else if (hy \u003c= p.y \u0026\u0026 hy \u003e= p.next.y \u0026\u0026 p.next.y !== p.y) {\n            const x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n            if (x \u003c= hx \u0026\u0026 x \u003e qx) {\n                qx = x;\n                m = p.x \u003c p.next.x ? p : p.next;\n                if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint\n            }\n        }\n        p = p.next;\n    } while (p !== outerNode);\n\n    if (!m) return null;\n\n    // look for points inside the triangle of hole point, segment intersection and endpoint;\n    // if there are no points found, we have a valid connection;\n    // otherwise choose the point of the minimum angle with the ray as connection point\n\n    const stop = m;\n    const mx = m.x;\n    const my = m.y;\n    let tanMin = Infinity;\n\n    p = m;\n\n    do {\n        if (hx \u003e= p.x \u0026\u0026 p.x \u003e= mx \u0026\u0026 hx !== p.x \u0026\u0026\n                pointInTriangle(hy \u003c my ? hx : qx, hy, mx, my, hy \u003c my ? qx : hx, hy, p.x, p.y)) {\n\n            const tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n            if (locallyInside(p, hole) \u0026\u0026\n                (tan \u003c tanMin || (tan === tanMin \u0026\u0026 (p.x \u003e m.x || (p.x === m.x \u0026\u0026 sectorContainsSector(m, p)))))) {\n                m = p;\n                tanMin = tan;\n            }\n        }\n\n        p = p.next;\n    } while (p !== stop);\n\n    return m;\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector(m, p) {\n    return area(m.prev, m, p.prev) \u003c 0 \u0026\u0026 area(p.next, m, m.next) \u003c 0;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, invSize) {\n    let p = start;\n    do {\n        if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n        p.prevZ = p.prev;\n        p.nextZ = p.next;\n        p = p.next;\n    } while (p !== start);\n\n    p.prevZ.nextZ = null;\n    p.prevZ = null;\n\n    sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n    let numMerges;\n    let inSize = 1;\n\n    do {\n        let p = list;\n        let e;\n        list = null;\n        let tail = null;\n        numMerges = 0;\n\n        while (p) {\n            numMerges++;\n            let q = p;\n            let pSize = 0;\n            for (let i = 0; i \u003c inSize; i++) {\n                pSize++;\n                q = q.nextZ;\n                if (!q) break;\n            }\n            let qSize = inSize;\n\n            while (pSize \u003e 0 || (qSize \u003e 0 \u0026\u0026 q)) {\n\n                if (pSize !== 0 \u0026\u0026 (qSize === 0 || !q || p.z \u003c= q.z)) {\n                    e = p;\n                    p = p.nextZ;\n                    pSize--;\n                } else {\n                    e = q;\n                    q = q.nextZ;\n                    qSize--;\n                }\n\n                if (tail) tail.nextZ = e;\n                else list = e;\n\n                e.prevZ = tail;\n                tail = e;\n            }\n\n            p = q;\n        }\n\n        tail.nextZ = null;\n        inSize *= 2;\n\n    } while (numMerges \u003e 1);\n\n    return list;\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x, y, minX, minY, invSize) {\n    // coords are transformed into non-negative 15-bit integer range\n    x = (x - minX) * invSize | 0;\n    y = (y - minY) * invSize | 0;\n\n    x = (x | (x \u003c\u003c 8)) \u0026 0x00FF00FF;\n    x = (x | (x \u003c\u003c 4)) \u0026 0x0F0F0F0F;\n    x = (x | (x \u003c\u003c 2)) \u0026 0x33333333;\n    x = (x | (x \u003c\u003c 1)) \u0026 0x55555555;\n\n    y = (y | (y \u003c\u003c 8)) \u0026 0x00FF00FF;\n    y = (y | (y \u003c\u003c 4)) \u0026 0x0F0F0F0F;\n    y = (y | (y \u003c\u003c 2)) \u0026 0x33333333;\n    y = (y | (y \u003c\u003c 1)) \u0026 0x55555555;\n\n    return x | (y \u003c\u003c 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n    let p = start,\n        leftmost = start;\n    do {\n        if (p.x \u003c leftmost.x || (p.x === leftmost.x \u0026\u0026 p.y \u003c leftmost.y)) leftmost = p;\n        p = p.next;\n    } while (p !== start);\n\n    return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n    return (cx - px) * (ay - py) \u003e= (ax - px) * (cy - py) \u0026\u0026\n           (ax - px) * (by - py) \u003e= (bx - px) * (ay - py) \u0026\u0026\n           (bx - px) * (cy - py) \u003e= (cx - px) * (by - py);\n}\n\n// check if a point lies within a convex triangle but false if its equal to the first point of the triangle\nfunction pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, px, py) {\n    return !(ax === px \u0026\u0026 ay === py) \u0026\u0026 pointInTriangle(ax, ay, bx, by, cx, cy, px, py);\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n    return a.next.i !== b.i \u0026\u0026 a.prev.i !== b.i \u0026\u0026 !intersectsPolygon(a, b) \u0026\u0026 // doesn't intersect other edges\n           (locallyInside(a, b) \u0026\u0026 locallyInside(b, a) \u0026\u0026 middleInside(a, b) \u0026\u0026 // locally visible\n            (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n            equals(a, b) \u0026\u0026 area(a.prev, a, a.next) \u003e 0 \u0026\u0026 area(b.prev, b, b.next) \u003e 0); // special zero-length case\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n    return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n    return p1.x === p2.x \u0026\u0026 p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n    const o1 = sign(area(p1, q1, p2));\n    const o2 = sign(area(p1, q1, q2));\n    const o3 = sign(area(p2, q2, p1));\n    const o4 = sign(area(p2, q2, q1));\n\n    if (o1 !== o2 \u0026\u0026 o3 !== o4) return true; // general case\n\n    if (o1 === 0 \u0026\u0026 onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n    if (o2 === 0 \u0026\u0026 onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n    if (o3 === 0 \u0026\u0026 onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n    if (o4 === 0 \u0026\u0026 onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n    return false;\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment(p, q, r) {\n    return q.x \u003c= Math.max(p.x, r.x) \u0026\u0026 q.x \u003e= Math.min(p.x, r.x) \u0026\u0026 q.y \u003c= Math.max(p.y, r.y) \u0026\u0026 q.y \u003e= Math.min(p.y, r.y);\n}\n\nfunction sign(num) {\n    return num \u003e 0 ? 1 : num \u003c 0 ? -1 : 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n    let p = a;\n    do {\n        if (p.i !== a.i \u0026\u0026 p.next.i !== a.i \u0026\u0026 p.i !== b.i \u0026\u0026 p.next.i !== b.i \u0026\u0026\n                intersects(p, p.next, a, b)) return true;\n        p = p.next;\n    } while (p !== a);\n\n    return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n    return area(a.prev, a, a.next) \u003c 0 ?\n        area(a, b, a.next) \u003e= 0 \u0026\u0026 area(a, a.prev, b) \u003e= 0 :\n        area(a, b, a.prev) \u003c 0 || area(a, a.next, b) \u003c 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n    let p = a;\n    let inside = false;\n    const px = (a.x + b.x) / 2;\n    const py = (a.y + b.y) / 2;\n    do {\n        if (((p.y \u003e py) !== (p.next.y \u003e py)) \u0026\u0026 p.next.y !== p.y \u0026\u0026\n                (px \u003c (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n            inside = !inside;\n        p = p.next;\n    } while (p !== a);\n\n    return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n    const a2 = createNode(a.i, a.x, a.y),\n        b2 = createNode(b.i, b.x, b.y),\n        an = a.next,\n        bp = b.prev;\n\n    a.next = b;\n    b.prev = a;\n\n    a2.next = an;\n    an.prev = a2;\n\n    b2.next = a2;\n    a2.prev = b2;\n\n    bp.next = b2;\n    b2.prev = bp;\n\n    return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n    const p = createNode(i, x, y);\n\n    if (!last) {\n        p.prev = p;\n        p.next = p;\n\n    } else {\n        p.next = last.next;\n        p.prev = last;\n        last.next.prev = p;\n        last.next = p;\n    }\n    return p;\n}\n\nfunction removeNode(p) {\n    p.next.prev = p.prev;\n    p.prev.next = p.next;\n\n    if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n    if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction createNode(i, x, y) {\n    return {\n        i, // vertex index in coordinates array\n        x, y, // vertex coordinates\n        prev: null, // previous and next vertex nodes in a polygon ring\n        next: null,\n        z: 0, // z-order curve value\n        prevZ: null, // previous and next nodes in z-order\n        nextZ: null,\n        steiner: false // indicates whether this is a steiner point\n    };\n}\n\nfunction signedArea(data, start, end, dim) {\n    let sum = 0;\n    for (let i = start, j = end - dim; i \u003c end; i += dim) {\n        sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n        j = i;\n    }\n    return sum;\n}\n\n/**\n * An implementation of the earcut polygon triangulation algorithm.\n * The code is a port of [mapbox/earcut](https://github.com/mapbox/earcut).\n *\n * @see https://github.com/mapbox/earcut\n */\nclass Earcut {\n\n\t/**\n\t * Triangulates the given shape definition by returning an array of triangles.\n\t *\n\t * @param {Array\u003cnumber\u003e} data - An array with 2D points.\n\t * @param {Array\u003cnumber\u003e} holeIndices - An array with indices defining holes.\n\t * @param {number} [dim=2] - The number of coordinates per vertex in the input array.\n\t * @return {Array\u003cnumber\u003e} An array representing the triangulated faces. Each face is defined by three consecutive numbers\n\t * representing vertex indices.\n\t */\n\tstatic triangulate( data, holeIndices, dim = 2 ) {\n\n\t\treturn earcut( data, holeIndices, dim );\n\n\t}\n\n}\n\n/**\n * A class containing utility functions for shapes.\n *\n * @hideconstructor\n */\nclass ShapeUtils {\n\n\t/**\n\t * Calculate area of a ( 2D ) contour polygon.\n\t *\n\t * @param {Array\u003cVector2\u003e} contour - An array of 2D points.\n\t * @return {number} The area.\n\t */\n\tstatic area( contour ) {\n\n\t\tconst n = contour.length;\n\t\tlet a = 0.0;\n\n\t\tfor ( let p = n - 1, q = 0; q \u003c n; p = q ++ ) {\n\n\t\t\ta += contour[ p ].x * contour[ q ].y - contour[ q ].x * contour[ p ].y;\n\n\t\t}\n\n\t\treturn a * 0.5;\n\n\t}\n\n\t/**\n\t * Returns `true` if the given contour uses a clockwise winding order.\n\t *\n\t * @param {Array\u003cVector2\u003e} pts - An array of 2D points defining a polygon.\n\t * @return {boolean} Whether the given contour uses a clockwise winding order or not.\n\t */\n\tstatic isClockWise( pts ) {\n\n\t\treturn ShapeUtils.area( pts ) \u003c 0;\n\n\t}\n\n\t/**\n\t * Triangulates the given shape definition.\n\t *\n\t * @param {Array\u003cVector2\u003e} contour - An array of 2D points defining the contour.\n\t * @param {Array\u003cArray\u003cVector2\u003e\u003e} holes - An array that holds arrays of 2D points defining the holes.\n\t * @return {Array\u003cArray\u003cnumber\u003e\u003e} An array that holds for each face definition an array with three indices.\n\t */\n\tstatic triangulateShape( contour, holes ) {\n\n\t\tconst vertices = []; // flat array of vertices like [ x0,y0, x1,y1, x2,y2, ... ]\n\t\tconst holeIndices = []; // array of hole indices\n\t\tconst faces = []; // final array of vertex indices like [ [ a,b,d ], [ b,c,d ] ]\n\n\t\tremoveDupEndPts( contour );\n\t\taddContour( vertices, contour );\n\n\t\t//\n\n\t\tlet holeIndex = contour.length;\n\n\t\tholes.forEach( removeDupEndPts );\n\n\t\tfor ( let i = 0; i \u003c holes.length; i ++ ) {\n\n\t\t\tholeIndices.push( holeIndex );\n\t\t\tholeIndex += holes[ i ].length;\n\t\t\taddContour( vertices, holes[ i ] );\n\n\t\t}\n\n\t\t//\n\n\t\tconst triangles = Earcut.triangulate( vertices, holeIndices );\n\n\t\t//\n\n\t\tfor ( let i = 0; i \u003c triangles.length; i += 3 ) {\n\n\t\t\tfaces.push( triangles.slice( i, i + 3 ) );\n\n\t\t}\n\n\t\treturn faces;\n\n\t}\n\n}\n\nfunction removeDupEndPts( points ) {\n\n\tconst l = points.length;\n\n\tif ( l \u003e 2 \u0026\u0026 points[ l - 1 ].equals( points[ 0 ] ) ) {\n\n\t\tpoints.pop();\n\n\t}\n\n}\n\nfunction addContour( vertices, contour ) {\n\n\tfor ( let i = 0; i \u003c contour.length; i ++ ) {\n\n\t\tvertices.push( contour[ i ].x );\n\t\tvertices.push( contour[ i ].y );\n\n\t}\n\n}\n\n/**\n * Creates extruded geometry from a path shape.\n *\n * ```js\n * const length = 12, width = 8;\n *\n * const shape = new THREE.Shape();\n * shape.moveTo( 0,0 );\n * shape.lineTo( 0, width );\n * shape.lineTo( length, width );\n * shape.lineTo( length, 0 );\n * shape.lineTo( 0, 0 );\n *\n * const geometry = new THREE.ExtrudeGeometry( shape );\n * const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );\n * const mesh = new THREE.Mesh( geometry, material ) ;\n * scene.add( mesh );\n * ```\n *\n * @augments BufferGeometry\n * @demo scenes/geometry-browser.html#ExtrudeGeometry\n */\nclass ExtrudeGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new extrude geometry.\n\t *\n\t * @param {Shape|Array\u003cShape\u003e} [shapes] - A shape or an array of shapes.\n\t * @param {ExtrudeGeometry~Options} [options] - The extrude settings.\n\t */\n\tconstructor( shapes = new Shape( [ new Vector2( 0.5, 0.5 ), new Vector2( -0.5, 0.5 ), new Vector2( -0.5, -0.5 ), new Vector2( 0.5, -0.5 ) ] ), options = {} ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'ExtrudeGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tshapes: shapes,\n\t\t\toptions: options\n\t\t};\n\n\t\tshapes = Array.isArray( shapes ) ? shapes : [ shapes ];\n\n\t\tconst scope = this;\n\n\t\tconst verticesArray = [];\n\t\tconst uvArray = [];\n\n\t\tfor ( let i = 0, l = shapes.length; i \u003c l; i ++ ) {\n\n\t\t\tconst shape = shapes[ i ];\n\t\t\taddShape( shape );\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( verticesArray, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvArray, 2 ) );\n\n\t\tthis.computeVertexNormals();\n\n\t\t// functions\n\n\t\tfunction addShape( shape ) {\n\n\t\t\tconst placeholder = [];\n\n\t\t\t// options\n\n\t\t\tconst curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12;\n\t\t\tconst steps = options.steps !== undefined ? options.steps : 1;\n\t\t\tconst depth = options.depth !== undefined ? options.depth : 1;\n\n\t\t\tlet bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true;\n\t\t\tlet bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 0.2;\n\t\t\tlet bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 0.1;\n\t\t\tlet bevelOffset = options.bevelOffset !== undefined ? options.bevelOffset : 0;\n\t\t\tlet bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3;\n\n\t\t\tconst extrudePath = options.extrudePath;\n\n\t\t\tconst uvgen = options.UVGenerator !== undefined ? options.UVGenerator : WorldUVGenerator;\n\n\t\t\t//\n\n\t\t\tlet extrudePts, extrudeByPath = false;\n\t\t\tlet splineTube, binormal, normal, position2;\n\n\t\t\tif ( extrudePath ) {\n\n\t\t\t\textrudePts = extrudePath.getSpacedPoints( steps );\n\n\t\t\t\textrudeByPath = true;\n\t\t\t\tbevelEnabled = false; // bevels not supported for path extrusion\n\n\t\t\t\t// SETUP TNB variables\n\n\t\t\t\tconst isClosed = extrudePath.isCatmullRomCurve3 ? extrudePath.closed : false;\n\n\t\t\t\tsplineTube = extrudePath.computeFrenetFrames( steps, isClosed );\n\n\t\t\t\t// log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length);\n\n\t\t\t\tbinormal = new Vector3();\n\t\t\t\tnormal = new Vector3();\n\t\t\t\tposition2 = new Vector3();\n\n\t\t\t}\n\n\t\t\t// Safeguards if bevels are not enabled\n\n\t\t\tif ( ! bevelEnabled ) {\n\n\t\t\t\tbevelSegments = 0;\n\t\t\t\tbevelThickness = 0;\n\t\t\t\tbevelSize = 0;\n\t\t\t\tbevelOffset = 0;\n\n\t\t\t}\n\n\t\t\t// Variables initialization\n\n\t\t\tconst shapePoints = shape.extractPoints( curveSegments );\n\n\t\t\tlet vertices = shapePoints.shape;\n\t\t\tconst holes = shapePoints.holes;\n\n\t\t\tconst reverse = ! ShapeUtils.isClockWise( vertices );\n\n\t\t\tif ( reverse ) {\n\n\t\t\t\tvertices = vertices.reverse();\n\n\t\t\t\t// Maybe we should also check if holes are in the opposite direction, just to be safe ...\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h \u003c hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\n\t\t\t\t\tif ( ShapeUtils.isClockWise( ahole ) ) {\n\n\t\t\t\t\t\tholes[ h ] = ahole.reverse();\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t/**Merges index-adjacent points that are within a threshold distance of each other. Array is modified in-place. Threshold distance is empirical, and scaled based on the magnitude of point coordinates.\n\t\t\t * @param {Array\u003cVector2\u003e} points\n\t\t\t*/\n\t\t\tfunction mergeOverlappingPoints( points ) {\n\n\t\t\t\tconst THRESHOLD = 1e-10;\n\t\t\t\tconst THRESHOLD_SQ = THRESHOLD * THRESHOLD;\n\t\t\t\tlet prevPos = points[ 0 ];\n\t\t\t\tfor ( let i = 1; i \u003c= points.length; i ++ ) {\n\n\t\t\t\t\tconst currentIndex = i % points.length;\n\t\t\t\t\tconst currentPos = points[ currentIndex ];\n\t\t\t\t\tconst dx = currentPos.x - prevPos.x;\n\t\t\t\t\tconst dy = currentPos.y - prevPos.y;\n\t\t\t\t\tconst distSq = dx * dx + dy * dy;\n\n\t\t\t\t\tconst scalingFactorSqrt = Math.max(\n\t\t\t\t\t\tMath.abs( currentPos.x ),\n\t\t\t\t\t\tMath.abs( currentPos.y ),\n\t\t\t\t\t\tMath.abs( prevPos.x ),\n\t\t\t\t\t\tMath.abs( prevPos.y )\n\t\t\t\t\t);\n\t\t\t\t\tconst thresholdSqScaled = THRESHOLD_SQ * scalingFactorSqrt * scalingFactorSqrt;\n\t\t\t\t\tif ( distSq \u003c= thresholdSqScaled ) {\n\n\t\t\t\t\t\tpoints.splice( currentIndex, 1 );\n\t\t\t\t\t\ti --;\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tprevPos = currentPos;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tmergeOverlappingPoints( vertices );\n\t\t\tholes.forEach( mergeOverlappingPoints );\n\n\t\t\tconst numHoles = holes.length;\n\n\t\t\t/* Vertices */\n\n\t\t\tconst contour = vertices; // vertices has all points but contour has only points of circumference\n\n\t\t\tfor ( let h = 0; h \u003c numHoles; h ++ ) {\n\n\t\t\t\tconst ahole = holes[ h ];\n\n\t\t\t\tvertices = vertices.concat( ahole );\n\n\t\t\t}\n\n\n\t\t\tfunction scalePt2( pt, vec, size ) {\n\n\t\t\t\tif ( ! vec ) error( 'ExtrudeGeometry: vec does not exist' );\n\n\t\t\t\treturn pt.clone().addScaledVector( vec, size );\n\n\t\t\t}\n\n\t\t\tconst vlen = vertices.length;\n\n\n\t\t\t// Find directions for point movement\n\n\n\t\t\tfunction getBevelVec( inPt, inPrev, inNext ) {\n\n\t\t\t\t// computes for inPt the corresponding point inPt' on a new contour\n\t\t\t\t//   shifted by 1 unit (length of normalized vector) to the left\n\t\t\t\t// if we walk along contour clockwise, this new contour is outside the old one\n\t\t\t\t//\n\t\t\t\t// inPt' is the intersection of the two lines parallel to the two\n\t\t\t\t//  adjacent edges of inPt at a distance of 1 unit on the left side.\n\n\t\t\t\tlet v_trans_x, v_trans_y, shrink_by; // resulting translation vector for inPt\n\n\t\t\t\t// good reading for geometry algorithms (here: line-line intersection)\n\t\t\t\t// http://geomalgorithms.com/a05-_intersect-1.html\n\n\t\t\t\tconst v_prev_x = inPt.x - inPrev.x,\n\t\t\t\t\tv_prev_y = inPt.y - inPrev.y;\n\t\t\t\tconst v_next_x = inNext.x - inPt.x,\n\t\t\t\t\tv_next_y = inNext.y - inPt.y;\n\n\t\t\t\tconst v_prev_lensq = ( v_prev_x * v_prev_x + v_prev_y * v_prev_y );\n\n\t\t\t\t// check for collinear edges\n\t\t\t\tconst collinear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x );\n\n\t\t\t\tif ( Math.abs( collinear0 ) \u003e Number.EPSILON ) {\n\n\t\t\t\t\t// not collinear\n\n\t\t\t\t\t// length of vectors for normalizing\n\n\t\t\t\t\tconst v_prev_len = Math.sqrt( v_prev_lensq );\n\t\t\t\t\tconst v_next_len = Math.sqrt( v_next_x * v_next_x + v_next_y * v_next_y );\n\n\t\t\t\t\t// shift adjacent points by unit vectors to the left\n\n\t\t\t\t\tconst ptPrevShift_x = ( inPrev.x - v_prev_y / v_prev_len );\n\t\t\t\t\tconst ptPrevShift_y = ( inPrev.y + v_prev_x / v_prev_len );\n\n\t\t\t\t\tconst ptNextShift_x = ( inNext.x - v_next_y / v_next_len );\n\t\t\t\t\tconst ptNextShift_y = ( inNext.y + v_next_x / v_next_len );\n\n\t\t\t\t\t// scaling factor for v_prev to intersection point\n\n\t\t\t\t\tconst sf = ( ( ptNextShift_x - ptPrevShift_x ) * v_next_y -\n\t\t\t\t\t\t\t( ptNextShift_y - ptPrevShift_y ) * v_next_x ) /\n\t\t\t\t\t\t( v_prev_x * v_next_y - v_prev_y * v_next_x );\n\n\t\t\t\t\t// vector from inPt to intersection point\n\n\t\t\t\t\tv_trans_x = ( ptPrevShift_x + v_prev_x * sf - inPt.x );\n\t\t\t\t\tv_trans_y = ( ptPrevShift_y + v_prev_y * sf - inPt.y );\n\n\t\t\t\t\t// Don't normalize!, otherwise sharp corners become ugly\n\t\t\t\t\t//  but prevent crazy spikes\n\t\t\t\t\tconst v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y );\n\t\t\t\t\tif ( v_trans_lensq \u003c= 2 ) {\n\n\t\t\t\t\t\treturn new Vector2( v_trans_x, v_trans_y );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tshrink_by = Math.sqrt( v_trans_lensq / 2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// handle special case of collinear edges\n\n\t\t\t\t\tlet direction_eq = false; // assumes: opposite\n\n\t\t\t\t\tif ( v_prev_x \u003e Number.EPSILON ) {\n\n\t\t\t\t\t\tif ( v_next_x \u003e Number.EPSILON ) {\n\n\t\t\t\t\t\t\tdirection_eq = true;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( v_prev_x \u003c - Number.EPSILON ) {\n\n\t\t\t\t\t\t\tif ( v_next_x \u003c - Number.EPSILON ) {\n\n\t\t\t\t\t\t\t\tdirection_eq = true;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( Math.sign( v_prev_y ) === Math.sign( v_next_y ) ) {\n\n\t\t\t\t\t\t\t\tdirection_eq = true;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( direction_eq ) {\n\n\t\t\t\t\t\t// log(\"Warning: lines are a straight sequence\");\n\t\t\t\t\t\tv_trans_x = - v_prev_y;\n\t\t\t\t\t\tv_trans_y = v_prev_x;\n\t\t\t\t\t\tshrink_by = Math.sqrt( v_prev_lensq );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// log(\"Warning: lines are a straight spike\");\n\t\t\t\t\t\tv_trans_x = v_prev_x;\n\t\t\t\t\t\tv_trans_y = v_prev_y;\n\t\t\t\t\t\tshrink_by = Math.sqrt( v_prev_lensq / 2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn new Vector2( v_trans_x / shrink_by, v_trans_y / shrink_by );\n\n\t\t\t}\n\n\n\t\t\tconst contourMovements = [];\n\n\t\t\tfor ( let i = 0, il = contour.length, j = il - 1, k = i + 1; i \u003c il; i ++, j ++, k ++ ) {\n\n\t\t\t\tif ( j === il ) j = 0;\n\t\t\t\tif ( k === il ) k = 0;\n\n\t\t\t\t//  (j)---(i)---(k)\n\t\t\t\t// log('i,j,k', i, j , k)\n\n\t\t\t\tcontourMovements[ i ] = getBevelVec( contour[ i ], contour[ j ], contour[ k ] );\n\n\t\t\t}\n\n\t\t\tconst holesMovements = [];\n\t\t\tlet oneHoleMovements, verticesMovements = contourMovements.concat();\n\n\t\t\tfor ( let h = 0, hl = numHoles; h \u003c hl; h ++ ) {\n\n\t\t\t\tconst ahole = holes[ h ];\n\n\t\t\t\toneHoleMovements = [];\n\n\t\t\t\tfor ( let i = 0, il = ahole.length, j = il - 1, k = i + 1; i \u003c il; i ++, j ++, k ++ ) {\n\n\t\t\t\t\tif ( j === il ) j = 0;\n\t\t\t\t\tif ( k === il ) k = 0;\n\n\t\t\t\t\t//  (j)---(i)---(k)\n\t\t\t\t\toneHoleMovements[ i ] = getBevelVec( ahole[ i ], ahole[ j ], ahole[ k ] );\n\n\t\t\t\t}\n\n\t\t\t\tholesMovements.push( oneHoleMovements );\n\t\t\t\tverticesMovements = verticesMovements.concat( oneHoleMovements );\n\n\t\t\t}\n\n\t\t\tlet faces;\n\n\t\t\tif ( bevelSegments === 0 ) {\n\n\t\t\t\tfaces = ShapeUtils.triangulateShape( contour, holes );\n\n\t\t\t} else {\n\n\t\t\t\tconst contractedContourVertices = [];\n\t\t\t\tconst expandedHoleVertices = [];\n\n\t\t\t\t// Loop bevelSegments, 1 for the front, 1 for the back\n\n\t\t\t\tfor ( let b = 0; b \u003c bevelSegments; b ++ ) {\n\n\t\t\t\t\t//for ( b = bevelSegments; b \u003e 0; b -- ) {\n\n\t\t\t\t\tconst t = b / bevelSegments;\n\t\t\t\t\tconst z = bevelThickness * Math.cos( t * Math.PI / 2 );\n\t\t\t\t\tconst bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset;\n\n\t\t\t\t\t// contract shape\n\n\t\t\t\t\tfor ( let i = 0, il = contour.length; i \u003c il; i ++ ) {\n\n\t\t\t\t\t\tconst vert = scalePt2( contour[ i ], contourMovements[ i ], bs );\n\n\t\t\t\t\t\tv( vert.x, vert.y, - z );\n\t\t\t\t\t\tif ( t === 0 ) contractedContourVertices.push( vert );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// expand holes\n\n\t\t\t\t\tfor ( let h = 0, hl = numHoles; h \u003c hl; h ++ ) {\n\n\t\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\t\toneHoleMovements = holesMovements[ h ];\n\t\t\t\t\t\tconst oneHoleVertices = [];\n\t\t\t\t\t\tfor ( let i = 0, il = ahole.length; i \u003c il; i ++ ) {\n\n\t\t\t\t\t\t\tconst vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs );\n\n\t\t\t\t\t\t\tv( vert.x, vert.y, - z );\n\t\t\t\t\t\t\tif ( t === 0 ) oneHoleVertices.push( vert );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( t === 0 ) expandedHoleVertices.push( oneHoleVertices );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tfaces = ShapeUtils.triangulateShape( contractedContourVertices, expandedHoleVertices );\n\n\t\t\t}\n\n\t\t\tconst flen = faces.length;\n\n\t\t\tconst bs = bevelSize + bevelOffset;\n\n\t\t\t// Back facing vertices\n\n\t\t\tfor ( let i = 0; i \u003c vlen; i ++ ) {\n\n\t\t\t\tconst vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ];\n\n\t\t\t\tif ( ! extrudeByPath ) {\n\n\t\t\t\t\tv( vert.x, vert.y, 0 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x );\n\n\t\t\t\t\tnormal.copy( splineTube.normals[ 0 ] ).multiplyScalar( vert.x );\n\t\t\t\t\tbinormal.copy( splineTube.binormals[ 0 ] ).multiplyScalar( vert.y );\n\n\t\t\t\t\tposition2.copy( extrudePts[ 0 ] ).add( normal ).add( binormal );\n\n\t\t\t\t\tv( position2.x, position2.y, position2.z );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Add stepped vertices...\n\t\t\t// Including front facing vertices\n\n\t\t\tfor ( let s = 1; s \u003c= steps; s ++ ) {\n\n\t\t\t\tfor ( let i = 0; i \u003c vlen; i ++ ) {\n\n\t\t\t\t\tconst vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ];\n\n\t\t\t\t\tif ( ! extrudeByPath ) {\n\n\t\t\t\t\t\tv( vert.x, vert.y, depth / steps * s );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x );\n\n\t\t\t\t\t\tnormal.copy( splineTube.normals[ s ] ).multiplyScalar( vert.x );\n\t\t\t\t\t\tbinormal.copy( splineTube.binormals[ s ] ).multiplyScalar( vert.y );\n\n\t\t\t\t\t\tposition2.copy( extrudePts[ s ] ).add( normal ).add( binormal );\n\n\t\t\t\t\t\tv( position2.x, position2.y, position2.z );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t\t// Add bevel segments planes\n\n\t\t\t//for ( b = 1; b \u003c= bevelSegments; b ++ ) {\n\t\t\tfor ( let b = bevelSegments - 1; b \u003e= 0; b -- ) {\n\n\t\t\t\tconst t = b / bevelSegments;\n\t\t\t\tconst z = bevelThickness * Math.cos( t * Math.PI / 2 );\n\t\t\t\tconst bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset;\n\n\t\t\t\t// contract shape\n\n\t\t\t\tfor ( let i = 0, il = contour.length; i \u003c il; i ++ ) {\n\n\t\t\t\t\tconst vert = scalePt2( contour[ i ], contourMovements[ i ], bs );\n\t\t\t\t\tv( vert.x, vert.y, depth + z );\n\n\t\t\t\t}\n\n\t\t\t\t// expand holes\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h \u003c hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\toneHoleMovements = holesMovements[ h ];\n\n\t\t\t\t\tfor ( let i = 0, il = ahole.length; i \u003c il; i ++ ) {\n\n\t\t\t\t\t\tconst vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs );\n\n\t\t\t\t\t\tif ( ! extrudeByPath ) {\n\n\t\t\t\t\t\t\tv( vert.x, vert.y, depth + z );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tv( vert.x, vert.y + extrudePts[ steps - 1 ].y, extrudePts[ steps - 1 ].x + z );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t/* Faces */\n\n\t\t\t// Top and bottom faces\n\n\t\t\tbuildLidFaces();\n\n\t\t\t// Sides faces\n\n\t\t\tbuildSideFaces();\n\n\n\t\t\t/////  Internal functions\n\n\t\t\tfunction buildLidFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\n\t\t\t\tif ( bevelEnabled ) {\n\n\t\t\t\t\tlet layer = 0; // steps + 1\n\t\t\t\t\tlet offset = vlen * layer;\n\n\t\t\t\t\t// Bottom faces\n\n\t\t\t\t\tfor ( let i = 0; i \u003c flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 2 ] + offset, face[ 1 ] + offset, face[ 0 ] + offset );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tlayer = steps + bevelSegments * 2;\n\t\t\t\t\toffset = vlen * layer;\n\n\t\t\t\t\t// Top faces\n\n\t\t\t\t\tfor ( let i = 0; i \u003c flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Bottom faces\n\n\t\t\t\t\tfor ( let i = 0; i \u003c flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 2 ], face[ 1 ], face[ 0 ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Top faces\n\n\t\t\t\t\tfor ( let i = 0; i \u003c flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 0 );\n\n\t\t\t}\n\n\t\t\t// Create faces for the z-sides of the shape\n\n\t\t\tfunction buildSideFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\tlet layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h \u003c hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}\n\n\t\t\tfunction sidewalls( contour, layeroffset ) {\n\n\t\t\t\tlet i = contour.length;\n\n\t\t\t\twhile ( -- i \u003e= 0 ) {\n\n\t\t\t\t\tconst j = i;\n\t\t\t\t\tlet k = i - 1;\n\t\t\t\t\tif ( k \u003c 0 ) k = contour.length - 1;\n\n\t\t\t\t\t//log('b', i,j, i-1, k,vertices.length);\n\n\t\t\t\t\tfor ( let s = 0, sl = ( steps + bevelSegments * 2 ); s \u003c sl; s ++ ) {\n\n\t\t\t\t\t\tconst slen1 = vlen * s;\n\t\t\t\t\t\tconst slen2 = vlen * ( s + 1 );\n\n\t\t\t\t\t\tconst a = layeroffset + j + slen1,\n\t\t\t\t\t\t\tb = layeroffset + k + slen1,\n\t\t\t\t\t\t\tc = layeroffset + k + slen2,\n\t\t\t\t\t\t\td = layeroffset + j + slen2;\n\n\t\t\t\t\t\tf4( a, b, c, d );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfunction v( x, y, z ) {\n\n\t\t\t\tplaceholder.push( x );\n\t\t\t\tplaceholder.push( y );\n\t\t\t\tplaceholder.push( z );\n\n\t\t\t}\n\n\n\t\t\tfunction f3( a, b, c ) {\n\n\t\t\t\taddVertex( a );\n\t\t\t\taddVertex( b );\n\t\t\t\taddVertex( c );\n\n\t\t\t\tconst nextIndex = verticesArray.length / 3;\n\t\t\t\tconst uvs = uvgen.generateTopUV( scope, verticesArray, nextIndex - 3, nextIndex - 2, nextIndex - 1 );\n\n\t\t\t\taddUV( uvs[ 0 ] );\n\t\t\t\taddUV( uvs[ 1 ] );\n\t\t\t\taddUV( uvs[ 2 ] );\n\n\t\t\t}\n\n\t\t\tfunction f4( a, b, c, d ) {\n\n\t\t\t\taddVertex( a );\n\t\t\t\taddVertex( b );\n\t\t\t\taddVertex( d );\n\n\t\t\t\taddVertex( b );\n\t\t\t\taddVertex( c );\n\t\t\t\taddVertex( d );\n\n\n\t\t\t\tconst nextIndex = verticesArray.length / 3;\n\t\t\t\tconst uvs = uvgen.generateSideWallUV( scope, verticesArray, nextIndex - 6, nextIndex - 3, nextIndex - 2, nextIndex - 1 );\n\n\t\t\t\taddUV( uvs[ 0 ] );\n\t\t\t\taddUV( uvs[ 1 ] );\n\t\t\t\taddUV( uvs[ 3 ] );\n\n\t\t\t\taddUV( uvs[ 1 ] );\n\t\t\t\taddUV( uvs[ 2 ] );\n\t\t\t\taddUV( uvs[ 3 ] );\n\n\t\t\t}\n\n\t\t\tfunction addVertex( index ) {\n\n\t\t\t\tverticesArray.push( placeholder[ index * 3 + 0 ] );\n\t\t\t\tverticesArray.push( placeholder[ index * 3 + 1 ] );\n\t\t\t\tverticesArray.push( placeholder[ index * 3 + 2 ] );\n\n\t\t\t}\n\n\n\t\t\tfunction addUV( vector2 ) {\n\n\t\t\t\tuvArray.push( vector2.x );\n\t\t\t\tuvArray.push( vector2.y );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tconst shapes = this.parameters.shapes;\n\t\tconst options = this.parameters.options;\n\n\t\treturn toJSON$1( shapes, options, data );\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @param {Array\u003cShape\u003e} shapes - An array of shapes.\n\t * @return {ExtrudeGeometry} A new instance.\n\t */\n\tstatic fromJSON( data, shapes ) {\n\n\t\tconst geometryShapes = [];\n\n\t\tfor ( let j = 0, jl = data.shapes.length; j \u003c jl; j ++ ) {\n\n\t\t\tconst shape = shapes[ data.shapes[ j ] ];\n\n\t\t\tgeometryShapes.push( shape );\n\n\t\t}\n\n\t\tconst extrudePath = data.options.extrudePath;\n\n\t\tif ( extrudePath !== undefined ) {\n\n\t\t\tdata.options.extrudePath = new Curves[ extrudePath.type ]().fromJSON( extrudePath );\n\n\t\t}\n\n\t\treturn new ExtrudeGeometry( geometryShapes, data.options );\n\n\t}\n\n}\n\nconst WorldUVGenerator = {\n\n\tgenerateTopUV: function ( geometry, vertices, indexA, indexB, indexC ) {\n\n\t\tconst a_x = vertices[ indexA * 3 ];\n\t\tconst a_y = vertices[ indexA * 3 + 1 ];\n\t\tconst b_x = vertices[ indexB * 3 ];\n\t\tconst b_y = vertices[ indexB * 3 + 1 ];\n\t\tconst c_x = vertices[ indexC * 3 ];\n\t\tconst c_y = vertices[ indexC * 3 + 1 ];\n\n\t\treturn [\n\t\t\tnew Vector2( a_x, a_y ),\n\t\t\tnew Vector2( b_x, b_y ),\n\t\t\tnew Vector2( c_x, c_y )\n\t\t];\n\n\t},\n\n\tgenerateSideWallUV: function ( geometry, vertices, indexA, indexB, indexC, indexD ) {\n\n\t\tconst a_x = vertices[ indexA * 3 ];\n\t\tconst a_y = vertices[ indexA * 3 + 1 ];\n\t\tconst a_z = vertices[ indexA * 3 + 2 ];\n\t\tconst b_x = vertices[ indexB * 3 ];\n\t\tconst b_y = vertices[ indexB * 3 + 1 ];\n\t\tconst b_z = vertices[ indexB * 3 + 2 ];\n\t\tconst c_x = vertices[ indexC * 3 ];\n\t\tconst c_y = vertices[ indexC * 3 + 1 ];\n\t\tconst c_z = vertices[ indexC * 3 + 2 ];\n\t\tconst d_x = vertices[ indexD * 3 ];\n\t\tconst d_y = vertices[ indexD * 3 + 1 ];\n\t\tconst d_z = vertices[ indexD * 3 + 2 ];\n\n\t\tif ( Math.abs( a_y - b_y ) \u003c Math.abs( a_x - b_x ) ) {\n\n\t\t\treturn [\n\t\t\t\tnew Vector2( a_x, 1 - a_z ),\n\t\t\t\tnew Vector2( b_x, 1 - b_z ),\n\t\t\t\tnew Vector2( c_x, 1 - c_z ),\n\t\t\t\tnew Vector2( d_x, 1 - d_z )\n\t\t\t];\n\n\t\t} else {\n\n\t\t\treturn [\n\t\t\t\tnew Vector2( a_y, 1 - a_z ),\n\t\t\t\tnew Vector2( b_y, 1 - b_z ),\n\t\t\t\tnew Vector2( c_y, 1 - c_z ),\n\t\t\t\tnew Vector2( d_y, 1 - d_z )\n\t\t\t];\n\n\t\t}\n\n\t}\n\n};\n\nfunction toJSON$1( shapes, options, data ) {\n\n\tdata.shapes = [];\n\n\tif ( Array.isArray( shapes ) ) {\n\n\t\tfor ( let i = 0, l = shapes.length; i \u003c l; i ++ ) {\n\n\t\t\tconst shape = shapes[ i ];\n\n\t\t\tdata.shapes.push( shape.uuid );\n\n\t\t}\n\n\t} else {\n\n\t\tdata.shapes.push( shapes.uuid );\n\n\t}\n\n\tdata.options = Object.assign( {}, options );\n\n\tif ( options.extrudePath !== undefined ) data.options.extrudePath = options.extrudePath.toJSON();\n\n\treturn data;\n\n}\n\n/**\n * A geometry class for representing an icosahedron.\n *\n * ```js\n * const geometry = new THREE.IcosahedronGeometry();\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const icosahedron = new THREE.Mesh( geometry, material );\n * scene.add( icosahedron );\n * ```\n *\n * @augments PolyhedronGeometry\n * @demo scenes/geometry-browser.html#IcosahedronGeometry\n */\nclass IcosahedronGeometry extends PolyhedronGeometry {\n\n\t/**\n\t * Constructs a new icosahedron geometry.\n\t *\n\t * @param {number} [radius=1] - Radius of the icosahedron.\n\t * @param {number} [detail=0] - Setting this to a value greater than `0` adds vertices making it no longer a icosahedron.\n\t */\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst t = ( 1 + Math.sqrt( 5 ) ) / 2;\n\n\t\tconst vertices = [\n\t\t\t-1, t, 0, \t1, t, 0, \t-1, - t, 0, \t1, - t, 0,\n\t\t\t0, -1, t, \t0, 1, t,\t0, -1, - t, \t0, 1, - t,\n\t\t\tt, 0, -1, \tt, 0, 1, \t- t, 0, -1, \t- t, 0, 1\n\t\t];\n\n\t\tconst indices = [\n\t\t\t0, 11, 5, \t0, 5, 1, \t0, 1, 7, \t0, 7, 10, \t0, 10, 11,\n\t\t\t1, 5, 9, \t5, 11, 4,\t11, 10, 2,\t10, 7, 6,\t7, 1, 8,\n\t\t\t3, 9, 4, \t3, 4, 2,\t3, 2, 6,\t3, 6, 8,\t3, 8, 9,\n\t\t\t4, 9, 5, \t2, 4, 11,\t6, 2, 10,\t8, 6, 7,\t9, 8, 1\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'IcosahedronGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {IcosahedronGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new IcosahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\n/**\n * Creates meshes with axial symmetry like vases. The lathe rotates around the Y axis.\n *\n * ```js\n * const points = [];\n * for ( let i = 0; i \u003c 10; i ++ ) {\n * \tpoints.push( new THREE.Vector2( Math.sin( i * 0.2 ) * 10 + 5, ( i - 5 ) * 2 ) );\n * }\n * const geometry = new THREE.LatheGeometry( points );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const lathe = new THREE.Mesh( geometry, material );\n * scene.add( lathe );\n * ```\n *\n * @augments BufferGeometry\n * @demo scenes/geometry-browser.html#LatheGeometry\n */\nclass LatheGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new lathe geometry.\n\t *\n\t * @param {Array\u003cVector2|Vector3\u003e} [points] - An array of points in 2D space. The x-coordinate of each point\n\t * must be greater than zero.\n\t * @param {number} [segments=12] - The number of circumference segments to generate.\n\t * @param {number} [phiStart=0] - The starting angle in radians.\n\t * @param {number} [phiLength=Math.PI*2] - The radian (0 to 2PI) range of the lathed section 2PI is a\n\t * closed lathe, less than 2PI is a portion.\n\t */\n\tconstructor( points = [ new Vector2( 0, -0.5 ), new Vector2( 0.5, 0 ), new Vector2( 0, 0.5 ) ], segments = 12, phiStart = 0, phiLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'LatheGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tpoints: points,\n\t\t\tsegments: segments,\n\t\t\tphiStart: phiStart,\n\t\t\tphiLength: phiLength\n\t\t};\n\n\t\tsegments = Math.floor( segments );\n\n\t\t// clamp phiLength so it's in range of [ 0, 2PI ]\n\n\t\tphiLength = clamp( phiLength, 0, Math.PI * 2 );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst uvs = [];\n\t\tconst initNormals = [];\n\t\tconst normals = [];\n\n\t\t// helper variables\n\n\t\tconst inverseSegments = 1.0 / segments;\n\t\tconst vertex = new Vector3();\n\t\tconst uv = new Vector2();\n\t\tconst normal = new Vector3();\n\t\tconst curNormal = new Vector3();\n\t\tconst prevNormal = new Vector3();\n\t\tlet dx = 0;\n\t\tlet dy = 0;\n\n\t\t// pre-compute normals for initial \"meridian\"\n\n\t\tfor ( let j = 0; j \u003c= ( points.length - 1 ); j ++ ) {\n\n\t\t\tswitch ( j ) {\n\n\t\t\t\tcase 0:\t\t\t\t// special handling for 1st vertex on path\n\n\t\t\t\t\tdx = points[ j + 1 ].x - points[ j ].x;\n\t\t\t\t\tdy = points[ j + 1 ].y - points[ j ].y;\n\n\t\t\t\t\tnormal.x = dy * 1.0;\n\t\t\t\t\tnormal.y = - dx;\n\t\t\t\t\tnormal.z = dy * 0.0;\n\n\t\t\t\t\tprevNormal.copy( normal );\n\n\t\t\t\t\tnormal.normalize();\n\n\t\t\t\t\tinitNormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ( points.length - 1 ):\t// special handling for last Vertex on path\n\n\t\t\t\t\tinitNormals.push( prevNormal.x, prevNormal.y, prevNormal.z );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\t\t\t// default handling for all vertices in between\n\n\t\t\t\t\tdx = points[ j + 1 ].x - points[ j ].x;\n\t\t\t\t\tdy = points[ j + 1 ].y - points[ j ].y;\n\n\t\t\t\t\tnormal.x = dy * 1.0;\n\t\t\t\t\tnormal.y = - dx;\n\t\t\t\t\tnormal.z = dy * 0.0;\n\n\t\t\t\t\tcurNormal.copy( normal );\n\n\t\t\t\t\tnormal.x += prevNormal.x;\n\t\t\t\t\tnormal.y += prevNormal.y;\n\t\t\t\t\tnormal.z += prevNormal.z;\n\n\t\t\t\t\tnormal.normalize();\n\n\t\t\t\t\tinitNormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t\tprevNormal.copy( curNormal );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate vertices, uvs and normals\n\n\t\tfor ( let i = 0; i \u003c= segments; i ++ ) {\n\n\t\t\tconst phi = phiStart + i * inverseSegments * phiLength;\n\n\t\t\tconst sin = Math.sin( phi );\n\t\t\tconst cos = Math.cos( phi );\n\n\t\t\tfor ( let j = 0; j \u003c= ( points.length - 1 ); j ++ ) {\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = points[ j ].x * sin;\n\t\t\t\tvertex.y = points[ j ].y;\n\t\t\t\tvertex.z = points[ j ].x * cos;\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuv.x = i / segments;\n\t\t\t\tuv.y = j / ( points.length - 1 );\n\n\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t\t// normal\n\n\t\t\t\tconst x = initNormals[ 3 * j + 0 ] * sin;\n\t\t\t\tconst y = initNormals[ 3 * j + 1 ];\n\t\t\t\tconst z = initNormals[ 3 * j + 0 ] * cos;\n\n\t\t\t\tnormals.push( x, y, z );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let i = 0; i \u003c segments; i ++ ) {\n\n\t\t\tfor ( let j = 0; j \u003c ( points.length - 1 ); j ++ ) {\n\n\t\t\t\tconst base = j + i * points.length;\n\n\t\t\t\tconst a = base;\n\t\t\t\tconst b = base + points.length;\n\t\t\t\tconst c = base + points.length + 1;\n\t\t\t\tconst d = base + 1;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( c, d, b );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {LatheGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new LatheGeometry( data.points, data.segments, data.phiStart, data.phiLength );\n\n\t}\n\n}\n\n/**\n * A geometry class for representing an octahedron.\n *\n * ```js\n * const geometry = new THREE.OctahedronGeometry();\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const octahedron = new THREE.Mesh( geometry, material );\n * scene.add( octahedron );\n * ```\n *\n * @augments PolyhedronGeometry\n * @demo scenes/geometry-browser.html#OctahedronGeometry\n */\nclass OctahedronGeometry extends PolyhedronGeometry {\n\n\t/**\n\t * Constructs a new octahedron geometry.\n\t *\n\t * @param {number} [radius=1] - Radius of the octahedron.\n\t * @param {number} [detail=0] - Setting this to a value greater than `0` adds vertices making it no longer a octahedron.\n\t */\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst vertices = [\n\t\t\t1, 0, 0, \t-1, 0, 0,\t0, 1, 0,\n\t\t\t0, -1, 0, \t0, 0, 1,\t0, 0, -1\n\t\t];\n\n\t\tconst indices = [\n\t\t\t0, 2, 4,\t0, 4, 3,\t0, 3, 5,\n\t\t\t0, 5, 2,\t1, 2, 5,\t1, 5, 3,\n\t\t\t1, 3, 4,\t1, 4, 2\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'OctahedronGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {OctahedronGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new OctahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\n/**\n * A geometry class for representing a plane.\n *\n * ```js\n * const geometry = new THREE.PlaneGeometry( 1, 1 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00, side: THREE.DoubleSide } );\n * const plane = new THREE.Mesh( geometry, material );\n * scene.add( plane );\n * ```\n *\n * @augments BufferGeometry\n * @demo scenes/geometry-browser.html#PlaneGeometry\n */\nclass PlaneGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new plane geometry.\n\t *\n\t * @param {number} [width=1] - The width along the X axis.\n\t * @param {number} [height=1] - The height along the Y axis\n\t * @param {number} [widthSegments=1] - The number of segments along the X axis.\n\t * @param {number} [heightSegments=1] - The number of segments along the Y axis.\n\t */\n\tconstructor( width = 1, height = 1, widthSegments = 1, heightSegments = 1 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'PlaneGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\twidth: width,\n\t\t\theight: height,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments\n\t\t};\n\n\t\tconst width_half = width / 2;\n\t\tconst height_half = height / 2;\n\n\t\tconst gridX = Math.floor( widthSegments );\n\t\tconst gridY = Math.floor( heightSegments );\n\n\t\tconst gridX1 = gridX + 1;\n\t\tconst gridY1 = gridY + 1;\n\n\t\tconst segment_width = width / gridX;\n\t\tconst segment_height = height / gridY;\n\n\t\t//\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\tfor ( let iy = 0; iy \u003c gridY1; iy ++ ) {\n\n\t\t\tconst y = iy * segment_height - height_half;\n\n\t\t\tfor ( let ix = 0; ix \u003c gridX1; ix ++ ) {\n\n\t\t\t\tconst x = ix * segment_width - width_half;\n\n\t\t\t\tvertices.push( x, - y, 0 );\n\n\t\t\t\tnormals.push( 0, 0, 1 );\n\n\t\t\t\tuvs.push( ix / gridX );\n\t\t\t\tuvs.push( 1 - ( iy / gridY ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( let iy = 0; iy \u003c gridY; iy ++ ) {\n\n\t\t\tfor ( let ix = 0; ix \u003c gridX; ix ++ ) {\n\n\t\t\t\tconst a = ix + gridX1 * iy;\n\t\t\t\tconst b = ix + gridX1 * ( iy + 1 );\n\t\t\t\tconst c = ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\t\tconst d = ( ix + 1 ) + gridX1 * iy;\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {PlaneGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new PlaneGeometry( data.width, data.height, data.widthSegments, data.heightSegments );\n\n\t}\n\n}\n\n/**\n * A class for generating a two-dimensional ring geometry.\n *\n * ```js\n * const geometry = new THREE.RingGeometry( 1, 5, 32 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00, side: THREE.DoubleSide } );\n * const mesh = new THREE.Mesh( geometry, material );\n * scene.add( mesh );\n * ```\n *\n * @augments BufferGeometry\n * @demo scenes/geometry-browser.html#RingGeometry\n */\nclass RingGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new ring geometry.\n\t *\n\t * @param {number} [innerRadius=0.5] - The inner radius of the ring.\n\t * @param {number} [outerRadius=1] - The outer radius of the ring.\n\t * @param {number} [thetaSegments=32] - Number of segments. A higher number means the ring will be more round. Minimum is `3`.\n\t * @param {number} [phiSegments=1] - Number of segments per ring segment. Minimum is `1`.\n\t * @param {number} [thetaStart=0] - Starting angle in radians.\n\t * @param {number} [thetaLength=Math.PI*2] - Central angle in radians.\n\t */\n\tconstructor( innerRadius = 0.5, outerRadius = 1, thetaSegments = 32, phiSegments = 1, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'RingGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tinnerRadius: innerRadius,\n\t\t\touterRadius: outerRadius,\n\t\t\tthetaSegments: thetaSegments,\n\t\t\tphiSegments: phiSegments,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tthetaSegments = Math.max( 3, thetaSegments );\n\t\tphiSegments = Math.max( 1, phiSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// some helper variables\n\n\t\tlet radius = innerRadius;\n\t\tconst radiusStep = ( ( outerRadius - innerRadius ) / phiSegments );\n\t\tconst vertex = new Vector3();\n\t\tconst uv = new Vector2();\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let j = 0; j \u003c= phiSegments; j ++ ) {\n\n\t\t\tfor ( let i = 0; i \u003c= thetaSegments; i ++ ) {\n\n\t\t\t\t// values are generate from the inside of the ring to the outside\n\n\t\t\t\tconst segment = thetaStart + i / thetaSegments * thetaLength;\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = radius * Math.cos( segment );\n\t\t\t\tvertex.y = radius * Math.sin( segment );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormals.push( 0, 0, 1 );\n\n\t\t\t\t// uv\n\n\t\t\t\tuv.x = ( vertex.x / outerRadius + 1 ) / 2;\n\t\t\t\tuv.y = ( vertex.y / outerRadius + 1 ) / 2;\n\n\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t}\n\n\t\t\t// increase the radius for next row of vertices\n\n\t\t\tradius += radiusStep;\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let j = 0; j \u003c phiSegments; j ++ ) {\n\n\t\t\tconst thetaSegmentLevel = j * ( thetaSegments + 1 );\n\n\t\t\tfor ( let i = 0; i \u003c thetaSegments; i ++ ) {\n\n\t\t\t\tconst segment = i + thetaSegmentLevel;\n\n\t\t\t\tconst a = segment;\n\t\t\t\tconst b = segment + thetaSegments + 1;\n\t\t\t\tconst c = segment + thetaSegments + 2;\n\t\t\t\tconst d = segment + 1;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {RingGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new RingGeometry( data.innerRadius, data.outerRadius, data.thetaSegments, data.phiSegments, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\n/**\n * Creates an one-sided polygonal geometry from one or more path shapes.\n *\n * ```js\n * const arcShape = new THREE.Shape()\n *\t.moveTo( 5, 1 )\n *\t.absarc( 1, 1, 4, 0, Math.PI * 2, false );\n *\n * const geometry = new THREE.ShapeGeometry( arcShape );\n * const material = new THREE.MeshBasicMaterial( { color: 0x00ff00, side: THREE.DoubleSide } );\n * const mesh = new THREE.Mesh( geometry, material ) ;\n * scene.add( mesh );\n * ```\n *\n * @augments BufferGeometry\n * @demo scenes/geometry-browser.html#ShapeGeometry\n */\nclass ShapeGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new shape geometry.\n\t *\n\t * @param {Shape|Array\u003cShape\u003e} [shapes] - A shape or an array of shapes.\n\t * @param {number} [curveSegments=12] - Number of segments per shape.\n\t */\n\tconstructor( shapes = new Shape( [ new Vector2( 0, 0.5 ), new Vector2( -0.5, -0.5 ), new Vector2( 0.5, -0.5 ) ] ), curveSegments = 12 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'ShapeGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tshapes: shapes,\n\t\t\tcurveSegments: curveSegments\n\t\t};\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tlet groupStart = 0;\n\t\tlet groupCount = 0;\n\n\t\t// allow single and array values for \"shapes\" parameter\n\n\t\tif ( Array.isArray( shapes ) === false ) {\n\n\t\t\taddShape( shapes );\n\n\t\t} else {\n\n\t\t\tfor ( let i = 0; i \u003c shapes.length; i ++ ) {\n\n\t\t\t\taddShape( shapes[ i ] );\n\n\t\t\t\tthis.addGroup( groupStart, groupCount, i ); // enables MultiMaterial support\n\n\t\t\t\tgroupStart += groupCount;\n\t\t\t\tgroupCount = 0;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\n\t\t// helper functions\n\n\t\tfunction addShape( shape ) {\n\n\t\t\tconst indexOffset = vertices.length / 3;\n\t\t\tconst points = shape.extractPoints( curveSegments );\n\n\t\t\tlet shapeVertices = points.shape;\n\t\t\tconst shapeHoles = points.holes;\n\n\t\t\t// check direction of vertices\n\n\t\t\tif ( ShapeUtils.isClockWise( shapeVertices ) === false ) {\n\n\t\t\t\tshapeVertices = shapeVertices.reverse();\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0, l = shapeHoles.length; i \u003c l; i ++ ) {\n\n\t\t\t\tconst shapeHole = shapeHoles[ i ];\n\n\t\t\t\tif ( ShapeUtils.isClockWise( shapeHole ) === true ) {\n\n\t\t\t\t\tshapeHoles[ i ] = shapeHole.reverse();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst faces = ShapeUtils.triangulateShape( shapeVertices, shapeHoles );\n\n\t\t\t// join vertices of inner and outer paths to a single array\n\n\t\t\tfor ( let i = 0, l = shapeHoles.length; i \u003c l; i ++ ) {\n\n\t\t\t\tconst shapeHole = shapeHoles[ i ];\n\t\t\t\tshapeVertices = shapeVertices.concat( shapeHole );\n\n\t\t\t}\n\n\t\t\t// vertices, normals, uvs\n\n\t\t\tfor ( let i = 0, l = shapeVertices.length; i \u003c l; i ++ ) {\n\n\t\t\t\tconst vertex = shapeVertices[ i ];\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, 0 );\n\t\t\t\tnormals.push( 0, 0, 1 );\n\t\t\t\tuvs.push( vertex.x, vertex.y ); // world uvs\n\n\t\t\t}\n\n\t\t\t// indices\n\n\t\t\tfor ( let i = 0, l = faces.length; i \u003c l; i ++ ) {\n\n\t\t\t\tconst face = faces[ i ];\n\n\t\t\t\tconst a = face[ 0 ] + indexOffset;\n\t\t\t\tconst b = face[ 1 ] + indexOffset;\n\t\t\t\tconst c = face[ 2 ] + indexOffset;\n\n\t\t\t\tindices.push( a, b, c );\n\t\t\t\tgroupCount += 3;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tconst shapes = this.parameters.shapes;\n\n\t\treturn toJSON( shapes, data );\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @param {Array\u003cShape\u003e} shapes - An array of shapes.\n\t * @return {ShapeGeometry} A new instance.\n\t */\n\tstatic fromJSON( data, shapes ) {\n\n\t\tconst geometryShapes = [];\n\n\t\tfor ( let j = 0, jl = data.shapes.length; j \u003c jl; j ++ ) {\n\n\t\t\tconst shape = shapes[ data.shapes[ j ] ];\n\n\t\t\tgeometryShapes.push( shape );\n\n\t\t}\n\n\t\treturn new ShapeGeometry( geometryShapes, data.curveSegments );\n\n\t}\n\n}\n\nfunction toJSON( shapes, data ) {\n\n\tdata.shapes = [];\n\n\tif ( Array.isArray( shapes ) ) {\n\n\t\tfor ( let i = 0, l = shapes.length; i \u003c l; i ++ ) {\n\n\t\t\tconst shape = shapes[ i ];\n\n\t\t\tdata.shapes.push( shape.uuid );\n\n\t\t}\n\n\t} else {\n\n\t\tdata.shapes.push( shapes.uuid );\n\n\t}\n\n\treturn data;\n\n}\n\n/**\n * A class for generating a sphere geometry.\n *\n * ```js\n * const geometry = new THREE.SphereGeometry( 15, 32, 16 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const sphere = new THREE.Mesh( geometry, material );\n * scene.add( sphere );\n * ```\n *\n * @augments BufferGeometry\n * @demo scenes/geometry-browser.html#SphereGeometry\n */\nclass SphereGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new sphere geometry.\n\t *\n\t * @param {number} [radius=1] - The sphere radius.\n\t * @param {number} [widthSegments=32] - The number of horizontal segments. Minimum value is `3`.\n\t * @param {number} [heightSegments=16] - The number of vertical segments. Minimum value is `2`.\n\t * @param {number} [phiStart=0] - The horizontal starting angle in radians.\n\t * @param {number} [phiLength=Math.PI*2] - The horizontal sweep angle size.\n\t * @param {number} [thetaStart=0] - The vertical starting angle in radians.\n\t * @param {number} [thetaLength=Math.PI] - The vertical sweep angle size.\n\t */\n\tconstructor( radius = 1, widthSegments = 32, heightSegments = 16, phiStart = 0, phiLength = Math.PI * 2, thetaStart = 0, thetaLength = Math.PI ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'SphereGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\tphiStart: phiStart,\n\t\t\tphiLength: phiLength,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\twidthSegments = Math.max( 3, Math.floor( widthSegments ) );\n\t\theightSegments = Math.max( 2, Math.floor( heightSegments ) );\n\n\t\tconst thetaEnd = Math.min( thetaStart + thetaLength, Math.PI );\n\n\t\tlet index = 0;\n\t\tconst grid = [];\n\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let iy = 0; iy \u003c= heightSegments; iy ++ ) {\n\n\t\t\tconst verticesRow = [];\n\n\t\t\tconst v = iy / heightSegments;\n\n\t\t\t// special case for the poles\n\n\t\t\tlet uOffset = 0;\n\n\t\t\tif ( iy === 0 \u0026\u0026 thetaStart === 0 ) {\n\n\t\t\t\tuOffset = 0.5 / widthSegments;\n\n\t\t\t} else if ( iy === heightSegments \u0026\u0026 thetaEnd === Math.PI ) {\n\n\t\t\t\tuOffset = -0.5 / widthSegments;\n\n\t\t\t}\n\n\t\t\tfor ( let ix = 0; ix \u003c= widthSegments; ix ++ ) {\n\n\t\t\t\tconst u = ix / widthSegments;\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength );\n\t\t\t\tvertex.y = radius * Math.cos( thetaStart + v * thetaLength );\n\t\t\t\tvertex.z = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormal.copy( vertex ).normalize();\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( u + uOffset, 1 - v );\n\n\t\t\t\tverticesRow.push( index ++ );\n\n\t\t\t}\n\n\t\t\tgrid.push( verticesRow );\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let iy = 0; iy \u003c heightSegments; iy ++ ) {\n\n\t\t\tfor ( let ix = 0; ix \u003c widthSegments; ix ++ ) {\n\n\t\t\t\tconst a = grid[ iy ][ ix + 1 ];\n\t\t\t\tconst b = grid[ iy ][ ix ];\n\t\t\t\tconst c = grid[ iy + 1 ][ ix ];\n\t\t\t\tconst d = grid[ iy + 1 ][ ix + 1 ];\n\n\t\t\t\tif ( iy !== 0 || thetaStart \u003e 0 ) indices.push( a, b, d );\n\t\t\t\tif ( iy !== heightSegments - 1 || thetaEnd \u003c Math.PI ) indices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {SphereGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new SphereGeometry( data.radius, data.widthSegments, data.heightSegments, data.phiStart, data.phiLength, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\n/**\n * A geometry class for representing an tetrahedron.\n *\n * ```js\n * const geometry = new THREE.TetrahedronGeometry();\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const tetrahedron = new THREE.Mesh( geometry, material );\n * scene.add( tetrahedron );\n * ```\n *\n * @augments PolyhedronGeometry\n * @demo scenes/geometry-browser.html#TetrahedronGeometry\n */\nclass TetrahedronGeometry extends PolyhedronGeometry {\n\n\t/**\n\t * Constructs a new tetrahedron geometry.\n\t *\n\t * @param {number} [radius=1] - Radius of the tetrahedron.\n\t * @param {number} [detail=0] - Setting this to a value greater than `0` adds vertices making it no longer a tetrahedron.\n\t */\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst vertices = [\n\t\t\t1, 1, 1, \t-1, -1, 1, \t-1, 1, -1, \t1, -1, -1\n\t\t];\n\n\t\tconst indices = [\n\t\t\t2, 1, 0, \t0, 3, 2,\t1, 3, 0,\t2, 3, 1\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'TetrahedronGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {TetrahedronGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new TetrahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\n/**\n * A geometry class for representing an torus.\n *\n * ```js\n * const geometry = new THREE.TorusGeometry( 10, 3, 16, 100 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const torus = new THREE.Mesh( geometry, material );\n * scene.add( torus );\n * ```\n *\n * @augments BufferGeometry\n * @demo scenes/geometry-browser.html#TorusGeometry\n */\nclass TorusGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new torus geometry.\n\t *\n\t * @param {number} [radius=1] - Radius of the torus, from the center of the torus to the center of the tube.\n\t * @param {number} [tube=0.4] - Radius of the tube. Must be smaller than `radius`.\n\t * @param {number} [radialSegments=12] - The number of radial segments.\n\t * @param {number} [tubularSegments=48] - The number of tubular segments.\n\t * @param {number} [arc=Math.PI*2] - Central angle in radians.\n\t */\n\tconstructor( radius = 1, tube = 0.4, radialSegments = 12, tubularSegments = 48, arc = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'TorusGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\ttube: tube,\n\t\t\tradialSegments: radialSegments,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tarc: arc\n\t\t};\n\n\t\tradialSegments = Math.floor( radialSegments );\n\t\ttubularSegments = Math.floor( tubularSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tconst center = new Vector3();\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let j = 0; j \u003c= radialSegments; j ++ ) {\n\n\t\t\tfor ( let i = 0; i \u003c= tubularSegments; i ++ ) {\n\n\t\t\t\tconst u = i / tubularSegments * arc;\n\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = ( radius + tube * Math.cos( v ) ) * Math.cos( u );\n\t\t\t\tvertex.y = ( radius + tube * Math.cos( v ) ) * Math.sin( u );\n\t\t\t\tvertex.z = tube * Math.sin( v );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tcenter.x = radius * Math.cos( u );\n\t\t\t\tcenter.y = radius * Math.sin( u );\n\t\t\t\tnormal.subVectors( vertex, center ).normalize();\n\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( i / tubularSegments );\n\t\t\t\tuvs.push( j / radialSegments );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate indices\n\n\t\tfor ( let j = 1; j \u003c= radialSegments; j ++ ) {\n\n\t\t\tfor ( let i = 1; i \u003c= tubularSegments; i ++ ) {\n\n\t\t\t\t// indices\n\n\t\t\t\tconst a = ( tubularSegments + 1 ) * j + i - 1;\n\t\t\t\tconst b = ( tubularSegments + 1 ) * ( j - 1 ) + i - 1;\n\t\t\t\tconst c = ( tubularSegments + 1 ) * ( j - 1 ) + i;\n\t\t\t\tconst d = ( tubularSegments + 1 ) * j + i;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {TorusGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new TorusGeometry( data.radius, data.tube, data.radialSegments, data.tubularSegments, data.arc );\n\n\t}\n\n}\n\n/**\n * Creates a torus knot, the particular shape of which is defined by a pair\n * of coprime integers, p and q. If p and q are not coprime, the result will\n * be a torus link.\n *\n * ```js\n * const geometry = new THREE.TorusKnotGeometry( 10, 3, 100, 16 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const torusKnot = new THREE.Mesh( geometry, material );\n * scene.add( torusKnot );\n * ```\n *\n * @augments BufferGeometry\n * @demo scenes/geometry-browser.html#TorusKnotGeometry\n */\nclass TorusKnotGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new torus knot geometry.\n\t *\n\t * @param {number} [radius=1] - Radius of the torus knot.\n\t * @param {number} [tube=0.4] - Radius of the tube.\n\t * @param {number} [tubularSegments=64] - The number of tubular segments.\n\t * @param {number} [radialSegments=8] - The number of radial segments.\n\t * @param {number} [p=2] - This value determines, how many times the geometry winds around its axis of rotational symmetry.\n\t * @param {number} [q=3] - This value determines, how many times the geometry winds around a circle in the interior of the torus.\n\t */\n\tconstructor( radius = 1, tube = 0.4, tubularSegments = 64, radialSegments = 8, p = 2, q = 3 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'TorusKnotGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\ttube: tube,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tradialSegments: radialSegments,\n\t\t\tp: p,\n\t\t\tq: q\n\t\t};\n\n\t\ttubularSegments = Math.floor( tubularSegments );\n\t\tradialSegments = Math.floor( radialSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\n\t\tconst P1 = new Vector3();\n\t\tconst P2 = new Vector3();\n\n\t\tconst B = new Vector3();\n\t\tconst T = new Vector3();\n\t\tconst N = new Vector3();\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let i = 0; i \u003c= tubularSegments; ++ i ) {\n\n\t\t\t// the radian \"u\" is used to calculate the position on the torus curve of the current tubular segment\n\n\t\t\tconst u = i / tubularSegments * p * Math.PI * 2;\n\n\t\t\t// now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead.\n\t\t\t// these points are used to create a special \"coordinate space\", which is necessary to calculate the correct vertex positions\n\n\t\t\tcalculatePositionOnCurve( u, p, q, radius, P1 );\n\t\t\tcalculatePositionOnCurve( u + 0.01, p, q, radius, P2 );\n\n\t\t\t// calculate orthonormal basis\n\n\t\t\tT.subVectors( P2, P1 );\n\t\t\tN.addVectors( P2, P1 );\n\t\t\tB.crossVectors( T, N );\n\t\t\tN.crossVectors( B, T );\n\n\t\t\t// normalize B, N. T can be ignored, we don't use it\n\n\t\t\tB.normalize();\n\t\t\tN.normalize();\n\n\t\t\tfor ( let j = 0; j \u003c= radialSegments; ++ j ) {\n\n\t\t\t\t// now calculate the vertices. they are nothing more than an extrusion of the torus curve.\n\t\t\t\t// because we extrude a shape in the xy-plane, there is no need to calculate a z-value.\n\n\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\t\t\t\tconst cx = - tube * Math.cos( v );\n\t\t\t\tconst cy = tube * Math.sin( v );\n\n\t\t\t\t// now calculate the final vertex position.\n\t\t\t\t// first we orient the extrusion with our basis vectors, then we add it to the current position on the curve\n\n\t\t\t\tvertex.x = P1.x + ( cx * N.x + cy * B.x );\n\t\t\t\tvertex.y = P1.y + ( cx * N.y + cy * B.y );\n\t\t\t\tvertex.z = P1.z + ( cx * N.z + cy * B.z );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal)\n\n\t\t\t\tnormal.subVectors( vertex, P1 ).normalize();\n\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( i / tubularSegments );\n\t\t\t\tuvs.push( j / radialSegments );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate indices\n\n\t\tfor ( let j = 1; j \u003c= tubularSegments; j ++ ) {\n\n\t\t\tfor ( let i = 1; i \u003c= radialSegments; i ++ ) {\n\n\t\t\t\t// indices\n\n\t\t\t\tconst a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 );\n\t\t\t\tconst b = ( radialSegments + 1 ) * j + ( i - 1 );\n\t\t\t\tconst c = ( radialSegments + 1 ) * j + i;\n\t\t\t\tconst d = ( radialSegments + 1 ) * ( j - 1 ) + i;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\t// this function calculates the current position on the torus curve\n\n\t\tfunction calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tconst cu = Math.cos( u );\n\t\t\tconst su = Math.sin( u );\n\t\t\tconst quOverP = q / p * u;\n\t\t\tconst cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {TorusKnotGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new TorusKnotGeometry( data.radius, data.tube, data.tubularSegments, data.radialSegments, data.p, data.q );\n\n\t}\n\n}\n\n/**\n * Creates a tube that extrudes along a 3D curve.\n *\n * ```js\n * class CustomSinCurve extends THREE.Curve {\n *\n * \tgetPoint( t, optionalTarget = new THREE.Vector3() ) {\n *\n * \t\tconst tx = t * 3 - 1.5;\n * \t\tconst ty = Math.sin( 2 * Math.PI * t );\n * \t\tconst tz = 0;\n *\n * \t\treturn optionalTarget.set( tx, ty, tz );\n * \t}\n *\n * }\n *\n * const path = new CustomSinCurve( 10 );\n * const geometry = new THREE.TubeGeometry( path, 20, 2, 8, false );\n * const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );\n * const mesh = new THREE.Mesh( geometry, material );\n * scene.add( mesh );\n * ```\n *\n * @augments BufferGeometry\n * @demo scenes/geometry-browser.html#TubeGeometry\n */\nclass TubeGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new tube geometry.\n\t *\n\t * @param {Curve} [path=QuadraticBezierCurve3] - A 3D curve defining the path of the tube.\n\t * @param {number} [tubularSegments=64] - The number of segments that make up the tube.\n\t * @param {number} [radius=1] -The radius of the tube.\n\t * @param {number} [radialSegments=8] - The number of segments that make up the cross-section.\n\t * @param {boolean} [closed=false] - Whether the tube is closed or not.\n\t */\n\tconstructor( path = new QuadraticBezierCurve3( new Vector3( -1, -1, 0 ), new Vector3( -1, 1, 0 ), new Vector3( 1, 1, 0 ) ), tubularSegments = 64, radius = 1, radialSegments = 8, closed = false ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'TubeGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tpath: path,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tradius: radius,\n\t\t\tradialSegments: radialSegments,\n\t\t\tclosed: closed\n\t\t};\n\n\t\tconst frames = path.computeFrenetFrames( tubularSegments, closed );\n\n\t\t// expose internals\n\n\t\tthis.tangents = frames.tangents;\n\t\tthis.normals = frames.normals;\n\t\tthis.binormals = frames.binormals;\n\n\t\t// helper variables\n\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\t\tconst uv = new Vector2();\n\t\tlet P = new Vector3();\n\n\t\t// buffer\n\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\t\tconst indices = [];\n\n\t\t// create buffer data\n\n\t\tgenerateBufferData();\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\t// functions\n\n\t\tfunction generateBufferData() {\n\n\t\t\tfor ( let i = 0; i \u003c tubularSegments; i ++ ) {\n\n\t\t\t\tgenerateSegment( i );\n\n\t\t\t}\n\n\t\t\t// if the geometry is not closed, generate the last row of vertices and normals\n\t\t\t// at the regular position on the given path\n\t\t\t//\n\t\t\t// if the geometry is closed, duplicate the first row of vertices and normals (uvs will differ)\n\n\t\t\tgenerateSegment( ( closed === false ) ? tubularSegments : 0 );\n\n\t\t\t// uvs are generated in a separate function.\n\t\t\t// this makes it easy compute correct values for closed geometries\n\n\t\t\tgenerateUVs();\n\n\t\t\t// finally create faces\n\n\t\t\tgenerateIndices();\n\n\t\t}\n\n\t\tfunction generateSegment( i ) {\n\n\t\t\t// we use getPointAt to sample evenly distributed points from the given path\n\n\t\t\tP = path.getPointAt( i / tubularSegments, P );\n\n\t\t\t// retrieve corresponding normal and binormal\n\n\t\t\tconst N = frames.normals[ i ];\n\t\t\tconst B = frames.binormals[ i ];\n\n\t\t\t// generate normals and vertices for the current segment\n\n\t\t\tfor ( let j = 0; j \u003c= radialSegments; j ++ ) {\n\n\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\n\t\t\t\tconst sin = Math.sin( v );\n\t\t\t\tconst cos = - Math.cos( v );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormal.x = ( cos * N.x + sin * B.x );\n\t\t\t\tnormal.y = ( cos * N.y + sin * B.y );\n\t\t\t\tnormal.z = ( cos * N.z + sin * B.z );\n\t\t\t\tnormal.normalize();\n\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = P.x + radius * normal.x;\n\t\t\t\tvertex.y = P.y + radius * normal.y;\n\t\t\t\tvertex.z = P.z + radius * normal.z;\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction generateIndices() {\n\n\t\t\tfor ( let j = 1; j \u003c= tubularSegments; j ++ ) {\n\n\t\t\t\tfor ( let i = 1; i \u003c= radialSegments; i ++ ) {\n\n\t\t\t\t\tconst a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 );\n\t\t\t\t\tconst b = ( radialSegments + 1 ) * j + ( i - 1 );\n\t\t\t\t\tconst c = ( radialSegments + 1 ) * j + i;\n\t\t\t\t\tconst d = ( radialSegments + 1 ) * ( j - 1 ) + i;\n\n\t\t\t\t\t// faces\n\n\t\t\t\t\tindices.push( a, b, d );\n\t\t\t\t\tindices.push( b, c, d );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction generateUVs() {\n\n\t\t\tfor ( let i = 0; i \u003c= tubularSegments; i ++ ) {\n\n\t\t\t\tfor ( let j = 0; j \u003c= radialSegments; j ++ ) {\n\n\t\t\t\t\tuv.x = i / tubularSegments;\n\t\t\t\t\tuv.y = j / radialSegments;\n\n\t\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.path = this.parameters.path.toJSON();\n\n\t\treturn data;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {TubeGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\t// This only works for built-in curves (e.g. CatmullRomCurve3).\n\t\t// User defined curves or instances of CurvePath will not be deserialized.\n\t\treturn new TubeGeometry(\n\t\t\tnew Curves[ data.path.type ]().fromJSON( data.path ),\n\t\t\tdata.tubularSegments,\n\t\t\tdata.radius,\n\t\t\tdata.radialSegments,\n\t\t\tdata.closed\n\t\t);\n\n\t}\n\n}\n\n/**\n * Can be used as a helper object to visualize a geometry as a wireframe.\n *\n * ```js\n * const geometry = new THREE.SphereGeometry();\n *\n * const wireframe = new THREE.WireframeGeometry( geometry );\n *\n * const line = new THREE.LineSegments( wireframe );\n * line.material.depthWrite = false;\n * line.material.opacity = 0.25;\n * line.material.transparent = true;\n *\n * scene.add( line );\n * ```\n *\n * Note: It is not yet possible to serialize/deserialize instances of this class.\n *\n * @augments BufferGeometry\n */\nclass WireframeGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new wireframe geometry.\n\t *\n\t * @param {?BufferGeometry} [geometry=null] - The geometry.\n\t */\n\tconstructor( geometry = null ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'WireframeGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tgeometry: geometry\n\t\t};\n\n\t\tif ( geometry !== null ) {\n\n\t\t\t// buffer\n\n\t\t\tconst vertices = [];\n\t\t\tconst edges = new Set();\n\n\t\t\t// helper variables\n\n\t\t\tconst start = new Vector3();\n\t\t\tconst end = new Vector3();\n\n\t\t\tif ( geometry.index !== null ) {\n\n\t\t\t\t// indexed BufferGeometry\n\n\t\t\t\tconst position = geometry.attributes.position;\n\t\t\t\tconst indices = geometry.index;\n\t\t\t\tlet groups = geometry.groups;\n\n\t\t\t\tif ( groups.length === 0 ) {\n\n\t\t\t\t\tgroups = [ { start: 0, count: indices.count, materialIndex: 0 } ];\n\n\t\t\t\t}\n\n\t\t\t\t// create a data structure that contains all edges without duplicates\n\n\t\t\t\tfor ( let o = 0, ol = groups.length; o \u003c ol; ++ o ) {\n\n\t\t\t\t\tconst group = groups[ o ];\n\n\t\t\t\t\tconst groupStart = group.start;\n\t\t\t\t\tconst groupCount = group.count;\n\n\t\t\t\t\tfor ( let i = groupStart, l = ( groupStart + groupCount ); i \u003c l; i += 3 ) {\n\n\t\t\t\t\t\tfor ( let j = 0; j \u003c 3; j ++ ) {\n\n\t\t\t\t\t\t\tconst index1 = indices.getX( i + j );\n\t\t\t\t\t\t\tconst index2 = indices.getX( i + ( j + 1 ) % 3 );\n\n\t\t\t\t\t\t\tstart.fromBufferAttribute( position, index1 );\n\t\t\t\t\t\t\tend.fromBufferAttribute( position, index2 );\n\n\t\t\t\t\t\t\tif ( isUniqueEdge( start, end, edges ) === true ) {\n\n\t\t\t\t\t\t\t\tvertices.push( start.x, start.y, start.z );\n\t\t\t\t\t\t\t\tvertices.push( end.x, end.y, end.z );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// non-indexed BufferGeometry\n\n\t\t\t\tconst position = geometry.attributes.position;\n\n\t\t\t\tfor ( let i = 0, l = ( position.count / 3 ); i \u003c l; i ++ ) {\n\n\t\t\t\t\tfor ( let j = 0; j \u003c 3; j ++ ) {\n\n\t\t\t\t\t\t// three edges per triangle, an edge is represented as (index1, index2)\n\t\t\t\t\t\t// e.g. the first triangle has the following edges: (0,1),(1,2),(2,0)\n\n\t\t\t\t\t\tconst index1 = 3 * i + j;\n\t\t\t\t\t\tconst index2 = 3 * i + ( ( j + 1 ) % 3 );\n\n\t\t\t\t\t\tstart.fromBufferAttribute( position, index1 );\n\t\t\t\t\t\tend.fromBufferAttribute( position, index2 );\n\n\t\t\t\t\t\tif ( isUniqueEdge( start, end, edges ) === true ) {\n\n\t\t\t\t\t\t\tvertices.push( start.x, start.y, start.z );\n\t\t\t\t\t\t\tvertices.push( end.x, end.y, end.z );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// build geometry\n\n\t\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n}\n\nfunction isUniqueEdge( start, end, edges ) {\n\n\tconst hash1 = `${start.x},${start.y},${start.z}-${end.x},${end.y},${end.z}`;\n\tconst hash2 = `${end.x},${end.y},${end.z}-${start.x},${start.y},${start.z}`; // coincident edge\n\n\tif ( edges.has( hash1 ) === true || edges.has( hash2 ) === true ) {\n\n\t\treturn false;\n\n\t} else {\n\n\t\tedges.add( hash1 );\n\t\tedges.add( hash2 );\n\t\treturn true;\n\n\t}\n\n}\n\nvar Geometries = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tBoxGeometry: BoxGeometry,\n\tCapsuleGeometry: CapsuleGeometry,\n\tCircleGeometry: CircleGeometry,\n\tConeGeometry: ConeGeometry,\n\tCylinderGeometry: CylinderGeometry,\n\tDodecahedronGeometry: DodecahedronGeometry,\n\tEdgesGeometry: EdgesGeometry,\n\tExtrudeGeometry: ExtrudeGeometry,\n\tIcosahedronGeometry: IcosahedronGeometry,\n\tLatheGeometry: LatheGeometry,\n\tOctahedronGeometry: OctahedronGeometry,\n\tPlaneGeometry: PlaneGeometry,\n\tPolyhedronGeometry: PolyhedronGeometry,\n\tRingGeometry: RingGeometry,\n\tShapeGeometry: ShapeGeometry,\n\tSphereGeometry: SphereGeometry,\n\tTetrahedronGeometry: TetrahedronGeometry,\n\tTorusGeometry: TorusGeometry,\n\tTorusKnotGeometry: TorusKnotGeometry,\n\tTubeGeometry: TubeGeometry,\n\tWireframeGeometry: WireframeGeometry\n});\n\n/**\n * This material can receive shadows, but otherwise is completely transparent.\n *\n * ```js\n * const geometry = new THREE.PlaneGeometry( 2000, 2000 );\n * geometry.rotateX( - Math.PI / 2 );\n *\n * const material = new THREE.ShadowMaterial();\n * material.opacity = 0.2;\n *\n * const plane = new THREE.Mesh( geometry, material );\n * plane.position.y = -200;\n * plane.receiveShadow = true;\n * scene.add( plane );\n * ```\n *\n * @augments Material\n */\nclass ShadowMaterial extends Material {\n\n\t/**\n\t * Constructs a new shadow material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isShadowMaterial = true;\n\n\t\tthis.type = 'ShadowMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.color = new Color( 0x000000 );\n\n\t\t/**\n\t\t * Overwritten since shadow materials are transparent\n\t\t * by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.transparent = true;\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * This class works just like {@link ShaderMaterial}, except that definitions\n * of built-in uniforms and attributes are not automatically prepended to the\n * GLSL shader code.\n *\n * `RawShaderMaterial` can only be used with {@link WebGLRenderer}.\n *\n * @augments ShaderMaterial\n */\nclass RawShaderMaterial extends ShaderMaterial {\n\n\t/**\n\t * Constructs a new raw shader material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper( parameters );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isRawShaderMaterial = true;\n\n\t\tthis.type = 'RawShaderMaterial';\n\n\t}\n\n}\n\n/**\n * A standard physically based material, using Metallic-Roughness workflow.\n *\n * Physically based rendering (PBR) has recently become the standard in many\n * 3D applications, such as [Unity](https://blogs.unity3d.com/2014/10/29/physically-based-shading-in-unity-5-a-primer/),\n * [Unreal](https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/PhysicallyBased/) and\n * [3D Studio Max](http://area.autodesk.com/blogs/the-3ds-max-blog/what039s-new-for-rendering-in-3ds-max-2017).\n *\n * This approach differs from older approaches in that instead of using\n * approximations for the way in which light interacts with a surface, a\n * physically correct model is used. The idea is that, instead of tweaking\n * materials to look good under specific lighting, a material can be created\n * that will react 'correctly' under all lighting scenarios.\n *\n * In practice this gives a more accurate and realistic looking result than\n * the {@link MeshLambertMaterial} or {@link MeshPhongMaterial}, at the cost of\n * being somewhat more computationally expensive. `MeshStandardMaterial` uses per-fragment\n * shading.\n *\n * Note that for best results you should always specify an environment map when using this material.\n *\n * For a non-technical introduction to the concept of PBR and how to set up a\n * PBR material, check out these articles by the people at [marmoset](https://www.marmoset.co):\n *\n * - [Basic Theory of Physically Based Rendering](https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/)\n * - [Physically Based Rendering and You Can Too](https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/)\n *\n * Technical details of the approach used in three.js (and most other PBR systems) can be found is this\n * [paper from Disney](https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf)\n * (pdf), by Brent Burley.\n *\n * @augments Material\n * @demo scenes/material-browser.html#MeshStandardMaterial\n */\nclass MeshStandardMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh standard material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshStandardMaterial = true;\n\n\t\tthis.type = 'MeshStandardMaterial';\n\n\t\tthis.defines = { 'STANDARD': '' };\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\t/**\n\t\t * How rough the material appears. `0.0` means a smooth mirror reflection, `1.0`\n\t\t * means fully diffuse. If `roughnessMap` is also provided,\n\t\t * both values are multiplied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.roughness = 1.0;\n\n\t\t/**\n\t\t * How much the material is like a metal. Non-metallic materials such as wood\n\t\t * or stone use `0.0`, metallic use `1.0`, with nothing (usually) in between.\n\t\t * A value between `0.0` and `1.0` could be used for a rusty metal look.\n\t\t * If `metalnessMap` is also provided, both values are multiplied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.metalness = 0.0;\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The light map. Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.lightMap = null;\n\n\t\t/**\n\t\t * Intensity of the baked light.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\t/**\n\t\t * The red channel of this texture is used as the ambient occlusion map.\n\t\t * Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.aoMap = null;\n\n\t\t/**\n\t\t * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0`\n\t\t * disables ambient occlusion. Where intensity is `1` and the AO map's\n\t\t * red channel is also `1`, ambient light is fully occluded on a surface.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\t/**\n\t\t * Emissive (light) color of the material, essentially a solid color\n\t\t * unaffected by other lighting.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.emissive = new Color( 0x000000 );\n\n\t\t/**\n\t\t * Intensity of the emissive light. Modulates the emissive color.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.emissiveIntensity = 1.0;\n\n\t\t/**\n\t\t * Set emissive (glow) map. The emissive map color is modulated by the\n\t\t * emissive color and the emissive intensity. If you have an emissive map,\n\t\t * be sure to set the emissive color to something other than black.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.emissiveMap = null;\n\n\t\t/**\n\t\t * The texture to create a bump map. The black and white values map to the\n\t\t * perceived depth in relation to the lights. Bump doesn't actually affect\n\t\t * the geometry of the object, only the lighting. If a normal map is defined\n\t\t * this will be ignored.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.bumpMap = null;\n\n\t\t/**\n\t\t * How much the bump map affects the material. Typical range is `[0,1]`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.bumpScale = 1;\n\n\t\t/**\n\t\t * The texture to create a normal map. The RGB values affect the surface\n\t\t * normal for each pixel fragment and change the way the color is lit. Normal\n\t\t * maps do not change the actual shape of the surface, only the lighting. In\n\t\t * case the material has a normal map authored using the left handed\n\t\t * convention, the `y` component of `normalScale` should be negated to compensate\n\t\t * for the different handedness.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.normalMap = null;\n\n\t\t/**\n\t\t * The type of normal map.\n\t\t *\n\t\t * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)}\n\t\t * @default TangentSpaceNormalMap\n\t\t */\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\n\t\t/**\n\t\t * How much the normal map affects the material. Typical value range is `[0,1]`.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (1,1)\n\t\t */\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\t/**\n\t\t * The displacement map affects the position of the mesh's vertices. Unlike\n\t\t * other maps which only affect the light and shade of the material the\n\t\t * displaced vertices can cast shadows, block other objects, and otherwise\n\t\t * act as real geometry. The displacement texture is an image where the value\n\t\t * of each pixel (white being the highest) is mapped against, and\n\t\t * repositions, the vertices of the mesh.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.displacementMap = null;\n\n\t\t/**\n\t\t * How much the displacement map affects the mesh (where black is no\n\t\t * displacement, and white is maximum displacement). Without a displacement\n\t\t * map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementScale = 1;\n\n\t\t/**\n\t\t * The offset of the displacement map's values on the mesh's vertices.\n\t\t * The bias is added to the scaled sample of the displacement map.\n\t\t * Without a displacement map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementBias = 0;\n\n\t\t/**\n\t\t * The green channel of this texture is used to alter the roughness of the\n\t\t * material.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.roughnessMap = null;\n\n\t\t/**\n\t\t * The blue channel of this texture is used to alter the metalness of the\n\t\t * material.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.metalnessMap = null;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * The environment map. To ensure a physically correct rendering, environment maps\n\t\t * are internally pre-processed with {@link PMREMGenerator}.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.envMap = null;\n\n\t\t/**\n\t\t * The rotation of the environment map in radians.\n\t\t *\n\t\t * @type {Euler}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.envMapRotation = new Euler();\n\n\t\t/**\n\t\t * Scales the effect of the environment map by multiplying its color.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.envMapIntensity = 1.0;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\t/**\n\t\t * Defines appearance of wireframe ends.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinecap = 'round';\n\n\t\t/**\n\t\t * Defines appearance of wireframe joints.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\t/**\n\t\t * Whether the material is rendered with flat shading or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flatShading = false;\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.defines = { 'STANDARD': '' };\n\n\t\tthis.color.copy( source.color );\n\t\tthis.roughness = source.roughness;\n\t\tthis.metalness = source.metalness;\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.roughnessMap = source.roughnessMap;\n\n\t\tthis.metalnessMap = source.metalnessMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapRotation.copy( source.envMapRotation );\n\t\tthis.envMapIntensity = source.envMapIntensity;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * An extension of the {@link MeshStandardMaterial}, providing more advanced\n * physically-based rendering properties:\n *\n * - Anisotropy: Ability to represent the anisotropic property of materials\n * as observable with brushed metals.\n * - Clearcoat: Some materials — like car paints, carbon fiber, and wet surfaces — require\n * a clear, reflective layer on top of another layer that may be irregular or rough.\n * Clearcoat approximates this effect, without the need for a separate transparent surface.\n * - Iridescence: Allows to render the effect where hue varies  depending on the viewing\n * angle and illumination angle. This can be seen on soap bubbles, oil films, or on the\n * wings of many insects.\n * - Physically-based transparency: One limitation of {@link Material#opacity} is that highly\n * transparent materials are less reflective. Physically-based transmission provides a more\n * realistic option for thin, transparent surfaces like glass.\n * - Advanced reflectivity: More flexible reflectivity for non-metallic materials.\n * - Sheen: Can be used for representing cloth and fabric materials.\n *\n * As a result of these complex shading features, `MeshPhysicalMaterial` has a\n * higher performance cost, per pixel, than other three.js materials. Most\n * effects are disabled by default, and add cost as they are enabled. For\n * best results, always specify an environment map when using this material.\n *\n * @augments MeshStandardMaterial\n * @demo scenes/material-browser.html#MeshPhysicalMaterial\n */\nclass MeshPhysicalMaterial extends MeshStandardMaterial {\n\n\t/**\n\t * Constructs a new mesh physical material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshPhysicalMaterial = true;\n\n\t\tthis.defines = {\n\n\t\t\t'STANDARD': '',\n\t\t\t'PHYSICAL': ''\n\n\t\t};\n\n\t\tthis.type = 'MeshPhysicalMaterial';\n\n\t\t/**\n\t\t * The rotation of the anisotropy in tangent, bitangent space, measured in radians\n\t\t * counter-clockwise from the tangent. When `anisotropyMap` is present, this\n\t\t * property provides additional rotation to the vectors in the texture.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.anisotropyRotation = 0;\n\n\t\t/**\n\t\t * Red and green channels represent the anisotropy direction in `[-1, 1]` tangent,\n\t\t * bitangent space, to be rotated by `anisotropyRotation`. The blue channel\n\t\t * contains strength as `[0, 1]` to be multiplied by `anisotropy`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.anisotropyMap = null;\n\n\t\t/**\n\t\t * The red channel of this texture is multiplied against `clearcoat`,\n\t\t * for per-pixel control over a coating's intensity.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.clearcoatMap = null;\n\n\t\t/**\n\t\t * Roughness of the clear coat layer, from `0.0` to `1.0`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.clearcoatRoughness = 0.0;\n\n\t\t/**\n\t\t * The green channel of this texture is multiplied against\n\t\t * `clearcoatRoughness`, for per-pixel control over a coating's roughness.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.clearcoatRoughnessMap = null;\n\n\t\t/**\n\t\t * How much `clearcoatNormalMap` affects the clear coat layer, from\n\t\t * `(0,0)` to `(1,1)`.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (1,1)\n\t\t */\n\t\tthis.clearcoatNormalScale = new Vector2( 1, 1 );\n\n\t\t/**\n\t\t * Can be used to enable independent normals for the clear coat layer.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.clearcoatNormalMap = null;\n\n\t\t/**\n\t\t * Index-of-refraction for non-metallic materials, from `1.0` to `2.333`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1.5\n\t\t */\n\t\tthis.ior = 1.5;\n\n\t\t/**\n\t\t * Degree of reflectivity, from `0.0` to `1.0`. Default is `0.5`, which\n\t\t * corresponds to an index-of-refraction of `1.5`.\n\t\t *\n\t\t * This models the reflectivity of non-metallic materials. It has no effect\n\t\t * when `metalness` is `1.0`\n\t\t *\n\t\t * @name MeshPhysicalMaterial#reflectivity\n\t\t * @type {number}\n\t\t * @default 0.5\n\t\t */\n\t\tObject.defineProperty( this, 'reflectivity', {\n\t\t\tget: function () {\n\n\t\t\t\treturn ( clamp( 2.5 * ( this.ior - 1 ) / ( this.ior + 1 ), 0, 1 ) );\n\n\t\t\t},\n\t\t\tset: function ( reflectivity ) {\n\n\t\t\t\tthis.ior = ( 1 + 0.4 * reflectivity ) / ( 1 - 0.4 * reflectivity );\n\n\t\t\t}\n\t\t} );\n\n\t\t/**\n\t\t * The red channel of this texture is multiplied against `iridescence`, for per-pixel\n\t\t * control over iridescence.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.iridescenceMap = null;\n\n\t\t/**\n\t\t * Strength of the iridescence RGB color shift effect, represented by an index-of-refraction.\n\t\t * Between `1.0` to `2.333`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1.3\n\t\t */\n\t\tthis.iridescenceIOR = 1.3;\n\n\t\t/**\n\t\t *Array of exactly 2 elements, specifying minimum and maximum thickness of the iridescence layer.\n\t\t Thickness of iridescence layer has an equivalent effect of the one `thickness` has on `ior`.\n\t\t *\n\t\t * @type {Array\u003cnumber,number\u003e}\n\t\t * @default [100,400]\n\t\t */\n\t\tthis.iridescenceThicknessRange = [ 100, 400 ];\n\n\t\t/**\n\t\t * A texture that defines the thickness of the iridescence layer, stored in the green channel.\n\t\t * Minimum and maximum values of thickness are defined by `iridescenceThicknessRange` array:\n\t\t * - `0.0` in the green channel will result in thickness equal to first element of the array.\n\t\t * - `1.0` in the green channel will result in thickness equal to second element of the array.\n\t\t * - Values in-between will linearly interpolate between the elements of the array.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.iridescenceThicknessMap = null;\n\n\t\t/**\n\t\t * The sheen tint.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.sheenColor = new Color( 0x000000 );\n\n\t\t/**\n\t\t * The RGB channels of this texture are multiplied against  `sheenColor`, for per-pixel control\n\t\t * over sheen tint.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.sheenColorMap = null;\n\n\t\t/**\n\t\t * Roughness of the sheen layer, from `0.0` to `1.0`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.sheenRoughness = 1.0;\n\n\t\t/**\n\t\t * The alpha channel of this texture is multiplied against `sheenRoughness`, for per-pixel control\n\t\t * over sheen roughness.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.sheenRoughnessMap = null;\n\n\t\t/**\n\t\t * The red channel of this texture is multiplied against `transmission`, for per-pixel control over\n\t\t * optical transparency.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.transmissionMap = null;\n\n\t\t/**\n\t\t * The thickness of the volume beneath the surface. The value is given in the\n\t\t * coordinate space of the mesh. If the value is `0` the material is\n\t\t * thin-walled. Otherwise the material is a volume boundary.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.thickness = 0;\n\n\t\t/**\n\t\t * A texture that defines the thickness, stored in the green channel. This will\n\t\t * be multiplied by `thickness`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.thicknessMap = null;\n\n\t\t/**\n\t\t * Density of the medium given as the average distance that light travels in\n\t\t * the medium before interacting with a particle. The value is given in world\n\t\t * space units, and must be greater than zero.\n\t\t *\n\t\t * @type {number}\n\t\t * @default Infinity\n\t\t */\n\t\tthis.attenuationDistance = Infinity;\n\n\t\t/**\n\t\t * The color that white light turns into due to absorption when reaching the\n\t\t * attenuation distance.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.attenuationColor = new Color( 1, 1, 1 );\n\n\t\t/**\n\t\t * A float that scales the amount of specular reflection for non-metals only.\n\t\t * When set to zero, the model is effectively Lambertian. From `0.0` to `1.0`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.specularIntensity = 1.0;\n\n\t\t/**\n\t\t * The alpha channel of this texture is multiplied against `specularIntensity`,\n\t\t * for per-pixel control over specular intensity.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.specularIntensityMap = null;\n\n\t\t/**\n\t\t * Tints the specular reflection at normal incidence for non-metals only.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.specularColor = new Color( 1, 1, 1 );\n\n\t\t/**\n\t\t * The RGB channels of this texture are multiplied against `specularColor`,\n\t\t * for per-pixel control over specular color.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.specularColorMap = null;\n\n\t\tthis._anisotropy = 0;\n\t\tthis._clearcoat = 0;\n\t\tthis._dispersion = 0;\n\t\tthis._iridescence = 0;\n\t\tthis._sheen = 0.0;\n\t\tthis._transmission = 0;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\t/**\n\t * The anisotropy strength, from `0.0` to `1.0`.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget anisotropy() {\n\n\t\treturn this._anisotropy;\n\n\t}\n\n\tset anisotropy( value ) {\n\n\t\tif ( this._anisotropy \u003e 0 !== value \u003e 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._anisotropy = value;\n\n\t}\n\n\t/**\n\t * Represents the intensity of the clear coat layer, from `0.0` to `1.0`. Use\n\t * clear coat related properties to enable multilayer materials that have a\n\t * thin translucent layer over the base layer.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget clearcoat() {\n\n\t\treturn this._clearcoat;\n\n\t}\n\n\tset clearcoat( value ) {\n\n\t\tif ( this._clearcoat \u003e 0 !== value \u003e 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._clearcoat = value;\n\n\t}\n\t/**\n\t * The intensity of the iridescence layer, simulating RGB color shift based on the angle between\n\t * the surface and the viewer, from `0.0` to `1.0`.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget iridescence() {\n\n\t\treturn this._iridescence;\n\n\t}\n\n\tset iridescence( value ) {\n\n\t\tif ( this._iridescence \u003e 0 !== value \u003e 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._iridescence = value;\n\n\t}\n\n\t/**\n\t * Defines the strength of the angular separation of colors (chromatic aberration) transmitting\n\t * through a relatively clear volume. Any value zero or larger is valid, the typical range of\n\t * realistic values is `[0, 1]`. This property can be only be used with transmissive objects.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget dispersion() {\n\n\t\treturn this._dispersion;\n\n\t}\n\n\tset dispersion( value ) {\n\n\t\tif ( this._dispersion \u003e 0 !== value \u003e 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._dispersion = value;\n\n\t}\n\n\t/**\n\t * The intensity of the sheen layer, from `0.0` to `1.0`.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget sheen() {\n\n\t\treturn this._sheen;\n\n\t}\n\n\tset sheen( value ) {\n\n\t\tif ( this._sheen \u003e 0 !== value \u003e 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._sheen = value;\n\n\t}\n\n\t/**\n\t * Degree of transmission (or optical transparency), from `0.0` to `1.0`.\n\t *\n\t * Thin, transparent or semitransparent, plastic or glass materials remain\n\t * largely reflective even if they are fully transmissive. The transmission\n\t * property can be used to model these materials.\n\t *\n\t * When transmission is non-zero, `opacity` should be  set to `1`.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget transmission() {\n\n\t\treturn this._transmission;\n\n\t}\n\n\tset transmission( value ) {\n\n\t\tif ( this._transmission \u003e 0 !== value \u003e 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._transmission = value;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.defines = {\n\n\t\t\t'STANDARD': '',\n\t\t\t'PHYSICAL': ''\n\n\t\t};\n\n\t\tthis.anisotropy = source.anisotropy;\n\t\tthis.anisotropyRotation = source.anisotropyRotation;\n\t\tthis.anisotropyMap = source.anisotropyMap;\n\n\t\tthis.clearcoat = source.clearcoat;\n\t\tthis.clearcoatMap = source.clearcoatMap;\n\t\tthis.clearcoatRoughness = source.clearcoatRoughness;\n\t\tthis.clearcoatRoughnessMap = source.clearcoatRoughnessMap;\n\t\tthis.clearcoatNormalMap = source.clearcoatNormalMap;\n\t\tthis.clearcoatNormalScale.copy( source.clearcoatNormalScale );\n\n\t\tthis.dispersion = source.dispersion;\n\t\tthis.ior = source.ior;\n\n\t\tthis.iridescence = source.iridescence;\n\t\tthis.iridescenceMap = source.iridescenceMap;\n\t\tthis.iridescenceIOR = source.iridescenceIOR;\n\t\tthis.iridescenceThicknessRange = [ ...source.iridescenceThicknessRange ];\n\t\tthis.iridescenceThicknessMap = source.iridescenceThicknessMap;\n\n\t\tthis.sheen = source.sheen;\n\t\tthis.sheenColor.copy( source.sheenColor );\n\t\tthis.sheenColorMap = source.sheenColorMap;\n\t\tthis.sheenRoughness = source.sheenRoughness;\n\t\tthis.sheenRoughnessMap = source.sheenRoughnessMap;\n\n\t\tthis.transmission = source.transmission;\n\t\tthis.transmissionMap = source.transmissionMap;\n\n\t\tthis.thickness = source.thickness;\n\t\tthis.thicknessMap = source.thicknessMap;\n\t\tthis.attenuationDistance = source.attenuationDistance;\n\t\tthis.attenuationColor.copy( source.attenuationColor );\n\n\t\tthis.specularIntensity = source.specularIntensity;\n\t\tthis.specularIntensityMap = source.specularIntensityMap;\n\t\tthis.specularColor.copy( source.specularColor );\n\t\tthis.specularColorMap = source.specularColorMap;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A material for shiny surfaces with specular highlights.\n *\n * The material uses a non-physically based [Blinn-Phong](https://en.wikipedia.org/wiki/Blinn-Phong_shading_model)\n * model for calculating reflectance. Unlike the Lambertian model used in the\n * {@link MeshLambertMaterial} this can simulate shiny surfaces with specular\n * highlights (such as varnished wood). `MeshPhongMaterial` uses per-fragment shading.\n *\n * Performance will generally be greater when using this material over the\n * {@link MeshStandardMaterial} or {@link MeshPhysicalMaterial}, at the cost of\n * some graphical accuracy.\n *\n * @augments Material\n * @demo scenes/material-browser.html#MeshPhongMaterial\n */\nclass MeshPhongMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh phong material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshPhongMaterial = true;\n\n\t\tthis.type = 'MeshPhongMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\t/**\n\t\t * Specular color of the material. The default color is set to `0x111111` (very dark grey)\n\t\t *\n\t\t * This defines how shiny the material is and the color of its shine.\n\t\t *\n\t\t * @type {Color}\n\t\t */\n\t\tthis.specular = new Color( 0x111111 );\n\n\t\t/**\n\t\t * How shiny the specular highlight is; a higher value gives a sharper highlight.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 30\n\t\t */\n\t\tthis.shininess = 30;\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The light map. Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.lightMap = null;\n\n\t\t/**\n\t\t * Intensity of the baked light.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\t/**\n\t\t * The red channel of this texture is used as the ambient occlusion map.\n\t\t * Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.aoMap = null;\n\n\t\t/**\n\t\t * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0`\n\t\t * disables ambient occlusion. Where intensity is `1` and the AO map's\n\t\t * red channel is also `1`, ambient light is fully occluded on a surface.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\t/**\n\t\t * Emissive (light) color of the material, essentially a solid color\n\t\t * unaffected by other lighting.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.emissive = new Color( 0x000000 );\n\n\t\t/**\n\t\t * Intensity of the emissive light. Modulates the emissive color.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.emissiveIntensity = 1.0;\n\n\t\t/**\n\t\t * Set emissive (glow) map. The emissive map color is modulated by the\n\t\t * emissive color and the emissive intensity. If you have an emissive map,\n\t\t * be sure to set the emissive color to something other than black.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.emissiveMap = null;\n\n\t\t/**\n\t\t * The texture to create a bump map. The black and white values map to the\n\t\t * perceived depth in relation to the lights. Bump doesn't actually affect\n\t\t * the geometry of the object, only the lighting. If a normal map is defined\n\t\t * this will be ignored.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.bumpMap = null;\n\n\t\t/**\n\t\t * How much the bump map affects the material. Typical range is `[0,1]`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.bumpScale = 1;\n\n\t\t/**\n\t\t * The texture to create a normal map. The RGB values affect the surface\n\t\t * normal for each pixel fragment and change the way the color is lit. Normal\n\t\t * maps do not change the actual shape of the surface, only the lighting. In\n\t\t * case the material has a normal map authored using the left handed\n\t\t * convention, the `y` component of `normalScale` should be negated to compensate\n\t\t * for the different handedness.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.normalMap = null;\n\n\t\t/**\n\t\t * The type of normal map.\n\t\t *\n\t\t * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)}\n\t\t * @default TangentSpaceNormalMap\n\t\t */\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\n\t\t/**\n\t\t * How much the normal map affects the material. Typical value range is `[0,1]`.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (1,1)\n\t\t */\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\t/**\n\t\t * The displacement map affects the position of the mesh's vertices. Unlike\n\t\t * other maps which only affect the light and shade of the material the\n\t\t * displaced vertices can cast shadows, block other objects, and otherwise\n\t\t * act as real geometry. The displacement texture is an image where the value\n\t\t * of each pixel (white being the highest) is mapped against, and\n\t\t * repositions, the vertices of the mesh.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.displacementMap = null;\n\n\t\t/**\n\t\t * How much the displacement map affects the mesh (where black is no\n\t\t * displacement, and white is maximum displacement). Without a displacement\n\t\t * map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementScale = 1;\n\n\t\t/**\n\t\t * The offset of the displacement map's values on the mesh's vertices.\n\t\t * The bias is added to the scaled sample of the displacement map.\n\t\t * Without a displacement map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementBias = 0;\n\n\t\t/**\n\t\t * The specular map value affects both how much the specular surface\n\t\t * highlight contributes and how much of the environment map affects the\n\t\t * surface.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.specularMap = null;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * The environment map.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.envMap = null;\n\n\t\t/**\n\t\t * The rotation of the environment map in radians.\n\t\t *\n\t\t * @type {Euler}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.envMapRotation = new Euler();\n\n\t\t/**\n\t\t * How to combine the result of the surface's color with the environment map, if any.\n\t\t *\n\t\t * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to\n\t\t * blend between the two colors.\n\t\t *\n\t\t * @type {(MultiplyOperation|MixOperation|AddOperation)}\n\t\t * @default MultiplyOperation\n\t\t */\n\t\tthis.combine = MultiplyOperation;\n\n\t\t/**\n\t\t * How much the environment map affects the surface.\n\t\t * The valid range is between `0` (no reflections) and `1` (full reflections).\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.reflectivity = 1;\n\n\t\t/**\n\t\t * The index of refraction (IOR) of air (approximately 1) divided by the\n\t\t * index of refraction of the material. It is used with environment mapping\n\t\t * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}.\n\t\t * The refraction ratio should not exceed `1`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0.98\n\t\t */\n\t\tthis.refractionRatio = 0.98;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\t/**\n\t\t * Defines appearance of wireframe ends.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinecap = 'round';\n\n\t\t/**\n\t\t * Defines appearance of wireframe joints.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\t/**\n\t\t * Whether the material is rendered with flat shading or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flatShading = false;\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\t\tthis.specular.copy( source.specular );\n\t\tthis.shininess = source.shininess;\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapRotation.copy( source.envMapRotation );\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A material implementing toon shading.\n *\n * @augments Material\n * @demo scenes/material-browser.html#MeshToonMaterial\n */\nclass MeshToonMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh toon material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshToonMaterial = true;\n\n\t\tthis.defines = { 'TOON': '' };\n\n\t\tthis.type = 'MeshToonMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff );\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * Gradient map for toon shading. It's required to set\n\t\t * {@link Texture#minFilter} and {@link Texture#magFilter} to {@linkNearestFilter}\n\t\t * when using this type of texture.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.gradientMap = null;\n\n\t\t/**\n\t\t * The light map. Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.lightMap = null;\n\n\t\t/**\n\t\t * Intensity of the baked light.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\t/**\n\t\t * The red channel of this texture is used as the ambient occlusion map.\n\t\t * Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.aoMap = null;\n\n\t\t/**\n\t\t * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0`\n\t\t * disables ambient occlusion. Where intensity is `1` and the AO map's\n\t\t * red channel is also `1`, ambient light is fully occluded on a surface.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\t/**\n\t\t * Emissive (light) color of the material, essentially a solid color\n\t\t * unaffected by other lighting.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.emissive = new Color( 0x000000 );\n\n\t\t/**\n\t\t * Intensity of the emissive light. Modulates the emissive color.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.emissiveIntensity = 1.0;\n\n\t\t/**\n\t\t * Set emissive (glow) map. The emissive map color is modulated by the\n\t\t * emissive color and the emissive intensity. If you have an emissive map,\n\t\t * be sure to set the emissive color to something other than black.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.emissiveMap = null;\n\n\t\t/**\n\t\t * The texture to create a bump map. The black and white values map to the\n\t\t * perceived depth in relation to the lights. Bump doesn't actually affect\n\t\t * the geometry of the object, only the lighting. If a normal map is defined\n\t\t * this will be ignored.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.bumpMap = null;\n\n\t\t/**\n\t\t * How much the bump map affects the material. Typical range is `[0,1]`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.bumpScale = 1;\n\n\t\t/**\n\t\t * The texture to create a normal map. The RGB values affect the surface\n\t\t * normal for each pixel fragment and change the way the color is lit. Normal\n\t\t * maps do not change the actual shape of the surface, only the lighting. In\n\t\t * case the material has a normal map authored using the left handed\n\t\t * convention, the `y` component of `normalScale` should be negated to compensate\n\t\t * for the different handedness.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.normalMap = null;\n\n\t\t/**\n\t\t * The type of normal map.\n\t\t *\n\t\t * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)}\n\t\t * @default TangentSpaceNormalMap\n\t\t */\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\n\t\t/**\n\t\t * How much the normal map affects the material. Typical value range is `[0,1]`.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (1,1)\n\t\t */\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\t/**\n\t\t * The displacement map affects the position of the mesh's vertices. Unlike\n\t\t * other maps which only affect the light and shade of the material the\n\t\t * displaced vertices can cast shadows, block other objects, and otherwise\n\t\t * act as real geometry. The displacement texture is an image where the value\n\t\t * of each pixel (white being the highest) is mapped against, and\n\t\t * repositions, the vertices of the mesh.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.displacementMap = null;\n\n\t\t/**\n\t\t * How much the displacement map affects the mesh (where black is no\n\t\t * displacement, and white is maximum displacement). Without a displacement\n\t\t * map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementScale = 1;\n\n\t\t/**\n\t\t * The offset of the displacement map's values on the mesh's vertices.\n\t\t * The bias is added to the scaled sample of the displacement map.\n\t\t * Without a displacement map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementBias = 0;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\t/**\n\t\t * Defines appearance of wireframe ends.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinecap = 'round';\n\n\t\t/**\n\t\t * Defines appearance of wireframe joints.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\t\tthis.gradientMap = source.gradientMap;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A material that maps the normal vectors to RGB colors.\n *\n * @augments Material\n * @demo scenes/material-browser.html#MeshNormalMaterial\n */\nclass MeshNormalMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh normal material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshNormalMaterial = true;\n\n\t\tthis.type = 'MeshNormalMaterial';\n\n\t\t/**\n\t\t * The texture to create a bump map. The black and white values map to the\n\t\t * perceived depth in relation to the lights. Bump doesn't actually affect\n\t\t * the geometry of the object, only the lighting. If a normal map is defined\n\t\t * this will be ignored.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.bumpMap = null;\n\n\t\t/**\n\t\t * How much the bump map affects the material. Typical range is `[0,1]`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.bumpScale = 1;\n\n\t\t/**\n\t\t * The texture to create a normal map. The RGB values affect the surface\n\t\t * normal for each pixel fragment and change the way the color is lit. Normal\n\t\t * maps do not change the actual shape of the surface, only the lighting. In\n\t\t * case the material has a normal map authored using the left handed\n\t\t * convention, the `y` component of `normalScale` should be negated to compensate\n\t\t * for the different handedness.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.normalMap = null;\n\n\t\t/**\n\t\t * The type of normal map.\n\t\t *\n\t\t * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)}\n\t\t * @default TangentSpaceNormalMap\n\t\t */\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\n\t\t/**\n\t\t * How much the normal map affects the material. Typical value range is `[0,1]`.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (1,1)\n\t\t */\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\t/**\n\t\t * The displacement map affects the position of the mesh's vertices. Unlike\n\t\t * other maps which only affect the light and shade of the material the\n\t\t * displaced vertices can cast shadows, block other objects, and otherwise\n\t\t * act as real geometry. The displacement texture is an image where the value\n\t\t * of each pixel (white being the highest) is mapped against, and\n\t\t * repositions, the vertices of the mesh.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.displacementMap = null;\n\n\t\t/**\n\t\t * How much the displacement map affects the mesh (where black is no\n\t\t * displacement, and white is maximum displacement). Without a displacement\n\t\t * map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementScale = 1;\n\n\t\t/**\n\t\t * The offset of the displacement map's values on the mesh's vertices.\n\t\t * The bias is added to the scaled sample of the displacement map.\n\t\t * Without a displacement map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementBias = 0;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * WebGL and WebGPU ignore this property and always render\n\t\t * 1 pixel wide lines.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\t/**\n\t\t * Whether the material is rendered with flat shading or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flatShading = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A material for non-shiny surfaces, without specular highlights.\n *\n * The material uses a non-physically based [Lambertian](https://en.wikipedia.org/wiki/Lambertian_reflectance)\n * model for calculating reflectance. This can simulate some surfaces (such\n * as untreated wood or stone) well, but cannot simulate shiny surfaces with\n * specular highlights (such as varnished wood). `MeshLambertMaterial` uses per-fragment\n * shading.\n *\n * Due to the simplicity of the reflectance and illumination models,\n * performance will be greater when using this material over the\n * {@link MeshPhongMaterial}, {@link MeshStandardMaterial} or\n * {@link MeshPhysicalMaterial}, at the cost of some graphical accuracy.\n *\n * @augments Material\n * @demo scenes/material-browser.html#MeshLambertMaterial\n */\nclass MeshLambertMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh lambert material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshLambertMaterial = true;\n\n\t\tthis.type = 'MeshLambertMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The light map. Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.lightMap = null;\n\n\t\t/**\n\t\t * Intensity of the baked light.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\t/**\n\t\t * The red channel of this texture is used as the ambient occlusion map.\n\t\t * Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.aoMap = null;\n\n\t\t/**\n\t\t * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0`\n\t\t * disables ambient occlusion. Where intensity is `1` and the AO map's\n\t\t * red channel is also `1`, ambient light is fully occluded on a surface.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\t/**\n\t\t * Emissive (light) color of the material, essentially a solid color\n\t\t * unaffected by other lighting.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.emissive = new Color( 0x000000 );\n\n\t\t/**\n\t\t * Intensity of the emissive light. Modulates the emissive color.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.emissiveIntensity = 1.0;\n\n\t\t/**\n\t\t * Set emissive (glow) map. The emissive map color is modulated by the\n\t\t * emissive color and the emissive intensity. If you have an emissive map,\n\t\t * be sure to set the emissive color to something other than black.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.emissiveMap = null;\n\n\t\t/**\n\t\t * The texture to create a bump map. The black and white values map to the\n\t\t * perceived depth in relation to the lights. Bump doesn't actually affect\n\t\t * the geometry of the object, only the lighting. If a normal map is defined\n\t\t * this will be ignored.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.bumpMap = null;\n\n\t\t/**\n\t\t * How much the bump map affects the material. Typical range is `[0,1]`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.bumpScale = 1;\n\n\t\t/**\n\t\t * The texture to create a normal map. The RGB values affect the surface\n\t\t * normal for each pixel fragment and change the way the color is lit. Normal\n\t\t * maps do not change the actual shape of the surface, only the lighting. In\n\t\t * case the material has a normal map authored using the left handed\n\t\t * convention, the `y` component of `normalScale` should be negated to compensate\n\t\t * for the different handedness.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.normalMap = null;\n\n\t\t/**\n\t\t * The type of normal map.\n\t\t *\n\t\t * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)}\n\t\t * @default TangentSpaceNormalMap\n\t\t */\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\n\t\t/**\n\t\t * How much the normal map affects the material. Typical value range is `[0,1]`.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (1,1)\n\t\t */\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\t/**\n\t\t * The displacement map affects the position of the mesh's vertices. Unlike\n\t\t * other maps which only affect the light and shade of the material the\n\t\t * displaced vertices can cast shadows, block other objects, and otherwise\n\t\t * act as real geometry. The displacement texture is an image where the value\n\t\t * of each pixel (white being the highest) is mapped against, and\n\t\t * repositions, the vertices of the mesh.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.displacementMap = null;\n\n\t\t/**\n\t\t * How much the displacement map affects the mesh (where black is no\n\t\t * displacement, and white is maximum displacement). Without a displacement\n\t\t * map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementScale = 1;\n\n\t\t/**\n\t\t * The offset of the displacement map's values on the mesh's vertices.\n\t\t * The bias is added to the scaled sample of the displacement map.\n\t\t * Without a displacement map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementBias = 0;\n\n\t\t/**\n\t\t * Specular map used by the material.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.specularMap = null;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * The environment map.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.envMap = null;\n\n\t\t/**\n\t\t * The rotation of the environment map in radians.\n\t\t *\n\t\t * @type {Euler}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.envMapRotation = new Euler();\n\n\t\t/**\n\t\t * How to combine the result of the surface's color with the environment map, if any.\n\t\t *\n\t\t * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to\n\t\t * blend between the two colors.\n\t\t *\n\t\t * @type {(MultiplyOperation|MixOperation|AddOperation)}\n\t\t * @default MultiplyOperation\n\t\t */\n\t\tthis.combine = MultiplyOperation;\n\n\t\t/**\n\t\t * How much the environment map affects the surface.\n\t\t * The valid range is between `0` (no reflections) and `1` (full reflections).\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.reflectivity = 1;\n\n\t\t/**\n\t\t * The index of refraction (IOR) of air (approximately 1) divided by the\n\t\t * index of refraction of the material. It is used with environment mapping\n\t\t * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}.\n\t\t * The refraction ratio should not exceed `1`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0.98\n\t\t */\n\t\tthis.refractionRatio = 0.98;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\t/**\n\t\t * Defines appearance of wireframe ends.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinecap = 'round';\n\n\t\t/**\n\t\t * Defines appearance of wireframe joints.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\t/**\n\t\t * Whether the material is rendered with flat shading or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flatShading = false;\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapRotation.copy( source.envMapRotation );\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A material for drawing geometry by depth. Depth is based off of the camera\n * near and far plane. White is nearest, black is farthest.\n *\n * @augments Material\n * @demo scenes/material-browser.html#MeshDepthMaterial\n */\nclass MeshDepthMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh depth material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshDepthMaterial = true;\n\n\t\tthis.type = 'MeshDepthMaterial';\n\n\t\t/**\n\t\t * Type for depth packing.\n\t\t *\n\t\t * @type {(BasicDepthPacking|RGBADepthPacking|RGBDepthPacking|RGDepthPacking)}\n\t\t * @default BasicDepthPacking\n\t\t */\n\t\tthis.depthPacking = BasicDepthPacking;\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * The displacement map affects the position of the mesh's vertices. Unlike\n\t\t * other maps which only affect the light and shade of the material the\n\t\t * displaced vertices can cast shadows, block other objects, and otherwise\n\t\t * act as real geometry. The displacement texture is an image where the value\n\t\t * of each pixel (white being the highest) is mapped against, and\n\t\t * repositions, the vertices of the mesh.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.displacementMap = null;\n\n\t\t/**\n\t\t * How much the displacement map affects the mesh (where black is no\n\t\t * displacement, and white is maximum displacement). Without a displacement\n\t\t * map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementScale = 1;\n\n\t\t/**\n\t\t * The offset of the displacement map's values on the mesh's vertices.\n\t\t * The bias is added to the scaled sample of the displacement map.\n\t\t * Without a displacement map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementBias = 0;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * WebGL and WebGPU ignore this property and always render\n\t\t * 1 pixel wide lines.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.depthPacking = source.depthPacking;\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A material used internally for implementing shadow mapping with\n * point lights.\n *\n * Can also be used to customize the shadow casting of an object by assigning\n * an instance of `MeshDistanceMaterial` to {@link Object3D#customDistanceMaterial}.\n * The following examples demonstrates this approach in order to ensure\n * transparent parts of objects do not cast shadows.\n *\n * @augments Material\n */\nclass MeshDistanceMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh distance material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshDistanceMaterial = true;\n\n\t\tthis.type = 'MeshDistanceMaterial';\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * The displacement map affects the position of the mesh's vertices. Unlike\n\t\t * other maps which only affect the light and shade of the material the\n\t\t * displaced vertices can cast shadows, block other objects, and otherwise\n\t\t * act as real geometry. The displacement texture is an image where the value\n\t\t * of each pixel (white being the highest) is mapped against, and\n\t\t * repositions, the vertices of the mesh.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.displacementMap = null;\n\n\t\t/**\n\t\t * How much the displacement map affects the mesh (where black is no\n\t\t * displacement, and white is maximum displacement). Without a displacement\n\t\t * map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementScale = 1;\n\n\t\t/**\n\t\t * The offset of the displacement map's values on the mesh's vertices.\n\t\t * The bias is added to the scaled sample of the displacement map.\n\t\t * Without a displacement map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementBias = 0;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * This material is defined by a MatCap (or Lit Sphere) texture, which encodes the\n * material color and shading.\n *\n * `MeshMatcapMaterial` does not respond to lights since the matcap image file encodes\n * baked lighting. It will cast a shadow onto an object that receives shadows\n * (and shadow clipping works), but it will not self-shadow or receive\n * shadows.\n *\n * @augments Material\n * @demo scenes/material-browser.html#MeshMatcapMaterial\n */\nclass MeshMatcapMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh matcap material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshMatcapMaterial = true;\n\n\t\tthis.defines = { 'MATCAP': '' };\n\n\t\tthis.type = 'MeshMatcapMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\t/**\n\t\t * The matcap map.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.matcap = null;\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The texture to create a bump map. The black and white values map to the\n\t\t * perceived depth in relation to the lights. Bump doesn't actually affect\n\t\t * the geometry of the object, only the lighting. If a normal map is defined\n\t\t * this will be ignored.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.bumpMap = null;\n\n\t\t/**\n\t\t * How much the bump map affects the material. Typical range is `[0,1]`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.bumpScale = 1;\n\n\t\t/**\n\t\t * The texture to create a normal map. The RGB values affect the surface\n\t\t * normal for each pixel fragment and change the way the color is lit. Normal\n\t\t * maps do not change the actual shape of the surface, only the lighting. In\n\t\t * case the material has a normal map authored using the left handed\n\t\t * convention, the `y` component of `normalScale` should be negated to compensate\n\t\t * for the different handedness.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.normalMap = null;\n\n\t\t/**\n\t\t * The type of normal map.\n\t\t *\n\t\t * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)}\n\t\t * @default TangentSpaceNormalMap\n\t\t */\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\n\t\t/**\n\t\t * How much the normal map affects the material. Typical value range is `[0,1]`.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (1,1)\n\t\t */\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\t/**\n\t\t * The displacement map affects the position of the mesh's vertices. Unlike\n\t\t * other maps which only affect the light and shade of the material the\n\t\t * displaced vertices can cast shadows, block other objects, and otherwise\n\t\t * act as real geometry. The displacement texture is an image where the value\n\t\t * of each pixel (white being the highest) is mapped against, and\n\t\t * repositions, the vertices of the mesh.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.displacementMap = null;\n\n\t\t/**\n\t\t * How much the displacement map affects the mesh (where black is no\n\t\t * displacement, and white is maximum displacement). Without a displacement\n\t\t * map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementScale = 1;\n\n\t\t/**\n\t\t * The offset of the displacement map's values on the mesh's vertices.\n\t\t * The bias is added to the scaled sample of the displacement map.\n\t\t * Without a displacement map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementBias = 0;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\t/**\n\t\t * Whether the material is rendered with flat shading or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flatShading = false;\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.defines = { 'MATCAP': '' };\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.matcap = source.matcap;\n\n\t\tthis.map = source.map;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A material for rendering line primitives.\n *\n * Materials define the appearance of renderable 3D objects.\n *\n * ```js\n * const material = new THREE.LineDashedMaterial( {\n * \tcolor: 0xffffff,\n * \tscale: 1,\n * \tdashSize: 3,\n * \tgapSize: 1,\n * } );\n * ```\n *\n * @augments LineBasicMaterial\n */\nclass LineDashedMaterial extends LineBasicMaterial {\n\n\t/**\n\t * Constructs a new line dashed material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLineDashedMaterial = true;\n\t\tthis.type = 'LineDashedMaterial';\n\n\t\t/**\n\t\t * The scale of the dashed part of a line.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.scale = 1;\n\n\t\t/**\n\t\t * The size of the dash. This is both the gap with the stroke.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 3\n\t\t */\n\t\tthis.dashSize = 3;\n\n\t\t/**\n\t\t * The size of the gap.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.gapSize = 1;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.scale = source.scale;\n\t\tthis.dashSize = source.dashSize;\n\t\tthis.gapSize = source.gapSize;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * Converts an array to a specific type.\n *\n * @param {TypedArray|Array} array - The array to convert.\n * @param {TypedArray.constructor} type - The constructor of a typed array that defines the new type.\n * @return {TypedArray} The converted array.\n */\nfunction convertArray( array, type ) {\n\n\tif ( ! array || array.constructor === type ) return array;\n\n\tif ( typeof type.BYTES_PER_ELEMENT === 'number' ) {\n\n\t\treturn new type( array ); // create typed array\n\n\t}\n\n\treturn Array.prototype.slice.call( array ); // create Array\n\n}\n\n/**\n * Returns an array by which times and values can be sorted.\n *\n * @param {Array\u003cnumber\u003e} times - The keyframe time values.\n * @return {Array\u003cnumber\u003e} The array.\n */\nfunction getKeyframeOrder( times ) {\n\n\tfunction compareTime( i, j ) {\n\n\t\treturn times[ i ] - times[ j ];\n\n\t}\n\n\tconst n = times.length;\n\tconst result = new Array( n );\n\tfor ( let i = 0; i !== n; ++ i ) result[ i ] = i;\n\n\tresult.sort( compareTime );\n\n\treturn result;\n\n}\n\n/**\n * Sorts the given array by the previously computed order via `getKeyframeOrder()`.\n *\n * @param {Array\u003cnumber\u003e} values - The values to sort.\n * @param {number} stride - The stride.\n * @param {Array\u003cnumber\u003e} order - The sort order.\n * @return {Array\u003cnumber\u003e} The sorted values.\n */\nfunction sortedArray( values, stride, order ) {\n\n\tconst nValues = values.length;\n\tconst result = new values.constructor( nValues );\n\n\tfor ( let i = 0, dstOffset = 0; dstOffset !== nValues; ++ i ) {\n\n\t\tconst srcOffset = order[ i ] * stride;\n\n\t\tfor ( let j = 0; j !== stride; ++ j ) {\n\n\t\t\tresult[ dstOffset ++ ] = values[ srcOffset + j ];\n\n\t\t}\n\n\t}\n\n\treturn result;\n\n}\n\n/**\n * Used for parsing AOS keyframe formats.\n *\n * @param {Array\u003cnumber\u003e} jsonKeys - A list of JSON keyframes.\n * @param {Array\u003cnumber\u003e} times - This array will be filled with keyframe times by this function.\n * @param {Array\u003cnumber\u003e} values - This array will be filled with keyframe values by this function.\n * @param {string} valuePropertyName - The name of the property to use.\n */\nfunction flattenJSON( jsonKeys, times, values, valuePropertyName ) {\n\n\tlet i = 1, key = jsonKeys[ 0 ];\n\n\twhile ( key !== undefined \u0026\u0026 key[ valuePropertyName ] === undefined ) {\n\n\t\tkey = jsonKeys[ i ++ ];\n\n\t}\n\n\tif ( key === undefined ) return; // no data\n\n\tlet value = key[ valuePropertyName ];\n\tif ( value === undefined ) return; // no data\n\n\tif ( Array.isArray( value ) ) {\n\n\t\tdo {\n\n\t\t\tvalue = key[ valuePropertyName ];\n\n\t\t\tif ( value !== undefined ) {\n\n\t\t\t\ttimes.push( key.time );\n\t\t\t\tvalues.push( ...value ); // push all elements\n\n\t\t\t}\n\n\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t} while ( key !== undefined );\n\n\t} else if ( value.toArray !== undefined ) {\n\n\t\t// ...assume THREE.Math-ish\n\n\t\tdo {\n\n\t\t\tvalue = key[ valuePropertyName ];\n\n\t\t\tif ( value !== undefined ) {\n\n\t\t\t\ttimes.push( key.time );\n\t\t\t\tvalue.toArray( values, values.length );\n\n\t\t\t}\n\n\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t} while ( key !== undefined );\n\n\t} else {\n\n\t\t// otherwise push as-is\n\n\t\tdo {\n\n\t\t\tvalue = key[ valuePropertyName ];\n\n\t\t\tif ( value !== undefined ) {\n\n\t\t\t\ttimes.push( key.time );\n\t\t\t\tvalues.push( value );\n\n\t\t\t}\n\n\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t} while ( key !== undefined );\n\n\t}\n\n}\n\n/**\n * Creates a new clip, containing only the segment of the original clip between the given frames.\n *\n * @param {AnimationClip} sourceClip - The values to sort.\n * @param {string} name - The name of the clip.\n * @param {number} startFrame - The start frame.\n * @param {number} endFrame - The end frame.\n * @param {number} [fps=30] - The FPS.\n * @return {AnimationClip} The new sub clip.\n */\nfunction subclip( sourceClip, name, startFrame, endFrame, fps = 30 ) {\n\n\tconst clip = sourceClip.clone();\n\n\tclip.name = name;\n\n\tconst tracks = [];\n\n\tfor ( let i = 0; i \u003c clip.tracks.length; ++ i ) {\n\n\t\tconst track = clip.tracks[ i ];\n\t\tconst valueSize = track.getValueSize();\n\n\t\tconst times = [];\n\t\tconst values = [];\n\n\t\tfor ( let j = 0; j \u003c track.times.length; ++ j ) {\n\n\t\t\tconst frame = track.times[ j ] * fps;\n\n\t\t\tif ( frame \u003c startFrame || frame \u003e= endFrame ) continue;\n\n\t\t\ttimes.push( track.times[ j ] );\n\n\t\t\tfor ( let k = 0; k \u003c valueSize; ++ k ) {\n\n\t\t\t\tvalues.push( track.values[ j * valueSize + k ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( times.length === 0 ) continue;\n\n\t\ttrack.times = convertArray( times, track.times.constructor );\n\t\ttrack.values = convertArray( values, track.values.constructor );\n\n\t\ttracks.push( track );\n\n\t}\n\n\tclip.tracks = tracks;\n\n\t// find minimum .times value across all tracks in the trimmed clip\n\n\tlet minStartTime = Infinity;\n\n\tfor ( let i = 0; i \u003c clip.tracks.length; ++ i ) {\n\n\t\tif ( minStartTime \u003e clip.tracks[ i ].times[ 0 ] ) {\n\n\t\t\tminStartTime = clip.tracks[ i ].times[ 0 ];\n\n\t\t}\n\n\t}\n\n\t// shift all tracks such that clip begins at t=0\n\n\tfor ( let i = 0; i \u003c clip.tracks.length; ++ i ) {\n\n\t\tclip.tracks[ i ].shift( -1 * minStartTime );\n\n\t}\n\n\tclip.resetDuration();\n\n\treturn clip;\n\n}\n\n/**\n * Converts the keyframes of the given animation clip to an additive format.\n *\n * @param {AnimationClip} targetClip - The clip to make additive.\n * @param {number} [referenceFrame=0] - The reference frame.\n * @param {AnimationClip} [referenceClip=targetClip] - The reference clip.\n * @param {number} [fps=30] - The FPS.\n * @return {AnimationClip} The updated clip which is now additive.\n */\nfunction makeClipAdditive( targetClip, referenceFrame = 0, referenceClip = targetClip, fps = 30 ) {\n\n\tif ( fps \u003c= 0 ) fps = 30;\n\n\tconst numTracks = referenceClip.tracks.length;\n\tconst referenceTime = referenceFrame / fps;\n\n\t// Make each track's values relative to the values at the reference frame\n\tfor ( let i = 0; i \u003c numTracks; ++ i ) {\n\n\t\tconst referenceTrack = referenceClip.tracks[ i ];\n\t\tconst referenceTrackType = referenceTrack.ValueTypeName;\n\n\t\t// Skip this track if it's non-numeric\n\t\tif ( referenceTrackType === 'bool' || referenceTrackType === 'string' ) continue;\n\n\t\t// Find the track in the target clip whose name and type matches the reference track\n\t\tconst targetTrack = targetClip.tracks.find( function ( track ) {\n\n\t\t\treturn track.name === referenceTrack.name\n\t\t\t\t\u0026\u0026 track.ValueTypeName === referenceTrackType;\n\n\t\t} );\n\n\t\tif ( targetTrack === undefined ) continue;\n\n\t\tlet referenceOffset = 0;\n\t\tconst referenceValueSize = referenceTrack.getValueSize();\n\n\t\tif ( referenceTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) {\n\n\t\t\treferenceOffset = referenceValueSize / 3;\n\n\t\t}\n\n\t\tlet targetOffset = 0;\n\t\tconst targetValueSize = targetTrack.getValueSize();\n\n\t\tif ( targetTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) {\n\n\t\t\ttargetOffset = targetValueSize / 3;\n\n\t\t}\n\n\t\tconst lastIndex = referenceTrack.times.length - 1;\n\t\tlet referenceValue;\n\n\t\t// Find the value to subtract out of the track\n\t\tif ( referenceTime \u003c= referenceTrack.times[ 0 ] ) {\n\n\t\t\t// Reference frame is earlier than the first keyframe, so just use the first keyframe\n\t\t\tconst startIndex = referenceOffset;\n\t\t\tconst endIndex = referenceValueSize - referenceOffset;\n\t\t\treferenceValue = referenceTrack.values.slice( startIndex, endIndex );\n\n\t\t} else if ( referenceTime \u003e= referenceTrack.times[ lastIndex ] ) {\n\n\t\t\t// Reference frame is after the last keyframe, so just use the last keyframe\n\t\t\tconst startIndex = lastIndex * referenceValueSize + referenceOffset;\n\t\t\tconst endIndex = startIndex + referenceValueSize - referenceOffset;\n\t\t\treferenceValue = referenceTrack.values.slice( startIndex, endIndex );\n\n\t\t} else {\n\n\t\t\t// Interpolate to the reference value\n\t\t\tconst interpolant = referenceTrack.createInterpolant();\n\t\t\tconst startIndex = referenceOffset;\n\t\t\tconst endIndex = referenceValueSize - referenceOffset;\n\t\t\tinterpolant.evaluate( referenceTime );\n\t\t\treferenceValue = interpolant.resultBuffer.slice( startIndex, endIndex );\n\n\t\t}\n\n\t\t// Conjugate the quaternion\n\t\tif ( referenceTrackType === 'quaternion' ) {\n\n\t\t\tconst referenceQuat = new Quaternion().fromArray( referenceValue ).normalize().conjugate();\n\t\t\treferenceQuat.toArray( referenceValue );\n\n\t\t}\n\n\t\t// Subtract the reference value from all of the track values\n\n\t\tconst numTimes = targetTrack.times.length;\n\t\tfor ( let j = 0; j \u003c numTimes; ++ j ) {\n\n\t\t\tconst valueStart = j * targetValueSize + targetOffset;\n\n\t\t\tif ( referenceTrackType === 'quaternion' ) {\n\n\t\t\t\t// Multiply the conjugate for quaternion track types\n\t\t\t\tQuaternion.multiplyQuaternionsFlat(\n\t\t\t\t\ttargetTrack.values,\n\t\t\t\t\tvalueStart,\n\t\t\t\t\treferenceValue,\n\t\t\t\t\t0,\n\t\t\t\t\ttargetTrack.values,\n\t\t\t\t\tvalueStart\n\t\t\t\t);\n\n\t\t\t} else {\n\n\t\t\t\tconst valueEnd = targetValueSize - targetOffset * 2;\n\n\t\t\t\t// Subtract each value for all other numeric track types\n\t\t\t\tfor ( let k = 0; k \u003c valueEnd; ++ k ) {\n\n\t\t\t\t\ttargetTrack.values[ valueStart + k ] -= referenceValue[ k ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttargetClip.blendMode = AdditiveAnimationBlendMode;\n\n\treturn targetClip;\n\n}\n\n/**\n * A class with various methods to assist with animations.\n *\n * @hideconstructor\n */\nclass AnimationUtils {\n\n\t/**\n\t * Converts an array to a specific type\n\t *\n\t * @static\n\t * @param {TypedArray|Array} array - The array to convert.\n\t * @param {TypedArray.constructor} type - The constructor of a type array.\n\t * @return {TypedArray} The converted array\n\t */\n\tstatic convertArray( array, type ) {\n\n\t\treturn convertArray( array, type );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given object is a typed array.\n\t *\n\t * @static\n\t * @param {any} object - The object to check.\n\t * @return {boolean} Whether the given object is a typed array.\n\t */\n\tstatic isTypedArray( object ) {\n\n\t\treturn isTypedArray( object );\n\n\t}\n\n\t/**\n\t * Returns an array by which times and values can be sorted.\n\t *\n\t * @static\n\t * @param {Array\u003cnumber\u003e} times - The keyframe time values.\n\t * @return {Array\u003cnumber\u003e} The array.\n\t */\n\tstatic getKeyframeOrder( times ) {\n\n\t\treturn getKeyframeOrder( times );\n\n\t}\n\n\t/**\n\t * Sorts the given array by the previously computed order via `getKeyframeOrder()`.\n\t *\n\t * @static\n\t * @param {Array\u003cnumber\u003e} values - The values to sort.\n\t * @param {number} stride - The stride.\n\t * @param {Array\u003cnumber\u003e} order - The sort order.\n\t * @return {Array\u003cnumber\u003e} The sorted values.\n\t */\n\tstatic sortedArray( values, stride, order ) {\n\n\t\treturn sortedArray( values, stride, order );\n\n\t}\n\n\t/**\n\t * Used for parsing AOS keyframe formats.\n\t *\n\t * @static\n\t * @param {Array\u003cnumber\u003e} jsonKeys - A list of JSON keyframes.\n\t * @param {Array\u003cnumber\u003e} times - This array will be filled with keyframe times by this method.\n\t * @param {Array\u003cnumber\u003e} values - This array will be filled with keyframe values by this method.\n\t * @param {string} valuePropertyName - The name of the property to use.\n\t */\n\tstatic flattenJSON( jsonKeys, times, values, valuePropertyName ) {\n\n\t\tflattenJSON( jsonKeys, times, values, valuePropertyName );\n\n\t}\n\n\t/**\n\t * Creates a new clip, containing only the segment of the original clip between the given frames.\n\t *\n\t * @static\n\t * @param {AnimationClip} sourceClip - The values to sort.\n\t * @param {string} name - The name of the clip.\n\t * @param {number} startFrame - The start frame.\n\t * @param {number} endFrame - The end frame.\n\t * @param {number} [fps=30] - The FPS.\n\t * @return {AnimationClip} The new sub clip.\n\t */\n\tstatic subclip( sourceClip, name, startFrame, endFrame, fps = 30 ) {\n\n\t\treturn subclip( sourceClip, name, startFrame, endFrame, fps );\n\n\t}\n\n\t/**\n\t * Converts the keyframes of the given animation clip to an additive format.\n\t *\n\t * @static\n\t * @param {AnimationClip} targetClip - The clip to make additive.\n\t * @param {number} [referenceFrame=0] - The reference frame.\n\t * @param {AnimationClip} [referenceClip=targetClip] - The reference clip.\n\t * @param {number} [fps=30] - The FPS.\n\t * @return {AnimationClip} The updated clip which is now additive.\n\t */\n\tstatic makeClipAdditive( targetClip, referenceFrame = 0, referenceClip = targetClip, fps = 30 ) {\n\n\t\treturn makeClipAdditive( targetClip, referenceFrame, referenceClip, fps );\n\n\t}\n\n}\n\n/**\n * Abstract base class of interpolants over parametric samples.\n *\n * The parameter domain is one dimensional, typically the time or a path\n * along a curve defined by the data.\n *\n * The sample values can have any dimensionality and derived classes may\n * apply special interpretations to the data.\n *\n * This class provides the interval seek in a Template Method, deferring\n * the actual interpolation to derived classes.\n *\n * Time complexity is O(1) for linear access crossing at most two points\n * and O(log N) for random access, where N is the number of positions.\n *\n * References: {@link http://www.oodesign.com/template-method-pattern.html}\n *\n * @abstract\n */\nclass Interpolant {\n\n\t/**\n\t * Constructs a new interpolant.\n\t *\n\t * @param {TypedArray} parameterPositions - The parameter positions hold the interpolation factors.\n\t * @param {TypedArray} sampleValues - The sample values.\n\t * @param {number} sampleSize - The sample size\n\t * @param {TypedArray} [resultBuffer] - The result buffer.\n\t */\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\t/**\n\t\t * The parameter positions.\n\t\t *\n\t\t * @type {TypedArray}\n\t\t */\n\t\tthis.parameterPositions = parameterPositions;\n\n\t\t/**\n\t\t * A cache index.\n\t\t *\n\t\t * @private\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis._cachedIndex = 0;\n\n\t\t/**\n\t\t * The result buffer.\n\t\t *\n\t\t * @type {TypedArray}\n\t\t */\n\t\tthis.resultBuffer = resultBuffer !== undefined ? resultBuffer : new sampleValues.constructor( sampleSize );\n\n\t\t/**\n\t\t * The sample values.\n\t\t *\n\t\t * @type {TypedArray}\n\t\t */\n\t\tthis.sampleValues = sampleValues;\n\n\t\t/**\n\t\t * The value size.\n\t\t *\n\t\t * @type {TypedArray}\n\t\t */\n\t\tthis.valueSize = sampleSize;\n\n\t\t/**\n\t\t * The interpolation settings.\n\t\t *\n\t\t * @type {?Object}\n\t\t * @default null\n\t\t */\n\t\tthis.settings = null;\n\n\t\t/**\n\t\t * The default settings object.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.DefaultSettings_ = {};\n\n\t}\n\n\t/**\n\t * Evaluate the interpolant at position `t`.\n\t *\n\t * @param {number} t - The interpolation factor.\n\t * @return {TypedArray} The result buffer.\n\t */\n\tevaluate( t ) {\n\n\t\tconst pp = this.parameterPositions;\n\t\tlet i1 = this._cachedIndex,\n\t\t\tt1 = pp[ i1 ],\n\t\t\tt0 = pp[ i1 - 1 ];\n\n\t\tvalidate_interval: {\n\n\t\t\tseek: {\n\n\t\t\t\tlet right;\n\n\t\t\t\tlinear_scan: {\n\n\t\t\t\t\t//- See http://jsperf.com/comparison-to-undefined/3\n\t\t\t\t\t//- slower code:\n\t\t\t\t\t//-\n\t\t\t\t\t//- \t\t\t\tif ( t \u003e= t1 || t1 === undefined ) {\n\t\t\t\t\tforward_scan: if ( ! ( t \u003c t1 ) ) {\n\n\t\t\t\t\t\tfor ( let giveUpAt = i1 + 2; ; ) {\n\n\t\t\t\t\t\t\tif ( t1 === undefined ) {\n\n\t\t\t\t\t\t\t\tif ( t \u003c t0 ) break forward_scan;\n\n\t\t\t\t\t\t\t\t// after end\n\n\t\t\t\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_( i1 - 1 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( i1 === giveUpAt ) break; // this loop\n\n\t\t\t\t\t\t\tt0 = t1;\n\t\t\t\t\t\t\tt1 = pp[ ++ i1 ];\n\n\t\t\t\t\t\t\tif ( t \u003c t1 ) {\n\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// prepare binary search on the right side of the index\n\t\t\t\t\t\tright = pp.length;\n\t\t\t\t\t\tbreak linear_scan;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t//- slower code:\n\t\t\t\t\t//-\t\t\t\t\tif ( t \u003c t0 || t0 === undefined ) {\n\t\t\t\t\tif ( ! ( t \u003e= t0 ) ) {\n\n\t\t\t\t\t\t// looping?\n\n\t\t\t\t\t\tconst t1global = pp[ 1 ];\n\n\t\t\t\t\t\tif ( t \u003c t1global ) {\n\n\t\t\t\t\t\t\ti1 = 2; // + 1, using the scan for the details\n\t\t\t\t\t\t\tt0 = t1global;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// linear reverse scan\n\n\t\t\t\t\t\tfor ( let giveUpAt = i1 - 2; ; ) {\n\n\t\t\t\t\t\t\tif ( t0 === undefined ) {\n\n\t\t\t\t\t\t\t\t// before start\n\n\t\t\t\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_( 0 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( i1 === giveUpAt ) break; // this loop\n\n\t\t\t\t\t\t\tt1 = t0;\n\t\t\t\t\t\t\tt0 = pp[ -- i1 - 1 ];\n\n\t\t\t\t\t\t\tif ( t \u003e= t0 ) {\n\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// prepare binary search on the left side of the index\n\t\t\t\t\t\tright = i1;\n\t\t\t\t\t\ti1 = 0;\n\t\t\t\t\t\tbreak linear_scan;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// the interval is valid\n\n\t\t\t\t\tbreak validate_interval;\n\n\t\t\t\t} // linear scan\n\n\t\t\t\t// binary search\n\n\t\t\t\twhile ( i1 \u003c right ) {\n\n\t\t\t\t\tconst mid = ( i1 + right ) \u003e\u003e\u003e 1;\n\n\t\t\t\t\tif ( t \u003c pp[ mid ] ) {\n\n\t\t\t\t\t\tright = mid;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ti1 = mid + 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tt1 = pp[ i1 ];\n\t\t\t\tt0 = pp[ i1 - 1 ];\n\n\t\t\t\t// check boundary cases, again\n\n\t\t\t\tif ( t0 === undefined ) {\n\n\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\treturn this.copySampleValue_( 0 );\n\n\t\t\t\t}\n\n\t\t\t\tif ( t1 === undefined ) {\n\n\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\treturn this.copySampleValue_( i1 - 1 );\n\n\t\t\t\t}\n\n\t\t\t} // seek\n\n\t\t\tthis._cachedIndex = i1;\n\n\t\t\tthis.intervalChanged_( i1, t0, t1 );\n\n\t\t} // validate_interval\n\n\t\treturn this.interpolate_( i1, t0, t, t1 );\n\n\t}\n\n\t/**\n\t * Returns the interpolation settings.\n\t *\n\t * @return {Object} The interpolation settings.\n\t */\n\tgetSettings_() {\n\n\t\treturn this.settings || this.DefaultSettings_;\n\n\t}\n\n\t/**\n\t * Copies a sample value to the result buffer.\n\t *\n\t * @param {number} index - An index into the sample value buffer.\n\t * @return {TypedArray} The result buffer.\n\t */\n\tcopySampleValue_( index ) {\n\n\t\t// copies a sample value to the result buffer\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\t\t\toffset = index * stride;\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tresult[ i ] = values[ offset + i ];\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n\t/**\n\t * Copies a sample value to the result buffer.\n\t *\n\t * @abstract\n\t * @param {number} i1 - An index into the sample value buffer.\n\t * @param {number} t0 - The previous interpolation factor.\n\t * @param {number} t - The current interpolation factor.\n\t * @param {number} t1 - The next interpolation factor.\n\t * @return {TypedArray} The result buffer.\n\t */\n\tinterpolate_( /* i1, t0, t, t1 */ ) {\n\n\t\tthrow new Error( 'call to abstract method' );\n\t\t// implementations shall return this.resultBuffer\n\n\t}\n\n\t/**\n\t * Optional method that is executed when the interval has changed.\n\t *\n\t * @param {number} i1 - An index into the sample value buffer.\n\t * @param {number} t0 - The previous interpolation factor.\n\t * @param {number} t - The current interpolation factor.\n\t */\n\tintervalChanged_( /* i1, t0, t1 */ ) {\n\n\t\t// empty\n\n\t}\n\n}\n\n/**\n * Fast and simple cubic spline interpolant.\n *\n * It was derived from a Hermitian construction setting the first derivative\n * at each sample position to the linear slope between neighboring positions\n * over their parameter interval.\n *\n * @augments Interpolant\n */\nclass CubicInterpolant extends Interpolant {\n\n\t/**\n\t * Constructs a new cubic interpolant.\n\t *\n\t * @param {TypedArray} parameterPositions - The parameter positions hold the interpolation factors.\n\t * @param {TypedArray} sampleValues - The sample values.\n\t * @param {number} sampleSize - The sample size\n\t * @param {TypedArray} [resultBuffer] - The result buffer.\n\t */\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t\tthis._weightPrev = -0;\n\t\tthis._offsetPrev = -0;\n\t\tthis._weightNext = -0;\n\t\tthis._offsetNext = -0;\n\n\t\tthis.DefaultSettings_ = {\n\n\t\t\tendingStart: ZeroCurvatureEnding,\n\t\t\tendingEnd: ZeroCurvatureEnding\n\n\t\t};\n\n\t}\n\n\tintervalChanged_( i1, t0, t1 ) {\n\n\t\tconst pp = this.parameterPositions;\n\t\tlet iPrev = i1 - 2,\n\t\t\tiNext = i1 + 1,\n\n\t\t\ttPrev = pp[ iPrev ],\n\t\t\ttNext = pp[ iNext ];\n\n\t\tif ( tPrev === undefined ) {\n\n\t\t\tswitch ( this.getSettings_().endingStart ) {\n\n\t\t\t\tcase ZeroSlopeEnding:\n\n\t\t\t\t\t// f'(t0) = 0\n\t\t\t\t\tiPrev = i1;\n\t\t\t\t\ttPrev = 2 * t0 - t1;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase WrapAroundEnding:\n\n\t\t\t\t\t// use the other end of the curve\n\t\t\t\t\tiPrev = pp.length - 2;\n\t\t\t\t\ttPrev = t0 + pp[ iPrev ] - pp[ iPrev + 1 ];\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault: // ZeroCurvatureEnding\n\n\t\t\t\t\t// f''(t0) = 0 a.k.a. Natural Spline\n\t\t\t\t\tiPrev = i1;\n\t\t\t\t\ttPrev = t1;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( tNext === undefined ) {\n\n\t\t\tswitch ( this.getSettings_().endingEnd ) {\n\n\t\t\t\tcase ZeroSlopeEnding:\n\n\t\t\t\t\t// f'(tN) = 0\n\t\t\t\t\tiNext = i1;\n\t\t\t\t\ttNext = 2 * t1 - t0;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase WrapAroundEnding:\n\n\t\t\t\t\t// use the other end of the curve\n\t\t\t\t\tiNext = 1;\n\t\t\t\t\ttNext = t1 + pp[ 1 ] - pp[ 0 ];\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault: // ZeroCurvatureEnding\n\n\t\t\t\t\t// f''(tN) = 0, a.k.a. Natural Spline\n\t\t\t\t\tiNext = i1 - 1;\n\t\t\t\t\ttNext = t0;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst halfDt = ( t1 - t0 ) * 0.5,\n\t\t\tstride = this.valueSize;\n\n\t\tthis._weightPrev = halfDt / ( t0 - tPrev );\n\t\tthis._weightNext = halfDt / ( tNext - t1 );\n\t\tthis._offsetPrev = iPrev * stride;\n\t\tthis._offsetNext = iNext * stride;\n\n\t}\n\n\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\n\t\t\to1 = i1 * stride,\t\to0 = o1 - stride,\n\t\t\toP = this._offsetPrev, \toN = this._offsetNext,\n\t\t\twP = this._weightPrev,\twN = this._weightNext,\n\n\t\t\tp = ( t - t0 ) / ( t1 - t0 ),\n\t\t\tpp = p * p,\n\t\t\tppp = pp * p;\n\n\t\t// evaluate polynomials\n\n\t\tconst sP = - wP * ppp + 2 * wP * pp - wP * p;\n\t\tconst s0 = ( 1 + wP ) * ppp + ( -1.5 - 2 * wP ) * pp + ( -0.5 + wP ) * p + 1;\n\t\tconst s1 = ( -1 - wN ) * ppp + ( 1.5 + wN ) * pp + 0.5 * p;\n\t\tconst sN = wN * ppp - wN * pp;\n\n\t\t// combine data linearly\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tresult[ i ] =\n\t\t\t\t\tsP * values[ oP + i ] +\n\t\t\t\t\ts0 * values[ o0 + i ] +\n\t\t\t\t\ts1 * values[ o1 + i ] +\n\t\t\t\t\tsN * values[ oN + i ];\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n}\n\n/**\n * A basic linear interpolant.\n *\n * @augments Interpolant\n */\nclass LinearInterpolant extends Interpolant {\n\n\t/**\n\t * Constructs a new linear interpolant.\n\t *\n\t * @param {TypedArray} parameterPositions - The parameter positions hold the interpolation factors.\n\t * @param {TypedArray} sampleValues - The sample values.\n\t * @param {number} sampleSize - The sample size\n\t * @param {TypedArray} [resultBuffer] - The result buffer.\n\t */\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\n\t\t\toffset1 = i1 * stride,\n\t\t\toffset0 = offset1 - stride,\n\n\t\t\tweight1 = ( t - t0 ) / ( t1 - t0 ),\n\t\t\tweight0 = 1 - weight1;\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tresult[ i ] =\n\t\t\t\t\tvalues[ offset0 + i ] * weight0 +\n\t\t\t\t\tvalues[ offset1 + i ] * weight1;\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n}\n\n/**\n * Interpolant that evaluates to the sample value at the position preceding\n * the parameter.\n *\n * @augments Interpolant\n */\nclass DiscreteInterpolant extends Interpolant {\n\n\t/**\n\t * Constructs a new discrete interpolant.\n\t *\n\t * @param {TypedArray} parameterPositions - The parameter positions hold the interpolation factors.\n\t * @param {TypedArray} sampleValues - The sample values.\n\t * @param {number} sampleSize - The sample size\n\t * @param {TypedArray} [resultBuffer] - The result buffer.\n\t */\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tinterpolate_( i1 /*, t0, t, t1 */ ) {\n\n\t\treturn this.copySampleValue_( i1 - 1 );\n\n\t}\n\n}\n\n/**\n * Represents s a timed sequence of keyframes, which are composed of lists of\n * times and related values, and which are used to animate a specific property\n * of an object.\n */\nclass KeyframeTrack {\n\n\t/**\n\t * Constructs a new keyframe track.\n\t *\n\t * @param {string} name - The keyframe track's name.\n\t * @param {Array\u003cnumber\u003e} times - A list of keyframe times.\n\t * @param {Array\u003cnumber|string|boolean\u003e} values - A list of keyframe values.\n\t * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.\n\t */\n\tconstructor( name, times, values, interpolation ) {\n\n\t\tif ( name === undefined ) throw new Error( 'THREE.KeyframeTrack: track name is undefined' );\n\t\tif ( times === undefined || times.length === 0 ) throw new Error( 'THREE.KeyframeTrack: no keyframes in track named ' + name );\n\n\t\t/**\n\t\t * The track's name can refer to morph targets or bones or\n\t\t * possibly other values within an animated object. See {@link PropertyBinding#parseTrackName}\n\t\t * for the forms of strings that can be parsed for property binding.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = name;\n\n\t\t/**\n\t\t * The keyframe times.\n\t\t *\n\t\t * @type {Float32Array}\n\t\t */\n\t\tthis.times = convertArray( times, this.TimeBufferType );\n\n\t\t/**\n\t\t * The keyframe values.\n\t\t *\n\t\t * @type {Float32Array}\n\t\t */\n\t\tthis.values = convertArray( values, this.ValueBufferType );\n\n\t\tthis.setInterpolation( interpolation || this.DefaultInterpolation );\n\n\t}\n\n\t/**\n\t * Converts the keyframe track to JSON.\n\t *\n\t * @static\n\t * @param {KeyframeTrack} track - The keyframe track to serialize.\n\t * @return {Object} The serialized keyframe track as JSON.\n\t */\n\tstatic toJSON( track ) {\n\n\t\tconst trackType = track.constructor;\n\n\t\tlet json;\n\n\t\t// derived classes can define a static toJSON method\n\t\tif ( trackType.toJSON !== this.toJSON ) {\n\n\t\t\tjson = trackType.toJSON( track );\n\n\t\t} else {\n\n\t\t\t// by default, we assume the data can be serialized as-is\n\t\t\tjson = {\n\n\t\t\t\t'name': track.name,\n\t\t\t\t'times': convertArray( track.times, Array ),\n\t\t\t\t'values': convertArray( track.values, Array )\n\n\t\t\t};\n\n\t\t\tconst interpolation = track.getInterpolation();\n\n\t\t\tif ( interpolation !== track.DefaultInterpolation ) {\n\n\t\t\t\tjson.interpolation = interpolation;\n\n\t\t\t}\n\n\t\t}\n\n\t\tjson.type = track.ValueTypeName; // mandatory\n\n\t\treturn json;\n\n\t}\n\n\t/**\n\t * Factory method for creating a new discrete interpolant.\n\t *\n\t * @static\n\t * @param {TypedArray} [result] - The result buffer.\n\t * @return {DiscreteInterpolant} The new interpolant.\n\t */\n\tInterpolantFactoryMethodDiscrete( result ) {\n\n\t\treturn new DiscreteInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n\t/**\n\t * Factory method for creating a new linear interpolant.\n\t *\n\t * @static\n\t * @param {TypedArray} [result] - The result buffer.\n\t * @return {LinearInterpolant} The new interpolant.\n\t */\n\tInterpolantFactoryMethodLinear( result ) {\n\n\t\treturn new LinearInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n\t/**\n\t * Factory method for creating a new smooth interpolant.\n\t *\n\t * @static\n\t * @param {TypedArray} [result] - The result buffer.\n\t * @return {CubicInterpolant} The new interpolant.\n\t */\n\tInterpolantFactoryMethodSmooth( result ) {\n\n\t\treturn new CubicInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n\t/**\n\t * Defines the interpolation factor method for this keyframe track.\n\t *\n\t * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} interpolation - The interpolation type.\n\t * @return {KeyframeTrack} A reference to this keyframe track.\n\t */\n\tsetInterpolation( interpolation ) {\n\n\t\tlet factoryMethod;\n\n\t\tswitch ( interpolation ) {\n\n\t\t\tcase InterpolateDiscrete:\n\n\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodDiscrete;\n\n\t\t\t\tbreak;\n\n\t\t\tcase InterpolateLinear:\n\n\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodLinear;\n\n\t\t\t\tbreak;\n\n\t\t\tcase InterpolateSmooth:\n\n\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodSmooth;\n\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\tif ( factoryMethod === undefined ) {\n\n\t\t\tconst message = 'unsupported interpolation for ' +\n\t\t\t\tthis.ValueTypeName + ' keyframe track named ' + this.name;\n\n\t\t\tif ( this.createInterpolant === undefined ) {\n\n\t\t\t\t// fall back to default, unless the default itself is messed up\n\t\t\t\tif ( interpolation !== this.DefaultInterpolation ) {\n\n\t\t\t\t\tthis.setInterpolation( this.DefaultInterpolation );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthrow new Error( message ); // fatal, in this case\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\twarn( 'KeyframeTrack:', message );\n\t\t\treturn this;\n\n\t\t}\n\n\t\tthis.createInterpolant = factoryMethod;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the current interpolation type.\n\t *\n\t * @return {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} The interpolation type.\n\t */\n\tgetInterpolation() {\n\n\t\tswitch ( this.createInterpolant ) {\n\n\t\t\tcase this.InterpolantFactoryMethodDiscrete:\n\n\t\t\t\treturn InterpolateDiscrete;\n\n\t\t\tcase this.InterpolantFactoryMethodLinear:\n\n\t\t\t\treturn InterpolateLinear;\n\n\t\t\tcase this.InterpolantFactoryMethodSmooth:\n\n\t\t\t\treturn InterpolateSmooth;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns the value size.\n\t *\n\t * @return {number} The value size.\n\t */\n\tgetValueSize() {\n\n\t\treturn this.values.length / this.times.length;\n\n\t}\n\n\t/**\n\t * Moves all keyframes either forward or backward in time.\n\t *\n\t * @param {number} timeOffset - The offset to move the time values.\n\t * @return {KeyframeTrack} A reference to this keyframe track.\n\t */\n\tshift( timeOffset ) {\n\n\t\tif ( timeOffset !== 0.0 ) {\n\n\t\t\tconst times = this.times;\n\n\t\t\tfor ( let i = 0, n = times.length; i !== n; ++ i ) {\n\n\t\t\t\ttimes[ i ] += timeOffset;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Scale all keyframe times by a factor (useful for frame - seconds conversions).\n\t *\n\t * @param {number} timeScale - The time scale.\n\t * @return {KeyframeTrack} A reference to this keyframe track.\n\t */\n\tscale( timeScale ) {\n\n\t\tif ( timeScale !== 1.0 ) {\n\n\t\t\tconst times = this.times;\n\n\t\t\tfor ( let i = 0, n = times.length; i !== n; ++ i ) {\n\n\t\t\t\ttimes[ i ] *= timeScale;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Removes keyframes before and after animation without changing any values within the defined time range.\n\t *\n\t * Note: The method does not shift around keys to the start of the track time, because for interpolated\n\t * keys this will change their values\n\t *\n\t * @param {number} startTime - The start time.\n\t * @param {number} endTime - The end time.\n\t * @return {KeyframeTrack} A reference to this keyframe track.\n\t */\n\ttrim( startTime, endTime ) {\n\n\t\tconst times = this.times,\n\t\t\tnKeys = times.length;\n\n\t\tlet from = 0,\n\t\t\tto = nKeys - 1;\n\n\t\twhile ( from !== nKeys \u0026\u0026 times[ from ] \u003c startTime ) {\n\n\t\t\t++ from;\n\n\t\t}\n\n\t\twhile ( to !== -1 \u0026\u0026 times[ to ] \u003e endTime ) {\n\n\t\t\t-- to;\n\n\t\t}\n\n\t\t++ to; // inclusive -\u003e exclusive bound\n\n\t\tif ( from !== 0 || to !== nKeys ) {\n\n\t\t\t// empty tracks are forbidden, so keep at least one keyframe\n\t\t\tif ( from \u003e= to ) {\n\n\t\t\t\tto = Math.max( to, 1 );\n\t\t\t\tfrom = to - 1;\n\n\t\t\t}\n\n\t\t\tconst stride = this.getValueSize();\n\t\t\tthis.times = times.slice( from, to );\n\t\t\tthis.values = this.values.slice( from * stride, to * stride );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Performs minimal validation on the keyframe track. Returns `true` if the values\n\t * are valid.\n\t *\n\t * @return {boolean} Whether the keyframes are valid or not.\n\t */\n\tvalidate() {\n\n\t\tlet valid = true;\n\n\t\tconst valueSize = this.getValueSize();\n\t\tif ( valueSize - Math.floor( valueSize ) !== 0 ) {\n\n\t\t\terror( 'KeyframeTrack: Invalid value size in track.', this );\n\t\t\tvalid = false;\n\n\t\t}\n\n\t\tconst times = this.times,\n\t\t\tvalues = this.values,\n\n\t\t\tnKeys = times.length;\n\n\t\tif ( nKeys === 0 ) {\n\n\t\t\terror( 'KeyframeTrack: Track is empty.', this );\n\t\t\tvalid = false;\n\n\t\t}\n\n\t\tlet prevTime = null;\n\n\t\tfor ( let i = 0; i !== nKeys; i ++ ) {\n\n\t\t\tconst currTime = times[ i ];\n\n\t\t\tif ( typeof currTime === 'number' \u0026\u0026 isNaN( currTime ) ) {\n\n\t\t\t\terror( 'KeyframeTrack: Time is not a valid number.', this, i, currTime );\n\t\t\t\tvalid = false;\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tif ( prevTime !== null \u0026\u0026 prevTime \u003e currTime ) {\n\n\t\t\t\terror( 'KeyframeTrack: Out of order keys.', this, i, currTime, prevTime );\n\t\t\t\tvalid = false;\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tprevTime = currTime;\n\n\t\t}\n\n\t\tif ( values !== undefined ) {\n\n\t\t\tif ( isTypedArray( values ) ) {\n\n\t\t\t\tfor ( let i = 0, n = values.length; i !== n; ++ i ) {\n\n\t\t\t\t\tconst value = values[ i ];\n\n\t\t\t\t\tif ( isNaN( value ) ) {\n\n\t\t\t\t\t\terror( 'KeyframeTrack: Value is not a valid number.', this, i, value );\n\t\t\t\t\t\tvalid = false;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn valid;\n\n\t}\n\n\t/**\n\t * Optimizes this keyframe track by removing equivalent sequential keys (which are\n\t * common in morph target sequences).\n\t *\n\t * @return {AnimationClip} A reference to this animation clip.\n\t */\n\toptimize() {\n\n\t\t// (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --\u003e (0,0,1,1,0,0)\n\n\t\t// times or values may be shared with other tracks, so overwriting is unsafe\n\t\tconst times = this.times.slice(),\n\t\t\tvalues = this.values.slice(),\n\t\t\tstride = this.getValueSize(),\n\n\t\t\tsmoothInterpolation = this.getInterpolation() === InterpolateSmooth,\n\n\t\t\tlastIndex = times.length - 1;\n\n\t\tlet writeIndex = 1;\n\n\t\tfor ( let i = 1; i \u003c lastIndex; ++ i ) {\n\n\t\t\tlet keep = false;\n\n\t\t\tconst time = times[ i ];\n\t\t\tconst timeNext = times[ i + 1 ];\n\n\t\t\t// remove adjacent keyframes scheduled at the same time\n\n\t\t\tif ( time !== timeNext \u0026\u0026 ( i !== 1 || time !== times[ 0 ] ) ) {\n\n\t\t\t\tif ( ! smoothInterpolation ) {\n\n\t\t\t\t\t// remove unnecessary keyframes same as their neighbors\n\n\t\t\t\t\tconst offset = i * stride,\n\t\t\t\t\t\toffsetP = offset - stride,\n\t\t\t\t\t\toffsetN = offset + stride;\n\n\t\t\t\t\tfor ( let j = 0; j !== stride; ++ j ) {\n\n\t\t\t\t\t\tconst value = values[ offset + j ];\n\n\t\t\t\t\t\tif ( value !== values[ offsetP + j ] ||\n\t\t\t\t\t\t\tvalue !== values[ offsetN + j ] ) {\n\n\t\t\t\t\t\t\tkeep = true;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tkeep = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// in-place compaction\n\n\t\t\tif ( keep ) {\n\n\t\t\t\tif ( i !== writeIndex ) {\n\n\t\t\t\t\ttimes[ writeIndex ] = times[ i ];\n\n\t\t\t\t\tconst readOffset = i * stride,\n\t\t\t\t\t\twriteOffset = writeIndex * stride;\n\n\t\t\t\t\tfor ( let j = 0; j !== stride; ++ j ) {\n\n\t\t\t\t\t\tvalues[ writeOffset + j ] = values[ readOffset + j ];\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t++ writeIndex;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// flush last keyframe (compaction looks ahead)\n\n\t\tif ( lastIndex \u003e 0 ) {\n\n\t\t\ttimes[ writeIndex ] = times[ lastIndex ];\n\n\t\t\tfor ( let readOffset = lastIndex * stride, writeOffset = writeIndex * stride, j = 0; j !== stride; ++ j ) {\n\n\t\t\t\tvalues[ writeOffset + j ] = values[ readOffset + j ];\n\n\t\t\t}\n\n\t\t\t++ writeIndex;\n\n\t\t}\n\n\t\tif ( writeIndex !== times.length ) {\n\n\t\t\tthis.times = times.slice( 0, writeIndex );\n\t\t\tthis.values = values.slice( 0, writeIndex * stride );\n\n\t\t} else {\n\n\t\t\tthis.times = times;\n\t\t\tthis.values = values;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new keyframe track with copied values from this instance.\n\t *\n\t * @return {KeyframeTrack} A clone of this instance.\n\t */\n\tclone() {\n\n\t\tconst times = this.times.slice();\n\t\tconst values = this.values.slice();\n\n\t\tconst TypedKeyframeTrack = this.constructor;\n\t\tconst track = new TypedKeyframeTrack( this.name, times, values );\n\n\t\t// Interpolant argument to constructor is not saved, so copy the factory method directly.\n\t\ttrack.createInterpolant = this.createInterpolant;\n\n\t\treturn track;\n\n\t}\n\n}\n\n/**\n * The value type name.\n *\n * @type {string}\n * @default ''\n */\nKeyframeTrack.prototype.ValueTypeName = '';\n\n/**\n * The time buffer type of this keyframe track.\n *\n * @type {TypedArray|Array}\n * @default Float32Array.constructor\n */\nKeyframeTrack.prototype.TimeBufferType = Float32Array;\n\n/**\n * The value buffer type of this keyframe track.\n *\n * @type {TypedArray|Array}\n * @default Float32Array.constructor\n */\nKeyframeTrack.prototype.ValueBufferType = Float32Array;\n\n/**\n * The default interpolation type of this keyframe track.\n *\n * @type {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)}\n * @default InterpolateLinear\n */\nKeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear;\n\n/**\n * A track for boolean keyframe values.\n *\n * @augments KeyframeTrack\n */\nclass BooleanKeyframeTrack extends KeyframeTrack {\n\n\t/**\n\t * Constructs a new boolean keyframe track.\n\t *\n\t * This keyframe track type has no `interpolation` parameter because the\n\t * interpolation is always discrete.\n\t *\n\t * @param {string} name - The keyframe track's name.\n\t * @param {Array\u003cnumber\u003e} times - A list of keyframe times.\n\t * @param {Array\u003cboolean\u003e} values - A list of keyframe values.\n\t */\n\tconstructor( name, times, values ) {\n\n\t\tsuper( name, times, values );\n\n\t}\n\n}\n\n/**\n * The value type name.\n *\n * @type {string}\n * @default 'bool'\n */\nBooleanKeyframeTrack.prototype.ValueTypeName = 'bool';\n\n/**\n * The value buffer type of this keyframe track.\n *\n * @type {TypedArray|Array}\n * @default Array.constructor\n */\nBooleanKeyframeTrack.prototype.ValueBufferType = Array;\n\n/**\n * The default interpolation type of this keyframe track.\n *\n * @type {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)}\n * @default InterpolateDiscrete\n */\nBooleanKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete;\nBooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined;\nBooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n/**\n * A track for color keyframe values.\n *\n * @augments KeyframeTrack\n */\nclass ColorKeyframeTrack extends KeyframeTrack {\n\n\t/**\n\t * Constructs a new color keyframe track.\n\t *\n\t * @param {string} name - The keyframe track's name.\n\t * @param {Array\u003cnumber\u003e} times - A list of keyframe times.\n\t * @param {Array\u003cnumber\u003e} values - A list of keyframe values.\n\t * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.\n\t */\n\tconstructor( name, times, values, interpolation ) {\n\n\t\tsuper( name, times, values, interpolation );\n\n\t}\n\n}\n\n/**\n * The value type name.\n *\n * @type {string}\n * @default 'color'\n */\nColorKeyframeTrack.prototype.ValueTypeName = 'color';\n\n/**\n * A track for numeric keyframe values.\n *\n * @augments KeyframeTrack\n */\nclass NumberKeyframeTrack extends KeyframeTrack {\n\n\t/**\n\t * Constructs a new number keyframe track.\n\t *\n\t * @param {string} name - The keyframe track's name.\n\t * @param {Array\u003cnumber\u003e} times - A list of keyframe times.\n\t * @param {Array\u003cnumber\u003e} values - A list of keyframe values.\n\t * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.\n\t */\n\tconstructor( name, times, values, interpolation ) {\n\n\t\tsuper( name, times, values, interpolation );\n\n\t}\n\n}\n\n/**\n * The value type name.\n *\n * @type {string}\n * @default 'number'\n */\nNumberKeyframeTrack.prototype.ValueTypeName = 'number';\n\n/**\n * Spherical linear unit quaternion interpolant.\n *\n * @augments Interpolant\n */\nclass QuaternionLinearInterpolant extends Interpolant {\n\n\t/**\n\t * Constructs a new SLERP interpolant.\n\t *\n\t * @param {TypedArray} parameterPositions - The parameter positions hold the interpolation factors.\n\t * @param {TypedArray} sampleValues - The sample values.\n\t * @param {number} sampleSize - The sample size\n\t * @param {TypedArray} [resultBuffer] - The result buffer.\n\t */\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\n\t\t\talpha = ( t - t0 ) / ( t1 - t0 );\n\n\t\tlet offset = i1 * stride;\n\n\t\tfor ( let end = offset + stride; offset !== end; offset += 4 ) {\n\n\t\t\tQuaternion.slerpFlat( result, 0, values, offset - stride, values, offset, alpha );\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n}\n\n/**\n * A track for Quaternion keyframe values.\n *\n * @augments KeyframeTrack\n */\nclass QuaternionKeyframeTrack extends KeyframeTrack {\n\n\t/**\n\t * Constructs a new Quaternion keyframe track.\n\t *\n\t * @param {string} name - The keyframe track's name.\n\t * @param {Array\u003cnumber\u003e} times - A list of keyframe times.\n\t * @param {Array\u003cnumber\u003e} values - A list of keyframe values.\n\t * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.\n\t */\n\tconstructor( name, times, values, interpolation ) {\n\n\t\tsuper( name, times, values, interpolation );\n\n\t}\n\n\t/**\n\t * Overwritten so the method returns Quaternion based interpolant.\n\t *\n\t * @static\n\t * @param {TypedArray} [result] - The result buffer.\n\t * @return {QuaternionLinearInterpolant} The new interpolant.\n\t */\n\tInterpolantFactoryMethodLinear( result ) {\n\n\t\treturn new QuaternionLinearInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n}\n\n/**\n * The value type name.\n *\n * @type {string}\n * @default 'quaternion'\n */\nQuaternionKeyframeTrack.prototype.ValueTypeName = 'quaternion';\n// ValueBufferType is inherited\n// DefaultInterpolation is inherited;\nQuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n/**\n * A track for string keyframe values.\n *\n * @augments KeyframeTrack\n */\nclass StringKeyframeTrack extends KeyframeTrack {\n\n\t/**\n\t * Constructs a new string keyframe track.\n\t *\n\t * This keyframe track type has no `interpolation` parameter because the\n\t * interpolation is always discrete.\n\t *\n\t * @param {string} name - The keyframe track's name.\n\t * @param {Array\u003cnumber\u003e} times - A list of keyframe times.\n\t * @param {Array\u003cstring\u003e} values - A list of keyframe values.\n\t */\n\tconstructor( name, times, values ) {\n\n\t\tsuper( name, times, values );\n\n\t}\n\n}\n\n/**\n * The value type name.\n *\n * @type {string}\n * @default 'string'\n */\nStringKeyframeTrack.prototype.ValueTypeName = 'string';\n\n/**\n * The value buffer type of this keyframe track.\n *\n * @type {TypedArray|Array}\n * @default Array.constructor\n */\nStringKeyframeTrack.prototype.ValueBufferType = Array;\n\n/**\n * The default interpolation type of this keyframe track.\n *\n * @type {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)}\n * @default InterpolateDiscrete\n */\nStringKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete;\nStringKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined;\nStringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n/**\n * A track for vector keyframe values.\n *\n * @augments KeyframeTrack\n */\nclass VectorKeyframeTrack extends KeyframeTrack {\n\n\t/**\n\t * Constructs a new vector keyframe track.\n\t *\n\t * @param {string} name - The keyframe track's name.\n\t * @param {Array\u003cnumber\u003e} times - A list of keyframe times.\n\t * @param {Array\u003cnumber\u003e} values - A list of keyframe values.\n\t * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.\n\t */\n\tconstructor( name, times, values, interpolation ) {\n\n\t\tsuper( name, times, values, interpolation );\n\n\t}\n\n}\n\n/**\n * The value type name.\n *\n * @type {string}\n * @default 'vector'\n */\nVectorKeyframeTrack.prototype.ValueTypeName = 'vector';\n\n/**\n * A reusable set of keyframe tracks which represent an animation.\n */\nclass AnimationClip {\n\n\t/**\n\t * Constructs a new animation clip.\n\t *\n\t * Note: Instead of instantiating an AnimationClip directly with the constructor, you can\n\t * use the static interface of this class for creating clips. In most cases though, animation clips\n\t * will automatically be created by loaders when importing animated 3D assets.\n\t *\n\t * @param {string} [name=''] - The clip's name.\n\t * @param {number} [duration=-1] - The clip's duration in seconds. If a negative value is passed,\n\t * the duration will be calculated from the passed keyframes.\n\t * @param {Array\u003cKeyframeTrack\u003e} tracks - An array of keyframe tracks.\n\t * @param {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} [blendMode=NormalAnimationBlendMode] - Defines how the animation\n\t * is blended/combined when two or more animations are simultaneously played.\n\t */\n\tconstructor( name = '', duration = -1, tracks = [], blendMode = NormalAnimationBlendMode ) {\n\n\t\t/**\n\t\t * The clip's name.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = name;\n\n\t\t/**\n\t\t *  An array of keyframe tracks.\n\t\t *\n\t\t * @type {Array\u003cKeyframeTrack\u003e}\n\t\t */\n\t\tthis.tracks = tracks;\n\n\t\t/**\n\t\t * The clip's duration in seconds.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.duration = duration;\n\n\t\t/**\n\t\t * Defines how the animation is blended/combined when two or more animations\n\t\t * are simultaneously played.\n\t\t *\n\t\t * @type {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)}\n\t\t */\n\t\tthis.blendMode = blendMode;\n\n\t\t/**\n\t\t * The UUID of the animation clip.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.uuid = generateUUID();\n\n\t\t/**\n\t\t * An object that can be used to store custom data about the animation clip.\n\t\t * It should not hold references to functions as these will not be cloned.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.userData = {};\n\n\t\t// this means it should figure out its duration by scanning the tracks\n\t\tif ( this.duration \u003c 0 ) {\n\n\t\t\tthis.resetDuration();\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Factory method for creating an animation clip from the given JSON.\n\t *\n\t * @static\n\t * @param {Object} json - The serialized animation clip.\n\t * @return {AnimationClip} The new animation clip.\n\t */\n\tstatic parse( json ) {\n\n\t\tconst tracks = [],\n\t\t\tjsonTracks = json.tracks,\n\t\t\tframeTime = 1.0 / ( json.fps || 1.0 );\n\n\t\tfor ( let i = 0, n = jsonTracks.length; i !== n; ++ i ) {\n\n\t\t\ttracks.push( parseKeyframeTrack( jsonTracks[ i ] ).scale( frameTime ) );\n\n\t\t}\n\n\t\tconst clip = new this( json.name, json.duration, tracks, json.blendMode );\n\t\tclip.uuid = json.uuid;\n\n\t\tclip.userData = JSON.parse( json.userData || '{}' );\n\n\t\treturn clip;\n\n\t}\n\n\t/**\n\t * Serializes the given animation clip into JSON.\n\t *\n\t * @static\n\t * @param {AnimationClip} clip - The animation clip to serialize.\n\t * @return {Object} The JSON object.\n\t */\n\tstatic toJSON( clip ) {\n\n\t\tconst tracks = [],\n\t\t\tclipTracks = clip.tracks;\n\n\t\tconst json = {\n\n\t\t\t'name': clip.name,\n\t\t\t'duration': clip.duration,\n\t\t\t'tracks': tracks,\n\t\t\t'uuid': clip.uuid,\n\t\t\t'blendMode': clip.blendMode,\n\t\t\t'userData': JSON.stringify( clip.userData ),\n\n\t\t};\n\n\t\tfor ( let i = 0, n = clipTracks.length; i !== n; ++ i ) {\n\n\t\t\ttracks.push( KeyframeTrack.toJSON( clipTracks[ i ] ) );\n\n\t\t}\n\n\t\treturn json;\n\n\t}\n\n\t/**\n\t * Returns a new animation clip from the passed morph targets array of a\n\t * geometry, taking a name and the number of frames per second.\n\t *\n\t * Note: The fps parameter is required, but the animation speed can be\n\t * overridden via {@link AnimationAction#setDuration}.\n\t *\n\t * @static\n\t * @param {string} name - The name of the animation clip.\n\t * @param {Array\u003cObject\u003e} morphTargetSequence - A sequence of morph targets.\n\t * @param {number} fps - The Frames-Per-Second value.\n\t * @param {boolean} noLoop - Whether the clip should be no loop or not.\n\t * @return {AnimationClip} The new animation clip.\n\t */\n\tstatic CreateFromMorphTargetSequence( name, morphTargetSequence, fps, noLoop ) {\n\n\t\tconst numMorphTargets = morphTargetSequence.length;\n\t\tconst tracks = [];\n\n\t\tfor ( let i = 0; i \u003c numMorphTargets; i ++ ) {\n\n\t\t\tlet times = [];\n\t\t\tlet values = [];\n\n\t\t\ttimes.push(\n\t\t\t\t( i + numMorphTargets - 1 ) % numMorphTargets,\n\t\t\t\ti,\n\t\t\t\t( i + 1 ) % numMorphTargets );\n\n\t\t\tvalues.push( 0, 1, 0 );\n\n\t\t\tconst order = getKeyframeOrder( times );\n\t\t\ttimes = sortedArray( times, 1, order );\n\t\t\tvalues = sortedArray( values, 1, order );\n\n\t\t\t// if there is a key at the first frame, duplicate it as the\n\t\t\t// last frame as well for perfect loop.\n\t\t\tif ( ! noLoop \u0026\u0026 times[ 0 ] === 0 ) {\n\n\t\t\t\ttimes.push( numMorphTargets );\n\t\t\t\tvalues.push( values[ 0 ] );\n\n\t\t\t}\n\n\t\t\ttracks.push(\n\t\t\t\tnew NumberKeyframeTrack(\n\t\t\t\t\t'.morphTargetInfluences[' + morphTargetSequence[ i ].name + ']',\n\t\t\t\t\ttimes, values\n\t\t\t\t).scale( 1.0 / fps ) );\n\n\t\t}\n\n\t\treturn new this( name, -1, tracks );\n\n\t}\n\n\t/**\n\t * Searches for an animation clip by name, taking as its first parameter\n\t * either an array of clips, or a mesh or geometry that contains an\n\t * array named \"animations\" property.\n\t *\n\t * @static\n\t * @param {(Array\u003cAnimationClip\u003e|Object3D)} objectOrClipArray - The array or object to search through.\n\t * @param {string} name - The name to search for.\n\t * @return {?AnimationClip} The found animation clip. Returns `null` if no clip has been found.\n\t */\n\tstatic findByName( objectOrClipArray, name ) {\n\n\t\tlet clipArray = objectOrClipArray;\n\n\t\tif ( ! Array.isArray( objectOrClipArray ) ) {\n\n\t\t\tconst o = objectOrClipArray;\n\t\t\tclipArray = o.geometry \u0026\u0026 o.geometry.animations || o.animations;\n\n\t\t}\n\n\t\tfor ( let i = 0; i \u003c clipArray.length; i ++ ) {\n\n\t\t\tif ( clipArray[ i ].name === name ) {\n\n\t\t\t\treturn clipArray[ i ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\t/**\n\t * Returns an array of new AnimationClips created from the morph target\n\t * sequences of a geometry, trying to sort morph target names into\n\t * animation-group-based patterns like \"Walk_001, Walk_002, Run_001, Run_002...\".\n\t *\n\t * See {@link MD2Loader#parse} as an example for how the method should be used.\n\t *\n\t * @static\n\t * @param {Array\u003cObject\u003e} morphTargets - A sequence of morph targets.\n\t * @param {number} fps - The Frames-Per-Second value.\n\t * @param {boolean} noLoop - Whether the clip should be no loop or not.\n\t * @return {Array\u003cAnimationClip\u003e} An array of new animation clips.\n\t */\n\tstatic CreateClipsFromMorphTargetSequences( morphTargets, fps, noLoop ) {\n\n\t\tconst animationToMorphTargets = {};\n\n\t\t// tested with https://regex101.com/ on trick sequences\n\t\t// such flamingo_flyA_003, flamingo_run1_003, crdeath0059\n\t\tconst pattern = /^([\\w-]*?)([\\d]+)$/;\n\n\t\t// sort morph target names into animation groups based\n\t\t// patterns like Walk_001, Walk_002, Run_001, Run_002\n\t\tfor ( let i = 0, il = morphTargets.length; i \u003c il; i ++ ) {\n\n\t\t\tconst morphTarget = morphTargets[ i ];\n\t\t\tconst parts = morphTarget.name.match( pattern );\n\n\t\t\tif ( parts \u0026\u0026 parts.length \u003e 1 ) {\n\n\t\t\t\tconst name = parts[ 1 ];\n\n\t\t\t\tlet animationMorphTargets = animationToMorphTargets[ name ];\n\n\t\t\t\tif ( ! animationMorphTargets ) {\n\n\t\t\t\t\tanimationToMorphTargets[ name ] = animationMorphTargets = [];\n\n\t\t\t\t}\n\n\t\t\t\tanimationMorphTargets.push( morphTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst clips = [];\n\n\t\tfor ( const name in animationToMorphTargets ) {\n\n\t\t\tclips.push( this.CreateFromMorphTargetSequence( name, animationToMorphTargets[ name ], fps, noLoop ) );\n\n\t\t}\n\n\t\treturn clips;\n\n\t}\n\n\t/**\n\t * Parses the `animation.hierarchy` format and returns a new animation clip.\n\t *\n\t * @static\n\t * @deprecated since r175.\n\t * @param {Object} animation - A serialized animation clip as JSON.\n\t * @param {Array\u003cBones\u003e} bones - An array of bones.\n\t * @return {?AnimationClip} The new animation clip.\n\t */\n\tstatic parseAnimation( animation, bones ) {\n\n\t\twarn( 'AnimationClip: parseAnimation() is deprecated and will be removed with r185' );\n\n\t\tif ( ! animation ) {\n\n\t\t\terror( 'AnimationClip: No animation in JSONLoader data.' );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst addNonemptyTrack = function ( trackType, trackName, animationKeys, propertyName, destTracks ) {\n\n\t\t\t// only return track if there are actually keys.\n\t\t\tif ( animationKeys.length !== 0 ) {\n\n\t\t\t\tconst times = [];\n\t\t\t\tconst values = [];\n\n\t\t\t\tflattenJSON( animationKeys, times, values, propertyName );\n\n\t\t\t\t// empty keys are filtered out, so check again\n\t\t\t\tif ( times.length !== 0 ) {\n\n\t\t\t\t\tdestTracks.push( new trackType( trackName, times, values ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tconst tracks = [];\n\n\t\tconst clipName = animation.name || 'default';\n\t\tconst fps = animation.fps || 30;\n\t\tconst blendMode = animation.blendMode;\n\n\t\t// automatic length determination in AnimationClip.\n\t\tlet duration = animation.length || -1;\n\n\t\tconst hierarchyTracks = animation.hierarchy || [];\n\n\t\tfor ( let h = 0; h \u003c hierarchyTracks.length; h ++ ) {\n\n\t\t\tconst animationKeys = hierarchyTracks[ h ].keys;\n\n\t\t\t// skip empty tracks\n\t\t\tif ( ! animationKeys || animationKeys.length === 0 ) continue;\n\n\t\t\t// process morph targets\n\t\t\tif ( animationKeys[ 0 ].morphTargets ) {\n\n\t\t\t\t// figure out all morph targets used in this track\n\t\t\t\tconst morphTargetNames = {};\n\n\t\t\t\tlet k;\n\n\t\t\t\tfor ( k = 0; k \u003c animationKeys.length; k ++ ) {\n\n\t\t\t\t\tif ( animationKeys[ k ].morphTargets ) {\n\n\t\t\t\t\t\tfor ( let m = 0; m \u003c animationKeys[ k ].morphTargets.length; m ++ ) {\n\n\t\t\t\t\t\t\tmorphTargetNames[ animationKeys[ k ].morphTargets[ m ] ] = -1;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// create a track for each morph target with all zero\n\t\t\t\t// morphTargetInfluences except for the keys in which\n\t\t\t\t// the morphTarget is named.\n\t\t\t\tfor ( const morphTargetName in morphTargetNames ) {\n\n\t\t\t\t\tconst times = [];\n\t\t\t\t\tconst values = [];\n\n\t\t\t\t\tfor ( let m = 0; m !== animationKeys[ k ].morphTargets.length; ++ m ) {\n\n\t\t\t\t\t\tconst animationKey = animationKeys[ k ];\n\n\t\t\t\t\t\ttimes.push( animationKey.time );\n\t\t\t\t\t\tvalues.push( ( animationKey.morphTarget === morphTargetName ) ? 1 : 0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttracks.push( new NumberKeyframeTrack( '.morphTargetInfluence[' + morphTargetName + ']', times, values ) );\n\n\t\t\t\t}\n\n\t\t\t\tduration = morphTargetNames.length * fps;\n\n\t\t\t} else {\n\n\t\t\t\t// ...assume skeletal animation\n\n\t\t\t\tconst boneName = '.bones[' + bones[ h ].name + ']';\n\n\t\t\t\taddNonemptyTrack(\n\t\t\t\t\tVectorKeyframeTrack, boneName + '.position',\n\t\t\t\t\tanimationKeys, 'pos', tracks );\n\n\t\t\t\taddNonemptyTrack(\n\t\t\t\t\tQuaternionKeyframeTrack, boneName + '.quaternion',\n\t\t\t\t\tanimationKeys, 'rot', tracks );\n\n\t\t\t\taddNonemptyTrack(\n\t\t\t\t\tVectorKeyframeTrack, boneName + '.scale',\n\t\t\t\t\tanimationKeys, 'scl', tracks );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( tracks.length === 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst clip = new this( clipName, duration, tracks, blendMode );\n\n\t\treturn clip;\n\n\t}\n\n\t/**\n\t * Sets the duration of this clip to the duration of its longest keyframe track.\n\t *\n\t * @return {AnimationClip} A reference to this animation clip.\n\t */\n\tresetDuration() {\n\n\t\tconst tracks = this.tracks;\n\t\tlet duration = 0;\n\n\t\tfor ( let i = 0, n = tracks.length; i !== n; ++ i ) {\n\n\t\t\tconst track = this.tracks[ i ];\n\n\t\t\tduration = Math.max( duration, track.times[ track.times.length - 1 ] );\n\n\t\t}\n\n\t\tthis.duration = duration;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Trims all tracks to the clip's duration.\n\t *\n\t * @return {AnimationClip} A reference to this animation clip.\n\t */\n\ttrim() {\n\n\t\tfor ( let i = 0; i \u003c this.tracks.length; i ++ ) {\n\n\t\t\tthis.tracks[ i ].trim( 0, this.duration );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Performs minimal validation on each track in the clip. Returns `true` if all\n\t * tracks are valid.\n\t *\n\t * @return {boolean} Whether the clip's keyframes are valid or not.\n\t */\n\tvalidate() {\n\n\t\tlet valid = true;\n\n\t\tfor ( let i = 0; i \u003c this.tracks.length; i ++ ) {\n\n\t\t\tvalid = valid \u0026\u0026 this.tracks[ i ].validate();\n\n\t\t}\n\n\t\treturn valid;\n\n\t}\n\n\t/**\n\t * Optimizes each track by removing equivalent sequential keys (which are\n\t * common in morph target sequences).\n\t *\n\t * @return {AnimationClip} A reference to this animation clip.\n\t */\n\toptimize() {\n\n\t\tfor ( let i = 0; i \u003c this.tracks.length; i ++ ) {\n\n\t\t\tthis.tracks[ i ].optimize();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new animation clip with copied values from this instance.\n\t *\n\t * @return {AnimationClip} A clone of this instance.\n\t */\n\tclone() {\n\n\t\tconst tracks = [];\n\n\t\tfor ( let i = 0; i \u003c this.tracks.length; i ++ ) {\n\n\t\t\ttracks.push( this.tracks[ i ].clone() );\n\n\t\t}\n\n\t\tconst clip = new this.constructor( this.name, this.duration, tracks, this.blendMode );\n\n\t\tclip.userData = JSON.parse( JSON.stringify( this.userData ) );\n\n\t\treturn clip;\n\n\t}\n\n\t/**\n\t * Serializes this animation clip into JSON.\n\t *\n\t * @return {Object} The JSON object.\n\t */\n\ttoJSON() {\n\n\t\treturn this.constructor.toJSON( this );\n\n\t}\n\n}\n\nfunction getTrackTypeForValueTypeName( typeName ) {\n\n\tswitch ( typeName.toLowerCase() ) {\n\n\t\tcase 'scalar':\n\t\tcase 'double':\n\t\tcase 'float':\n\t\tcase 'number':\n\t\tcase 'integer':\n\n\t\t\treturn NumberKeyframeTrack;\n\n\t\tcase 'vector':\n\t\tcase 'vector2':\n\t\tcase 'vector3':\n\t\tcase 'vector4':\n\n\t\t\treturn VectorKeyframeTrack;\n\n\t\tcase 'color':\n\n\t\t\treturn ColorKeyframeTrack;\n\n\t\tcase 'quaternion':\n\n\t\t\treturn QuaternionKeyframeTrack;\n\n\t\tcase 'bool':\n\t\tcase 'boolean':\n\n\t\t\treturn BooleanKeyframeTrack;\n\n\t\tcase 'string':\n\n\t\t\treturn StringKeyframeTrack;\n\n\t}\n\n\tthrow new Error( 'THREE.KeyframeTrack: Unsupported typeName: ' + typeName );\n\n}\n\nfunction parseKeyframeTrack( json ) {\n\n\tif ( json.type === undefined ) {\n\n\t\tthrow new Error( 'THREE.KeyframeTrack: track type undefined, can not parse' );\n\n\t}\n\n\tconst trackType = getTrackTypeForValueTypeName( json.type );\n\n\tif ( json.times === undefined ) {\n\n\t\tconst times = [], values = [];\n\n\t\tflattenJSON( json.keys, times, values, 'value' );\n\n\t\tjson.times = times;\n\t\tjson.values = values;\n\n\t}\n\n\t// derived classes can define a static parse method\n\tif ( trackType.parse !== undefined ) {\n\n\t\treturn trackType.parse( json );\n\n\t} else {\n\n\t\t// by default, we assume a constructor compatible with the base\n\t\treturn new trackType( json.name, json.times, json.values, json.interpolation );\n\n\t}\n\n}\n\n/**\n * @class\n * @classdesc A simple caching system, used internally by {@link FileLoader}.\n * To enable caching across all loaders that use {@link FileLoader}, add `THREE.Cache.enabled = true.` once in your app.\n * @hideconstructor\n */\nconst Cache = {\n\n\t/**\n\t * Whether caching is enabled or not.\n\t *\n\t * @static\n\t * @type {boolean}\n\t * @default false\n\t */\n\tenabled: false,\n\n\t/**\n\t * A dictionary that holds cached files.\n\t *\n\t * @static\n\t * @type {Object\u003cstring,Object\u003e}\n\t */\n\tfiles: {},\n\n\t/**\n\t * Adds a cache entry with a key to reference the file. If this key already\n\t * holds a file, it is overwritten.\n\t *\n\t * @static\n\t * @param {string} key - The key to reference the cached file.\n\t * @param {Object} file -  The file to be cached.\n\t */\n\tadd: function ( key, file ) {\n\n\t\tif ( this.enabled === false ) return;\n\n\t\t// log( 'Cache', 'Adding key:', key );\n\n\t\tthis.files[ key ] = file;\n\n\t},\n\n\t/**\n\t * Gets the cached value for the given key.\n\t *\n\t * @static\n\t * @param {string} key - The key to reference the cached file.\n\t * @return {Object|undefined} The cached file. If the key does not exist `undefined` is returned.\n\t */\n\tget: function ( key ) {\n\n\t\tif ( this.enabled === false ) return;\n\n\t\t// log( 'Cache', 'Checking key:', key );\n\n\t\treturn this.files[ key ];\n\n\t},\n\n\t/**\n\t * Removes the cached file associated with the given key.\n\t *\n\t * @static\n\t * @param {string} key - The key to reference the cached file.\n\t */\n\tremove: function ( key ) {\n\n\t\tdelete this.files[ key ];\n\n\t},\n\n\t/**\n\t * Remove all values from the cache.\n\t *\n\t * @static\n\t */\n\tclear: function () {\n\n\t\tthis.files = {};\n\n\t}\n\n};\n\n/**\n * Handles and keeps track of loaded and pending data. A default global\n * instance of this class is created and used by loaders if not supplied\n * manually.\n *\n * In general that should be sufficient, however there are times when it can\n * be useful to have separate loaders - for example if you want to show\n * separate loading bars for objects and textures.\n *\n * ```js\n * const manager = new THREE.LoadingManager();\n * manager.onLoad = () =\u003e console.log( 'Loading complete!' );\n *\n * const loader1 = new OBJLoader( manager );\n * const loader2 = new ColladaLoader( manager );\n * ```\n */\nclass LoadingManager {\n\n\t/**\n\t * Constructs a new loading manager.\n\t *\n\t * @param {Function} [onLoad] - Executes when all items have been loaded.\n\t * @param {Function} [onProgress] - Executes when single items have been loaded.\n\t * @param {Function} [onError] - Executes when an error occurs.\n\t */\n\tconstructor( onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tlet isLoading = false;\n\t\tlet itemsLoaded = 0;\n\t\tlet itemsTotal = 0;\n\t\tlet urlModifier = undefined;\n\t\tconst handlers = [];\n\n\t\t// Refer to #5689 for the reason why we don't set .onStart\n\t\t// in the constructor\n\n\t\t/**\n\t\t * Executes when an item starts loading.\n\t\t *\n\t\t * @type {Function|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.onStart = undefined;\n\n\t\t/**\n\t\t * Executes when all items have been loaded.\n\t\t *\n\t\t * @type {Function|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.onLoad = onLoad;\n\n\t\t/**\n\t\t * Executes when single items have been loaded.\n\t\t *\n\t\t * @type {Function|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.onProgress = onProgress;\n\n\t\t/**\n\t\t * Executes when an error occurs.\n\t\t *\n\t\t * @type {Function|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.onError = onError;\n\n\t\t/**\n\t\t * Used for aborting ongoing requests in loaders using this manager.\n\t\t *\n\t\t * @private\n\t\t * @type {AbortController | null}\n\t\t */\n\t\tthis._abortController = null;\n\n\t\t/**\n\t\t * This should be called by any loader using the manager when the loader\n\t\t * starts loading an item.\n\t\t *\n\t\t * @param {string} url - The URL to load.\n\t\t */\n\t\tthis.itemStart = function ( url ) {\n\n\t\t\titemsTotal ++;\n\n\t\t\tif ( isLoading === false ) {\n\n\t\t\t\tif ( scope.onStart !== undefined ) {\n\n\t\t\t\t\tscope.onStart( url, itemsLoaded, itemsTotal );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tisLoading = true;\n\n\t\t};\n\n\t\t/**\n\t\t * This should be called by any loader using the manager when the loader\n\t\t * ended loading an item.\n\t\t *\n\t\t * @param {string} url - The URL of the loaded item.\n\t\t */\n\t\tthis.itemEnd = function ( url ) {\n\n\t\t\titemsLoaded ++;\n\n\t\t\tif ( scope.onProgress !== undefined ) {\n\n\t\t\t\tscope.onProgress( url, itemsLoaded, itemsTotal );\n\n\t\t\t}\n\n\t\t\tif ( itemsLoaded === itemsTotal ) {\n\n\t\t\t\tisLoading = false;\n\n\t\t\t\tif ( scope.onLoad !== undefined ) {\n\n\t\t\t\t\tscope.onLoad();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\t/**\n\t\t * This should be called by any loader using the manager when the loader\n\t\t * encounters an error when loading an item.\n\t\t *\n\t\t * @param {string} url - The URL of the item that produces an error.\n\t\t */\n\t\tthis.itemError = function ( url ) {\n\n\t\t\tif ( scope.onError !== undefined ) {\n\n\t\t\t\tscope.onError( url );\n\n\t\t\t}\n\n\t\t};\n\n\t\t/**\n\t\t * Given a URL, uses the URL modifier callback (if any) and returns a\n\t\t * resolved URL. If no URL modifier is set, returns the original URL.\n\t\t *\n\t\t * @param {string} url - The URL to load.\n\t\t * @return {string} The resolved URL.\n\t\t */\n\t\tthis.resolveURL = function ( url ) {\n\n\t\t\tif ( urlModifier ) {\n\n\t\t\t\treturn urlModifier( url );\n\n\t\t\t}\n\n\t\t\treturn url;\n\n\t\t};\n\n\t\t/**\n\t\t * If provided, the callback will be passed each resource URL before a\n\t\t * request is sent. The callback may return the original URL, or a new URL to\n\t\t * override loading behavior. This behavior can be used to load assets from\n\t\t * .ZIP files, drag-and-drop APIs, and Data URIs.\n\t\t *\n\t\t * ```js\n\t\t * const blobs = {'fish.gltf': blob1, 'diffuse.png': blob2, 'normal.png': blob3};\n\t\t *\n\t\t * const manager = new THREE.LoadingManager();\n\t\t *\n\t\t * // Initialize loading manager with URL callback.\n\t\t * const objectURLs = [];\n\t\t * manager.setURLModifier( ( url ) =\u003e {\n\t\t *\n\t\t * \turl = URL.createObjectURL( blobs[ url ] );\n\t\t * \tobjectURLs.push( url );\n\t\t * \treturn url;\n\t\t *\n\t\t * } );\n\t\t *\n\t\t * // Load as usual, then revoke the blob URLs.\n\t\t * const loader = new GLTFLoader( manager );\n\t\t * loader.load( 'fish.gltf', (gltf) =\u003e {\n\t\t *\n\t\t * \tscene.add( gltf.scene );\n\t\t * \tobjectURLs.forEach( ( url ) =\u003e URL.revokeObjectURL( url ) );\n\t\t *\n\t\t * } );\n\t\t * ```\n\t\t *\n\t\t * @param {function(string):string} transform - URL modifier callback. Called with an URL and must return a resolved URL.\n\t\t * @return {LoadingManager} A reference to this loading manager.\n\t\t */\n\t\tthis.setURLModifier = function ( transform ) {\n\n\t\t\turlModifier = transform;\n\n\t\t\treturn this;\n\n\t\t};\n\n\t\t/**\n\t\t * Registers a loader with the given regular expression. Can be used to\n\t\t * define what loader should be used in order to load specific files. A\n\t\t * typical use case is to overwrite the default loader for textures.\n\t\t *\n\t\t * ```js\n\t\t * // add handler for TGA textures\n\t\t * manager.addHandler( /\\.tga$/i, new TGALoader() );\n\t\t * ```\n\t\t *\n\t\t * @param {string} regex - A regular expression.\n\t\t * @param {Loader} loader - A loader that should handle matched cases.\n\t\t * @return {LoadingManager} A reference to this loading manager.\n\t\t */\n\t\tthis.addHandler = function ( regex, loader ) {\n\n\t\t\thandlers.push( regex, loader );\n\n\t\t\treturn this;\n\n\t\t};\n\n\t\t/**\n\t\t * Removes the loader for the given regular expression.\n\t\t *\n\t\t * @param {string} regex - A regular expression.\n\t\t * @return {LoadingManager} A reference to this loading manager.\n\t\t */\n\t\tthis.removeHandler = function ( regex ) {\n\n\t\t\tconst index = handlers.indexOf( regex );\n\n\t\t\tif ( index !== -1 ) {\n\n\t\t\t\thandlers.splice( index, 2 );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t};\n\n\t\t/**\n\t\t * Can be used to retrieve the registered loader for the given file path.\n\t\t *\n\t\t * @param {string} file - The file path.\n\t\t * @return {?Loader} The registered loader. Returns `null` if no loader was found.\n\t\t */\n\t\tthis.getHandler = function ( file ) {\n\n\t\t\tfor ( let i = 0, l = handlers.length; i \u003c l; i += 2 ) {\n\n\t\t\t\tconst regex = handlers[ i ];\n\t\t\t\tconst loader = handlers[ i + 1 ];\n\n\t\t\t\tif ( regex.global ) regex.lastIndex = 0; // see #17920\n\n\t\t\t\tif ( regex.test( file ) ) {\n\n\t\t\t\t\treturn loader;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn null;\n\n\t\t};\n\n\t\t/**\n\t\t * Can be used to abort ongoing loading requests in loaders using this manager.\n\t\t * The abort only works if the loaders implement {@link Loader#abort} and `AbortSignal.any()`\n\t\t * is supported in the browser.\n\t\t *\n\t\t * @return {LoadingManager} A reference to this loading manager.\n\t\t */\n\t\tthis.abort = function () {\n\n\n\t\t\tthis.abortController.abort();\n\t\t\tthis._abortController = null;\n\n\t\t\treturn this;\n\n\t\t};\n\n\t}\n\n\t// TODO: Revert this back to a single member variable once this issue has been fixed\n\t// https://github.com/cloudflare/workerd/issues/3657\n\n\t/**\n\t * Used for aborting ongoing requests in loaders using this manager.\n\t *\n\t * @type {AbortController}\n\t */\n\tget abortController() {\n\n\t\tif ( ! this._abortController ) {\n\n\t\t\tthis._abortController = new AbortController();\n\n\t\t}\n\n\t\treturn this._abortController;\n\n\t}\n\n}\n\n/**\n * The global default loading manager.\n *\n * @constant\n * @type {LoadingManager}\n */\nconst DefaultLoadingManager = /*@__PURE__*/ new LoadingManager();\n\n/**\n * Abstract base class for loaders.\n *\n * @abstract\n */\nclass Loader {\n\n\t/**\n\t * Constructs a new loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\t/**\n\t\t * The loading manager.\n\t\t *\n\t\t * @type {LoadingManager}\n\t\t * @default DefaultLoadingManager\n\t\t */\n\t\tthis.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;\n\n\t\t/**\n\t\t * The crossOrigin string to implement CORS for loading the url from a\n\t\t * different domain that allows CORS.\n\t\t *\n\t\t * @type {string}\n\t\t * @default 'anonymous'\n\t\t */\n\t\tthis.crossOrigin = 'anonymous';\n\n\t\t/**\n\t\t * Whether the XMLHttpRequest uses credentials.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.withCredentials = false;\n\n\t\t/**\n\t\t * The base path from which the asset will be loaded.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.path = '';\n\n\t\t/**\n\t\t * The base path from which additional resources like textures will be loaded.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.resourcePath = '';\n\n\t\t/**\n\t\t * The [request header](https://developer.mozilla.org/en-US/docs/Glossary/Request_header)\n\t\t * used in HTTP request.\n\t\t *\n\t\t * @type {Object\u003cstring, any\u003e}\n\t\t */\n\t\tthis.requestHeader = {};\n\n\t}\n\n\t/**\n\t * This method needs to be implemented by all concrete loaders. It holds the\n\t * logic for loading assets from the backend.\n\t *\n\t * @abstract\n\t * @param {string} url - The path/URL of the file to be loaded.\n\t * @param {Function} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.\n\t * @param {onErrorCallback} [onError] - Executed when errors occur.\n\t */\n\tload( /* url, onLoad, onProgress, onError */ ) {}\n\n\t/**\n\t * A async version of {@link Loader#load}.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded.\n\t * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.\n\t * @return {Promise} A Promise that resolves when the asset has been loaded.\n\t */\n\tloadAsync( url, onProgress ) {\n\n\t\tconst scope = this;\n\n\t\treturn new Promise( function ( resolve, reject ) {\n\n\t\t\tscope.load( url, resolve, onProgress, reject );\n\n\t\t} );\n\n\t}\n\n\t/**\n\t * This method needs to be implemented by all concrete loaders. It holds the\n\t * logic for parsing the asset into three.js entities.\n\t *\n\t * @abstract\n\t * @param {any} data - The data to parse.\n\t */\n\tparse( /* data */ ) {}\n\n\t/**\n\t * Sets the `crossOrigin` String to implement CORS for loading the URL\n\t * from a different domain that allows CORS.\n\t *\n\t * @param {string} crossOrigin - The `crossOrigin` value.\n\t * @return {Loader} A reference to this instance.\n\t */\n\tsetCrossOrigin( crossOrigin ) {\n\n\t\tthis.crossOrigin = crossOrigin;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Whether the XMLHttpRequest uses credentials such as cookies, authorization\n\t * headers or TLS client certificates, see [XMLHttpRequest.withCredentials](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials).\n\t *\n\t * Note: This setting has no effect if you are loading files locally or from the same domain.\n\t *\n\t * @param {boolean} value - The `withCredentials` value.\n\t * @return {Loader} A reference to this instance.\n\t */\n\tsetWithCredentials( value ) {\n\n\t\tthis.withCredentials = value;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the base path for the asset.\n\t *\n\t * @param {string} path - The base path.\n\t * @return {Loader} A reference to this instance.\n\t */\n\tsetPath( path ) {\n\n\t\tthis.path = path;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the base path for dependent resources like textures.\n\t *\n\t * @param {string} resourcePath - The resource path.\n\t * @return {Loader} A reference to this instance.\n\t */\n\tsetResourcePath( resourcePath ) {\n\n\t\tthis.resourcePath = resourcePath;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given request header.\n\t *\n\t * @param {Object} requestHeader - A [request header](https://developer.mozilla.org/en-US/docs/Glossary/Request_header)\n\t * for configuring the HTTP request.\n\t * @return {Loader} A reference to this instance.\n\t */\n\tsetRequestHeader( requestHeader ) {\n\n\t\tthis.requestHeader = requestHeader;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * This method can be implemented in loaders for aborting ongoing requests.\n\t *\n\t * @abstract\n\t * @return {Loader} A reference to this instance.\n\t */\n\tabort() {\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * Callback for onProgress in loaders.\n *\n * @callback onProgressCallback\n * @param {ProgressEvent} event - An instance of `ProgressEvent` that represents the current loading status.\n */\n\n/**\n * Callback for onError in loaders.\n *\n * @callback onErrorCallback\n * @param {Error} error - The error which occurred during the loading process.\n */\n\n/**\n * The default material name that is used by loaders\n * when creating materials for loaded 3D objects.\n *\n * Note: Not all loaders might honor this setting.\n *\n * @static\n * @type {string}\n * @default '__DEFAULT'\n */\nLoader.DEFAULT_MATERIAL_NAME = '__DEFAULT';\n\nconst loading = {};\n\nclass HttpError extends Error {\n\n\tconstructor( message, response ) {\n\n\t\tsuper( message );\n\t\tthis.response = response;\n\n\t}\n\n}\n\n/**\n * A low level class for loading resources with the Fetch API, used internally by\n * most loaders. It can also be used directly to load any file type that does\n * not have a loader.\n *\n * This loader supports caching. If you want to use it, add `THREE.Cache.enabled = true;`\n * once to your application.\n *\n * ```js\n * const loader = new THREE.FileLoader();\n * const data = await loader.loadAsync( 'example.txt' );\n * ```\n *\n * @augments Loader\n */\nclass FileLoader extends Loader {\n\n\t/**\n\t * Constructs a new file loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t\t/**\n\t\t * The expected mime type. Valid values can be found\n\t\t * [here](hhttps://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#mimetype)\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.mimeType = '';\n\n\t\t/**\n\t\t * The expected response type.\n\t\t *\n\t\t * @type {('arraybuffer'|'blob'|'document'|'json'|'')}\n\t\t * @default ''\n\t\t */\n\t\tthis.responseType = '';\n\n\t\t/**\n\t\t * Used for aborting requests.\n\t\t *\n\t\t * @private\n\t\t * @type {AbortController}\n\t\t */\n\t\tthis._abortController = new AbortController();\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and pass the loaded response to the `onLoad()` callback.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(any)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.\n\t * @param {onErrorCallback} [onError] - Executed when errors occur.\n\t * @return {any|undefined} The cached resource if available.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tif ( url === undefined ) url = '';\n\n\t\tif ( this.path !== undefined ) url = this.path + url;\n\n\t\turl = this.manager.resolveURL( url );\n\n\t\tconst cached = Cache.get( `file:${url}` );\n\n\t\tif ( cached !== undefined ) {\n\n\t\t\tthis.manager.itemStart( url );\n\n\t\t\tsetTimeout( () =\u003e {\n\n\t\t\t\tif ( onLoad ) onLoad( cached );\n\n\t\t\t\tthis.manager.itemEnd( url );\n\n\t\t\t}, 0 );\n\n\t\t\treturn cached;\n\n\t\t}\n\n\t\t// Check if request is duplicate\n\n\t\tif ( loading[ url ] !== undefined ) {\n\n\t\t\tloading[ url ].push( {\n\n\t\t\t\tonLoad: onLoad,\n\t\t\t\tonProgress: onProgress,\n\t\t\t\tonError: onError\n\n\t\t\t} );\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t// Initialise array for duplicate requests\n\t\tloading[ url ] = [];\n\n\t\tloading[ url ].push( {\n\t\t\tonLoad: onLoad,\n\t\t\tonProgress: onProgress,\n\t\t\tonError: onError,\n\t\t} );\n\n\t\t// create request\n\t\tconst req = new Request( url, {\n\t\t\theaders: new Headers( this.requestHeader ),\n\t\t\tcredentials: this.withCredentials ? 'include' : 'same-origin',\n\t\t\tsignal: ( typeof AbortSignal.any === 'function' ) ? AbortSignal.any( [ this._abortController.signal, this.manager.abortController.signal ] ) : this._abortController.signal\n\t\t} );\n\n\t\t// record states ( avoid data race )\n\t\tconst mimeType = this.mimeType;\n\t\tconst responseType = this.responseType;\n\n\t\t// start the fetch\n\t\tfetch( req )\n\t\t\t.then( response =\u003e {\n\n\t\t\t\tif ( response.status === 200 || response.status === 0 ) {\n\n\t\t\t\t\t// Some browsers return HTTP Status 0 when using non-http protocol\n\t\t\t\t\t// e.g. 'file://' or 'data://'. Handle as success.\n\n\t\t\t\t\tif ( response.status === 0 ) {\n\n\t\t\t\t\t\twarn( 'FileLoader: HTTP Status 0 received.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Workaround: Checking if response.body === undefined for Alipay browser #23548\n\n\t\t\t\t\tif ( typeof ReadableStream === 'undefined' || response.body === undefined || response.body.getReader === undefined ) {\n\n\t\t\t\t\t\treturn response;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst callbacks = loading[ url ];\n\t\t\t\t\tconst reader = response.body.getReader();\n\n\t\t\t\t\t// Nginx needs X-File-Size check\n\t\t\t\t\t// https://serverfault.com/questions/482875/why-does-nginx-remove-content-length-header-for-chunked-content\n\t\t\t\t\tconst contentLength = response.headers.get( 'X-File-Size' ) || response.headers.get( 'Content-Length' );\n\t\t\t\t\tconst total = contentLength ? parseInt( contentLength ) : 0;\n\t\t\t\t\tconst lengthComputable = total !== 0;\n\t\t\t\t\tlet loaded = 0;\n\n\t\t\t\t\t// periodically read data into the new stream tracking while download progress\n\t\t\t\t\tconst stream = new ReadableStream( {\n\t\t\t\t\t\tstart( controller ) {\n\n\t\t\t\t\t\t\treadData();\n\n\t\t\t\t\t\t\tfunction readData() {\n\n\t\t\t\t\t\t\t\treader.read().then( ( { done, value } ) =\u003e {\n\n\t\t\t\t\t\t\t\t\tif ( done ) {\n\n\t\t\t\t\t\t\t\t\t\tcontroller.close();\n\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\tloaded += value.byteLength;\n\n\t\t\t\t\t\t\t\t\t\tconst event = new ProgressEvent( 'progress', { lengthComputable, loaded, total } );\n\t\t\t\t\t\t\t\t\t\tfor ( let i = 0, il = callbacks.length; i \u003c il; i ++ ) {\n\n\t\t\t\t\t\t\t\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\t\t\t\t\t\t\t\tif ( callback.onProgress ) callback.onProgress( event );\n\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tcontroller.enqueue( value );\n\t\t\t\t\t\t\t\t\t\treadData();\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}, ( e ) =\u003e {\n\n\t\t\t\t\t\t\t\t\tcontroller.error( e );\n\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn new Response( stream );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthrow new HttpError( `fetch for \"${response.url}\" responded with ${response.status}: ${response.statusText}`, response );\n\n\t\t\t\t}\n\n\t\t\t} )\n\t\t\t.then( response =\u003e {\n\n\t\t\t\tswitch ( responseType ) {\n\n\t\t\t\t\tcase 'arraybuffer':\n\n\t\t\t\t\t\treturn response.arrayBuffer();\n\n\t\t\t\t\tcase 'blob':\n\n\t\t\t\t\t\treturn response.blob();\n\n\t\t\t\t\tcase 'document':\n\n\t\t\t\t\t\treturn response.text()\n\t\t\t\t\t\t\t.then( text =\u003e {\n\n\t\t\t\t\t\t\t\tconst parser = new DOMParser();\n\t\t\t\t\t\t\t\treturn parser.parseFromString( text, mimeType );\n\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\tcase 'json':\n\n\t\t\t\t\t\treturn response.json();\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tif ( mimeType === '' ) {\n\n\t\t\t\t\t\t\treturn response.text();\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// sniff encoding\n\t\t\t\t\t\t\tconst re = /charset=\"?([^;\"\\s]*)\"?/i;\n\t\t\t\t\t\t\tconst exec = re.exec( mimeType );\n\t\t\t\t\t\t\tconst label = exec \u0026\u0026 exec[ 1 ] ? exec[ 1 ].toLowerCase() : undefined;\n\t\t\t\t\t\t\tconst decoder = new TextDecoder( label );\n\t\t\t\t\t\t\treturn response.arrayBuffer().then( ab =\u003e decoder.decode( ab ) );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} )\n\t\t\t.then( data =\u003e {\n\n\t\t\t\t// Add to cache only on HTTP success, so that we do not cache\n\t\t\t\t// error response bodies as proper responses to requests.\n\t\t\t\tCache.add( `file:${url}`, data );\n\n\t\t\t\tconst callbacks = loading[ url ];\n\t\t\t\tdelete loading[ url ];\n\n\t\t\t\tfor ( let i = 0, il = callbacks.length; i \u003c il; i ++ ) {\n\n\t\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\t\tif ( callback.onLoad ) callback.onLoad( data );\n\n\t\t\t\t}\n\n\t\t\t} )\n\t\t\t.catch( err =\u003e {\n\n\t\t\t\t// Abort errors and other errors are handled the same\n\n\t\t\t\tconst callbacks = loading[ url ];\n\n\t\t\t\tif ( callbacks === undefined ) {\n\n\t\t\t\t\t// When onLoad was called and url was deleted in `loading`\n\t\t\t\t\tthis.manager.itemError( url );\n\t\t\t\t\tthrow err;\n\n\t\t\t\t}\n\n\t\t\t\tdelete loading[ url ];\n\n\t\t\t\tfor ( let i = 0, il = callbacks.length; i \u003c il; i ++ ) {\n\n\t\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\t\tif ( callback.onError ) callback.onError( err );\n\n\t\t\t\t}\n\n\t\t\t\tthis.manager.itemError( url );\n\n\t\t\t} )\n\t\t\t.finally( () =\u003e {\n\n\t\t\t\tthis.manager.itemEnd( url );\n\n\t\t\t} );\n\n\t\tthis.manager.itemStart( url );\n\n\t}\n\n\t/**\n\t * Sets the expected response type.\n\t *\n\t * @param {('arraybuffer'|'blob'|'document'|'json'|'')} value - The response type.\n\t * @return {FileLoader} A reference to this file loader.\n\t */\n\tsetResponseType( value ) {\n\n\t\tthis.responseType = value;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the expected mime type of the loaded file.\n\t *\n\t * @param {string} value - The mime type.\n\t * @return {FileLoader} A reference to this file loader.\n\t */\n\tsetMimeType( value ) {\n\n\t\tthis.mimeType = value;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Aborts ongoing fetch requests.\n\t *\n\t * @return {FileLoader} A reference to this instance.\n\t */\n\tabort() {\n\n\t\tthis._abortController.abort();\n\t\tthis._abortController = new AbortController();\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * Class for loading animation clips in the JSON format. The files are internally\n * loaded via {@link FileLoader}.\n *\n * ```js\n * const loader = new THREE.AnimationLoader();\n * const animations = await loader.loadAsync( 'animations/animation.js' );\n * ```\n *\n * @augments Loader\n */\nclass AnimationLoader extends Loader {\n\n\t/**\n\t * Constructs a new animation loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and pass the loaded animations as an array\n\t * holding instances of {@link AnimationClip} to the `onLoad()` callback.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(Array\u003cAnimationClip\u003e)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Executed while the loading is in progress.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\terror( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\t/**\n\t * Parses the given JSON object and returns an array of animation clips.\n\t *\n\t * @param {Object} json - The serialized animation clips.\n\t * @return {Array\u003cAnimationClip\u003e} The parsed animation clips.\n\t */\n\tparse( json ) {\n\n\t\tconst animations = [];\n\n\t\tfor ( let i = 0; i \u003c json.length; i ++ ) {\n\n\t\t\tconst clip = AnimationClip.parse( json[ i ] );\n\n\t\t\tanimations.push( clip );\n\n\t\t}\n\n\t\treturn animations;\n\n\t}\n\n}\n\n/**\n * Abstract base class for loading compressed texture formats S3TC, ASTC or ETC.\n * Textures are internally loaded via {@link FileLoader}.\n *\n * Derived classes have to implement the `parse()` method which holds the parsing\n * for the respective format.\n *\n * @abstract\n * @augments Loader\n */\nclass CompressedTextureLoader extends Loader {\n\n\t/**\n\t * Constructs a new compressed texture loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and passes the loaded compressed texture\n\t * to the `onLoad()` callback. The method also returns a new texture object which can\n\t * directly be used for material creation. If you do it this way, the texture\n\t * may pop up in your scene once the respective loading process is finished.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(CompressedTexture)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Executed while the loading is in progress.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t * @return {CompressedTexture} The compressed texture.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst images = [];\n\n\t\tconst texture = new CompressedTexture();\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\n\t\tlet loaded = 0;\n\n\t\tfunction loadTexture( i ) {\n\n\t\t\tloader.load( url[ i ], function ( buffer ) {\n\n\t\t\t\tconst texDatas = scope.parse( buffer, true );\n\n\t\t\t\timages[ i ] = {\n\t\t\t\t\twidth: texDatas.width,\n\t\t\t\t\theight: texDatas.height,\n\t\t\t\t\tformat: texDatas.format,\n\t\t\t\t\tmipmaps: texDatas.mipmaps\n\t\t\t\t};\n\n\t\t\t\tloaded += 1;\n\n\t\t\t\tif ( loaded === 6 ) {\n\n\t\t\t\t\tif ( texDatas.mipmapCount === 1 ) texture.minFilter = LinearFilter;\n\n\t\t\t\t\ttexture.image = images;\n\t\t\t\t\ttexture.format = texDatas.format;\n\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t\t}\n\n\t\t\t}, onProgress, onError );\n\n\t\t}\n\n\t\tif ( Array.isArray( url ) ) {\n\n\t\t\tfor ( let i = 0, il = url.length; i \u003c il; ++ i ) {\n\n\t\t\t\tloadTexture( i );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// compressed cubemap texture stored in a single DDS file\n\n\t\t\tloader.load( url, function ( buffer ) {\n\n\t\t\t\tconst texDatas = scope.parse( buffer, true );\n\n\t\t\t\tif ( texDatas.isCubemap ) {\n\n\t\t\t\t\tconst faces = texDatas.mipmaps.length / texDatas.mipmapCount;\n\n\t\t\t\t\tfor ( let f = 0; f \u003c faces; f ++ ) {\n\n\t\t\t\t\t\timages[ f ] = { mipmaps: [] };\n\n\t\t\t\t\t\tfor ( let i = 0; i \u003c texDatas.mipmapCount; i ++ ) {\n\n\t\t\t\t\t\t\timages[ f ].mipmaps.push( texDatas.mipmaps[ f * texDatas.mipmapCount + i ] );\n\t\t\t\t\t\t\timages[ f ].format = texDatas.format;\n\t\t\t\t\t\t\timages[ f ].width = texDatas.width;\n\t\t\t\t\t\t\timages[ f ].height = texDatas.height;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.image = images;\n\n\t\t\t\t} else {\n\n\t\t\t\t\ttexture.image.width = texDatas.width;\n\t\t\t\t\ttexture.image.height = texDatas.height;\n\t\t\t\t\ttexture.mipmaps = texDatas.mipmaps;\n\n\t\t\t\t}\n\n\t\t\t\tif ( texDatas.mipmapCount === 1 ) {\n\n\t\t\t\t\ttexture.minFilter = LinearFilter;\n\n\t\t\t\t}\n\n\t\t\t\ttexture.format = texDatas.format;\n\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t}, onProgress, onError );\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n}\n\nconst _loading = new WeakMap();\n\n/**\n * A loader for loading images. The class loads images with the HTML `Image` API.\n *\n * ```js\n * const loader = new THREE.ImageLoader();\n * const image = await loader.loadAsync( 'image.png' );\n * ```\n * Please note that `ImageLoader` has dropped support for progress\n * events in `r84`. For an `ImageLoader` that supports progress events, see\n * [this thread](https://github.com/mrdoob/three.js/issues/10439#issuecomment-275785639).\n *\n * @augments Loader\n */\nclass ImageLoader extends Loader {\n\n\t/**\n\t * Constructs a new image loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and passes the loaded image\n\t * to the `onLoad()` callback. The method also returns a new `Image` object which can\n\t * directly be used for texture creation. If you do it this way, the texture\n\t * may pop up in your scene once the respective loading process is finished.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(Image)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Unsupported in this loader.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t * @return {Image} The image.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tif ( this.path !== undefined ) url = this.path + url;\n\n\t\turl = this.manager.resolveURL( url );\n\n\t\tconst scope = this;\n\n\t\tconst cached = Cache.get( `image:${url}` );\n\n\t\tif ( cached !== undefined ) {\n\n\t\t\tif ( cached.complete === true ) {\n\n\t\t\t\tscope.manager.itemStart( url );\n\n\t\t\t\tsetTimeout( function () {\n\n\t\t\t\t\tif ( onLoad ) onLoad( cached );\n\n\t\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t\t}, 0 );\n\n\t\t\t} else {\n\n\t\t\t\tlet arr = _loading.get( cached );\n\n\t\t\t\tif ( arr === undefined ) {\n\n\t\t\t\t\tarr = [];\n\t\t\t\t\t_loading.set( cached, arr );\n\n\t\t\t\t}\n\n\t\t\t\tarr.push( { onLoad, onError } );\n\n\t\t\t}\n\n\t\t\treturn cached;\n\n\t\t}\n\n\t\tconst image = createElementNS( 'img' );\n\n\t\tfunction onImageLoad() {\n\n\t\t\tremoveEventListeners();\n\n\t\t\tif ( onLoad ) onLoad( this );\n\n\t\t\t//\n\n\t\t\tconst callbacks = _loading.get( this ) || [];\n\n\t\t\tfor ( let i = 0; i \u003c callbacks.length; i ++ ) {\n\n\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\tif ( callback.onLoad ) callback.onLoad( this );\n\n\t\t\t}\n\n\t\t\t_loading.delete( this );\n\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t}\n\n\t\tfunction onImageError( event ) {\n\n\t\t\tremoveEventListeners();\n\n\t\t\tif ( onError ) onError( event );\n\n\t\t\tCache.remove( `image:${url}` );\n\n\t\t\t//\n\n\t\t\tconst callbacks = _loading.get( this ) || [];\n\n\t\t\tfor ( let i = 0; i \u003c callbacks.length; i ++ ) {\n\n\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\tif ( callback.onError ) callback.onError( event );\n\n\t\t\t}\n\n\t\t\t_loading.delete( this );\n\n\n\t\t\tscope.manager.itemError( url );\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t}\n\n\t\tfunction removeEventListeners() {\n\n\t\t\timage.removeEventListener( 'load', onImageLoad, false );\n\t\t\timage.removeEventListener( 'error', onImageError, false );\n\n\t\t}\n\n\t\timage.addEventListener( 'load', onImageLoad, false );\n\t\timage.addEventListener( 'error', onImageError, false );\n\n\t\tif ( url.slice( 0, 5 ) !== 'data:' ) {\n\n\t\t\tif ( this.crossOrigin !== undefined ) image.crossOrigin = this.crossOrigin;\n\n\t\t}\n\n\t\tCache.add( `image:${url}`, image );\n\t\tscope.manager.itemStart( url );\n\n\t\timage.src = url;\n\n\t\treturn image;\n\n\t}\n\n}\n\n/**\n * Class for loading cube textures. Images are internally loaded via {@link ImageLoader}.\n *\n * The loader returns an instance of {@link CubeTexture} and expects the cube map to\n * be defined as six separate images representing the sides of a cube. Other cube map definitions\n * like vertical and horizontal cross, column and row layouts are not supported.\n *\n * Note that, by convention, cube maps are specified in a coordinate system\n * in which positive-x is to the right when looking up the positive-z axis --\n * in other words, using a left-handed coordinate system. Since three.js uses\n * a right-handed coordinate system, environment maps used in three.js will\n * have pos-x and neg-x swapped.\n *\n * The loaded cube texture is in sRGB color space. Meaning {@link Texture#colorSpace}\n * is set to `SRGBColorSpace` by default.\n *\n * ```js\n * const loader = new THREE.CubeTextureLoader().setPath( 'textures/cubeMaps/' );\n * const cubeTexture = await loader.loadAsync( [\n * \t'px.png', 'nx.png', 'py.png', 'ny.png', 'pz.png', 'nz.png'\n * ] );\n * scene.background = cubeTexture;\n * ```\n *\n * @augments Loader\n */\nclass CubeTextureLoader extends Loader {\n\n\t/**\n\t * Constructs a new cube texture loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and pass the fully loaded cube texture\n\t * to the `onLoad()` callback. The method also returns a new cube texture object which can\n\t * directly be used for material creation. If you do it this way, the cube texture\n\t * may pop up in your scene once the respective loading process is finished.\n\t *\n\t * @param {Array\u003cstring\u003e} urls - Array of 6 URLs to images, one for each side of the\n\t * cube texture. The urls should be specified in the following order: pos-x,\n\t * neg-x, pos-y, neg-y, pos-z, neg-z. An array of data URIs are allowed as well.\n\t * @param {function(CubeTexture)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Unsupported in this loader.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t * @return {CubeTexture} The cube texture.\n\t */\n\tload( urls, onLoad, onProgress, onError ) {\n\n\t\tconst texture = new CubeTexture();\n\t\ttexture.colorSpace = SRGBColorSpace;\n\n\t\tconst loader = new ImageLoader( this.manager );\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.setPath( this.path );\n\n\t\tlet loaded = 0;\n\n\t\tfunction loadTexture( i ) {\n\n\t\t\tloader.load( urls[ i ], function ( image ) {\n\n\t\t\t\ttexture.images[ i ] = image;\n\n\t\t\t\tloaded ++;\n\n\t\t\t\tif ( loaded === 6 ) {\n\n\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t\t}\n\n\t\t\t}, undefined, onError );\n\n\t\t}\n\n\t\tfor ( let i = 0; i \u003c urls.length; ++ i ) {\n\n\t\t\tloadTexture( i );\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n}\n\n/**\n * Abstract base class for loading binary texture formats RGBE, EXR or TGA.\n * Textures are internally loaded via {@link FileLoader}.\n *\n * Derived classes have to implement the `parse()` method which holds the parsing\n * for the respective format.\n *\n * @abstract\n * @augments Loader\n */\nclass DataTextureLoader extends Loader {\n\n\t/**\n\t * Constructs a new data texture loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and passes the loaded data texture\n\t * to the `onLoad()` callback. The method also returns a new texture object which can\n\t * directly be used for material creation. If you do it this way, the texture\n\t * may pop up in your scene once the respective loading process is finished.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(DataTexture)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Executed while the loading is in progress.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t * @return {DataTexture} The data texture.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst texture = new DataTexture();\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setPath( this.path );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\t\tloader.load( url, function ( buffer ) {\n\n\t\t\tlet texData;\n\n\t\t\ttry {\n\n\t\t\t\ttexData = scope.parse( buffer );\n\n\t\t\t} catch ( error ) {\n\n\t\t\t\tif ( onError !== undefined ) {\n\n\t\t\t\t\tonError( error );\n\n\t\t\t\t} else {\n\n\t\t\t\t\terror( error );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( texData.image !== undefined ) {\n\n\t\t\t\ttexture.image = texData.image;\n\n\t\t\t} else if ( texData.data !== undefined ) {\n\n\t\t\t\ttexture.image.width = texData.width;\n\t\t\t\ttexture.image.height = texData.height;\n\t\t\t\ttexture.image.data = texData.data;\n\n\t\t\t}\n\n\t\t\ttexture.wrapS = texData.wrapS !== undefined ? texData.wrapS : ClampToEdgeWrapping;\n\t\t\ttexture.wrapT = texData.wrapT !== undefined ? texData.wrapT : ClampToEdgeWrapping;\n\n\t\t\ttexture.magFilter = texData.magFilter !== undefined ? texData.magFilter : LinearFilter;\n\t\t\ttexture.minFilter = texData.minFilter !== undefined ? texData.minFilter : LinearFilter;\n\n\t\t\ttexture.anisotropy = texData.anisotropy !== undefined ? texData.anisotropy : 1;\n\n\t\t\tif ( texData.colorSpace !== undefined ) {\n\n\t\t\t\ttexture.colorSpace = texData.colorSpace;\n\n\t\t\t}\n\n\t\t\tif ( texData.flipY !== undefined ) {\n\n\t\t\t\ttexture.flipY = texData.flipY;\n\n\t\t\t}\n\n\t\t\tif ( texData.format !== undefined ) {\n\n\t\t\t\ttexture.format = texData.format;\n\n\t\t\t}\n\n\t\t\tif ( texData.type !== undefined ) {\n\n\t\t\t\ttexture.type = texData.type;\n\n\t\t\t}\n\n\t\t\tif ( texData.mipmaps !== undefined ) {\n\n\t\t\t\ttexture.mipmaps = texData.mipmaps;\n\t\t\t\ttexture.minFilter = LinearMipmapLinearFilter; // presumably...\n\n\t\t\t}\n\n\t\t\tif ( texData.mipmapCount === 1 ) {\n\n\t\t\t\ttexture.minFilter = LinearFilter;\n\n\t\t\t}\n\n\t\t\tif ( texData.generateMipmaps !== undefined ) {\n\n\t\t\t\ttexture.generateMipmaps = texData.generateMipmaps;\n\n\t\t\t}\n\n\t\t\ttexture.needsUpdate = true;\n\n\t\t\tif ( onLoad ) onLoad( texture, texData );\n\n\t\t}, onProgress, onError );\n\n\n\t\treturn texture;\n\n\t}\n\n}\n\n/**\n * Class for loading textures. Images are internally\n * loaded via {@link ImageLoader}.\n *\n * ```js\n * const loader = new THREE.TextureLoader();\n * const texture = await loader.loadAsync( 'textures/land_ocean_ice_cloud_2048.jpg' );\n *\n * const material = new THREE.MeshBasicMaterial( { map:texture } );\n * ```\n * Please note that `TextureLoader` has dropped support for progress\n * events in `r84`. For a `TextureLoader` that supports progress events, see\n * [this thread](https://github.com/mrdoob/three.js/issues/10439#issuecomment-293260145).\n *\n * @augments Loader\n */\nclass TextureLoader extends Loader {\n\n\t/**\n\t * Constructs a new texture loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and pass the fully loaded texture\n\t * to the `onLoad()` callback. The method also returns a new texture object which can\n\t * directly be used for material creation. If you do it this way, the texture\n\t * may pop up in your scene once the respective loading process is finished.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(Texture)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Unsupported in this loader.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t * @return {Texture} The texture.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst texture = new Texture();\n\n\t\tconst loader = new ImageLoader( this.manager );\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.setPath( this.path );\n\n\t\tloader.load( url, function ( image ) {\n\n\t\t\ttexture.image = image;\n\t\t\ttexture.needsUpdate = true;\n\n\t\t\tif ( onLoad !== undefined ) {\n\n\t\t\t\tonLoad( texture );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t\treturn texture;\n\n\t}\n\n}\n\n/**\n * Abstract base class for lights - all other light types inherit the\n * properties and methods described here.\n *\n * @abstract\n * @augments Object3D\n */\nclass Light extends Object3D {\n\n\t/**\n\t * Constructs a new light.\n\t *\n\t * @param {(number|Color|string)} [color=0xffffff] - The light's color.\n\t * @param {number} [intensity=1] - The light's strength/intensity.\n\t */\n\tconstructor( color, intensity = 1 ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLight = true;\n\n\t\tthis.type = 'Light';\n\n\t\t/**\n\t\t * The light's color.\n\t\t *\n\t\t * @type {Color}\n\t\t */\n\t\tthis.color = new Color( color );\n\n\t\t/**\n\t\t * The light's intensity.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.intensity = intensity;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.color.copy( source.color );\n\t\tthis.intensity = source.intensity;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.color = this.color.getHex();\n\t\tdata.object.intensity = this.intensity;\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * A light source positioned directly above the scene, with color fading from\n * the sky color to the ground color.\n *\n * This light cannot be used to cast shadows.\n *\n * ```js\n * const light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 );\n * scene.add( light );\n * ```\n *\n * @augments Light\n */\nclass HemisphereLight extends Light {\n\n\t/**\n\t * Constructs a new hemisphere light.\n\t *\n\t * @param {(number|Color|string)} [skyColor=0xffffff] - The light's sky color.\n\t * @param {(number|Color|string)} [groundColor=0xffffff] - The light's ground color.\n\t * @param {number} [intensity=1] - The light's strength/intensity.\n\t */\n\tconstructor( skyColor, groundColor, intensity ) {\n\n\t\tsuper( skyColor, intensity );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isHemisphereLight = true;\n\n\t\tthis.type = 'HemisphereLight';\n\n\t\tthis.position.copy( Object3D.DEFAULT_UP );\n\t\tthis.updateMatrix();\n\n\t\t/**\n\t\t * The light's ground color.\n\t\t *\n\t\t * @type {Color}\n\t\t */\n\t\tthis.groundColor = new Color( groundColor );\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.groundColor.copy( source.groundColor );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.groundColor = this.groundColor.getHex();\n\n\t\treturn data;\n\n\t}\n\n}\n\nconst _projScreenMatrix = /*@__PURE__*/ new Matrix4();\nconst _lightPositionWorld = /*@__PURE__*/ new Vector3();\nconst _lookTarget = /*@__PURE__*/ new Vector3();\n\n/**\n * Abstract base class for light shadow classes. These classes\n * represent the shadow configuration for different light types.\n *\n * @abstract\n */\nclass LightShadow {\n\n\t/**\n\t * Constructs a new light shadow.\n\t *\n\t * @param {Camera} camera - The light's view of the world.\n\t */\n\tconstructor( camera ) {\n\n\t\t/**\n\t\t * The light's view of the world.\n\t\t *\n\t\t * @type {Camera}\n\t\t */\n\t\tthis.camera = camera;\n\n\t\t/**\n\t\t * The intensity of the shadow. The default is `1`.\n\t\t * Valid values are in the range `[0, 1]`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.intensity = 1;\n\n\t\t/**\n\t\t * Shadow map bias, how much to add or subtract from the normalized depth\n\t\t * when deciding whether a surface is in shadow.\n\t\t *\n\t\t * The default is `0`. Very tiny adjustments here (in the order of `0.0001`)\n\t\t * may help reduce artifacts in shadows.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.bias = 0;\n\n\t\t/**\n\t\t * Defines how much the position used to query the shadow map is offset along\n\t\t * the object normal. The default is `0`. Increasing this value can be used to\n\t\t * reduce shadow acne especially in large scenes where light shines onto\n\t\t * geometry at a shallow angle. The cost is that shadows may appear distorted.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.normalBias = 0;\n\n\t\t/**\n\t\t * Setting this to values greater than 1 will blur the edges of the shadow.\n\t\t * High values will cause unwanted banding effects in the shadows - a greater\n\t\t * map size will allow for a higher value to be used here before these effects\n\t\t * become visible.\n\t\t *\n\t\t * The property has no effect when the shadow map type is `BasicShadowMap`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.radius = 1;\n\n\t\t/**\n\t\t * The amount of samples to use when blurring a VSM shadow map.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 8\n\t\t */\n\t\tthis.blurSamples = 8;\n\n\t\t/**\n\t\t * Defines the width and height of the shadow map. Higher values give better quality\n\t\t * shadows at the cost of computation time. Values must be powers of two.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (512,512)\n\t\t */\n\t\tthis.mapSize = new Vector2( 512, 512 );\n\n\t\t/**\n\t\t * The type of shadow texture. The default is `UnsignedByteType`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default UnsignedByteType\n\t\t */\n\t\tthis.mapType = UnsignedByteType;\n\n\t\t/**\n\t\t * The depth map generated using the internal camera; a location beyond a\n\t\t * pixel's depth is in shadow. Computed internally during rendering.\n\t\t *\n\t\t * @type {?RenderTarget}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The distribution map generated using the internal camera; an occlusion is\n\t\t * calculated based on the distribution of depths. Computed internally during\n\t\t * rendering.\n\t\t *\n\t\t * @type {?RenderTarget}\n\t\t * @default null\n\t\t */\n\t\tthis.mapPass = null;\n\n\t\t/**\n\t\t * Model to shadow camera space, to compute location and depth in shadow map.\n\t\t * This is computed internally during rendering.\n\t\t *\n\t\t * @type {Matrix4}\n\t\t */\n\t\tthis.matrix = new Matrix4();\n\n\t\t/**\n\t\t * Enables automatic updates of the light's shadow. If you do not require dynamic\n\t\t * lighting / shadows, you may set this to `false`.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.autoUpdate = true;\n\n\t\t/**\n\t\t * When set to `true`, shadow maps will be updated in the next `render` call.\n\t\t * If you have set {@link LightShadow#autoUpdate} to `false`, you will need to\n\t\t * set this property to `true` and then make a render call to update the light's shadow.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.needsUpdate = false;\n\n\t\tthis._frustum = new Frustum();\n\t\tthis._frameExtents = new Vector2( 1, 1 );\n\n\t\tthis._viewportCount = 1;\n\n\t\tthis._viewports = [\n\n\t\t\tnew Vector4( 0, 0, 1, 1 )\n\n\t\t];\n\n\t}\n\n\t/**\n\t * Used internally by the renderer to get the number of viewports that need\n\t * to be rendered for this shadow.\n\t *\n\t * @return {number} The viewport count.\n\t */\n\tgetViewportCount() {\n\n\t\treturn this._viewportCount;\n\n\t}\n\n\t/**\n\t * Gets the shadow cameras frustum. Used internally by the renderer to cull objects.\n\t *\n\t * @return {Frustum} The shadow camera frustum.\n\t */\n\tgetFrustum() {\n\n\t\treturn this._frustum;\n\n\t}\n\n\t/**\n\t * Update the matrices for the camera and shadow, used internally by the renderer.\n\t *\n\t * @param {Light} light - The light for which the shadow is being rendered.\n\t */\n\tupdateMatrices( light ) {\n\n\t\tconst shadowCamera = this.camera;\n\t\tconst shadowMatrix = this.matrix;\n\n\t\t_lightPositionWorld.setFromMatrixPosition( light.matrixWorld );\n\t\tshadowCamera.position.copy( _lightPositionWorld );\n\n\t\t_lookTarget.setFromMatrixPosition( light.target.matrixWorld );\n\t\tshadowCamera.lookAt( _lookTarget );\n\t\tshadowCamera.updateMatrixWorld();\n\n\t\t_projScreenMatrix.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse );\n\t\tthis._frustum.setFromProjectionMatrix( _projScreenMatrix, shadowCamera.coordinateSystem, shadowCamera.reversedDepth );\n\n\t\tif ( shadowCamera.reversedDepth ) {\n\n\t\t\tshadowMatrix.set(\n\t\t\t\t0.5, 0.0, 0.0, 0.5,\n\t\t\t\t0.0, 0.5, 0.0, 0.5,\n\t\t\t\t0.0, 0.0, 1.0, 0.0,\n\t\t\t\t0.0, 0.0, 0.0, 1.0\n\t\t\t);\n\n\t\t} else {\n\n\t\t\tshadowMatrix.set(\n\t\t\t\t0.5, 0.0, 0.0, 0.5,\n\t\t\t\t0.0, 0.5, 0.0, 0.5,\n\t\t\t\t0.0, 0.0, 0.5, 0.5,\n\t\t\t\t0.0, 0.0, 0.0, 1.0\n\t\t\t);\n\n\t\t}\n\n\t\tshadowMatrix.multiply( _projScreenMatrix );\n\n\t}\n\n\t/**\n\t * Returns a viewport definition for the given viewport index.\n\t *\n\t * @param {number} viewportIndex - The viewport index.\n\t * @return {Vector4} The viewport.\n\t */\n\tgetViewport( viewportIndex ) {\n\n\t\treturn this._viewports[ viewportIndex ];\n\n\t}\n\n\t/**\n\t * Returns the frame extends.\n\t *\n\t * @return {Vector2} The frame extends.\n\t */\n\tgetFrameExtents() {\n\n\t\treturn this._frameExtents;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tif ( this.map ) {\n\n\t\t\tthis.map.dispose();\n\n\t\t}\n\n\t\tif ( this.mapPass ) {\n\n\t\t\tthis.mapPass.dispose();\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Copies the values of the given light shadow instance to this instance.\n\t *\n\t * @param {LightShadow} source - The light shadow to copy.\n\t * @return {LightShadow} A reference to this light shadow instance.\n\t */\n\tcopy( source ) {\n\n\t\tthis.camera = source.camera.clone();\n\n\t\tthis.intensity = source.intensity;\n\n\t\tthis.bias = source.bias;\n\t\tthis.radius = source.radius;\n\n\t\tthis.autoUpdate = source.autoUpdate;\n\t\tthis.needsUpdate = source.needsUpdate;\n\t\tthis.normalBias = source.normalBias;\n\t\tthis.blurSamples = source.blurSamples;\n\n\t\tthis.mapSize.copy( source.mapSize );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new light shadow instance with copied values from this instance.\n\t *\n\t * @return {LightShadow} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Serializes the light shadow into JSON.\n\t *\n\t * @return {Object} A JSON object representing the serialized light shadow.\n\t * @see {@link ObjectLoader#parse}\n\t */\n\ttoJSON() {\n\n\t\tconst object = {};\n\n\t\tif ( this.intensity !== 1 ) object.intensity = this.intensity;\n\t\tif ( this.bias !== 0 ) object.bias = this.bias;\n\t\tif ( this.normalBias !== 0 ) object.normalBias = this.normalBias;\n\t\tif ( this.radius !== 1 ) object.radius = this.radius;\n\t\tif ( this.mapSize.x !== 512 || this.mapSize.y !== 512 ) object.mapSize = this.mapSize.toArray();\n\n\t\tobject.camera = this.camera.toJSON( false ).object;\n\t\tdelete object.camera.matrix;\n\n\t\treturn object;\n\n\t}\n\n}\n\n/**\n * Represents the shadow configuration of directional lights.\n *\n * @augments LightShadow\n */\nclass SpotLightShadow extends LightShadow {\n\n\t/**\n\t * Constructs a new spot light shadow.\n\t */\n\tconstructor() {\n\n\t\tsuper( new PerspectiveCamera( 50, 1, 0.5, 500 ) );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSpotLightShadow = true;\n\n\t\t/**\n\t\t * Used to focus the shadow camera. The camera's field of view is set as a\n\t\t * percentage of the spotlight's field-of-view. Range is `[0, 1]`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.focus = 1;\n\n\t\t/**\n\t\t * Texture aspect ratio.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.aspect = 1;\n\n\t}\n\n\tupdateMatrices( light ) {\n\n\t\tconst camera = this.camera;\n\n\t\tconst fov = RAD2DEG * 2 * light.angle * this.focus;\n\t\tconst aspect = ( this.mapSize.width / this.mapSize.height ) * this.aspect;\n\t\tconst far = light.distance || camera.far;\n\n\t\tif ( fov !== camera.fov || aspect !== camera.aspect || far !== camera.far ) {\n\n\t\t\tcamera.fov = fov;\n\t\t\tcamera.aspect = aspect;\n\t\t\tcamera.far = far;\n\t\t\tcamera.updateProjectionMatrix();\n\n\t\t}\n\n\t\tsuper.updateMatrices( light );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.focus = source.focus;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * This light gets emitted from a single point in one direction, along a cone\n * that increases in size the further from the light it gets.\n *\n * This light can cast shadows - see the {@link SpotLightShadow} for details.\n *\n * ```js\n * // white spotlight shining from the side, modulated by a texture\n * const spotLight = new THREE.SpotLight( 0xffffff );\n * spotLight.position.set( 100, 1000, 100 );\n * spotLight.map = new THREE.TextureLoader().load( url );\n *\n * spotLight.castShadow = true;\n * spotLight.shadow.mapSize.width = 1024;\n * spotLight.shadow.mapSize.height = 1024;\n * spotLight.shadow.camera.near = 500;\n * spotLight.shadow.camera.far = 4000;\n * spotLight.shadow.camera.fov = 30;s\n * ```\n *\n * @augments Light\n */\nclass SpotLight extends Light {\n\n\t/**\n\t * Constructs a new spot light.\n\t *\n\t * @param {(number|Color|string)} [color=0xffffff] - The light's color.\n\t * @param {number} [intensity=1] - The light's strength/intensity measured in candela (cd).\n\t * @param {number} [distance=0] - Maximum range of the light. `0` means no limit.\n\t * @param {number} [angle=Math.PI/3] - Maximum angle of light dispersion from its direction whose upper bound is `Math.PI/2`.\n\t * @param {number} [penumbra=0] - Percent of the spotlight cone that is attenuated due to penumbra. Value range is `[0,1]`.\n\t * @param {number} [decay=2] - The amount the light dims along the distance of the light.\n\t */\n\tconstructor( color, intensity, distance = 0, angle = Math.PI / 3, penumbra = 0, decay = 2 ) {\n\n\t\tsuper( color, intensity );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSpotLight = true;\n\n\t\tthis.type = 'SpotLight';\n\n\t\tthis.position.copy( Object3D.DEFAULT_UP );\n\t\tthis.updateMatrix();\n\n\t\t/**\n\t\t * The spot light points from its position to the\n\t\t * target's position.\n\t\t *\n\t\t * For the target's position to be changed to anything other\n\t\t * than the default, it must be added to the scene.\n\t\t *\n\t\t * It is also possible to set the target to be another 3D object\n\t\t * in the scene. The light will now track the target object.\n\t\t *\n\t\t * @type {Object3D}\n\t\t */\n\t\tthis.target = new Object3D();\n\n\t\t/**\n\t\t * Maximum range of the light. `0` means no limit.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.distance = distance;\n\n\t\t/**\n\t\t * Maximum angle of light dispersion from its direction whose upper bound is `Math.PI/2`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default Math.PI/3\n\t\t */\n\t\tthis.angle = angle;\n\n\t\t/**\n\t\t * Percent of the spotlight cone that is attenuated due to penumbra.\n\t\t * Value range is `[0,1]`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.penumbra = penumbra;\n\n\t\t/**\n\t\t * The amount the light dims along the distance of the light. In context of\n\t\t * physically-correct rendering the default value should not be changed.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 2\n\t\t */\n\t\tthis.decay = decay;\n\n\t\t/**\n\t\t * A texture used to modulate the color of the light. The spot light\n\t\t * color is mixed with the RGB value of this texture, with a ratio\n\t\t * corresponding to its alpha value. The cookie-like masking effect is\n\t\t * reproduced using pixel values (0, 0, 0, 1-cookie_value).\n\t\t *\n\t\t * *Warning*: This property is disabled if {@link Object3D#castShadow} is set to `false`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * This property holds the light's shadow configuration.\n\t\t *\n\t\t * @type {SpotLightShadow}\n\t\t */\n\t\tthis.shadow = new SpotLightShadow();\n\n\t}\n\n\t/**\n\t * The light's power. Power is the luminous power of the light measured in lumens (lm).\n\t *  Changing the power will also change the light's intensity.\n\t *\n\t * @type {number}\n\t */\n\tget power() {\n\n\t\t// compute the light's luminous power (in lumens) from its intensity (in candela)\n\t\t// by convention for a spotlight, luminous power (lm) = π * luminous intensity (cd)\n\t\treturn this.intensity * Math.PI;\n\n\t}\n\n\tset power( power ) {\n\n\t\t// set the light's intensity (in candela) from the desired luminous power (in lumens)\n\t\tthis.intensity = power / Math.PI;\n\n\t}\n\n\tdispose() {\n\n\t\tsuper.dispose();\n\n\t\tthis.shadow.dispose();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.distance = source.distance;\n\t\tthis.angle = source.angle;\n\t\tthis.penumbra = source.penumbra;\n\t\tthis.decay = source.decay;\n\n\t\tthis.target = source.target.clone();\n\t\tthis.map = source.map;\n\t\tthis.shadow = source.shadow.clone();\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.distance = this.distance;\n\t\tdata.object.angle = this.angle;\n\t\tdata.object.decay = this.decay;\n\t\tdata.object.penumbra = this.penumbra;\n\n\t\tdata.object.target = this.target.uuid;\n\n\t\tif ( this.map \u0026\u0026 this.map.isTexture ) data.object.map = this.map.toJSON( meta ).uuid;\n\n\t\tdata.object.shadow = this.shadow.toJSON();\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * Represents the shadow configuration of point lights.\n *\n * @augments LightShadow\n */\nclass PointLightShadow extends LightShadow {\n\n\t/**\n\t * Constructs a new point light shadow.\n\t */\n\tconstructor() {\n\n\t\tsuper( new PerspectiveCamera( 90, 1, 0.5, 500 ) );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isPointLightShadow = true;\n\n\t}\n\n}\n\n/**\n * A light that gets emitted from a single point in all directions. A common\n * use case for this is to replicate the light emitted from a bare\n * lightbulb.\n *\n * This light can cast shadows - see the {@link PointLightShadow} for details.\n *\n * ```js\n * const light = new THREE.PointLight( 0xff0000, 1, 100 );\n * light.position.set( 50, 50, 50 );\n * scene.add( light );\n * ```\n *\n * @augments Light\n */\nclass PointLight extends Light {\n\n\t/**\n\t * Constructs a new point light.\n\t *\n\t * @param {(number|Color|string)} [color=0xffffff] - The light's color.\n\t * @param {number} [intensity=1] - The light's strength/intensity measured in candela (cd).\n\t * @param {number} [distance=0] - Maximum range of the light. `0` means no limit.\n\t * @param {number} [decay=2] - The amount the light dims along the distance of the light.\n\t */\n\tconstructor( color, intensity, distance = 0, decay = 2 ) {\n\n\t\tsuper( color, intensity );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isPointLight = true;\n\n\t\tthis.type = 'PointLight';\n\n\t\t/**\n\t\t * When distance is zero, light will attenuate according to inverse-square\n\t\t * law to infinite distance. When distance is non-zero, light will attenuate\n\t\t * according to inverse-square law until near the distance cutoff, where it\n\t\t * will then attenuate quickly and smoothly to 0. Inherently, cutoffs are not\n\t\t * physically correct.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.distance = distance;\n\n\t\t/**\n\t\t * The amount the light dims along the distance of the light. In context of\n\t\t * physically-correct rendering the default value should not be changed.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 2\n\t\t */\n\t\tthis.decay = decay;\n\n\t\t/**\n\t\t * This property holds the light's shadow configuration.\n\t\t *\n\t\t * @type {PointLightShadow}\n\t\t */\n\t\tthis.shadow = new PointLightShadow();\n\n\t}\n\n\t/**\n\t * The light's power. Power is the luminous power of the light measured in lumens (lm).\n\t * Changing the power will also change the light's intensity.\n\t *\n\t * @type {number}\n\t */\n\tget power() {\n\n\t\t// compute the light's luminous power (in lumens) from its intensity (in candela)\n\t\t// for an isotropic light source, luminous power (lm) = 4 π luminous intensity (cd)\n\t\treturn this.intensity * 4 * Math.PI;\n\n\t}\n\n\tset power( power ) {\n\n\t\t// set the light's intensity (in candela) from the desired luminous power (in lumens)\n\t\tthis.intensity = power / ( 4 * Math.PI );\n\n\t}\n\n\tdispose() {\n\n\t\tsuper.dispose();\n\n\t\tthis.shadow.dispose();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.distance = source.distance;\n\t\tthis.decay = source.decay;\n\n\t\tthis.shadow = source.shadow.clone();\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.distance = this.distance;\n\t\tdata.object.decay = this.decay;\n\n\t\tdata.object.shadow = this.shadow.toJSON();\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * Camera that uses [orthographic projection](https://en.wikipedia.org/wiki/Orthographic_projection).\n *\n * In this projection mode, an object's size in the rendered image stays\n * constant regardless of its distance from the camera. This can be useful\n * for rendering 2D scenes and UI elements, amongst other things.\n *\n * ```js\n * const camera = new THREE.OrthographicCamera( width / - 2, width / 2, height / 2, height / - 2, 1, 1000 );\n * scene.add( camera );\n * ```\n *\n * @augments Camera\n */\nclass OrthographicCamera extends Camera {\n\n\t/**\n\t * Constructs a new orthographic camera.\n\t *\n\t * @param {number} [left=-1] - The left plane of the camera's frustum.\n\t * @param {number} [right=1] - The right plane of the camera's frustum.\n\t * @param {number} [top=1] - The top plane of the camera's frustum.\n\t * @param {number} [bottom=-1] - The bottom plane of the camera's frustum.\n\t * @param {number} [near=0.1] - The camera's near plane.\n\t * @param {number} [far=2000] - The camera's far plane.\n\t */\n\tconstructor( left = -1, right = 1, top = 1, bottom = -1, near = 0.1, far = 2000 ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isOrthographicCamera = true;\n\n\t\tthis.type = 'OrthographicCamera';\n\n\t\t/**\n\t\t * The zoom factor of the camera.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.zoom = 1;\n\n\t\t/**\n\t\t * Represents the frustum window specification. This property should not be edited\n\t\t * directly but via {@link PerspectiveCamera#setViewOffset} and {@link PerspectiveCamera#clearViewOffset}.\n\t\t *\n\t\t * @type {?Object}\n\t\t * @default null\n\t\t */\n\t\tthis.view = null;\n\n\t\t/**\n\t\t * The left plane of the camera's frustum.\n\t\t *\n\t\t * @type {number}\n\t\t * @default -1\n\t\t */\n\t\tthis.left = left;\n\n\t\t/**\n\t\t * The right plane of the camera's frustum.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.right = right;\n\n\t\t/**\n\t\t * The top plane of the camera's frustum.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.top = top;\n\n\t\t/**\n\t\t * The bottom plane of the camera's frustum.\n\t\t *\n\t\t * @type {number}\n\t\t * @default -1\n\t\t */\n\t\tthis.bottom = bottom;\n\n\t\t/**\n\t\t * The camera's near plane. The valid range is greater than `0`\n\t\t * and less than the current value of {@link OrthographicCamera#far}.\n\t\t *\n\t\t * Note that, unlike for the {@link PerspectiveCamera}, `0` is a\n\t\t * valid value for an orthographic camera's near plane.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0.1\n\t\t */\n\t\tthis.near = near;\n\n\t\t/**\n\t\t * The camera's far plane. Must be greater than the\n\t\t * current value of {@link OrthographicCamera#near}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 2000\n\t\t */\n\t\tthis.far = far;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.left = source.left;\n\t\tthis.right = source.right;\n\t\tthis.top = source.top;\n\t\tthis.bottom = source.bottom;\n\t\tthis.near = source.near;\n\t\tthis.far = source.far;\n\n\t\tthis.zoom = source.zoom;\n\t\tthis.view = source.view === null ? null : Object.assign( {}, source.view );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets an offset in a larger frustum. This is useful for multi-window or\n\t * multi-monitor/multi-machine setups.\n\t *\n\t * @param {number} fullWidth - The full width of multiview setup.\n\t * @param {number} fullHeight - The full height of multiview setup.\n\t * @param {number} x - The horizontal offset of the subcamera.\n\t * @param {number} y - The vertical offset of the subcamera.\n\t * @param {number} width - The width of subcamera.\n\t * @param {number} height - The height of subcamera.\n\t * @see {@link PerspectiveCamera#setViewOffset}\n\t */\n\tsetViewOffset( fullWidth, fullHeight, x, y, width, height ) {\n\n\t\tif ( this.view === null ) {\n\n\t\t\tthis.view = {\n\t\t\t\tenabled: true,\n\t\t\t\tfullWidth: 1,\n\t\t\t\tfullHeight: 1,\n\t\t\t\toffsetX: 0,\n\t\t\t\toffsetY: 0,\n\t\t\t\twidth: 1,\n\t\t\t\theight: 1\n\t\t\t};\n\n\t\t}\n\n\t\tthis.view.enabled = true;\n\t\tthis.view.fullWidth = fullWidth;\n\t\tthis.view.fullHeight = fullHeight;\n\t\tthis.view.offsetX = x;\n\t\tthis.view.offsetY = y;\n\t\tthis.view.width = width;\n\t\tthis.view.height = height;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\t/**\n\t * Removes the view offset from the projection matrix.\n\t */\n\tclearViewOffset() {\n\n\t\tif ( this.view !== null ) {\n\n\t\t\tthis.view.enabled = false;\n\n\t\t}\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\t/**\n\t * Updates the camera's projection matrix. Must be called after any change of\n\t * camera properties.\n\t */\n\tupdateProjectionMatrix() {\n\n\t\tconst dx = ( this.right - this.left ) / ( 2 * this.zoom );\n\t\tconst dy = ( this.top - this.bottom ) / ( 2 * this.zoom );\n\t\tconst cx = ( this.right + this.left ) / 2;\n\t\tconst cy = ( this.top + this.bottom ) / 2;\n\n\t\tlet left = cx - dx;\n\t\tlet right = cx + dx;\n\t\tlet top = cy + dy;\n\t\tlet bottom = cy - dy;\n\n\t\tif ( this.view !== null \u0026\u0026 this.view.enabled ) {\n\n\t\t\tconst scaleW = ( this.right - this.left ) / this.view.fullWidth / this.zoom;\n\t\t\tconst scaleH = ( this.top - this.bottom ) / this.view.fullHeight / this.zoom;\n\n\t\t\tleft += scaleW * this.view.offsetX;\n\t\t\tright = left + scaleW * this.view.width;\n\t\t\ttop -= scaleH * this.view.offsetY;\n\t\t\tbottom = top - scaleH * this.view.height;\n\n\t\t}\n\n\t\tthis.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem, this.reversedDepth );\n\n\t\tthis.projectionMatrixInverse.copy( this.projectionMatrix ).invert();\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.zoom = this.zoom;\n\t\tdata.object.left = this.left;\n\t\tdata.object.right = this.right;\n\t\tdata.object.top = this.top;\n\t\tdata.object.bottom = this.bottom;\n\t\tdata.object.near = this.near;\n\t\tdata.object.far = this.far;\n\n\t\tif ( this.view !== null ) data.object.view = Object.assign( {}, this.view );\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * Represents the shadow configuration of directional lights.\n *\n * @augments LightShadow\n */\nclass DirectionalLightShadow extends LightShadow {\n\n\t/**\n\t * Constructs a new directional light shadow.\n\t */\n\tconstructor() {\n\n\t\tsuper( new OrthographicCamera( -5, 5, 5, -5, 0.5, 500 ) );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isDirectionalLightShadow = true;\n\n\t}\n\n}\n\n/**\n * A light that gets emitted in a specific direction. This light will behave\n * as though it is infinitely far away and the rays produced from it are all\n * parallel. The common use case for this is to simulate daylight; the sun is\n * far enough away that its position can be considered to be infinite, and\n * all light rays coming from it are parallel.\n *\n * A common point of confusion for directional lights is that setting the\n * rotation has no effect. This is because three.js's DirectionalLight is the\n * equivalent to what is often called a 'Target Direct Light' in other\n * applications.\n *\n * This means that its direction is calculated as pointing from the light's\n * {@link Object3D#position} to the {@link DirectionalLight#target} position\n * (as opposed to a 'Free Direct Light' that just has a rotation\n * component).\n *\n * This light can cast shadows - see the {@link DirectionalLightShadow} for details.\n *\n * ```js\n * // White directional light at half intensity shining from the top.\n * const directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 );\n * scene.add( directionalLight );\n * ```\n *\n * @augments Light\n */\nclass DirectionalLight extends Light {\n\n\t/**\n\t * Constructs a new directional light.\n\t *\n\t * @param {(number|Color|string)} [color=0xffffff] - The light's color.\n\t * @param {number} [intensity=1] - The light's strength/intensity.\n\t */\n\tconstructor( color, intensity ) {\n\n\t\tsuper( color, intensity );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isDirectionalLight = true;\n\n\t\tthis.type = 'DirectionalLight';\n\n\t\tthis.position.copy( Object3D.DEFAULT_UP );\n\t\tthis.updateMatrix();\n\n\t\t/**\n\t\t * The directional light points from its position to the\n\t\t * target's position.\n\t\t *\n\t\t * For the target's position to be changed to anything other\n\t\t * than the default, it must be added to the scene.\n\t\t *\n\t\t * It is also possible to set the target to be another 3D object\n\t\t * in the scene. The light will now track the target object.\n\t\t *\n\t\t * @type {Object3D}\n\t\t */\n\t\tthis.target = new Object3D();\n\n\t\t/**\n\t\t * This property holds the light's shadow configuration.\n\t\t *\n\t\t * @type {DirectionalLightShadow}\n\t\t */\n\t\tthis.shadow = new DirectionalLightShadow();\n\n\t}\n\n\tdispose() {\n\n\t\tsuper.dispose();\n\n\t\tthis.shadow.dispose();\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.target = source.target.clone();\n\t\tthis.shadow = source.shadow.clone();\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.shadow = this.shadow.toJSON();\n\t\tdata.object.target = this.target.uuid;\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * This light globally illuminates all objects in the scene equally.\n *\n * It cannot be used to cast shadows as it does not have a direction.\n *\n * ```js\n * const light = new THREE.AmbientLight( 0x404040 ); // soft white light\n * scene.add( light );\n * ```\n *\n * @augments Light\n */\nclass AmbientLight extends Light {\n\n\t/**\n\t * Constructs a new ambient light.\n\t *\n\t * @param {(number|Color|string)} [color=0xffffff] - The light's color.\n\t * @param {number} [intensity=1] - The light's strength/intensity.\n\t */\n\tconstructor( color, intensity ) {\n\n\t\tsuper( color, intensity );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isAmbientLight = true;\n\n\t\tthis.type = 'AmbientLight';\n\n\t}\n\n}\n\n/**\n * This class emits light uniformly across the face a rectangular plane.\n * This light type can be used to simulate light sources such as bright\n * windows or strip lighting.\n *\n * Important Notes:\n *\n * - There is no shadow support.\n * - Only PBR materials are supported.\n * - You have to include `RectAreaLightUniformsLib` (`WebGLRenderer`) or `RectAreaLightTexturesLib` (`WebGPURenderer`)\n * into your app and init the uniforms/textures.\n *\n * ```js\n * RectAreaLightUniformsLib.init(); // only relevant for WebGLRenderer\n * THREE.RectAreaLightNode.setLTC( RectAreaLightTexturesLib.init() ); //  only relevant for WebGPURenderer\n *\n * const intensity = 1; const width = 10; const height = 10;\n * const rectLight = new THREE.RectAreaLight( 0xffffff, intensity, width, height );\n * rectLight.position.set( 5, 5, 0 );\n * rectLight.lookAt( 0, 0, 0 );\n * scene.add( rectLight )\n * ```\n *\n * @augments Light\n */\nclass RectAreaLight extends Light {\n\n\t/**\n\t * Constructs a new area light.\n\t *\n\t * @param {(number|Color|string)} [color=0xffffff] - The light's color.\n\t * @param {number} [intensity=1] - The light's strength/intensity.\n\t * @param {number} [width=10] - The width of the light.\n\t * @param {number} [height=10] - The height of the light.\n\t */\n\tconstructor( color, intensity, width = 10, height = 10 ) {\n\n\t\tsuper( color, intensity );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isRectAreaLight = true;\n\n\t\tthis.type = 'RectAreaLight';\n\n\t\t/**\n\t\t * The width of the light.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 10\n\t\t */\n\t\tthis.width = width;\n\n\t\t/**\n\t\t * The height of the light.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 10\n\t\t */\n\t\tthis.height = height;\n\n\t}\n\n\t/**\n\t * The light's power. Power is the luminous power of the light measured in lumens (lm).\n\t * Changing the power will also change the light's intensity.\n\t *\n\t * @type {number}\n\t */\n\tget power() {\n\n\t\t// compute the light's luminous power (in lumens) from its intensity (in nits)\n\t\treturn this.intensity * this.width * this.height * Math.PI;\n\n\t}\n\n\tset power( power ) {\n\n\t\t// set the light's intensity (in nits) from the desired luminous power (in lumens)\n\t\tthis.intensity = power / ( this.width * this.height * Math.PI );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.width = source.width;\n\t\tthis.height = source.height;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.width = this.width;\n\t\tdata.object.height = this.height;\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * Represents a third-order spherical harmonics (SH). Light probes use this class\n * to encode lighting information.\n *\n * - Primary reference: {@link https://graphics.stanford.edu/papers/envmap/envmap.pdf}\n * - Secondary reference: {@link https://www.ppsloan.org/publications/StupidSH36.pdf}\n */\nclass SphericalHarmonics3 {\n\n\t/**\n\t * Constructs a new spherical harmonics.\n\t */\n\tconstructor() {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSphericalHarmonics3 = true;\n\n\t\t/**\n\t\t * An array holding the (9) SH coefficients.\n\t\t *\n\t\t * @type {Array\u003cVector3\u003e}\n\t\t */\n\t\tthis.coefficients = [];\n\n\t\tfor ( let i = 0; i \u003c 9; i ++ ) {\n\n\t\t\tthis.coefficients.push( new Vector3() );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Sets the given SH coefficients to this instance by copying\n\t * the values.\n\t *\n\t * @param {Array\u003cVector3\u003e} coefficients - The SH coefficients.\n\t * @return {SphericalHarmonics3} A reference to this spherical harmonics.\n\t */\n\tset( coefficients ) {\n\n\t\tfor ( let i = 0; i \u003c 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].copy( coefficients[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets all SH coefficients to `0`.\n\t *\n\t * @return {SphericalHarmonics3} A reference to this spherical harmonics.\n\t */\n\tzero() {\n\n\t\tfor ( let i = 0; i \u003c 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].set( 0, 0, 0 );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the radiance in the direction of the given normal.\n\t *\n\t * @param {Vector3} normal - The normal vector (assumed to be unit length)\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The radiance.\n\t */\n\tgetAt( normal, target ) {\n\n\t\t// normal is assumed to be unit length\n\n\t\tconst x = normal.x, y = normal.y, z = normal.z;\n\n\t\tconst coeff = this.coefficients;\n\n\t\t// band 0\n\t\ttarget.copy( coeff[ 0 ] ).multiplyScalar( 0.282095 );\n\n\t\t// band 1\n\t\ttarget.addScaledVector( coeff[ 1 ], 0.488603 * y );\n\t\ttarget.addScaledVector( coeff[ 2 ], 0.488603 * z );\n\t\ttarget.addScaledVector( coeff[ 3 ], 0.488603 * x );\n\n\t\t// band 2\n\t\ttarget.addScaledVector( coeff[ 4 ], 1.092548 * ( x * y ) );\n\t\ttarget.addScaledVector( coeff[ 5 ], 1.092548 * ( y * z ) );\n\t\ttarget.addScaledVector( coeff[ 6 ], 0.315392 * ( 3.0 * z * z - 1.0 ) );\n\t\ttarget.addScaledVector( coeff[ 7 ], 1.092548 * ( x * z ) );\n\t\ttarget.addScaledVector( coeff[ 8 ], 0.546274 * ( x * x - y * y ) );\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Returns the irradiance (radiance convolved with cosine lobe) in the\n\t * direction of the given normal.\n\t *\n\t * @param {Vector3} normal - The normal vector (assumed to be unit length)\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The irradiance.\n\t */\n\tgetIrradianceAt( normal, target ) {\n\n\t\t// normal is assumed to be unit length\n\n\t\tconst x = normal.x, y = normal.y, z = normal.z;\n\n\t\tconst coeff = this.coefficients;\n\n\t\t// band 0\n\t\ttarget.copy( coeff[ 0 ] ).multiplyScalar( 0.886227 ); // π * 0.282095\n\n\t\t// band 1\n\t\ttarget.addScaledVector( coeff[ 1 ], 2.0 * 0.511664 * y ); // ( 2 * π / 3 ) * 0.488603\n\t\ttarget.addScaledVector( coeff[ 2 ], 2.0 * 0.511664 * z );\n\t\ttarget.addScaledVector( coeff[ 3 ], 2.0 * 0.511664 * x );\n\n\t\t// band 2\n\t\ttarget.addScaledVector( coeff[ 4 ], 2.0 * 0.429043 * x * y ); // ( π / 4 ) * 1.092548\n\t\ttarget.addScaledVector( coeff[ 5 ], 2.0 * 0.429043 * y * z );\n\t\ttarget.addScaledVector( coeff[ 6 ], 0.743125 * z * z - 0.247708 ); // ( π / 4 ) * 0.315392 * 3\n\t\ttarget.addScaledVector( coeff[ 7 ], 2.0 * 0.429043 * x * z );\n\t\ttarget.addScaledVector( coeff[ 8 ], 0.429043 * ( x * x - y * y ) ); // ( π / 4 ) * 0.546274\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Adds the given SH to this instance.\n\t *\n\t * @param {SphericalHarmonics3} sh - The SH to add.\n\t * @return {SphericalHarmonics3} A reference to this spherical harmonics.\n\t */\n\tadd( sh ) {\n\n\t\tfor ( let i = 0; i \u003c 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].add( sh.coefficients[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * A convenience method for performing {@link SphericalHarmonics3#add} and\n\t * {@link SphericalHarmonics3#scale} at once.\n\t *\n\t * @param {SphericalHarmonics3} sh - The SH to add.\n\t * @param {number} s - The scale factor.\n\t * @return {SphericalHarmonics3} A reference to this spherical harmonics.\n\t */\n\taddScaledSH( sh, s ) {\n\n\t\tfor ( let i = 0; i \u003c 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].addScaledVector( sh.coefficients[ i ], s );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Scales this SH by the given scale factor.\n\t *\n\t * @param {number} s - The scale factor.\n\t * @return {SphericalHarmonics3} A reference to this spherical harmonics.\n\t */\n\tscale( s ) {\n\n\t\tfor ( let i = 0; i \u003c 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].multiplyScalar( s );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Linear interpolates between the given SH and this instance by the given\n\t * alpha factor.\n\t *\n\t * @param {SphericalHarmonics3} sh - The SH to interpolate with.\n\t * @param {number} alpha - The alpha factor.\n\t * @return {SphericalHarmonics3} A reference to this spherical harmonics.\n\t */\n\tlerp( sh, alpha ) {\n\n\t\tfor ( let i = 0; i \u003c 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].lerp( sh.coefficients[ i ], alpha );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this spherical harmonics is equal with the given one.\n\t *\n\t * @param {SphericalHarmonics3} sh - The spherical harmonics to test for equality.\n\t * @return {boolean} Whether this spherical harmonics is equal with the given one.\n\t */\n\tequals( sh ) {\n\n\t\tfor ( let i = 0; i \u003c 9; i ++ ) {\n\n\t\t\tif ( ! this.coefficients[ i ].equals( sh.coefficients[ i ] ) ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\t/**\n\t * Copies the values of the given spherical harmonics to this instance.\n\t *\n\t * @param {SphericalHarmonics3} sh - The spherical harmonics to copy.\n\t * @return {SphericalHarmonics3} A reference to this spherical harmonics.\n\t */\n\tcopy( sh ) {\n\n\t\treturn this.set( sh.coefficients );\n\n\t}\n\n\t/**\n\t * Returns a new spherical harmonics with copied values from this instance.\n\t *\n\t * @return {SphericalHarmonics3} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Sets the SH coefficients of this instance from the given array.\n\t *\n\t * @param {Array\u003cnumber\u003e} array - An array holding the SH coefficients.\n\t * @param {number} [offset=0] - The array offset where to start copying.\n\t * @return {SphericalHarmonics3} A clone of this instance.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tconst coefficients = this.coefficients;\n\n\t\tfor ( let i = 0; i \u003c 9; i ++ ) {\n\n\t\t\tcoefficients[ i ].fromArray( array, offset + ( i * 3 ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns an array with the SH coefficients, or copies them into the provided\n\t * array. The coefficients are represented as numbers.\n\t *\n\t * @param {Array\u003cnumber\u003e} [array=[]] - The target array.\n\t * @param {number} [offset=0] - The array offset where to start copying.\n\t * @return {Array\u003cnumber\u003e} An array with flat SH coefficients.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tconst coefficients = this.coefficients;\n\n\t\tfor ( let i = 0; i \u003c 9; i ++ ) {\n\n\t\t\tcoefficients[ i ].toArray( array, offset + ( i * 3 ) );\n\n\t\t}\n\n\t\treturn array;\n\n\t}\n\n\t/**\n\t * Computes the SH basis for the given normal vector.\n\t *\n\t * @param {Vector3} normal - The normal.\n\t * @param {Array\u003cnumber\u003e} shBasis - The target array holding the SH basis.\n\t */\n\tstatic getBasisAt( normal, shBasis ) {\n\n\t\t// normal is assumed to be unit length\n\n\t\tconst x = normal.x, y = normal.y, z = normal.z;\n\n\t\t// band 0\n\t\tshBasis[ 0 ] = 0.282095;\n\n\t\t// band 1\n\t\tshBasis[ 1 ] = 0.488603 * y;\n\t\tshBasis[ 2 ] = 0.488603 * z;\n\t\tshBasis[ 3 ] = 0.488603 * x;\n\n\t\t// band 2\n\t\tshBasis[ 4 ] = 1.092548 * x * y;\n\t\tshBasis[ 5 ] = 1.092548 * y * z;\n\t\tshBasis[ 6 ] = 0.315392 * ( 3 * z * z - 1 );\n\t\tshBasis[ 7 ] = 1.092548 * x * z;\n\t\tshBasis[ 8 ] = 0.546274 * ( x * x - y * y );\n\n\t}\n\n}\n\n/**\n * Light probes are an alternative way of adding light to a 3D scene. Unlike\n * classical light sources (e.g. directional, point or spot lights), light\n * probes do not emit light. Instead they store information about light\n * passing through 3D space. During rendering, the light that hits a 3D\n * object is approximated by using the data from the light probe.\n *\n * Light probes are usually created from (radiance) environment maps. The\n * class {@link LightProbeGenerator} can be used to create light probes from\n * cube textures or render targets. However, light estimation data could also\n * be provided in other forms e.g. by WebXR. This enables the rendering of\n * augmented reality content that reacts to real world lighting.\n *\n * The current probe implementation in three.js supports so-called diffuse\n * light probes. This type of light probe is functionally equivalent to an\n * irradiance environment map.\n *\n * @augments Light\n */\nclass LightProbe extends Light {\n\n\t/**\n\t * Constructs a new light probe.\n\t *\n\t * @param {SphericalHarmonics3} sh - The spherical harmonics which represents encoded lighting information.\n\t * @param {number} [intensity=1] - The light's strength/intensity.\n\t */\n\tconstructor( sh = new SphericalHarmonics3(), intensity = 1 ) {\n\n\t\tsuper( undefined, intensity );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLightProbe = true;\n\n\t\t/**\n\t\t * A light probe uses spherical harmonics to encode lighting information.\n\t\t *\n\t\t * @type {SphericalHarmonics3}\n\t\t */\n\t\tthis.sh = sh;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.sh.copy( source.sh );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.sh = this.sh.toArray();\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * Class for loading materials. The files are internally\n * loaded via {@link FileLoader}.\n *\n * ```js\n * const loader = new THREE.MaterialLoader();\n * const material = await loader.loadAsync( 'material.json' );\n * ```\n * This loader does not support node materials. Use {@link NodeMaterialLoader} instead.\n *\n * @augments Loader\n */\nclass MaterialLoader extends Loader {\n\n\t/**\n\t * Constructs a new material loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t\t/**\n\t\t * A dictionary holding textures used by the material.\n\t\t *\n\t\t * @type {Object\u003cstring,Texture\u003e}\n\t\t */\n\t\tthis.textures = {};\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and pass the loaded material to the `onLoad()` callback.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(Material)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Executed while the loading is in progress.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( scope.manager );\n\t\tloader.setPath( scope.path );\n\t\tloader.setRequestHeader( scope.requestHeader );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\terror( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\t/**\n\t * Parses the given JSON object and returns a material.\n\t *\n\t * @param {Object} json - The serialized material.\n\t * @return {Material} The parsed material.\n\t */\n\tparse( json ) {\n\n\t\tconst textures = this.textures;\n\n\t\tfunction getTexture( name ) {\n\n\t\t\tif ( textures[ name ] === undefined ) {\n\n\t\t\t\twarn( 'MaterialLoader: Undefined texture', name );\n\n\t\t\t}\n\n\t\t\treturn textures[ name ];\n\n\t\t}\n\n\t\tconst material = this.createMaterialFromType( json.type );\n\n\t\tif ( json.uuid !== undefined ) material.uuid = json.uuid;\n\t\tif ( json.name !== undefined ) material.name = json.name;\n\t\tif ( json.color !== undefined \u0026\u0026 material.color !== undefined ) material.color.setHex( json.color );\n\t\tif ( json.roughness !== undefined ) material.roughness = json.roughness;\n\t\tif ( json.metalness !== undefined ) material.metalness = json.metalness;\n\t\tif ( json.sheen !== undefined ) material.sheen = json.sheen;\n\t\tif ( json.sheenColor !== undefined ) material.sheenColor = new Color().setHex( json.sheenColor );\n\t\tif ( json.sheenRoughness !== undefined ) material.sheenRoughness = json.sheenRoughness;\n\t\tif ( json.emissive !== undefined \u0026\u0026 material.emissive !== undefined ) material.emissive.setHex( json.emissive );\n\t\tif ( json.specular !== undefined \u0026\u0026 material.specular !== undefined ) material.specular.setHex( json.specular );\n\t\tif ( json.specularIntensity !== undefined ) material.specularIntensity = json.specularIntensity;\n\t\tif ( json.specularColor !== undefined \u0026\u0026 material.specularColor !== undefined ) material.specularColor.setHex( json.specularColor );\n\t\tif ( json.shininess !== undefined ) material.shininess = json.shininess;\n\t\tif ( json.clearcoat !== undefined ) material.clearcoat = json.clearcoat;\n\t\tif ( json.clearcoatRoughness !== undefined ) material.clearcoatRoughness = json.clearcoatRoughness;\n\t\tif ( json.dispersion !== undefined ) material.dispersion = json.dispersion;\n\t\tif ( json.iridescence !== undefined ) material.iridescence = json.iridescence;\n\t\tif ( json.iridescenceIOR !== undefined ) material.iridescenceIOR = json.iridescenceIOR;\n\t\tif ( json.iridescenceThicknessRange !== undefined ) material.iridescenceThicknessRange = json.iridescenceThicknessRange;\n\t\tif ( json.transmission !== undefined ) material.transmission = json.transmission;\n\t\tif ( json.thickness !== undefined ) material.thickness = json.thickness;\n\t\tif ( json.attenuationDistance !== undefined ) material.attenuationDistance = json.attenuationDistance;\n\t\tif ( json.attenuationColor !== undefined \u0026\u0026 material.attenuationColor !== undefined ) material.attenuationColor.setHex( json.attenuationColor );\n\t\tif ( json.anisotropy !== undefined ) material.anisotropy = json.anisotropy;\n\t\tif ( json.anisotropyRotation !== undefined ) material.anisotropyRotation = json.anisotropyRotation;\n\t\tif ( json.fog !== undefined ) material.fog = json.fog;\n\t\tif ( json.flatShading !== undefined ) material.flatShading = json.flatShading;\n\t\tif ( json.blending !== undefined ) material.blending = json.blending;\n\t\tif ( json.combine !== undefined ) material.combine = json.combine;\n\t\tif ( json.side !== undefined ) material.side = json.side;\n\t\tif ( json.shadowSide !== undefined ) material.shadowSide = json.shadowSide;\n\t\tif ( json.opacity !== undefined ) material.opacity = json.opacity;\n\t\tif ( json.transparent !== undefined ) material.transparent = json.transparent;\n\t\tif ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest;\n\t\tif ( json.alphaHash !== undefined ) material.alphaHash = json.alphaHash;\n\t\tif ( json.depthFunc !== undefined ) material.depthFunc = json.depthFunc;\n\t\tif ( json.depthTest !== undefined ) material.depthTest = json.depthTest;\n\t\tif ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite;\n\t\tif ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite;\n\t\tif ( json.blendSrc !== undefined ) material.blendSrc = json.blendSrc;\n\t\tif ( json.blendDst !== undefined ) material.blendDst = json.blendDst;\n\t\tif ( json.blendEquation !== undefined ) material.blendEquation = json.blendEquation;\n\t\tif ( json.blendSrcAlpha !== undefined ) material.blendSrcAlpha = json.blendSrcAlpha;\n\t\tif ( json.blendDstAlpha !== undefined ) material.blendDstAlpha = json.blendDstAlpha;\n\t\tif ( json.blendEquationAlpha !== undefined ) material.blendEquationAlpha = json.blendEquationAlpha;\n\t\tif ( json.blendColor !== undefined \u0026\u0026 material.blendColor !== undefined ) material.blendColor.setHex( json.blendColor );\n\t\tif ( json.blendAlpha !== undefined ) material.blendAlpha = json.blendAlpha;\n\t\tif ( json.stencilWriteMask !== undefined ) material.stencilWriteMask = json.stencilWriteMask;\n\t\tif ( json.stencilFunc !== undefined ) material.stencilFunc = json.stencilFunc;\n\t\tif ( json.stencilRef !== undefined ) material.stencilRef = json.stencilRef;\n\t\tif ( json.stencilFuncMask !== undefined ) material.stencilFuncMask = json.stencilFuncMask;\n\t\tif ( json.stencilFail !== undefined ) material.stencilFail = json.stencilFail;\n\t\tif ( json.stencilZFail !== undefined ) material.stencilZFail = json.stencilZFail;\n\t\tif ( json.stencilZPass !== undefined ) material.stencilZPass = json.stencilZPass;\n\t\tif ( json.stencilWrite !== undefined ) material.stencilWrite = json.stencilWrite;\n\n\t\tif ( json.wireframe !== undefined ) material.wireframe = json.wireframe;\n\t\tif ( json.wireframeLinewidth !== undefined ) material.wireframeLinewidth = json.wireframeLinewidth;\n\t\tif ( json.wireframeLinecap !== undefined ) material.wireframeLinecap = json.wireframeLinecap;\n\t\tif ( json.wireframeLinejoin !== undefined ) material.wireframeLinejoin = json.wireframeLinejoin;\n\n\t\tif ( json.rotation !== undefined ) material.rotation = json.rotation;\n\n\t\tif ( json.linewidth !== undefined ) material.linewidth = json.linewidth;\n\t\tif ( json.dashSize !== undefined ) material.dashSize = json.dashSize;\n\t\tif ( json.gapSize !== undefined ) material.gapSize = json.gapSize;\n\t\tif ( json.scale !== undefined ) material.scale = json.scale;\n\n\t\tif ( json.polygonOffset !== undefined ) material.polygonOffset = json.polygonOffset;\n\t\tif ( json.polygonOffsetFactor !== undefined ) material.polygonOffsetFactor = json.polygonOffsetFactor;\n\t\tif ( json.polygonOffsetUnits !== undefined ) material.polygonOffsetUnits = json.polygonOffsetUnits;\n\n\t\tif ( json.dithering !== undefined ) material.dithering = json.dithering;\n\n\t\tif ( json.alphaToCoverage !== undefined ) material.alphaToCoverage = json.alphaToCoverage;\n\t\tif ( json.premultipliedAlpha !== undefined ) material.premultipliedAlpha = json.premultipliedAlpha;\n\t\tif ( json.forceSinglePass !== undefined ) material.forceSinglePass = json.forceSinglePass;\n\t\tif ( json.allowOverride !== undefined ) material.allowOverride = json.allowOverride;\n\n\t\tif ( json.visible !== undefined ) material.visible = json.visible;\n\n\t\tif ( json.toneMapped !== undefined ) material.toneMapped = json.toneMapped;\n\n\t\tif ( json.userData !== undefined ) material.userData = json.userData;\n\n\t\tif ( json.vertexColors !== undefined ) {\n\n\t\t\tif ( typeof json.vertexColors === 'number' ) {\n\n\t\t\t\tmaterial.vertexColors = ( json.vertexColors \u003e 0 ) ? true : false;\n\n\t\t\t} else {\n\n\t\t\t\tmaterial.vertexColors = json.vertexColors;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Shader Material\n\n\t\tif ( json.uniforms !== undefined ) {\n\n\t\t\tfor ( const name in json.uniforms ) {\n\n\t\t\t\tconst uniform = json.uniforms[ name ];\n\n\t\t\t\tmaterial.uniforms[ name ] = {};\n\n\t\t\t\tswitch ( uniform.type ) {\n\n\t\t\t\t\tcase 't':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = getTexture( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'c':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Color().setHex( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'v2':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Vector2().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'v3':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Vector3().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'v4':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Vector4().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'm3':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Matrix3().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'm4':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Matrix4().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = uniform.value;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json.defines !== undefined ) material.defines = json.defines;\n\t\tif ( json.vertexShader !== undefined ) material.vertexShader = json.vertexShader;\n\t\tif ( json.fragmentShader !== undefined ) material.fragmentShader = json.fragmentShader;\n\t\tif ( json.glslVersion !== undefined ) material.glslVersion = json.glslVersion;\n\n\t\tif ( json.extensions !== undefined ) {\n\n\t\t\tfor ( const key in json.extensions ) {\n\n\t\t\t\tmaterial.extensions[ key ] = json.extensions[ key ];\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json.lights !== undefined ) material.lights = json.lights;\n\t\tif ( json.clipping !== undefined ) material.clipping = json.clipping;\n\n\t\t// for PointsMaterial\n\n\t\tif ( json.size !== undefined ) material.size = json.size;\n\t\tif ( json.sizeAttenuation !== undefined ) material.sizeAttenuation = json.sizeAttenuation;\n\n\t\t// maps\n\n\t\tif ( json.map !== undefined ) material.map = getTexture( json.map );\n\t\tif ( json.matcap !== undefined ) material.matcap = getTexture( json.matcap );\n\n\t\tif ( json.alphaMap !== undefined ) material.alphaMap = getTexture( json.alphaMap );\n\n\t\tif ( json.bumpMap !== undefined ) material.bumpMap = getTexture( json.bumpMap );\n\t\tif ( json.bumpScale !== undefined ) material.bumpScale = json.bumpScale;\n\n\t\tif ( json.normalMap !== undefined ) material.normalMap = getTexture( json.normalMap );\n\t\tif ( json.normalMapType !== undefined ) material.normalMapType = json.normalMapType;\n\t\tif ( json.normalScale !== undefined ) {\n\n\t\t\tlet normalScale = json.normalScale;\n\n\t\t\tif ( Array.isArray( normalScale ) === false ) {\n\n\t\t\t\t// Blender exporter used to export a scalar. See #7459\n\n\t\t\t\tnormalScale = [ normalScale, normalScale ];\n\n\t\t\t}\n\n\t\t\tmaterial.normalScale = new Vector2().fromArray( normalScale );\n\n\t\t}\n\n\t\tif ( json.displacementMap !== undefined ) material.displacementMap = getTexture( json.displacementMap );\n\t\tif ( json.displacementScale !== undefined ) material.displacementScale = json.displacementScale;\n\t\tif ( json.displacementBias !== undefined ) material.displacementBias = json.displacementBias;\n\n\t\tif ( json.roughnessMap !== undefined ) material.roughnessMap = getTexture( json.roughnessMap );\n\t\tif ( json.metalnessMap !== undefined ) material.metalnessMap = getTexture( json.metalnessMap );\n\n\t\tif ( json.emissiveMap !== undefined ) material.emissiveMap = getTexture( json.emissiveMap );\n\t\tif ( json.emissiveIntensity !== undefined ) material.emissiveIntensity = json.emissiveIntensity;\n\n\t\tif ( json.specularMap !== undefined ) material.specularMap = getTexture( json.specularMap );\n\t\tif ( json.specularIntensityMap !== undefined ) material.specularIntensityMap = getTexture( json.specularIntensityMap );\n\t\tif ( json.specularColorMap !== undefined ) material.specularColorMap = getTexture( json.specularColorMap );\n\n\t\tif ( json.envMap !== undefined ) material.envMap = getTexture( json.envMap );\n\t\tif ( json.envMapRotation !== undefined ) material.envMapRotation.fromArray( json.envMapRotation );\n\t\tif ( json.envMapIntensity !== undefined ) material.envMapIntensity = json.envMapIntensity;\n\n\t\tif ( json.reflectivity !== undefined ) material.reflectivity = json.reflectivity;\n\t\tif ( json.refractionRatio !== undefined ) material.refractionRatio = json.refractionRatio;\n\n\t\tif ( json.lightMap !== undefined ) material.lightMap = getTexture( json.lightMap );\n\t\tif ( json.lightMapIntensity !== undefined ) material.lightMapIntensity = json.lightMapIntensity;\n\n\t\tif ( json.aoMap !== undefined ) material.aoMap = getTexture( json.aoMap );\n\t\tif ( json.aoMapIntensity !== undefined ) material.aoMapIntensity = json.aoMapIntensity;\n\n\t\tif ( json.gradientMap !== undefined ) material.gradientMap = getTexture( json.gradientMap );\n\n\t\tif ( json.clearcoatMap !== undefined ) material.clearcoatMap = getTexture( json.clearcoatMap );\n\t\tif ( json.clearcoatRoughnessMap !== undefined ) material.clearcoatRoughnessMap = getTexture( json.clearcoatRoughnessMap );\n\t\tif ( json.clearcoatNormalMap !== undefined ) material.clearcoatNormalMap = getTexture( json.clearcoatNormalMap );\n\t\tif ( json.clearcoatNormalScale !== undefined ) material.clearcoatNormalScale = new Vector2().fromArray( json.clearcoatNormalScale );\n\n\t\tif ( json.iridescenceMap !== undefined ) material.iridescenceMap = getTexture( json.iridescenceMap );\n\t\tif ( json.iridescenceThicknessMap !== undefined ) material.iridescenceThicknessMap = getTexture( json.iridescenceThicknessMap );\n\n\t\tif ( json.transmissionMap !== undefined ) material.transmissionMap = getTexture( json.transmissionMap );\n\t\tif ( json.thicknessMap !== undefined ) material.thicknessMap = getTexture( json.thicknessMap );\n\n\t\tif ( json.anisotropyMap !== undefined ) material.anisotropyMap = getTexture( json.anisotropyMap );\n\n\t\tif ( json.sheenColorMap !== undefined ) material.sheenColorMap = getTexture( json.sheenColorMap );\n\t\tif ( json.sheenRoughnessMap !== undefined ) material.sheenRoughnessMap = getTexture( json.sheenRoughnessMap );\n\n\t\treturn material;\n\n\t}\n\n\t/**\n\t * Textures are not embedded in the material JSON so they have\n\t * to be injected before the loading process starts.\n\t *\n\t * @param {Object} value - A dictionary holding textures for material properties.\n\t * @return {MaterialLoader} A reference to this material loader.\n\t */\n\tsetTextures( value ) {\n\n\t\tthis.textures = value;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Creates a material for the given type.\n\t *\n\t * @param {string} type - The material type.\n\t * @return {Material} The new material.\n\t */\n\tcreateMaterialFromType( type ) {\n\n\t\treturn MaterialLoader.createMaterialFromType( type );\n\n\t}\n\n\t/**\n\t * Creates a material for the given type.\n\t *\n\t * @static\n\t * @param {string} type - The material type.\n\t * @return {Material} The new material.\n\t */\n\tstatic createMaterialFromType( type ) {\n\n\t\tconst materialLib = {\n\t\t\tShadowMaterial,\n\t\t\tSpriteMaterial,\n\t\t\tRawShaderMaterial,\n\t\t\tShaderMaterial,\n\t\t\tPointsMaterial,\n\t\t\tMeshPhysicalMaterial,\n\t\t\tMeshStandardMaterial,\n\t\t\tMeshPhongMaterial,\n\t\t\tMeshToonMaterial,\n\t\t\tMeshNormalMaterial,\n\t\t\tMeshLambertMaterial,\n\t\t\tMeshDepthMaterial,\n\t\t\tMeshDistanceMaterial,\n\t\t\tMeshBasicMaterial,\n\t\t\tMeshMatcapMaterial,\n\t\t\tLineDashedMaterial,\n\t\t\tLineBasicMaterial,\n\t\t\tMaterial\n\t\t};\n\n\t\treturn new materialLib[ type ]();\n\n\t}\n\n}\n\n/**\n * A class with loader utility functions.\n */\nclass LoaderUtils {\n\n\t/**\n\t * Extracts the base URL from the given URL.\n\t *\n\t * @param {string} url -The URL to extract the base URL from.\n\t * @return {string} The extracted base URL.\n\t */\n\tstatic extractUrlBase( url ) {\n\n\t\tconst index = url.lastIndexOf( '/' );\n\n\t\tif ( index === -1 ) return './';\n\n\t\treturn url.slice( 0, index + 1 );\n\n\t}\n\n\t/**\n\t * Resolves relative URLs against the given path. Absolute paths, data urls,\n\t * and blob URLs will be returned as is. Invalid URLs will return an empty\n\t * string.\n\t *\n\t * @param {string} url -The URL to resolve.\n\t * @param {string} path - The base path for relative URLs to be resolved against.\n\t * @return {string} The resolved URL.\n\t */\n\tstatic resolveURL( url, path ) {\n\n\t\t// Invalid URL\n\t\tif ( typeof url !== 'string' || url === '' ) return '';\n\n\t\t// Host Relative URL\n\t\tif ( /^https?:\\/\\//i.test( path ) \u0026\u0026 /^\\//.test( url ) ) {\n\n\t\t\tpath = path.replace( /(^https?:\\/\\/[^\\/]+).*/i, '$1' );\n\n\t\t}\n\n\t\t// Absolute URL http://,https://,//\n\t\tif ( /^(https?:)?\\/\\//i.test( url ) ) return url;\n\n\t\t// Data URI\n\t\tif ( /^data:.*,.*$/i.test( url ) ) return url;\n\n\t\t// Blob URL\n\t\tif ( /^blob:.*$/i.test( url ) ) return url;\n\n\t\t// Relative URL\n\t\treturn path + url;\n\n\t}\n\n}\n\n/**\n * An instanced version of a geometry.\n */\nclass InstancedBufferGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new instanced buffer geometry.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isInstancedBufferGeometry = true;\n\n\t\tthis.type = 'InstancedBufferGeometry';\n\n\t\t/**\n\t\t * The instance count.\n\t\t *\n\t\t * @type {number}\n\t\t * @default Infinity\n\t\t */\n\t\tthis.instanceCount = Infinity;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.instanceCount = source.instanceCount;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.instanceCount = this.instanceCount;\n\n\t\tdata.isInstancedBufferGeometry = true;\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * Class for loading geometries. The files are internally\n * loaded via {@link FileLoader}.\n *\n * ```js\n * const loader = new THREE.BufferGeometryLoader();\n * const geometry = await loader.loadAsync( 'models/json/pressure.json' );\n *\n * const material = new THREE.MeshBasicMaterial( { color: 0xF5F5F5 } );\n * const object = new THREE.Mesh( geometry, material );\n * scene.add( object );\n * ```\n *\n * @augments Loader\n */\nclass BufferGeometryLoader extends Loader {\n\n\t/**\n\t * Constructs a new geometry loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and pass the loaded geometry to the `onLoad()` callback.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(BufferGeometry)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Executed while the loading is in progress.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( scope.manager );\n\t\tloader.setPath( scope.path );\n\t\tloader.setRequestHeader( scope.requestHeader );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\terror( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\t/**\n\t * Parses the given JSON object and returns a geometry.\n\t *\n\t * @param {Object} json - The serialized geometry.\n\t * @return {BufferGeometry} The parsed geometry.\n\t */\n\tparse( json ) {\n\n\t\tconst interleavedBufferMap = {};\n\t\tconst arrayBufferMap = {};\n\n\t\tfunction getInterleavedBuffer( json, uuid ) {\n\n\t\t\tif ( interleavedBufferMap[ uuid ] !== undefined ) return interleavedBufferMap[ uuid ];\n\n\t\t\tconst interleavedBuffers = json.interleavedBuffers;\n\t\t\tconst interleavedBuffer = interleavedBuffers[ uuid ];\n\n\t\t\tconst buffer = getArrayBuffer( json, interleavedBuffer.buffer );\n\n\t\t\tconst array = getTypedArray( interleavedBuffer.type, buffer );\n\t\t\tconst ib = new InterleavedBuffer( array, interleavedBuffer.stride );\n\t\t\tib.uuid = interleavedBuffer.uuid;\n\n\t\t\tinterleavedBufferMap[ uuid ] = ib;\n\n\t\t\treturn ib;\n\n\t\t}\n\n\t\tfunction getArrayBuffer( json, uuid ) {\n\n\t\t\tif ( arrayBufferMap[ uuid ] !== undefined ) return arrayBufferMap[ uuid ];\n\n\t\t\tconst arrayBuffers = json.arrayBuffers;\n\t\t\tconst arrayBuffer = arrayBuffers[ uuid ];\n\n\t\t\tconst ab = new Uint32Array( arrayBuffer ).buffer;\n\n\t\t\tarrayBufferMap[ uuid ] = ab;\n\n\t\t\treturn ab;\n\n\t\t}\n\n\t\tconst geometry = json.isInstancedBufferGeometry ? new InstancedBufferGeometry() : new BufferGeometry();\n\n\t\tconst index = json.data.index;\n\n\t\tif ( index !== undefined ) {\n\n\t\t\tconst typedArray = getTypedArray( index.type, index.array );\n\t\t\tgeometry.setIndex( new BufferAttribute( typedArray, 1 ) );\n\n\t\t}\n\n\t\tconst attributes = json.data.attributes;\n\n\t\tfor ( const key in attributes ) {\n\n\t\t\tconst attribute = attributes[ key ];\n\t\t\tlet bufferAttribute;\n\n\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\tconst interleavedBuffer = getInterleavedBuffer( json.data, attribute.data );\n\t\t\t\tbufferAttribute = new InterleavedBufferAttribute( interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized );\n\n\t\t\t} else {\n\n\t\t\t\tconst typedArray = getTypedArray( attribute.type, attribute.array );\n\t\t\t\tconst bufferAttributeConstr = attribute.isInstancedBufferAttribute ? InstancedBufferAttribute : BufferAttribute;\n\t\t\t\tbufferAttribute = new bufferAttributeConstr( typedArray, attribute.itemSize, attribute.normalized );\n\n\t\t\t}\n\n\t\t\tif ( attribute.name !== undefined ) bufferAttribute.name = attribute.name;\n\t\t\tif ( attribute.usage !== undefined ) bufferAttribute.setUsage( attribute.usage );\n\n\t\t\tgeometry.setAttribute( key, bufferAttribute );\n\n\t\t}\n\n\t\tconst morphAttributes = json.data.morphAttributes;\n\n\t\tif ( morphAttributes ) {\n\n\t\t\tfor ( const key in morphAttributes ) {\n\n\t\t\t\tconst attributeArray = morphAttributes[ key ];\n\n\t\t\t\tconst array = [];\n\n\t\t\t\tfor ( let i = 0, il = attributeArray.length; i \u003c il; i ++ ) {\n\n\t\t\t\t\tconst attribute = attributeArray[ i ];\n\t\t\t\t\tlet bufferAttribute;\n\n\t\t\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\t\t\tconst interleavedBuffer = getInterleavedBuffer( json.data, attribute.data );\n\t\t\t\t\t\tbufferAttribute = new InterleavedBufferAttribute( interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconst typedArray = getTypedArray( attribute.type, attribute.array );\n\t\t\t\t\t\tbufferAttribute = new BufferAttribute( typedArray, attribute.itemSize, attribute.normalized );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( attribute.name !== undefined ) bufferAttribute.name = attribute.name;\n\t\t\t\t\tarray.push( bufferAttribute );\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.morphAttributes[ key ] = array;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst morphTargetsRelative = json.data.morphTargetsRelative;\n\n\t\tif ( morphTargetsRelative ) {\n\n\t\t\tgeometry.morphTargetsRelative = true;\n\n\t\t}\n\n\t\tconst groups = json.data.groups || json.data.drawcalls || json.data.offsets;\n\n\t\tif ( groups !== undefined ) {\n\n\t\t\tfor ( let i = 0, n = groups.length; i !== n; ++ i ) {\n\n\t\t\t\tconst group = groups[ i ];\n\n\t\t\t\tgeometry.addGroup( group.start, group.count, group.materialIndex );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst boundingSphere = json.data.boundingSphere;\n\n\t\tif ( boundingSphere !== undefined ) {\n\n\t\t\tgeometry.boundingSphere = new Sphere().fromJSON( boundingSphere );\n\n\t\t}\n\n\t\tif ( json.name ) geometry.name = json.name;\n\t\tif ( json.userData ) geometry.userData = json.userData;\n\n\t\treturn geometry;\n\n\t}\n\n}\n\n/**\n * A loader for loading a JSON resource in the [JSON Object/Scene format](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4).\n * The files are internally loaded via {@link FileLoader}.\n *\n * ```js\n * const loader = new THREE.ObjectLoader();\n * const obj = await loader.loadAsync( 'models/json/example.json' );\n * scene.add( obj );\n *\n * // Alternatively, to parse a previously loaded JSON structure\n * const object = await loader.parseAsync( a_json_object );\n * scene.add( object );\n * ```\n *\n * @augments Loader\n */\nclass ObjectLoader extends Loader {\n\n\t/**\n\t * Constructs a new object loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and pass the loaded 3D object to the `onLoad()` callback.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(Object3D)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Executed while the loading is in progress.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst path = ( this.path === '' ) ? LoaderUtils.extractUrlBase( url ) : this.path;\n\t\tthis.resourcePath = this.resourcePath || path;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\tlet json = null;\n\n\t\t\ttry {\n\n\t\t\t\tjson = JSON.parse( text );\n\n\t\t\t} catch ( error ) {\n\n\t\t\t\tif ( onError !== undefined ) onError( error );\n\n\t\t\t\terror( 'ObjectLoader: Can\\'t parse ' + url + '.', error.message );\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tconst metadata = json.metadata;\n\n\t\t\tif ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) {\n\n\t\t\t\tif ( onError !== undefined ) onError( new Error( 'THREE.ObjectLoader: Can\\'t load ' + url ) );\n\n\t\t\t\terror( 'ObjectLoader: Can\\'t load ' + url );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tscope.parse( json, onLoad );\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\t/**\n\t * Async version of {@link ObjectLoader#load}.\n\t *\n\t * @async\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {onProgressCallback} onProgress - Executed while the loading is in progress.\n\t * @return {Promise\u003cObject3D\u003e} A Promise that resolves with the loaded 3D object.\n\t */\n\tasync loadAsync( url, onProgress ) {\n\n\t\tconst scope = this;\n\n\t\tconst path = ( this.path === '' ) ? LoaderUtils.extractUrlBase( url ) : this.path;\n\t\tthis.resourcePath = this.resourcePath || path;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\n\t\tconst text = await loader.loadAsync( url, onProgress );\n\n\t\tconst json = JSON.parse( text );\n\n\t\tconst metadata = json.metadata;\n\n\t\tif ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) {\n\n\t\t\tthrow new Error( 'THREE.ObjectLoader: Can\\'t load ' + url );\n\n\t\t}\n\n\t\treturn await scope.parseAsync( json );\n\n\t}\n\n\t/**\n\t * Parses the given JSON. This is used internally by {@link ObjectLoader#load}\n\t * but can also be used directly to parse a previously loaded JSON structure.\n\t *\n\t * @param {Object} json - The serialized 3D object.\n\t * @param {onLoad} onLoad - Executed when all resources (e.g. textures) have been fully loaded.\n\t * @return {Object3D} The parsed 3D object.\n\t */\n\tparse( json, onLoad ) {\n\n\t\tconst animations = this.parseAnimations( json.animations );\n\t\tconst shapes = this.parseShapes( json.shapes );\n\t\tconst geometries = this.parseGeometries( json.geometries, shapes );\n\n\t\tconst images = this.parseImages( json.images, function () {\n\n\t\t\tif ( onLoad !== undefined ) onLoad( object );\n\n\t\t} );\n\n\t\tconst textures = this.parseTextures( json.textures, images );\n\t\tconst materials = this.parseMaterials( json.materials, textures );\n\n\t\tconst object = this.parseObject( json.object, geometries, materials, textures, animations );\n\t\tconst skeletons = this.parseSkeletons( json.skeletons, object );\n\n\t\tthis.bindSkeletons( object, skeletons );\n\t\tthis.bindLightTargets( object );\n\n\t\t//\n\n\t\tif ( onLoad !== undefined ) {\n\n\t\t\tlet hasImages = false;\n\n\t\t\tfor ( const uuid in images ) {\n\n\t\t\t\tif ( images[ uuid ].data instanceof HTMLImageElement ) {\n\n\t\t\t\t\thasImages = true;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( hasImages === false ) onLoad( object );\n\n\t\t}\n\n\t\treturn object;\n\n\t}\n\n\t/**\n\t * Async version of {@link ObjectLoader#parse}.\n\t *\n\t * @param {Object} json - The serialized 3D object.\n\t * @return {Promise\u003cObject3D\u003e} A Promise that resolves with the parsed 3D object.\n\t */\n\tasync parseAsync( json ) {\n\n\t\tconst animations = this.parseAnimations( json.animations );\n\t\tconst shapes = this.parseShapes( json.shapes );\n\t\tconst geometries = this.parseGeometries( json.geometries, shapes );\n\n\t\tconst images = await this.parseImagesAsync( json.images );\n\n\t\tconst textures = this.parseTextures( json.textures, images );\n\t\tconst materials = this.parseMaterials( json.materials, textures );\n\n\t\tconst object = this.parseObject( json.object, geometries, materials, textures, animations );\n\t\tconst skeletons = this.parseSkeletons( json.skeletons, object );\n\n\t\tthis.bindSkeletons( object, skeletons );\n\t\tthis.bindLightTargets( object );\n\n\t\treturn object;\n\n\t}\n\n\t// internals\n\n\tparseShapes( json ) {\n\n\t\tconst shapes = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0, l = json.length; i \u003c l; i ++ ) {\n\n\t\t\t\tconst shape = new Shape().fromJSON( json[ i ] );\n\n\t\t\t\tshapes[ shape.uuid ] = shape;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn shapes;\n\n\t}\n\n\tparseSkeletons( json, object ) {\n\n\t\tconst skeletons = {};\n\t\tconst bones = {};\n\n\t\t// generate bone lookup table\n\n\t\tobject.traverse( function ( child ) {\n\n\t\t\tif ( child.isBone ) bones[ child.uuid ] = child;\n\n\t\t} );\n\n\t\t// create skeletons\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0, l = json.length; i \u003c l; i ++ ) {\n\n\t\t\t\tconst skeleton = new Skeleton().fromJSON( json[ i ], bones );\n\n\t\t\t\tskeletons[ skeleton.uuid ] = skeleton;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn skeletons;\n\n\t}\n\n\tparseGeometries( json, shapes ) {\n\n\t\tconst geometries = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tconst bufferGeometryLoader = new BufferGeometryLoader();\n\n\t\t\tfor ( let i = 0, l = json.length; i \u003c l; i ++ ) {\n\n\t\t\t\tlet geometry;\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tswitch ( data.type ) {\n\n\t\t\t\t\tcase 'BufferGeometry':\n\t\t\t\t\tcase 'InstancedBufferGeometry':\n\n\t\t\t\t\t\tgeometry = bufferGeometryLoader.parse( data );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tif ( data.type in Geometries ) {\n\n\t\t\t\t\t\t\tgeometry = Geometries[ data.type ].fromJSON( data, shapes );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\twarn( `ObjectLoader: Unsupported geometry type \"${ data.type }\"` );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.uuid = data.uuid;\n\n\t\t\t\tif ( data.name !== undefined ) geometry.name = data.name;\n\t\t\t\tif ( data.userData !== undefined ) geometry.userData = data.userData;\n\n\t\t\t\tgeometries[ data.uuid ] = geometry;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn geometries;\n\n\t}\n\n\tparseMaterials( json, textures ) {\n\n\t\tconst cache = {}; // MultiMaterial\n\t\tconst materials = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tconst loader = new MaterialLoader();\n\t\t\tloader.setTextures( textures );\n\n\t\t\tfor ( let i = 0, l = json.length; i \u003c l; i ++ ) {\n\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tif ( cache[ data.uuid ] === undefined ) {\n\n\t\t\t\t\tcache[ data.uuid ] = loader.parse( data );\n\n\t\t\t\t}\n\n\t\t\t\tmaterials[ data.uuid ] = cache[ data.uuid ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn materials;\n\n\t}\n\n\tparseAnimations( json ) {\n\n\t\tconst animations = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0; i \u003c json.length; i ++ ) {\n\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tconst clip = AnimationClip.parse( data );\n\n\t\t\t\tanimations[ clip.uuid ] = clip;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn animations;\n\n\t}\n\n\tparseImages( json, onLoad ) {\n\n\t\tconst scope = this;\n\t\tconst images = {};\n\n\t\tlet loader;\n\n\t\tfunction loadImage( url ) {\n\n\t\t\tscope.manager.itemStart( url );\n\n\t\t\treturn loader.load( url, function () {\n\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t}, undefined, function () {\n\n\t\t\t\tscope.manager.itemError( url );\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t} );\n\n\t\t}\n\n\t\tfunction deserializeImage( image ) {\n\n\t\t\tif ( typeof image === 'string' ) {\n\n\t\t\t\tconst url = image;\n\n\t\t\t\tconst path = /^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test( url ) ? url : scope.resourcePath + url;\n\n\t\t\t\treturn loadImage( path );\n\n\t\t\t} else {\n\n\t\t\t\tif ( image.data ) {\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: getTypedArray( image.type, image.data ),\n\t\t\t\t\t\twidth: image.width,\n\t\t\t\t\t\theight: image.height\n\t\t\t\t\t};\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json !== undefined \u0026\u0026 json.length \u003e 0 ) {\n\n\t\t\tconst manager = new LoadingManager( onLoad );\n\n\t\t\tloader = new ImageLoader( manager );\n\t\t\tloader.setCrossOrigin( this.crossOrigin );\n\n\t\t\tfor ( let i = 0, il = json.length; i \u003c il; i ++ ) {\n\n\t\t\t\tconst image = json[ i ];\n\t\t\t\tconst url = image.url;\n\n\t\t\t\tif ( Array.isArray( url ) ) {\n\n\t\t\t\t\t// load array of images e.g CubeTexture\n\n\t\t\t\t\tconst imageArray = [];\n\n\t\t\t\t\tfor ( let j = 0, jl = url.length; j \u003c jl; j ++ ) {\n\n\t\t\t\t\t\tconst currentUrl = url[ j ];\n\n\t\t\t\t\t\tconst deserializedImage = deserializeImage( currentUrl );\n\n\t\t\t\t\t\tif ( deserializedImage !== null ) {\n\n\t\t\t\t\t\t\tif ( deserializedImage instanceof HTMLImageElement ) {\n\n\t\t\t\t\t\t\t\timageArray.push( deserializedImage );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// special case: handle array of data textures for cube textures\n\n\t\t\t\t\t\t\t\timageArray.push( new DataTexture( deserializedImage.data, deserializedImage.width, deserializedImage.height ) );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\timages[ image.uuid ] = new Source( imageArray );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// load single image\n\n\t\t\t\t\tconst deserializedImage = deserializeImage( image.url );\n\t\t\t\t\timages[ image.uuid ] = new Source( deserializedImage );\n\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn images;\n\n\t}\n\n\tasync parseImagesAsync( json ) {\n\n\t\tconst scope = this;\n\t\tconst images = {};\n\n\t\tlet loader;\n\n\t\tasync function deserializeImage( image ) {\n\n\t\t\tif ( typeof image === 'string' ) {\n\n\t\t\t\tconst url = image;\n\n\t\t\t\tconst path = /^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test( url ) ? url : scope.resourcePath + url;\n\n\t\t\t\treturn await loader.loadAsync( path );\n\n\t\t\t} else {\n\n\t\t\t\tif ( image.data ) {\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: getTypedArray( image.type, image.data ),\n\t\t\t\t\t\twidth: image.width,\n\t\t\t\t\t\theight: image.height\n\t\t\t\t\t};\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json !== undefined \u0026\u0026 json.length \u003e 0 ) {\n\n\t\t\tloader = new ImageLoader( this.manager );\n\t\t\tloader.setCrossOrigin( this.crossOrigin );\n\n\t\t\tfor ( let i = 0, il = json.length; i \u003c il; i ++ ) {\n\n\t\t\t\tconst image = json[ i ];\n\t\t\t\tconst url = image.url;\n\n\t\t\t\tif ( Array.isArray( url ) ) {\n\n\t\t\t\t\t// load array of images e.g CubeTexture\n\n\t\t\t\t\tconst imageArray = [];\n\n\t\t\t\t\tfor ( let j = 0, jl = url.length; j \u003c jl; j ++ ) {\n\n\t\t\t\t\t\tconst currentUrl = url[ j ];\n\n\t\t\t\t\t\tconst deserializedImage = await deserializeImage( currentUrl );\n\n\t\t\t\t\t\tif ( deserializedImage !== null ) {\n\n\t\t\t\t\t\t\tif ( deserializedImage instanceof HTMLImageElement ) {\n\n\t\t\t\t\t\t\t\timageArray.push( deserializedImage );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// special case: handle array of data textures for cube textures\n\n\t\t\t\t\t\t\t\timageArray.push( new DataTexture( deserializedImage.data, deserializedImage.width, deserializedImage.height ) );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\timages[ image.uuid ] = new Source( imageArray );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// load single image\n\n\t\t\t\t\tconst deserializedImage = await deserializeImage( image.url );\n\t\t\t\t\timages[ image.uuid ] = new Source( deserializedImage );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn images;\n\n\t}\n\n\tparseTextures( json, images ) {\n\n\t\tfunction parseConstant( value, type ) {\n\n\t\t\tif ( typeof value === 'number' ) return value;\n\n\t\t\twarn( 'ObjectLoader.parseTexture: Constant should be in numeric form.', value );\n\n\t\t\treturn type[ value ];\n\n\t\t}\n\n\t\tconst textures = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0, l = json.length; i \u003c l; i ++ ) {\n\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tif ( data.image === undefined ) {\n\n\t\t\t\t\twarn( 'ObjectLoader: No \"image\" specified for', data.uuid );\n\n\t\t\t\t}\n\n\t\t\t\tif ( images[ data.image ] === undefined ) {\n\n\t\t\t\t\twarn( 'ObjectLoader: Undefined image', data.image );\n\n\t\t\t\t}\n\n\t\t\t\tconst source = images[ data.image ];\n\t\t\t\tconst image = source.data;\n\n\t\t\t\tlet texture;\n\n\t\t\t\tif ( Array.isArray( image ) ) {\n\n\t\t\t\t\ttexture = new CubeTexture();\n\n\t\t\t\t\tif ( image.length === 6 ) texture.needsUpdate = true;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( image \u0026\u0026 image.data ) {\n\n\t\t\t\t\t\ttexture = new DataTexture();\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttexture = new Texture();\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( image ) texture.needsUpdate = true; // textures can have undefined image data\n\n\t\t\t\t}\n\n\t\t\t\ttexture.source = source;\n\n\t\t\t\ttexture.uuid = data.uuid;\n\n\t\t\t\tif ( data.name !== undefined ) texture.name = data.name;\n\n\t\t\t\tif ( data.mapping !== undefined ) texture.mapping = parseConstant( data.mapping, TEXTURE_MAPPING );\n\t\t\t\tif ( data.channel !== undefined ) texture.channel = data.channel;\n\n\t\t\t\tif ( data.offset !== undefined ) texture.offset.fromArray( data.offset );\n\t\t\t\tif ( data.repeat !== undefined ) texture.repeat.fromArray( data.repeat );\n\t\t\t\tif ( data.center !== undefined ) texture.center.fromArray( data.center );\n\t\t\t\tif ( data.rotation !== undefined ) texture.rotation = data.rotation;\n\n\t\t\t\tif ( data.wrap !== undefined ) {\n\n\t\t\t\t\ttexture.wrapS = parseConstant( data.wrap[ 0 ], TEXTURE_WRAPPING );\n\t\t\t\t\ttexture.wrapT = parseConstant( data.wrap[ 1 ], TEXTURE_WRAPPING );\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.format !== undefined ) texture.format = data.format;\n\t\t\t\tif ( data.internalFormat !== undefined ) texture.internalFormat = data.internalFormat;\n\t\t\t\tif ( data.type !== undefined ) texture.type = data.type;\n\t\t\t\tif ( data.colorSpace !== undefined ) texture.colorSpace = data.colorSpace;\n\n\t\t\t\tif ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter, TEXTURE_FILTER );\n\t\t\t\tif ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter, TEXTURE_FILTER );\n\t\t\t\tif ( data.anisotropy !== undefined ) texture.anisotropy = data.anisotropy;\n\n\t\t\t\tif ( data.flipY !== undefined ) texture.flipY = data.flipY;\n\n\t\t\t\tif ( data.generateMipmaps !== undefined ) texture.generateMipmaps = data.generateMipmaps;\n\t\t\t\tif ( data.premultiplyAlpha !== undefined ) texture.premultiplyAlpha = data.premultiplyAlpha;\n\t\t\t\tif ( data.unpackAlignment !== undefined ) texture.unpackAlignment = data.unpackAlignment;\n\t\t\t\tif ( data.compareFunction !== undefined ) texture.compareFunction = data.compareFunction;\n\n\t\t\t\tif ( data.userData !== undefined ) texture.userData = data.userData;\n\n\t\t\t\ttextures[ data.uuid ] = texture;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn textures;\n\n\t}\n\n\tparseObject( data, geometries, materials, textures, animations ) {\n\n\t\tlet object;\n\n\t\tfunction getGeometry( name ) {\n\n\t\t\tif ( geometries[ name ] === undefined ) {\n\n\t\t\t\twarn( 'ObjectLoader: Undefined geometry', name );\n\n\t\t\t}\n\n\t\t\treturn geometries[ name ];\n\n\t\t}\n\n\t\tfunction getMaterial( name ) {\n\n\t\t\tif ( name === undefined ) return undefined;\n\n\t\t\tif ( Array.isArray( name ) ) {\n\n\t\t\t\tconst array = [];\n\n\t\t\t\tfor ( let i = 0, l = name.length; i \u003c l; i ++ ) {\n\n\t\t\t\t\tconst uuid = name[ i ];\n\n\t\t\t\t\tif ( materials[ uuid ] === undefined ) {\n\n\t\t\t\t\t\twarn( 'ObjectLoader: Undefined material', uuid );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tarray.push( materials[ uuid ] );\n\n\t\t\t\t}\n\n\t\t\t\treturn array;\n\n\t\t\t}\n\n\t\t\tif ( materials[ name ] === undefined ) {\n\n\t\t\t\twarn( 'ObjectLoader: Undefined material', name );\n\n\t\t\t}\n\n\t\t\treturn materials[ name ];\n\n\t\t}\n\n\t\tfunction getTexture( uuid ) {\n\n\t\t\tif ( textures[ uuid ] === undefined ) {\n\n\t\t\t\twarn( 'ObjectLoader: Undefined texture', uuid );\n\n\t\t\t}\n\n\t\t\treturn textures[ uuid ];\n\n\t\t}\n\n\t\tlet geometry, material;\n\n\t\tswitch ( data.type ) {\n\n\t\t\tcase 'Scene':\n\n\t\t\t\tobject = new Scene();\n\n\t\t\t\tif ( data.background !== undefined ) {\n\n\t\t\t\t\tif ( Number.isInteger( data.background ) ) {\n\n\t\t\t\t\t\tobject.background = new Color( data.background );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tobject.background = getTexture( data.background );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.environment !== undefined ) {\n\n\t\t\t\t\tobject.environment = getTexture( data.environment );\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.fog !== undefined ) {\n\n\t\t\t\t\tif ( data.fog.type === 'Fog' ) {\n\n\t\t\t\t\t\tobject.fog = new Fog( data.fog.color, data.fog.near, data.fog.far );\n\n\t\t\t\t\t} else if ( data.fog.type === 'FogExp2' ) {\n\n\t\t\t\t\t\tobject.fog = new FogExp2( data.fog.color, data.fog.density );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( data.fog.name !== '' ) {\n\n\t\t\t\t\t\tobject.fog.name = data.fog.name;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.backgroundBlurriness !== undefined ) object.backgroundBlurriness = data.backgroundBlurriness;\n\t\t\t\tif ( data.backgroundIntensity !== undefined ) object.backgroundIntensity = data.backgroundIntensity;\n\t\t\t\tif ( data.backgroundRotation !== undefined ) object.backgroundRotation.fromArray( data.backgroundRotation );\n\n\t\t\t\tif ( data.environmentIntensity !== undefined ) object.environmentIntensity = data.environmentIntensity;\n\t\t\t\tif ( data.environmentRotation !== undefined ) object.environmentRotation.fromArray( data.environmentRotation );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'PerspectiveCamera':\n\n\t\t\t\tobject = new PerspectiveCamera( data.fov, data.aspect, data.near, data.far );\n\n\t\t\t\tif ( data.focus !== undefined ) object.focus = data.focus;\n\t\t\t\tif ( data.zoom !== undefined ) object.zoom = data.zoom;\n\t\t\t\tif ( data.filmGauge !== undefined ) object.filmGauge = data.filmGauge;\n\t\t\t\tif ( data.filmOffset !== undefined ) object.filmOffset = data.filmOffset;\n\t\t\t\tif ( data.view !== undefined ) object.view = Object.assign( {}, data.view );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'OrthographicCamera':\n\n\t\t\t\tobject = new OrthographicCamera( data.left, data.right, data.top, data.bottom, data.near, data.far );\n\n\t\t\t\tif ( data.zoom !== undefined ) object.zoom = data.zoom;\n\t\t\t\tif ( data.view !== undefined ) object.view = Object.assign( {}, data.view );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'AmbientLight':\n\n\t\t\t\tobject = new AmbientLight( data.color, data.intensity );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'DirectionalLight':\n\n\t\t\t\tobject = new DirectionalLight( data.color, data.intensity );\n\t\t\t\tobject.target = data.target || '';\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'PointLight':\n\n\t\t\t\tobject = new PointLight( data.color, data.intensity, data.distance, data.decay );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'RectAreaLight':\n\n\t\t\t\tobject = new RectAreaLight( data.color, data.intensity, data.width, data.height );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'SpotLight':\n\n\t\t\t\tobject = new SpotLight( data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay );\n\t\t\t\tobject.target = data.target || '';\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'HemisphereLight':\n\n\t\t\t\tobject = new HemisphereLight( data.color, data.groundColor, data.intensity );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LightProbe':\n\n\t\t\t\tconst sh = new SphericalHarmonics3().fromArray( data.sh );\n\t\t\t\tobject = new LightProbe( sh, data.intensity );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'SkinnedMesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t \tmaterial = getMaterial( data.material );\n\n\t\t\t\tobject = new SkinnedMesh( geometry, material );\n\n\t\t\t\tif ( data.bindMode !== undefined ) object.bindMode = data.bindMode;\n\t\t\t\tif ( data.bindMatrix !== undefined ) object.bindMatrix.fromArray( data.bindMatrix );\n\t\t\t\tif ( data.skeleton !== undefined ) object.skeleton = data.skeleton;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Mesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t\tmaterial = getMaterial( data.material );\n\n\t\t\t\tobject = new Mesh( geometry, material );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'InstancedMesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t\tmaterial = getMaterial( data.material );\n\t\t\t\tconst count = data.count;\n\t\t\t\tconst instanceMatrix = data.instanceMatrix;\n\t\t\t\tconst instanceColor = data.instanceColor;\n\n\t\t\t\tobject = new InstancedMesh( geometry, material, count );\n\t\t\t\tobject.instanceMatrix = new InstancedBufferAttribute( new Float32Array( instanceMatrix.array ), 16 );\n\t\t\t\tif ( instanceColor !== undefined ) object.instanceColor = new InstancedBufferAttribute( new Float32Array( instanceColor.array ), instanceColor.itemSize );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'BatchedMesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t\tmaterial = getMaterial( data.material );\n\n\t\t\t\tobject = new BatchedMesh( data.maxInstanceCount, data.maxVertexCount, data.maxIndexCount, material );\n\t\t\t\tobject.geometry = geometry;\n\t\t\t\tobject.perObjectFrustumCulled = data.perObjectFrustumCulled;\n\t\t\t\tobject.sortObjects = data.sortObjects;\n\n\t\t\t\tobject._drawRanges = data.drawRanges;\n\t\t\t\tobject._reservedRanges = data.reservedRanges;\n\n\t\t\t\tobject._geometryInfo = data.geometryInfo.map( info =\u003e {\n\n\t\t\t\t\tlet box = null;\n\t\t\t\t\tlet sphere = null;\n\t\t\t\t\tif ( info.boundingBox !== undefined ) {\n\n\t\t\t\t\t\tbox = new Box3().fromJSON( info.boundingBox );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( info.boundingSphere !== undefined ) {\n\n\t\t\t\t\t\tsphere = new Sphere().fromJSON( info.boundingSphere );\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...info,\n\t\t\t\t\t\tboundingBox: box,\n\t\t\t\t\t\tboundingSphere: sphere\n\t\t\t\t\t};\n\n\t\t\t\t} );\n\t\t\t\tobject._instanceInfo = data.instanceInfo;\n\n\t\t\t\tobject._availableInstanceIds = data._availableInstanceIds;\n\t\t\t\tobject._availableGeometryIds = data._availableGeometryIds;\n\n\t\t\t\tobject._nextIndexStart = data.nextIndexStart;\n\t\t\t\tobject._nextVertexStart = data.nextVertexStart;\n\t\t\t\tobject._geometryCount = data.geometryCount;\n\n\t\t\t\tobject._maxInstanceCount = data.maxInstanceCount;\n\t\t\t\tobject._maxVertexCount = data.maxVertexCount;\n\t\t\t\tobject._maxIndexCount = data.maxIndexCount;\n\n\t\t\t\tobject._geometryInitialized = data.geometryInitialized;\n\n\t\t\t\tobject._matricesTexture = getTexture( data.matricesTexture.uuid );\n\n\t\t\t\tobject._indirectTexture = getTexture( data.indirectTexture.uuid );\n\n\t\t\t\tif ( data.colorsTexture !== undefined ) {\n\n\t\t\t\t\tobject._colorsTexture = getTexture( data.colorsTexture.uuid );\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.boundingSphere !== undefined ) {\n\n\t\t\t\t\tobject.boundingSphere = new Sphere().fromJSON( data.boundingSphere );\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.boundingBox !== undefined ) {\n\n\t\t\t\t\tobject.boundingBox = new Box3().fromJSON( data.boundingBox );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LOD':\n\n\t\t\t\tobject = new LOD();\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Line':\n\n\t\t\t\tobject = new Line( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LineLoop':\n\n\t\t\t\tobject = new LineLoop( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LineSegments':\n\n\t\t\t\tobject = new LineSegments( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'PointCloud':\n\t\t\tcase 'Points':\n\n\t\t\t\tobject = new Points( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Sprite':\n\n\t\t\t\tobject = new Sprite( getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Group':\n\n\t\t\t\tobject = new Group();\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Bone':\n\n\t\t\t\tobject = new Bone();\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tobject = new Object3D();\n\n\t\t}\n\n\t\tobject.uuid = data.uuid;\n\n\t\tif ( data.name !== undefined ) object.name = data.name;\n\n\t\tif ( data.matrix !== undefined ) {\n\n\t\t\tobject.matrix.fromArray( data.matrix );\n\n\t\t\tif ( data.matrixAutoUpdate !== undefined ) object.matrixAutoUpdate = data.matrixAutoUpdate;\n\t\t\tif ( object.matrixAutoUpdate ) object.matrix.decompose( object.position, object.quaternion, object.scale );\n\n\t\t} else {\n\n\t\t\tif ( data.position !== undefined ) object.position.fromArray( data.position );\n\t\t\tif ( data.rotation !== undefined ) object.rotation.fromArray( data.rotation );\n\t\t\tif ( data.quaternion !== undefined ) object.quaternion.fromArray( data.quaternion );\n\t\t\tif ( data.scale !== undefined ) object.scale.fromArray( data.scale );\n\n\t\t}\n\n\t\tif ( data.up !== undefined ) object.up.fromArray( data.up );\n\n\t\tif ( data.castShadow !== undefined ) object.castShadow = data.castShadow;\n\t\tif ( data.receiveShadow !== undefined ) object.receiveShadow = data.receiveShadow;\n\n\t\tif ( data.shadow ) {\n\n\t\t\tif ( data.shadow.intensity !== undefined ) object.shadow.intensity = data.shadow.intensity;\n\t\t\tif ( data.shadow.bias !== undefined ) object.shadow.bias = data.shadow.bias;\n\t\t\tif ( data.shadow.normalBias !== undefined ) object.shadow.normalBias = data.shadow.normalBias;\n\t\t\tif ( data.shadow.radius !== undefined ) object.shadow.radius = data.shadow.radius;\n\t\t\tif ( data.shadow.mapSize !== undefined ) object.shadow.mapSize.fromArray( data.shadow.mapSize );\n\t\t\tif ( data.shadow.camera !== undefined ) object.shadow.camera = this.parseObject( data.shadow.camera );\n\n\t\t}\n\n\t\tif ( data.visible !== undefined ) object.visible = data.visible;\n\t\tif ( data.frustumCulled !== undefined ) object.frustumCulled = data.frustumCulled;\n\t\tif ( data.renderOrder !== undefined ) object.renderOrder = data.renderOrder;\n\t\tif ( data.userData !== undefined ) object.userData = data.userData;\n\t\tif ( data.layers !== undefined ) object.layers.mask = data.layers;\n\n\t\tif ( data.children !== undefined ) {\n\n\t\t\tconst children = data.children;\n\n\t\t\tfor ( let i = 0; i \u003c children.length; i ++ ) {\n\n\t\t\t\tobject.add( this.parseObject( children[ i ], geometries, materials, textures, animations ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( data.animations !== undefined ) {\n\n\t\t\tconst objectAnimations = data.animations;\n\n\t\t\tfor ( let i = 0; i \u003c objectAnimations.length; i ++ ) {\n\n\t\t\t\tconst uuid = objectAnimations[ i ];\n\n\t\t\t\tobject.animations.push( animations[ uuid ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( data.type === 'LOD' ) {\n\n\t\t\tif ( data.autoUpdate !== undefined ) object.autoUpdate = data.autoUpdate;\n\n\t\t\tconst levels = data.levels;\n\n\t\t\tfor ( let l = 0; l \u003c levels.length; l ++ ) {\n\n\t\t\t\tconst level = levels[ l ];\n\t\t\t\tconst child = object.getObjectByProperty( 'uuid', level.object );\n\n\t\t\t\tif ( child !== undefined ) {\n\n\t\t\t\t\tobject.addLevel( child, level.distance, level.hysteresis );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn object;\n\n\t}\n\n\tbindSkeletons( object, skeletons ) {\n\n\t\tif ( Object.keys( skeletons ).length === 0 ) return;\n\n\t\tobject.traverse( function ( child ) {\n\n\t\t\tif ( child.isSkinnedMesh === true \u0026\u0026 child.skeleton !== undefined ) {\n\n\t\t\t\tconst skeleton = skeletons[ child.skeleton ];\n\n\t\t\t\tif ( skeleton === undefined ) {\n\n\t\t\t\t\twarn( 'ObjectLoader: No skeleton found with UUID:', child.skeleton );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tchild.bind( skeleton, child.bindMatrix );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} );\n\n\t}\n\n\tbindLightTargets( object ) {\n\n\t\tobject.traverse( function ( child ) {\n\n\t\t\tif ( child.isDirectionalLight || child.isSpotLight ) {\n\n\t\t\t\tconst uuid = child.target;\n\n\t\t\t\tconst target = object.getObjectByProperty( 'uuid', uuid );\n\n\t\t\t\tif ( target !== undefined ) {\n\n\t\t\t\t\tchild.target = target;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tchild.target = new Object3D();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} );\n\n\t}\n\n}\n\nconst TEXTURE_MAPPING = {\n\tUVMapping: UVMapping,\n\tCubeReflectionMapping: CubeReflectionMapping,\n\tCubeRefractionMapping: CubeRefractionMapping,\n\tEquirectangularReflectionMapping: EquirectangularReflectionMapping,\n\tEquirectangularRefractionMapping: EquirectangularRefractionMapping,\n\tCubeUVReflectionMapping: CubeUVReflectionMapping\n};\n\nconst TEXTURE_WRAPPING = {\n\tRepeatWrapping: RepeatWrapping,\n\tClampToEdgeWrapping: ClampToEdgeWrapping,\n\tMirroredRepeatWrapping: MirroredRepeatWrapping\n};\n\nconst TEXTURE_FILTER = {\n\tNearestFilter: NearestFilter,\n\tNearestMipmapNearestFilter: NearestMipmapNearestFilter,\n\tNearestMipmapLinearFilter: NearestMipmapLinearFilter,\n\tLinearFilter: LinearFilter,\n\tLinearMipmapNearestFilter: LinearMipmapNearestFilter,\n\tLinearMipmapLinearFilter: LinearMipmapLinearFilter\n};\n\nconst _errorMap = new WeakMap();\n\n/**\n * A loader for loading images as an [ImageBitmap](https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap).\n * An `ImageBitmap` provides an asynchronous and resource efficient pathway to prepare\n * textures for rendering.\n *\n * Note that {@link Texture#flipY} and {@link Texture#premultiplyAlpha} are ignored with image bitmaps.\n * They needs these configuration on bitmap creation unlike regular images need them on uploading to GPU.\n *\n * You need to set the equivalent options via {@link ImageBitmapLoader#setOptions} instead.\n *\n * Also note that unlike {@link FileLoader}, this loader avoids multiple concurrent requests to the same URL only if `Cache` is enabled.\n *\n * ```js\n * const loader = new THREE.ImageBitmapLoader();\n * loader.setOptions( { imageOrientation: 'flipY' } ); // set options if needed\n * const imageBitmap = await loader.loadAsync( 'image.png' );\n *\n * const texture = new THREE.Texture( imageBitmap );\n * texture.needsUpdate = true;\n * ```\n *\n * @augments Loader\n */\nclass ImageBitmapLoader extends Loader {\n\n\t/**\n\t * Constructs a new image bitmap loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isImageBitmapLoader = true;\n\n\t\tif ( typeof createImageBitmap === 'undefined' ) {\n\n\t\t\twarn( 'ImageBitmapLoader: createImageBitmap() not supported.' );\n\n\t\t}\n\n\t\tif ( typeof fetch === 'undefined' ) {\n\n\t\t\twarn( 'ImageBitmapLoader: fetch() not supported.' );\n\n\t\t}\n\n\t\t/**\n\t\t * Represents the loader options.\n\t\t *\n\t\t * @type {Object}\n\t\t * @default {premultiplyAlpha:'none'}\n\t\t */\n\t\tthis.options = { premultiplyAlpha: 'none' };\n\n\t\t/**\n\t\t * Used for aborting requests.\n\t\t *\n\t\t * @private\n\t\t * @type {AbortController}\n\t\t */\n\t\tthis._abortController = new AbortController();\n\n\t}\n\n\t/**\n\t * Sets the given loader options. The structure of the object must match the `options` parameter of\n\t * [createImageBitmap](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap).\n\t *\n\t * @param {Object} options - The loader options to set.\n\t * @return {ImageBitmapLoader} A reference to this image bitmap loader.\n\t */\n\tsetOptions( options ) {\n\n\t\tthis.options = options;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and pass the loaded image bitmap to the `onLoad()` callback.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(ImageBitmap)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Unsupported in this loader.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t * @return {ImageBitmap|undefined} The image bitmap.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tif ( url === undefined ) url = '';\n\n\t\tif ( this.path !== undefined ) url = this.path + url;\n\n\t\turl = this.manager.resolveURL( url );\n\n\t\tconst scope = this;\n\n\t\tconst cached = Cache.get( `image-bitmap:${url}` );\n\n\t\tif ( cached !== undefined ) {\n\n\t\t\tscope.manager.itemStart( url );\n\n\t\t\t// If cached is a promise, wait for it to resolve\n\t\t\tif ( cached.then ) {\n\n\t\t\t\tcached.then( imageBitmap =\u003e {\n\n\t\t\t\t\t// check if there is an error for the cached promise\n\n\t\t\t\t\tif ( _errorMap.has( cached ) === true ) {\n\n\t\t\t\t\t\tif ( onError ) onError( _errorMap.get( cached ) );\n\n\t\t\t\t\t\tscope.manager.itemError( url );\n\t\t\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( onLoad ) onLoad( imageBitmap );\n\n\t\t\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t\t\t\treturn imageBitmap;\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\t// If cached is not a promise (i.e., it's already an imageBitmap)\n\t\t\tsetTimeout( function () {\n\n\t\t\t\tif ( onLoad ) onLoad( cached );\n\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t}, 0 );\n\n\t\t\treturn cached;\n\n\t\t}\n\n\t\tconst fetchOptions = {};\n\t\tfetchOptions.credentials = ( this.crossOrigin === 'anonymous' ) ? 'same-origin' : 'include';\n\t\tfetchOptions.headers = this.requestHeader;\n\t\tfetchOptions.signal = ( typeof AbortSignal.any === 'function' ) ? AbortSignal.any( [ this._abortController.signal, this.manager.abortController.signal ] ) : this._abortController.signal;\n\n\t\tconst promise = fetch( url, fetchOptions ).then( function ( res ) {\n\n\t\t\treturn res.blob();\n\n\t\t} ).then( function ( blob ) {\n\n\t\t\treturn createImageBitmap( blob, Object.assign( scope.options, { colorSpaceConversion: 'none' } ) );\n\n\t\t} ).then( function ( imageBitmap ) {\n\n\t\t\tCache.add( `image-bitmap:${url}`, imageBitmap );\n\n\t\t\tif ( onLoad ) onLoad( imageBitmap );\n\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t\treturn imageBitmap;\n\n\t\t} ).catch( function ( e ) {\n\n\t\t\tif ( onError ) onError( e );\n\n\t\t\t_errorMap.set( promise, e );\n\n\t\t\tCache.remove( `image-bitmap:${url}` );\n\n\t\t\tscope.manager.itemError( url );\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t} );\n\n\t\tCache.add( `image-bitmap:${url}`, promise );\n\t\tscope.manager.itemStart( url );\n\n\t}\n\n\t/**\n\t * Aborts ongoing fetch requests.\n\t *\n\t * @return {ImageBitmapLoader} A reference to this instance.\n\t */\n\tabort() {\n\n\t\tthis._abortController.abort();\n\t\tthis._abortController = new AbortController();\n\n\t\treturn this;\n\n\t}\n\n}\n\nlet _context;\n\n/**\n * Manages the global audio context in the engine.\n *\n * @hideconstructor\n */\nclass AudioContext {\n\n\t/**\n\t * Returns the global native audio context.\n\t *\n\t * @return {AudioContext} The native audio context.\n\t */\n\tstatic getContext() {\n\n\t\tif ( _context === undefined ) {\n\n\t\t\t_context = new ( window.AudioContext || window.webkitAudioContext )();\n\n\t\t}\n\n\t\treturn _context;\n\n\t}\n\n\t/**\n\t * Allows to set the global native audio context from outside.\n\t *\n\t * @param {AudioContext} value - The native context to set.\n\t */\n\tstatic setContext( value ) {\n\n\t\t_context = value;\n\n\t}\n\n}\n\n/**\n * Class for loading audio buffers. Audios are internally\n * loaded via {@link FileLoader}.\n *\n * ```js\n * const audioListener = new THREE.AudioListener();\n * const ambientSound = new THREE.Audio( audioListener );\n *\n * const loader = new THREE.AudioLoader();\n * const audioBuffer = await loader.loadAsync( 'audio/ambient_ocean.ogg' );\n *\n * ambientSound.setBuffer( audioBuffer );\n * ambientSound.play();\n * ```\n *\n * @augments Loader\n */\nclass AudioLoader extends Loader {\n\n\t/**\n\t * Constructs a new audio loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and passes the loaded audio buffer\n\t * to the `onLoad()` callback.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(AudioBuffer)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Executed while the loading is in progress.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\t\tloader.load( url, function ( buffer ) {\n\n\t\t\ttry {\n\n\t\t\t\t// Create a copy of the buffer. The `decodeAudioData` method\n\t\t\t\t// detaches the buffer when complete, preventing reuse.\n\t\t\t\tconst bufferCopy = buffer.slice( 0 );\n\n\t\t\t\tconst context = AudioContext.getContext();\n\t\t\t\tcontext.decodeAudioData( bufferCopy, function ( audioBuffer ) {\n\n\t\t\t\t\tonLoad( audioBuffer );\n\n\t\t\t\t} ).catch( handleError );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\thandleError( e );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t\tfunction handleError( e ) {\n\n\t\t\tif ( onError ) {\n\n\t\t\t\tonError( e );\n\n\t\t\t} else {\n\n\t\t\t\terror( e );\n\n\t\t\t}\n\n\t\t\tscope.manager.itemError( url );\n\n\t\t}\n\n\t}\n\n}\n\nconst _eyeRight = /*@__PURE__*/ new Matrix4();\nconst _eyeLeft = /*@__PURE__*/ new Matrix4();\nconst _projectionMatrix = /*@__PURE__*/ new Matrix4();\n\n/**\n * A special type of camera that uses two perspective cameras with\n * stereoscopic projection. Can be used for rendering stereo effects\n * like [3D Anaglyph](https://en.wikipedia.org/wiki/Anaglyph_3D) or\n * [Parallax Barrier](https://en.wikipedia.org/wiki/parallax_barrier).\n */\nclass StereoCamera {\n\n\t/**\n\t * Constructs a new stereo camera.\n\t */\n\tconstructor() {\n\n\t\t/**\n\t\t * The type property is used for detecting the object type\n\t\t * in context of serialization/deserialization.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.type = 'StereoCamera';\n\n\t\t/**\n\t\t * The aspect.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.aspect = 1;\n\n\t\t/**\n\t\t * The eye separation which represents the distance\n\t\t * between the left and right camera.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0.064\n\t\t */\n\t\tthis.eyeSep = 0.064;\n\n\t\t/**\n\t\t * The camera representing the left eye. This is added to layer `1` so objects to be\n\t\t * rendered by the left camera must also be added to this layer.\n\t\t *\n\t\t * @type {PerspectiveCamera}\n\t\t */\n\t\tthis.cameraL = new PerspectiveCamera();\n\t\tthis.cameraL.layers.enable( 1 );\n\t\tthis.cameraL.matrixAutoUpdate = false;\n\n\t\t/**\n\t\t * The camera representing the right eye. This is added to layer `2` so objects to be\n\t\t * rendered by the right camera must also be added to this layer.\n\t\t *\n\t\t * @type {PerspectiveCamera}\n\t\t */\n\t\tthis.cameraR = new PerspectiveCamera();\n\t\tthis.cameraR.layers.enable( 2 );\n\t\tthis.cameraR.matrixAutoUpdate = false;\n\n\t\tthis._cache = {\n\t\t\tfocus: null,\n\t\t\tfov: null,\n\t\t\taspect: null,\n\t\t\tnear: null,\n\t\t\tfar: null,\n\t\t\tzoom: null,\n\t\t\teyeSep: null\n\t\t};\n\n\t}\n\n\t/**\n\t * Updates the stereo camera based on the given perspective camera.\n\t *\n\t * @param {PerspectiveCamera} camera - The perspective camera.\n\t */\n\tupdate( camera ) {\n\n\t\tconst cache = this._cache;\n\n\t\tconst needsUpdate = cache.focus !== camera.focus || cache.fov !== camera.fov ||\n\t\t\tcache.aspect !== camera.aspect * this.aspect || cache.near !== camera.near ||\n\t\t\tcache.far !== camera.far || cache.zoom !== camera.zoom || cache.eyeSep !== this.eyeSep;\n\n\t\tif ( needsUpdate ) {\n\n\t\t\tcache.focus = camera.focus;\n\t\t\tcache.fov = camera.fov;\n\t\t\tcache.aspect = camera.aspect * this.aspect;\n\t\t\tcache.near = camera.near;\n\t\t\tcache.far = camera.far;\n\t\t\tcache.zoom = camera.zoom;\n\t\t\tcache.eyeSep = this.eyeSep;\n\n\t\t\t// Off-axis stereoscopic effect based on\n\t\t\t// http://paulbourke.net/stereographics/stereorender/\n\n\t\t\t_projectionMatrix.copy( camera.projectionMatrix );\n\t\t\tconst eyeSepHalf = cache.eyeSep / 2;\n\t\t\tconst eyeSepOnProjection = eyeSepHalf * cache.near / cache.focus;\n\t\t\tconst ymax = ( cache.near * Math.tan( DEG2RAD * cache.fov * 0.5 ) ) / cache.zoom;\n\t\t\tlet xmin, xmax;\n\n\t\t\t// translate xOffset\n\n\t\t\t_eyeLeft.elements[ 12 ] = - eyeSepHalf;\n\t\t\t_eyeRight.elements[ 12 ] = eyeSepHalf;\n\n\t\t\t// for left eye\n\n\t\t\txmin = - ymax * cache.aspect + eyeSepOnProjection;\n\t\t\txmax = ymax * cache.aspect + eyeSepOnProjection;\n\n\t\t\t_projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin );\n\t\t\t_projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\tthis.cameraL.projectionMatrix.copy( _projectionMatrix );\n\n\t\t\t// for right eye\n\n\t\t\txmin = - ymax * cache.aspect - eyeSepOnProjection;\n\t\t\txmax = ymax * cache.aspect - eyeSepOnProjection;\n\n\t\t\t_projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin );\n\t\t\t_projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\tthis.cameraR.projectionMatrix.copy( _projectionMatrix );\n\n\t\t}\n\n\t\tthis.cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeLeft );\n\t\tthis.cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeRight );\n\n\t}\n\n}\n\n/**\n * This type of camera can be used in order to efficiently render a scene with a\n * predefined set of cameras. This is an important performance aspect for\n * rendering VR scenes.\n *\n * An instance of `ArrayCamera` always has an array of sub cameras. It's mandatory\n * to define for each sub camera the `viewport` property which determines the\n * part of the viewport that is rendered with this camera.\n *\n * @augments PerspectiveCamera\n */\nclass ArrayCamera extends PerspectiveCamera {\n\n\t/**\n\t * Constructs a new array camera.\n\t *\n\t * @param {Array\u003cPerspectiveCamera\u003e} [array=[]] - An array of perspective sub cameras.\n\t */\n\tconstructor( array = [] ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isArrayCamera = true;\n\n\t\t/**\n\t\t * Whether this camera is used with multiview rendering or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default false\n\t\t */\n\t\tthis.isMultiViewCamera = false;\n\n\t\t/**\n\t\t * An array of perspective sub cameras.\n\t\t *\n\t\t * @type {Array\u003cPerspectiveCamera\u003e}\n\t\t */\n\t\tthis.cameras = array;\n\n\t}\n\n}\n\n/**\n * Class for keeping track of time.\n */\nclass Clock {\n\n\t/**\n\t * Constructs a new clock.\n\t *\n\t * @param {boolean} [autoStart=true] - Whether to automatically start the clock when\n\t * `getDelta()` is called for the first time.\n\t */\n\tconstructor( autoStart = true ) {\n\n\t\t/**\n\t\t * If set to `true`, the clock starts automatically when `getDelta()` is called\n\t\t * for the first time.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.autoStart = autoStart;\n\n\t\t/**\n\t\t * Holds the time at which the clock's `start()` method was last called.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.startTime = 0;\n\n\t\t/**\n\t\t * Holds the time at which the clock's `start()`, `getElapsedTime()` or\n\t\t * `getDelta()` methods were last called.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.oldTime = 0;\n\n\t\t/**\n\t\t * Keeps track of the total time that the clock has been running.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.elapsedTime = 0;\n\n\t\t/**\n\t\t * Whether the clock is running or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.running = false;\n\n\t}\n\n\t/**\n\t * Starts the clock. When `autoStart` is set to `true`, the method is automatically\n\t * called by the class.\n\t */\n\tstart() {\n\n\t\tthis.startTime = performance.now();\n\n\t\tthis.oldTime = this.startTime;\n\t\tthis.elapsedTime = 0;\n\t\tthis.running = true;\n\n\t}\n\n\t/**\n\t * Stops the clock.\n\t */\n\tstop() {\n\n\t\tthis.getElapsedTime();\n\t\tthis.running = false;\n\t\tthis.autoStart = false;\n\n\t}\n\n\t/**\n\t * Returns the elapsed time in seconds.\n\t *\n\t * @return {number} The elapsed time.\n\t */\n\tgetElapsedTime() {\n\n\t\tthis.getDelta();\n\t\treturn this.elapsedTime;\n\n\t}\n\n\t/**\n\t * Returns the delta time in seconds.\n\t *\n\t * @return {number} The delta time.\n\t */\n\tgetDelta() {\n\n\t\tlet diff = 0;\n\n\t\tif ( this.autoStart \u0026\u0026 ! this.running ) {\n\n\t\t\tthis.start();\n\t\t\treturn 0;\n\n\t\t}\n\n\t\tif ( this.running ) {\n\n\t\t\tconst newTime = performance.now();\n\n\t\t\tdiff = ( newTime - this.oldTime ) / 1000;\n\t\t\tthis.oldTime = newTime;\n\n\t\t\tthis.elapsedTime += diff;\n\n\t\t}\n\n\t\treturn diff;\n\n\t}\n\n}\n\nconst _position$1 = /*@__PURE__*/ new Vector3();\nconst _quaternion$1 = /*@__PURE__*/ new Quaternion();\nconst _scale$1 = /*@__PURE__*/ new Vector3();\n\nconst _forward = /*@__PURE__*/ new Vector3();\nconst _up = /*@__PURE__*/ new Vector3();\n\n/**\n * The class represents a virtual listener of the all positional and non-positional audio effects\n * in the scene. A three.js application usually creates a single listener. It is a mandatory\n * constructor parameter for audios entities like {@link Audio} and {@link PositionalAudio}.\n *\n * In most cases, the listener object is a child of the camera. So the 3D transformation of the\n * camera represents the 3D transformation of the listener.\n *\n * @augments Object3D\n */\nclass AudioListener extends Object3D {\n\n\t/**\n\t * Constructs a new audio listener.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.type = 'AudioListener';\n\n\t\t/**\n\t\t * The native audio context.\n\t\t *\n\t\t * @type {AudioContext}\n\t\t * @readonly\n\t\t */\n\t\tthis.context = AudioContext.getContext();\n\n\t\t/**\n\t\t * The gain node used for volume control.\n\t\t *\n\t\t * @type {GainNode}\n\t\t * @readonly\n\t\t */\n\t\tthis.gain = this.context.createGain();\n\t\tthis.gain.connect( this.context.destination );\n\n\t\t/**\n\t\t * An optional filter.\n\t\t *\n\t\t * Defined via {@link AudioListener#setFilter}.\n\t\t *\n\t\t * @type {?AudioNode}\n\t\t * @default null\n\t\t * @readonly\n\t\t */\n\t\tthis.filter = null;\n\n\t\t/**\n\t\t * Time delta values required for `linearRampToValueAtTime()` usage.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t * @readonly\n\t\t */\n\t\tthis.timeDelta = 0;\n\n\t\t// private\n\n\t\tthis._clock = new Clock();\n\n\t}\n\n\t/**\n\t * Returns the listener's input node.\n\t *\n\t * This method is used by other audio nodes to connect to this listener.\n\t *\n\t * @return {GainNode} The input node.\n\t */\n\tgetInput() {\n\n\t\treturn this.gain;\n\n\t}\n\n\t/**\n\t * Removes the current filter from this listener.\n\t *\n\t * @return {AudioListener} A reference to this listener.\n\t */\n\tremoveFilter() {\n\n\t\tif ( this.filter !== null ) {\n\n\t\t\tthis.gain.disconnect( this.filter );\n\t\t\tthis.filter.disconnect( this.context.destination );\n\t\t\tthis.gain.connect( this.context.destination );\n\t\t\tthis.filter = null;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the current set filter.\n\t *\n\t * @return {?AudioNode} The filter.\n\t */\n\tgetFilter() {\n\n\t\treturn this.filter;\n\n\t}\n\n\t/**\n\t * Sets the given filter to this listener.\n\t *\n\t * @param {AudioNode} value - The filter to set.\n\t * @return {AudioListener} A reference to this listener.\n\t */\n\tsetFilter( value ) {\n\n\t\tif ( this.filter !== null ) {\n\n\t\t\tthis.gain.disconnect( this.filter );\n\t\t\tthis.filter.disconnect( this.context.destination );\n\n\t\t} else {\n\n\t\t\tthis.gain.disconnect( this.context.destination );\n\n\t\t}\n\n\t\tthis.filter = value;\n\t\tthis.gain.connect( this.filter );\n\t\tthis.filter.connect( this.context.destination );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the applications master volume.\n\t *\n\t * @return {number} The master volume.\n\t */\n\tgetMasterVolume() {\n\n\t\treturn this.gain.gain.value;\n\n\t}\n\n\t/**\n\t * Sets the applications master volume. This volume setting affects\n\t * all audio nodes in the scene.\n\t *\n\t * @param {number} value - The master volume to set.\n\t * @return {AudioListener} A reference to this listener.\n\t */\n\tsetMasterVolume( value ) {\n\n\t\tthis.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 );\n\n\t\treturn this;\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tconst listener = this.context.listener;\n\n\t\tthis.timeDelta = this._clock.getDelta();\n\n\t\tthis.matrixWorld.decompose( _position$1, _quaternion$1, _scale$1 );\n\n\t\t// the initial forward and up directions must be orthogonal\n\t\t_forward.set( 0, 0, -1 ).applyQuaternion( _quaternion$1 );\n\t\t_up.set( 0, 1, 0 ).applyQuaternion( _quaternion$1 );\n\n\t\tif ( listener.positionX ) {\n\n\t\t\t// code path for Chrome (see #14393)\n\n\t\t\tconst endTime = this.context.currentTime + this.timeDelta;\n\n\t\t\tlistener.positionX.linearRampToValueAtTime( _position$1.x, endTime );\n\t\t\tlistener.positionY.linearRampToValueAtTime( _position$1.y, endTime );\n\t\t\tlistener.positionZ.linearRampToValueAtTime( _position$1.z, endTime );\n\t\t\tlistener.forwardX.linearRampToValueAtTime( _forward.x, endTime );\n\t\t\tlistener.forwardY.linearRampToValueAtTime( _forward.y, endTime );\n\t\t\tlistener.forwardZ.linearRampToValueAtTime( _forward.z, endTime );\n\t\t\tlistener.upX.linearRampToValueAtTime( _up.x, endTime );\n\t\t\tlistener.upY.linearRampToValueAtTime( _up.y, endTime );\n\t\t\tlistener.upZ.linearRampToValueAtTime( _up.z, endTime );\n\n\t\t} else {\n\n\t\t\tlistener.setPosition( _position$1.x, _position$1.y, _position$1.z );\n\t\t\tlistener.setOrientation( _forward.x, _forward.y, _forward.z, _up.x, _up.y, _up.z );\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * Represents a non-positional ( global ) audio object.\n *\n * This and related audio modules make use of the [Web Audio API](https://www.w3.org/TR/webaudio-1.1/).\n *\n * ```js\n * // create an AudioListener and add it to the camera\n * const listener = new THREE.AudioListener();\n * camera.add( listener );\n *\n * // create a global audio source\n * const sound = new THREE.Audio( listener );\n *\n * // load a sound and set it as the Audio object's buffer\n * const audioLoader = new THREE.AudioLoader();\n * audioLoader.load( 'sounds/ambient.ogg', function( buffer ) {\n * \tsound.setBuffer( buffer );\n * \tsound.setLoop( true );\n * \tsound.setVolume( 0.5 );\n * \tsound.play();\n * });\n * ```\n *\n * @augments Object3D\n */\nclass Audio extends Object3D {\n\n\t/**\n\t * Constructs a new audio.\n\t *\n\t * @param {AudioListener} listener - The global audio listener.\n\t */\n\tconstructor( listener ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'Audio';\n\n\t\t/**\n\t\t * The global audio listener.\n\t\t *\n\t\t * @type {AudioListener}\n\t\t * @readonly\n\t\t */\n\t\tthis.listener = listener;\n\n\t\t/**\n\t\t * The audio context.\n\t\t *\n\t\t * @type {AudioContext}\n\t\t * @readonly\n\t\t */\n\t\tthis.context = listener.context;\n\n\t\t/**\n\t\t * The gain node used for volume control.\n\t\t *\n\t\t * @type {GainNode}\n\t\t * @readonly\n\t\t */\n\t\tthis.gain = this.context.createGain();\n\t\tthis.gain.connect( listener.getInput() );\n\n\t\t/**\n\t\t * Whether to start playback automatically or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.autoplay = false;\n\n\t\t/**\n\t\t * A reference to an audio buffer.\n\t\t *\n\t\t * Defined via {@link Audio#setBuffer}.\n\t\t *\n\t\t * @type {?AudioBuffer}\n\t\t * @default null\n\t\t * @readonly\n\t\t */\n\t\tthis.buffer = null;\n\n\t\t/**\n\t\t * Modify pitch, measured in cents. +/- 100 is a semitone.\n\t\t * +/- 1200 is an octave.\n\t\t *\n\t\t * Defined via {@link Audio#setDetune}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t * @readonly\n\t\t */\n\t\tthis.detune = 0;\n\n\t\t/**\n\t\t * Whether the audio should loop or not.\n\t\t *\n\t\t * Defined via {@link Audio#setLoop}.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t * @readonly\n\t\t */\n\t\tthis.loop = false;\n\n\t\t/**\n\t\t * Defines where in the audio buffer the replay should\n\t\t * start, in seconds.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.loopStart = 0;\n\n\t\t/**\n\t\t * Defines where in the audio buffer the replay should\n\t\t * stop, in seconds.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.loopEnd = 0;\n\n\t\t/**\n\t\t * An offset to the time within the audio buffer the playback\n\t\t * should begin, in seconds.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.offset = 0;\n\n\t\t/**\n\t\t * Overrides the default duration of the audio.\n\t\t *\n\t\t * @type {undefined|number}\n\t\t * @default undefined\n\t\t */\n\t\tthis.duration = undefined;\n\n\t\t/**\n\t\t * The playback speed.\n\t\t *\n\t\t * Defined via {@link Audio#setPlaybackRate}.\n\t\t *\n\t\t * @type {number}\n\t\t * @readonly\n\t\t * @default 1\n\t\t */\n\t\tthis.playbackRate = 1;\n\n\t\t/**\n\t\t * Indicates whether the audio is playing or not.\n\t\t *\n\t\t * This flag will be automatically set when using {@link Audio#play},\n\t\t * {@link Audio#pause}, {@link Audio#stop}.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default false\n\t\t */\n\t\tthis.isPlaying = false;\n\n\t\t/**\n\t\t * Indicates whether the audio playback can be controlled\n\t\t * with method like {@link Audio#play} or {@link Audio#pause}.\n\t\t *\n\t\t * This flag will be automatically set when audio sources are\n\t\t * defined.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.hasPlaybackControl = true;\n\n\t\t/**\n\t\t * Holds a reference to the current audio source.\n\t\t *\n\t\t * The property is automatically by one of the `set*()` methods.\n\t\t *\n\t\t * @type {?AudioNode}\n\t\t * @readonly\n\t\t * @default null\n\t\t */\n\t\tthis.source = null;\n\n\t\t/**\n\t\t * Defines the source type.\n\t\t *\n\t\t * The property is automatically by one of the `set*()` methods.\n\t\t *\n\t\t * @type {('empty'|'audioNode'|'mediaNode'|'mediaStreamNode'|'buffer')}\n\t\t * @readonly\n\t\t * @default 'empty'\n\t\t */\n\t\tthis.sourceType = 'empty';\n\n\t\tthis._startedAt = 0;\n\t\tthis._progress = 0;\n\t\tthis._connected = false;\n\n\t\t/**\n\t\t * Can be used to apply a variety of low-order filters to create\n\t\t * more complex sound effects e.g. via `BiquadFilterNode`.\n\t\t *\n\t\t * The property is automatically set by {@link Audio#setFilters}.\n\t\t *\n\t\t * @type {Array\u003cAudioNode\u003e}\n\t\t * @readonly\n\t\t */\n\t\tthis.filters = [];\n\n\t}\n\n\t/**\n\t * Returns the output audio node.\n\t *\n\t * @return {GainNode} The output node.\n\t */\n\tgetOutput() {\n\n\t\treturn this.gain;\n\n\t}\n\n\t/**\n\t * Sets the given audio node as the source of this instance.\n\t *\n\t * {@link Audio#sourceType} is set to `audioNode` and {@link Audio#hasPlaybackControl} to `false`.\n\t *\n\t * @param {AudioNode} audioNode - The audio node like an instance of `OscillatorNode`.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetNodeSource( audioNode ) {\n\n\t\tthis.hasPlaybackControl = false;\n\t\tthis.sourceType = 'audioNode';\n\t\tthis.source = audioNode;\n\t\tthis.connect();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given media element as the source of this instance.\n\t *\n\t * {@link Audio#sourceType} is set to `mediaNode` and {@link Audio#hasPlaybackControl} to `false`.\n\t *\n\t * @param {HTMLMediaElement} mediaElement - The media element.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetMediaElementSource( mediaElement ) {\n\n\t\tthis.hasPlaybackControl = false;\n\t\tthis.sourceType = 'mediaNode';\n\t\tthis.source = this.context.createMediaElementSource( mediaElement );\n\t\tthis.connect();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given media stream as the source of this instance.\n\t *\n\t * {@link Audio#sourceType} is set to `mediaStreamNode` and {@link Audio#hasPlaybackControl} to `false`.\n\t *\n\t * @param {MediaStream} mediaStream - The media stream.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetMediaStreamSource( mediaStream ) {\n\n\t\tthis.hasPlaybackControl = false;\n\t\tthis.sourceType = 'mediaStreamNode';\n\t\tthis.source = this.context.createMediaStreamSource( mediaStream );\n\t\tthis.connect();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given audio buffer as the source of this instance.\n\t *\n\t * {@link Audio#sourceType} is set to `buffer` and {@link Audio#hasPlaybackControl} to `true`.\n\t *\n\t * @param {AudioBuffer} audioBuffer - The audio buffer.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetBuffer( audioBuffer ) {\n\n\t\tthis.buffer = audioBuffer;\n\t\tthis.sourceType = 'buffer';\n\n\t\tif ( this.autoplay ) this.play();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Starts the playback of the audio.\n\t *\n\t * Can only be used with compatible audio sources that allow playback control.\n\t *\n\t * @param {number} [delay=0] - The delay, in seconds, at which the audio should start playing.\n\t * @return {Audio|undefined} A reference to this instance.\n\t */\n\tplay( delay = 0 ) {\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\twarn( 'Audio: Audio is already playing.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\twarn( 'Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis._startedAt = this.context.currentTime + delay;\n\n\t\tconst source = this.context.createBufferSource();\n\t\tsource.buffer = this.buffer;\n\t\tsource.loop = this.loop;\n\t\tsource.loopStart = this.loopStart;\n\t\tsource.loopEnd = this.loopEnd;\n\t\tsource.onended = this.onEnded.bind( this );\n\t\tsource.start( this._startedAt, this._progress + this.offset, this.duration );\n\n\t\tthis.isPlaying = true;\n\n\t\tthis.source = source;\n\n\t\tthis.setDetune( this.detune );\n\t\tthis.setPlaybackRate( this.playbackRate );\n\n\t\treturn this.connect();\n\n\t}\n\n\t/**\n\t * Pauses the playback of the audio.\n\t *\n\t * Can only be used with compatible audio sources that allow playback control.\n\t *\n\t * @return {Audio|undefined} A reference to this instance.\n\t */\n\tpause() {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\twarn( 'Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\t// update current progress\n\n\t\t\tthis._progress += Math.max( this.context.currentTime - this._startedAt, 0 ) * this.playbackRate;\n\n\t\t\tif ( this.loop === true ) {\n\n\t\t\t\t// ensure _progress does not exceed duration with looped audios\n\n\t\t\t\tthis._progress = this._progress % ( this.duration || this.buffer.duration );\n\n\t\t\t}\n\n\t\t\tthis.source.stop();\n\t\t\tthis.source.onended = null;\n\n\t\t\tthis.isPlaying = false;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Stops the playback of the audio.\n\t *\n\t * Can only be used with compatible audio sources that allow playback control.\n\t *\n\t * @param {number} [delay=0] - The delay, in seconds, at which the audio should stop playing.\n\t * @return {Audio|undefined} A reference to this instance.\n\t */\n\tstop( delay = 0 ) {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\twarn( 'Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis._progress = 0;\n\n\t\tif ( this.source !== null ) {\n\n\t\t\tthis.source.stop( this.context.currentTime + delay );\n\t\t\tthis.source.onended = null;\n\n\t\t}\n\n\t\tthis.isPlaying = false;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Connects to the audio source. This is used internally on\n\t * initialisation and when setting / removing filters.\n\t *\n\t * @return {Audio} A reference to this instance.\n\t */\n\tconnect() {\n\n\t\tif ( this.filters.length \u003e 0 ) {\n\n\t\t\tthis.source.connect( this.filters[ 0 ] );\n\n\t\t\tfor ( let i = 1, l = this.filters.length; i \u003c l; i ++ ) {\n\n\t\t\t\tthis.filters[ i - 1 ].connect( this.filters[ i ] );\n\n\t\t\t}\n\n\t\t\tthis.filters[ this.filters.length - 1 ].connect( this.getOutput() );\n\n\t\t} else {\n\n\t\t\tthis.source.connect( this.getOutput() );\n\n\t\t}\n\n\t\tthis._connected = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Disconnects to the audio source. This is used internally on\n\t * initialisation and when setting / removing filters.\n\t *\n\t * @return {Audio|undefined} A reference to this instance.\n\t */\n\tdisconnect() {\n\n\t\tif ( this._connected === false ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.filters.length \u003e 0 ) {\n\n\t\t\tthis.source.disconnect( this.filters[ 0 ] );\n\n\t\t\tfor ( let i = 1, l = this.filters.length; i \u003c l; i ++ ) {\n\n\t\t\t\tthis.filters[ i - 1 ].disconnect( this.filters[ i ] );\n\n\t\t\t}\n\n\t\t\tthis.filters[ this.filters.length - 1 ].disconnect( this.getOutput() );\n\n\t\t} else {\n\n\t\t\tthis.source.disconnect( this.getOutput() );\n\n\t\t}\n\n\t\tthis._connected = false;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the current set filters.\n\t *\n\t * @return {Array\u003cAudioNode\u003e} The list of filters.\n\t */\n\tgetFilters() {\n\n\t\treturn this.filters;\n\n\t}\n\n\t/**\n\t * Sets an array of filters and connects them with the audio source.\n\t *\n\t * @param {Array\u003cAudioNode\u003e} [value] - A list of filters.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetFilters( value ) {\n\n\t\tif ( ! value ) value = [];\n\n\t\tif ( this._connected === true ) {\n\n\t\t\tthis.disconnect();\n\t\t\tthis.filters = value.slice();\n\t\t\tthis.connect();\n\n\t\t} else {\n\n\t\t\tthis.filters = value.slice();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Defines the detuning of oscillation in cents.\n\t *\n\t * @param {number} value - The detuning of oscillation in cents.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetDetune( value ) {\n\n\t\tthis.detune = value;\n\n\t\tif ( this.isPlaying === true \u0026\u0026 this.source.detune !== undefined ) {\n\n\t\t\tthis.source.detune.setTargetAtTime( this.detune, this.context.currentTime, 0.01 );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the detuning of oscillation in cents.\n\t *\n\t * @return {number} The detuning of oscillation in cents.\n\t */\n\tgetDetune() {\n\n\t\treturn this.detune;\n\n\t}\n\n\t/**\n\t * Returns the first filter in the list of filters.\n\t *\n\t * @return {AudioNode|undefined} The first filter in the list of filters.\n\t */\n\tgetFilter() {\n\n\t\treturn this.getFilters()[ 0 ];\n\n\t}\n\n\t/**\n\t * Applies a single filter node to the audio.\n\t *\n\t * @param {AudioNode} [filter] - The filter to set.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetFilter( filter ) {\n\n\t\treturn this.setFilters( filter ? [ filter ] : [] );\n\n\t}\n\n\t/**\n\t * Sets the playback rate.\n\t *\n\t * Can only be used with compatible audio sources that allow playback control.\n\t *\n\t * @param {number} [value] - The playback rate to set.\n\t * @return {Audio|undefined} A reference to this instance.\n\t */\n\tsetPlaybackRate( value ) {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\twarn( 'Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis.playbackRate = value;\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\tthis.source.playbackRate.setTargetAtTime( this.playbackRate, this.context.currentTime, 0.01 );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the current playback rate.\n\n\t * @return {number} The playback rate.\n\t */\n\tgetPlaybackRate() {\n\n\t\treturn this.playbackRate;\n\n\t}\n\n\t/**\n\t * Automatically called when playback finished.\n\t */\n\tonEnded() {\n\n\t\tthis.isPlaying = false;\n\t\tthis._progress = 0;\n\n\t}\n\n\t/**\n\t * Returns the loop flag.\n\t *\n\t * Can only be used with compatible audio sources that allow playback control.\n\t *\n\t * @return {boolean} Whether the audio should loop or not.\n\t */\n\tgetLoop() {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\twarn( 'Audio: this Audio has no playback control.' );\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn this.loop;\n\n\t}\n\n\t/**\n\t * Sets the loop flag.\n\t *\n\t * Can only be used with compatible audio sources that allow playback control.\n\t *\n\t * @param {boolean} value - Whether the audio should loop or not.\n\t * @return {Audio|undefined} A reference to this instance.\n\t */\n\tsetLoop( value ) {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\twarn( 'Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis.loop = value;\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\tthis.source.loop = this.loop;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the loop start value which defines where in the audio buffer the replay should\n\t * start, in seconds.\n\t *\n\t * @param {number} value - The loop start value.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetLoopStart( value ) {\n\n\t\tthis.loopStart = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the loop end value which defines where in the audio buffer the replay should\n\t * stop, in seconds.\n\t *\n\t * @param {number} value - The loop end value.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetLoopEnd( value ) {\n\n\t\tthis.loopEnd = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the volume.\n\t *\n\t * @return {number} The volume.\n\t */\n\tgetVolume() {\n\n\t\treturn this.gain.gain.value;\n\n\t}\n\n\t/**\n\t * Sets the volume.\n\t *\n\t * @param {number} value - The volume to set.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetVolume( value ) {\n\n\t\tthis.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tif ( source.sourceType !== 'buffer' ) {\n\n\t\t\twarn( 'Audio: Audio source type cannot be copied.' );\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tthis.autoplay = source.autoplay;\n\n\t\tthis.buffer = source.buffer;\n\t\tthis.detune = source.detune;\n\t\tthis.loop = source.loop;\n\t\tthis.loopStart = source.loopStart;\n\t\tthis.loopEnd = source.loopEnd;\n\t\tthis.offset = source.offset;\n\t\tthis.duration = source.duration;\n\t\tthis.playbackRate = source.playbackRate;\n\t\tthis.hasPlaybackControl = source.hasPlaybackControl;\n\t\tthis.sourceType = source.sourceType;\n\n\t\tthis.filters = source.filters.slice();\n\n\t\treturn this;\n\n\t}\n\n\tclone( recursive ) {\n\n\t\treturn new this.constructor( this.listener ).copy( this, recursive );\n\n\t}\n\n}\n\nconst _position = /*@__PURE__*/ new Vector3();\nconst _quaternion = /*@__PURE__*/ new Quaternion();\nconst _scale = /*@__PURE__*/ new Vector3();\nconst _orientation = /*@__PURE__*/ new Vector3();\n\n/**\n * Represents a positional audio object.\n *\n * ```js\n * // create an AudioListener and add it to the camera\n * const listener = new THREE.AudioListener();\n * camera.add( listener );\n *\n * // create the PositionalAudio object (passing in the listener)\n * const sound = new THREE.PositionalAudio( listener );\n *\n * // load a sound and set it as the PositionalAudio object's buffer\n * const audioLoader = new THREE.AudioLoader();\n * audioLoader.load( 'sounds/song.ogg', function( buffer ) {\n * \tsound.setBuffer( buffer );\n * \tsound.setRefDistance( 20 );\n * \tsound.play();\n * });\n *\n * // create an object for the sound to play from\n * const sphere = new THREE.SphereGeometry( 20, 32, 16 );\n * const material = new THREE.MeshPhongMaterial( { color: 0xff2200 } );\n * const mesh = new THREE.Mesh( sphere, material );\n * scene.add( mesh );\n *\n * // finally add the sound to the mesh\n * mesh.add( sound );\n *\n * @augments Audio\n */\nclass PositionalAudio extends Audio {\n\n\t/**\n\t * Constructs a positional audio.\n\t *\n\t * @param {AudioListener} listener - The global audio listener.\n\t */\n\tconstructor( listener ) {\n\n\t\tsuper( listener );\n\n\t\t/**\n\t\t * The panner node represents the location, direction, and behavior of an audio\n\t\t * source in 3D space.\n\t\t *\n\t\t * @type {PannerNode}\n\t\t * @readonly\n\t\t */\n\t\tthis.panner = this.context.createPanner();\n\t\tthis.panner.panningModel = 'HRTF';\n\t\tthis.panner.connect( this.gain );\n\n\t}\n\n\tconnect() {\n\n\t\tsuper.connect();\n\n\t\tthis.panner.connect( this.gain );\n\n\t\treturn this;\n\n\t}\n\n\tdisconnect() {\n\n\t\tsuper.disconnect();\n\n\t\tthis.panner.disconnect( this.gain );\n\n\t\treturn this;\n\n\t}\n\n\tgetOutput() {\n\n\t\treturn this.panner;\n\n\t}\n\n\t/**\n\t * Returns the current reference distance.\n\t *\n\t * @return {number} The reference distance.\n\t */\n\tgetRefDistance() {\n\n\t\treturn this.panner.refDistance;\n\n\t}\n\n\t/**\n\t * Defines the reference distance for reducing volume as the audio source moves\n\t * further from the listener – i.e. the distance at which the volume reduction\n\t * starts taking effect.\n\t *\n\t * @param {number} value - The reference distance to set.\n\t * @return {PositionalAudio} A reference to this instance.\n\t */\n\tsetRefDistance( value ) {\n\n\t\tthis.panner.refDistance = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the current rolloff factor.\n\t *\n\t * @return {number} The rolloff factor.\n\t */\n\tgetRolloffFactor() {\n\n\t\treturn this.panner.rolloffFactor;\n\n\t}\n\n\t/**\n\t * Defines how quickly the volume is reduced as the source moves away from the listener.\n\t *\n\t * @param {number} value - The rolloff factor.\n\t * @return {PositionalAudio} A reference to this instance.\n\t */\n\tsetRolloffFactor( value ) {\n\n\t\tthis.panner.rolloffFactor = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the current distance model.\n\t *\n\t * @return {('linear'|'inverse'|'exponential')} The distance model.\n\t */\n\tgetDistanceModel() {\n\n\t\treturn this.panner.distanceModel;\n\n\t}\n\n\t/**\n\t * Defines which algorithm to use to reduce the volume of the audio source\n\t * as it moves away from the listener.\n\t *\n\t * Read [the spec](https://www.w3.org/TR/webaudio-1.1/#enumdef-distancemodeltype)\n\t * for more details.\n\t *\n\t * @param {('linear'|'inverse'|'exponential')} value - The distance model to set.\n\t * @return {PositionalAudio} A reference to this instance.\n\t */\n\tsetDistanceModel( value ) {\n\n\t\tthis.panner.distanceModel = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the current max distance.\n\t *\n\t * @return {number} The max distance.\n\t */\n\tgetMaxDistance() {\n\n\t\treturn this.panner.maxDistance;\n\n\t}\n\n\t/**\n\t * Defines the maximum distance between the audio source and the listener,\n\t * after which the volume is not reduced any further.\n\t *\n\t * This value is used only by the `linear` distance model.\n\t *\n\t * @param {number} value - The max distance.\n\t * @return {PositionalAudio} A reference to this instance.\n\t */\n\tsetMaxDistance( value ) {\n\n\t\tthis.panner.maxDistance = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the directional cone in which the audio can be listened.\n\t *\n\t * @param {number} coneInnerAngle - An angle, in degrees, of a cone inside of which there will be no volume reduction.\n\t * @param {number} coneOuterAngle - An angle, in degrees, of a cone outside of which the volume will be reduced by a constant value, defined by the `coneOuterGain` parameter.\n\t * @param {number} coneOuterGain - The amount of volume reduction outside the cone defined by the `coneOuterAngle`. When set to `0`, no sound can be heard.\n\t * @return {PositionalAudio} A reference to this instance.\n\t */\n\tsetDirectionalCone( coneInnerAngle, coneOuterAngle, coneOuterGain ) {\n\n\t\tthis.panner.coneInnerAngle = coneInnerAngle;\n\t\tthis.panner.coneOuterAngle = coneOuterAngle;\n\t\tthis.panner.coneOuterGain = coneOuterGain;\n\n\t\treturn this;\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tif ( this.hasPlaybackControl === true \u0026\u0026 this.isPlaying === false ) return;\n\n\t\tthis.matrixWorld.decompose( _position, _quaternion, _scale );\n\n\t\t_orientation.set( 0, 0, 1 ).applyQuaternion( _quaternion );\n\n\t\tconst panner = this.panner;\n\n\t\tif ( panner.positionX ) {\n\n\t\t\t// code path for Chrome and Firefox (see #14393)\n\n\t\t\tconst endTime = this.context.currentTime + this.listener.timeDelta;\n\n\t\t\tpanner.positionX.linearRampToValueAtTime( _position.x, endTime );\n\t\t\tpanner.positionY.linearRampToValueAtTime( _position.y, endTime );\n\t\t\tpanner.positionZ.linearRampToValueAtTime( _position.z, endTime );\n\t\t\tpanner.orientationX.linearRampToValueAtTime( _orientation.x, endTime );\n\t\t\tpanner.orientationY.linearRampToValueAtTime( _orientation.y, endTime );\n\t\t\tpanner.orientationZ.linearRampToValueAtTime( _orientation.z, endTime );\n\n\t\t} else {\n\n\t\t\tpanner.setPosition( _position.x, _position.y, _position.z );\n\t\t\tpanner.setOrientation( _orientation.x, _orientation.y, _orientation.z );\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * This class can be used to analyse audio data.\n *\n * ```js\n * // create an AudioListener and add it to the camera\n * const listener = new THREE.AudioListener();\n * camera.add( listener );\n *\n * // create an Audio source\n * const sound = new THREE.Audio( listener );\n *\n * // load a sound and set it as the Audio object's buffer\n * const audioLoader = new THREE.AudioLoader();\n * audioLoader.load( 'sounds/ambient.ogg', function( buffer ) {\n * \tsound.setBuffer( buffer );\n * \tsound.setLoop(true);\n * \tsound.setVolume(0.5);\n * \tsound.play();\n * });\n *\n * // create an AudioAnalyser, passing in the sound and desired fftSize\n * const analyser = new THREE.AudioAnalyser( sound, 32 );\n *\n * // get the average frequency of the sound\n * const data = analyser.getAverageFrequency();\n * ```\n */\nclass AudioAnalyser {\n\n\t/**\n\t * Constructs a new audio analyzer.\n\t *\n\t * @param {Audio} audio - The audio to analyze.\n\t * @param {number} [fftSize=2048] - The window size in samples that is used when performing a Fast Fourier Transform (FFT) to get frequency domain data.\n\t */\n\tconstructor( audio, fftSize = 2048 ) {\n\n\t\t/**\n\t\t * The global audio listener.\n\t\t *\n\t\t * @type {AnalyserNode}\n\t\t */\n\t\tthis.analyser = audio.context.createAnalyser();\n\t\tthis.analyser.fftSize = fftSize;\n\n\t\t/**\n\t\t * Holds the analyzed data.\n\t\t *\n\t\t * @type {Uint8Array}\n\t\t */\n\t\tthis.data = new Uint8Array( this.analyser.frequencyBinCount );\n\n\t\taudio.getOutput().connect( this.analyser );\n\n\t}\n\n\t/**\n\t * Returns an array with frequency data of the audio.\n\t *\n\t * Each item in the array represents the decibel value for a specific frequency.\n\t * The frequencies are spread linearly from 0 to 1/2 of the sample rate.\n\t * For example, for 48000 sample rate, the last item of the array will represent\n\t * the decibel value for 24000 Hz.\n\t *\n\t * @return {Uint8Array} The frequency data.\n\t */\n\tgetFrequencyData() {\n\n\t\tthis.analyser.getByteFrequencyData( this.data );\n\n\t\treturn this.data;\n\n\t}\n\n\t/**\n\t * Returns the average of the frequencies returned by {@link AudioAnalyser#getFrequencyData}.\n\t *\n\t * @return {number} The average frequency.\n\t */\n\tgetAverageFrequency() {\n\n\t\tlet value = 0;\n\t\tconst data = this.getFrequencyData();\n\n\t\tfor ( let i = 0; i \u003c data.length; i ++ ) {\n\n\t\t\tvalue += data[ i ];\n\n\t\t}\n\n\t\treturn value / data.length;\n\n\t}\n\n}\n\n/**\n * Buffered scene graph property that allows weighted accumulation; used internally.\n */\nclass PropertyMixer {\n\n\t/**\n\t * Constructs a new property mixer.\n\t *\n\t * @param {PropertyBinding} binding - The property binding.\n\t * @param {string} typeName - The keyframe track type name.\n\t * @param {number} valueSize - The keyframe track value size.\n\t */\n\tconstructor( binding, typeName, valueSize ) {\n\n\t\t/**\n\t\t * The property binding.\n\t\t *\n\t\t * @type {PropertyBinding}\n\t\t */\n\t\tthis.binding = binding;\n\n\t\t/**\n\t\t * The keyframe track value size.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.valueSize = valueSize;\n\n\t\tlet mixFunction,\n\t\t\tmixFunctionAdditive,\n\t\t\tsetIdentity;\n\n\t\t// buffer layout: [ incoming | accu0 | accu1 | orig | addAccu | (optional work) ]\n\t\t//\n\t\t// interpolators can use .buffer as their .result\n\t\t// the data then goes to 'incoming'\n\t\t//\n\t\t// 'accu0' and 'accu1' are used frame-interleaved for\n\t\t// the cumulative result and are compared to detect\n\t\t// changes\n\t\t//\n\t\t// 'orig' stores the original state of the property\n\t\t//\n\t\t// 'add' is used for additive cumulative results\n\t\t//\n\t\t// 'work' is optional and is only present for quaternion types. It is used\n\t\t// to store intermediate quaternion multiplication results\n\n\t\tswitch ( typeName ) {\n\n\t\t\tcase 'quaternion':\n\t\t\t\tmixFunction = this._slerp;\n\t\t\t\tmixFunctionAdditive = this._slerpAdditive;\n\t\t\t\tsetIdentity = this._setAdditiveIdentityQuaternion;\n\n\t\t\t\tthis.buffer = new Float64Array( valueSize * 6 );\n\t\t\t\tthis._workIndex = 5;\n\t\t\t\tbreak;\n\n\t\t\tcase 'string':\n\t\t\tcase 'bool':\n\t\t\t\tmixFunction = this._select;\n\n\t\t\t\t// Use the regular mix function and for additive on these types,\n\t\t\t\t// additive is not relevant for non-numeric types\n\t\t\t\tmixFunctionAdditive = this._select;\n\n\t\t\t\tsetIdentity = this._setAdditiveIdentityOther;\n\n\t\t\t\tthis.buffer = new Array( valueSize * 5 );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tmixFunction = this._lerp;\n\t\t\t\tmixFunctionAdditive = this._lerpAdditive;\n\t\t\t\tsetIdentity = this._setAdditiveIdentityNumeric;\n\n\t\t\t\tthis.buffer = new Float64Array( valueSize * 5 );\n\n\t\t}\n\n\t\tthis._mixBufferRegion = mixFunction;\n\t\tthis._mixBufferRegionAdditive = mixFunctionAdditive;\n\t\tthis._setIdentity = setIdentity;\n\t\tthis._origIndex = 3;\n\t\tthis._addIndex = 4;\n\n\t\t/**\n\t\t * TODO\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.cumulativeWeight = 0;\n\n\t\t/**\n\t\t * TODO\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.cumulativeWeightAdditive = 0;\n\n\t\t/**\n\t\t * TODO\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.useCount = 0;\n\n\t\t/**\n\t\t * TODO\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.referenceCount = 0;\n\n\t}\n\n\t/**\n\t * Accumulates data in the `incoming` region into `accu\u003ci\u003e`.\n\t *\n\t * @param {number} accuIndex - The accumulation index.\n\t * @param {number} weight - The weight.\n\t */\n\taccumulate( accuIndex, weight ) {\n\n\t\t// note: happily accumulating nothing when weight = 0, the caller knows\n\t\t// the weight and shouldn't have made the call in the first place\n\n\t\tconst buffer = this.buffer,\n\t\t\tstride = this.valueSize,\n\t\t\toffset = accuIndex * stride + stride;\n\n\t\tlet currentWeight = this.cumulativeWeight;\n\n\t\tif ( currentWeight === 0 ) {\n\n\t\t\t// accuN := incoming * weight\n\n\t\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\t\tbuffer[ offset + i ] = buffer[ i ];\n\n\t\t\t}\n\n\t\t\tcurrentWeight = weight;\n\n\t\t} else {\n\n\t\t\t// accuN := accuN + incoming * weight\n\n\t\t\tcurrentWeight += weight;\n\t\t\tconst mix = weight / currentWeight;\n\t\t\tthis._mixBufferRegion( buffer, offset, 0, mix, stride );\n\n\t\t}\n\n\t\tthis.cumulativeWeight = currentWeight;\n\n\t}\n\n\t/**\n\t * Accumulates data in the `incoming` region into `add`.\n\t *\n\t * @param {number} weight - The weight.\n\t */\n\taccumulateAdditive( weight ) {\n\n\t\tconst buffer = this.buffer,\n\t\t\tstride = this.valueSize,\n\t\t\toffset = stride * this._addIndex;\n\n\t\tif ( this.cumulativeWeightAdditive === 0 ) {\n\n\t\t\t// add = identity\n\n\t\t\tthis._setIdentity();\n\n\t\t}\n\n\t\t// add := add + incoming * weight\n\n\t\tthis._mixBufferRegionAdditive( buffer, offset, 0, weight, stride );\n\t\tthis.cumulativeWeightAdditive += weight;\n\n\t}\n\n\t/**\n\t * Applies the state of `accu\u003ci\u003e` to the binding when accus differ.\n\t *\n\t * @param {number} accuIndex - The accumulation index.\n\t */\n\tapply( accuIndex ) {\n\n\t\tconst stride = this.valueSize,\n\t\t\tbuffer = this.buffer,\n\t\t\toffset = accuIndex * stride + stride,\n\n\t\t\tweight = this.cumulativeWeight,\n\t\t\tweightAdditive = this.cumulativeWeightAdditive,\n\n\t\t\tbinding = this.binding;\n\n\t\tthis.cumulativeWeight = 0;\n\t\tthis.cumulativeWeightAdditive = 0;\n\n\t\tif ( weight \u003c 1 ) {\n\n\t\t\t// accuN := accuN + original * ( 1 - cumulativeWeight )\n\n\t\t\tconst originalValueOffset = stride * this._origIndex;\n\n\t\t\tthis._mixBufferRegion(\n\t\t\t\tbuffer, offset, originalValueOffset, 1 - weight, stride );\n\n\t\t}\n\n\t\tif ( weightAdditive \u003e 0 ) {\n\n\t\t\t// accuN := accuN + additive accuN\n\n\t\t\tthis._mixBufferRegionAdditive( buffer, offset, this._addIndex * stride, 1, stride );\n\n\t\t}\n\n\t\tfor ( let i = stride, e = stride + stride; i !== e; ++ i ) {\n\n\t\t\tif ( buffer[ i ] !== buffer[ i + stride ] ) {\n\n\t\t\t\t// value has changed -\u003e update scene graph\n\n\t\t\t\tbinding.setValue( buffer, offset );\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\n\t/**\n\t * Remembers the state of the bound property and copy it to both accus.\n\t */\n\tsaveOriginalState() {\n\n\t\tconst binding = this.binding;\n\n\t\tconst buffer = this.buffer,\n\t\t\tstride = this.valueSize,\n\n\t\t\toriginalValueOffset = stride * this._origIndex;\n\n\t\tbinding.getValue( buffer, originalValueOffset );\n\n\t\t// accu[0..1] := orig -- initially detect changes against the original\n\t\tfor ( let i = stride, e = originalValueOffset; i !== e; ++ i ) {\n\n\t\t\tbuffer[ i ] = buffer[ originalValueOffset + ( i % stride ) ];\n\n\t\t}\n\n\t\t// Add to identity for additive\n\t\tthis._setIdentity();\n\n\t\tthis.cumulativeWeight = 0;\n\t\tthis.cumulativeWeightAdditive = 0;\n\n\t}\n\n\t/**\n\t * Applies the state previously taken via {@link PropertyMixer#saveOriginalState} to the binding.\n\t */\n\trestoreOriginalState() {\n\n\t\tconst originalValueOffset = this.valueSize * 3;\n\t\tthis.binding.setValue( this.buffer, originalValueOffset );\n\n\t}\n\n\t// internals\n\n\t_setAdditiveIdentityNumeric() {\n\n\t\tconst startIndex = this._addIndex * this.valueSize;\n\t\tconst endIndex = startIndex + this.valueSize;\n\n\t\tfor ( let i = startIndex; i \u003c endIndex; i ++ ) {\n\n\t\t\tthis.buffer[ i ] = 0;\n\n\t\t}\n\n\t}\n\n\t_setAdditiveIdentityQuaternion() {\n\n\t\tthis._setAdditiveIdentityNumeric();\n\t\tthis.buffer[ this._addIndex * this.valueSize + 3 ] = 1;\n\n\t}\n\n\t_setAdditiveIdentityOther() {\n\n\t\tconst startIndex = this._origIndex * this.valueSize;\n\t\tconst targetIndex = this._addIndex * this.valueSize;\n\n\t\tfor ( let i = 0; i \u003c this.valueSize; i ++ ) {\n\n\t\t\tthis.buffer[ targetIndex + i ] = this.buffer[ startIndex + i ];\n\n\t\t}\n\n\t}\n\n\n\t// mix functions\n\n\t_select( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tif ( t \u003e= 0.5 ) {\n\n\t\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\t\tbuffer[ dstOffset + i ] = buffer[ srcOffset + i ];\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_slerp( buffer, dstOffset, srcOffset, t ) {\n\n\t\tQuaternion.slerpFlat( buffer, dstOffset, buffer, dstOffset, buffer, srcOffset, t );\n\n\t}\n\n\t_slerpAdditive( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tconst workOffset = this._workIndex * stride;\n\n\t\t// Store result in intermediate buffer offset\n\t\tQuaternion.multiplyQuaternionsFlat( buffer, workOffset, buffer, dstOffset, buffer, srcOffset );\n\n\t\t// Slerp to the intermediate result\n\t\tQuaternion.slerpFlat( buffer, dstOffset, buffer, dstOffset, buffer, workOffset, t );\n\n\t}\n\n\t_lerp( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tconst s = 1 - t;\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tconst j = dstOffset + i;\n\n\t\t\tbuffer[ j ] = buffer[ j ] * s + buffer[ srcOffset + i ] * t;\n\n\t\t}\n\n\t}\n\n\t_lerpAdditive( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tconst j = dstOffset + i;\n\n\t\t\tbuffer[ j ] = buffer[ j ] + buffer[ srcOffset + i ] * t;\n\n\t\t}\n\n\t}\n\n}\n\n// Characters [].:/ are reserved for track binding syntax.\nconst _RESERVED_CHARS_RE = '\\\\[\\\\]\\\\.:\\\\/';\nconst _reservedRe = new RegExp( '[' + _RESERVED_CHARS_RE + ']', 'g' );\n\n// Attempts to allow node names from any language. ES5's `\\w` regexp matches\n// only latin characters, and the unicode \\p{L} is not yet supported. So\n// instead, we exclude reserved characters and match everything else.\nconst _wordChar = '[^' + _RESERVED_CHARS_RE + ']';\nconst _wordCharOrDot = '[^' + _RESERVED_CHARS_RE.replace( '\\\\.', '' ) + ']';\n\n// Parent directories, delimited by '/' or ':'. Currently unused, but must\n// be matched to parse the rest of the track name.\nconst _directoryRe = /*@__PURE__*/ /((?:WC+[\\/:])*)/.source.replace( 'WC', _wordChar );\n\n// Target node. May contain word characters (a-zA-Z0-9_) and '.' or '-'.\nconst _nodeRe = /*@__PURE__*/ /(WCOD+)?/.source.replace( 'WCOD', _wordCharOrDot );\n\n// Object on target node, and accessor. May not contain reserved\n// characters. Accessor may contain any character except closing bracket.\nconst _objectRe = /*@__PURE__*/ /(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace( 'WC', _wordChar );\n\n// Property and accessor. May not contain reserved characters. Accessor may\n// contain any non-bracket characters.\nconst _propertyRe = /*@__PURE__*/ /\\.(WC+)(?:\\[(.+)\\])?/.source.replace( 'WC', _wordChar );\n\nconst _trackRe = new RegExp( ''\n\t+ '^'\n\t+ _directoryRe\n\t+ _nodeRe\n\t+ _objectRe\n\t+ _propertyRe\n\t+ '$'\n);\n\nconst _supportedObjectNames = [ 'material', 'materials', 'bones', 'map' ];\n\nclass Composite {\n\n\tconstructor( targetGroup, path, optionalParsedPath ) {\n\n\t\tconst parsedPath = optionalParsedPath || PropertyBinding.parseTrackName( path );\n\n\t\tthis._targetGroup = targetGroup;\n\t\tthis._bindings = targetGroup.subscribe_( path, parsedPath );\n\n\t}\n\n\tgetValue( array, offset ) {\n\n\t\tthis.bind(); // bind all binding\n\n\t\tconst firstValidIndex = this._targetGroup.nCachedObjects_,\n\t\t\tbinding = this._bindings[ firstValidIndex ];\n\n\t\t// and only call .getValue on the first\n\t\tif ( binding !== undefined ) binding.getValue( array, offset );\n\n\t}\n\n\tsetValue( array, offset ) {\n\n\t\tconst bindings = this._bindings;\n\n\t\tfor ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tbindings[ i ].setValue( array, offset );\n\n\t\t}\n\n\t}\n\n\tbind() {\n\n\t\tconst bindings = this._bindings;\n\n\t\tfor ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tbindings[ i ].bind();\n\n\t\t}\n\n\t}\n\n\tunbind() {\n\n\t\tconst bindings = this._bindings;\n\n\t\tfor ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tbindings[ i ].unbind();\n\n\t\t}\n\n\t}\n\n}\n\n// Note: This class uses a State pattern on a per-method basis:\n// 'bind' sets 'this.getValue' / 'setValue' and shadows the\n// prototype version of these methods with one that represents\n// the bound state. When the property is not found, the methods\n// become no-ops.\n\n\n/**\n * This holds a reference to a real property in the scene graph; used internally.\n */\nclass PropertyBinding {\n\n\t/**\n\t * Constructs a new property binding.\n\t *\n\t * @param {Object} rootNode - The root node.\n\t * @param {string} path - The path.\n\t * @param {?Object} [parsedPath] - The parsed path.\n\t */\n\tconstructor( rootNode, path, parsedPath ) {\n\n\t\t/**\n\t\t * The object path to the animated property.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.path = path;\n\n\t\t/**\n\t\t * An object holding information about the path.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parsedPath = parsedPath || PropertyBinding.parseTrackName( path );\n\n\t\t/**\n\t\t * The object owns the animated property.\n\t\t *\n\t\t * @type {?Object}\n\t\t */\n\t\tthis.node = PropertyBinding.findNode( rootNode, this.parsedPath.nodeName );\n\n\t\t/**\n\t\t * The root node.\n\t\t *\n\t\t * @type {Object3D|Skeleton}\n\t\t */\n\t\tthis.rootNode = rootNode;\n\n\t\t// initial state of these methods that calls 'bind'\n\t\tthis.getValue = this._getValue_unbound;\n\t\tthis.setValue = this._setValue_unbound;\n\n\t}\n\n\n\t/**\n\t * Factory method for creating a property binding from the given parameters.\n\t *\n\t * @static\n\t * @param {Object} root - The root node.\n\t * @param {string} path - The path.\n\t * @param {?Object} [parsedPath] - The parsed path.\n\t * @return {PropertyBinding|Composite} The created property binding or composite.\n\t */\n\tstatic create( root, path, parsedPath ) {\n\n\t\tif ( ! ( root \u0026\u0026 root.isAnimationObjectGroup ) ) {\n\n\t\t\treturn new PropertyBinding( root, path, parsedPath );\n\n\t\t} else {\n\n\t\t\treturn new PropertyBinding.Composite( root, path, parsedPath );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Replaces spaces with underscores and removes unsupported characters from\n\t * node names, to ensure compatibility with parseTrackName().\n\t *\n\t * @param {string} name - Node name to be sanitized.\n\t * @return {string} The sanitized node name.\n\t */\n\tstatic sanitizeNodeName( name ) {\n\n\t\treturn name.replace( /\\s/g, '_' ).replace( _reservedRe, '' );\n\n\t}\n\n\t/**\n\t * Parses the given track name (an object path to an animated property) and\n\t * returns an object with information about the path. Matches strings in the following forms:\n\t *\n\t * - nodeName.property\n\t * - nodeName.property[accessor]\n\t * - nodeName.material.property[accessor]\n\t * - uuid.property[accessor]\n\t * - uuid.objectName[objectIndex].propertyName[propertyIndex]\n\t * - parentName/nodeName.property\n\t * - parentName/parentName/nodeName.property[index]\n\t * - .bone[Armature.DEF_cog].position\n\t * - scene:helium_balloon_model:helium_balloon_model.position\n\t *\n\t * @static\n\t * @param {string} trackName - The track name to parse.\n\t * @return {Object} The parsed track name as an object.\n\t */\n\tstatic parseTrackName( trackName ) {\n\n\t\tconst matches = _trackRe.exec( trackName );\n\n\t\tif ( matches === null ) {\n\n\t\t\tthrow new Error( 'PropertyBinding: Cannot parse trackName: ' + trackName );\n\n\t\t}\n\n\t\tconst results = {\n\t\t\t// directoryName: matches[ 1 ], // (tschw) currently unused\n\t\t\tnodeName: matches[ 2 ],\n\t\t\tobjectName: matches[ 3 ],\n\t\t\tobjectIndex: matches[ 4 ],\n\t\t\tpropertyName: matches[ 5 ], // required\n\t\t\tpropertyIndex: matches[ 6 ]\n\t\t};\n\n\t\tconst lastDot = results.nodeName \u0026\u0026 results.nodeName.lastIndexOf( '.' );\n\n\t\tif ( lastDot !== undefined \u0026\u0026 lastDot !== -1 ) {\n\n\t\t\tconst objectName = results.nodeName.substring( lastDot + 1 );\n\n\t\t\t// Object names must be checked against an allowlist. Otherwise, there\n\t\t\t// is no way to parse 'foo.bar.baz': 'baz' must be a property, but\n\t\t\t// 'bar' could be the objectName, or part of a nodeName (which can\n\t\t\t// include '.' characters).\n\t\t\tif ( _supportedObjectNames.indexOf( objectName ) !== -1 ) {\n\n\t\t\t\tresults.nodeName = results.nodeName.substring( 0, lastDot );\n\t\t\t\tresults.objectName = objectName;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( results.propertyName === null || results.propertyName.length === 0 ) {\n\n\t\t\tthrow new Error( 'PropertyBinding: can not parse propertyName from trackName: ' + trackName );\n\n\t\t}\n\n\t\treturn results;\n\n\t}\n\n\t/**\n\t * Searches for a node in the hierarchy of the given root object by the given\n\t * node name.\n\t *\n\t * @static\n\t * @param {Object} root - The root object.\n\t * @param {string|number} nodeName - The name of the node.\n\t * @return {?Object} The found node. Returns `null` if no object was found.\n\t */\n\tstatic findNode( root, nodeName ) {\n\n\t\tif ( nodeName === undefined || nodeName === '' || nodeName === '.' || nodeName === -1 || nodeName === root.name || nodeName === root.uuid ) {\n\n\t\t\treturn root;\n\n\t\t}\n\n\t\t// search into skeleton bones.\n\t\tif ( root.skeleton ) {\n\n\t\t\tconst bone = root.skeleton.getBoneByName( nodeName );\n\n\t\t\tif ( bone !== undefined ) {\n\n\t\t\t\treturn bone;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// search into node subtree.\n\t\tif ( root.children ) {\n\n\t\t\tconst searchNodeSubtree = function ( children ) {\n\n\t\t\t\tfor ( let i = 0; i \u003c children.length; i ++ ) {\n\n\t\t\t\t\tconst childNode = children[ i ];\n\n\t\t\t\t\tif ( childNode.name === nodeName || childNode.uuid === nodeName ) {\n\n\t\t\t\t\t\treturn childNode;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst result = searchNodeSubtree( childNode.children );\n\n\t\t\t\t\tif ( result ) return result;\n\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\n\t\t\t};\n\n\t\t\tconst subTreeNode = searchNodeSubtree( root.children );\n\n\t\t\tif ( subTreeNode ) {\n\n\t\t\t\treturn subTreeNode;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\t// these are used to \"bind\" a nonexistent property\n\t_getValue_unavailable() {}\n\t_setValue_unavailable() {}\n\n\t// Getters\n\n\t_getValue_direct( buffer, offset ) {\n\n\t\tbuffer[ offset ] = this.targetObject[ this.propertyName ];\n\n\t}\n\n\t_getValue_array( buffer, offset ) {\n\n\t\tconst source = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = source.length; i !== n; ++ i ) {\n\n\t\t\tbuffer[ offset ++ ] = source[ i ];\n\n\t\t}\n\n\t}\n\n\t_getValue_arrayElement( buffer, offset ) {\n\n\t\tbuffer[ offset ] = this.resolvedProperty[ this.propertyIndex ];\n\n\t}\n\n\t_getValue_toArray( buffer, offset ) {\n\n\t\tthis.resolvedProperty.toArray( buffer, offset );\n\n\t}\n\n\t// Direct\n\n\t_setValue_direct( buffer, offset ) {\n\n\t\tthis.targetObject[ this.propertyName ] = buffer[ offset ];\n\n\t}\n\n\t_setValue_direct_setNeedsUpdate( buffer, offset ) {\n\n\t\tthis.targetObject[ this.propertyName ] = buffer[ offset ];\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_direct_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tthis.targetObject[ this.propertyName ] = buffer[ offset ];\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t// EntireArray\n\n\t_setValue_array( buffer, offset ) {\n\n\t\tconst dest = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = dest.length; i !== n; ++ i ) {\n\n\t\t\tdest[ i ] = buffer[ offset ++ ];\n\n\t\t}\n\n\t}\n\n\t_setValue_array_setNeedsUpdate( buffer, offset ) {\n\n\t\tconst dest = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = dest.length; i !== n; ++ i ) {\n\n\t\t\tdest[ i ] = buffer[ offset ++ ];\n\n\t\t}\n\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_array_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tconst dest = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = dest.length; i !== n; ++ i ) {\n\n\t\t\tdest[ i ] = buffer[ offset ++ ];\n\n\t\t}\n\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t// ArrayElement\n\n\t_setValue_arrayElement( buffer, offset ) {\n\n\t\tthis.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];\n\n\t}\n\n\t_setValue_arrayElement_setNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_arrayElement_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t// HasToFromArray\n\n\t_setValue_fromArray( buffer, offset ) {\n\n\t\tthis.resolvedProperty.fromArray( buffer, offset );\n\n\t}\n\n\t_setValue_fromArray_setNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty.fromArray( buffer, offset );\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_fromArray_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty.fromArray( buffer, offset );\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t_getValue_unbound( targetArray, offset ) {\n\n\t\tthis.bind();\n\t\tthis.getValue( targetArray, offset );\n\n\t}\n\n\t_setValue_unbound( sourceArray, offset ) {\n\n\t\tthis.bind();\n\t\tthis.setValue( sourceArray, offset );\n\n\t}\n\n\t/**\n\t * Creates a getter / setter pair for the property tracked by this binding.\n\t */\n\tbind() {\n\n\t\tlet targetObject = this.node;\n\t\tconst parsedPath = this.parsedPath;\n\n\t\tconst objectName = parsedPath.objectName;\n\t\tconst propertyName = parsedPath.propertyName;\n\t\tlet propertyIndex = parsedPath.propertyIndex;\n\n\t\tif ( ! targetObject ) {\n\n\t\t\ttargetObject = PropertyBinding.findNode( this.rootNode, parsedPath.nodeName );\n\n\t\t\tthis.node = targetObject;\n\n\t\t}\n\n\t\t// set fail state so we can just 'return' on error\n\t\tthis.getValue = this._getValue_unavailable;\n\t\tthis.setValue = this._setValue_unavailable;\n\n\t\t// ensure there is a value node\n\t\tif ( ! targetObject ) {\n\n\t\t\twarn( 'PropertyBinding: No target node found for track: ' + this.path + '.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( objectName ) {\n\n\t\t\tlet objectIndex = parsedPath.objectIndex;\n\n\t\t\t// special cases were we need to reach deeper into the hierarchy to get the face materials....\n\t\t\tswitch ( objectName ) {\n\n\t\t\t\tcase 'materials':\n\n\t\t\t\t\tif ( ! targetObject.material ) {\n\n\t\t\t\t\t\terror( 'PropertyBinding: Can not bind to material as node does not have a material.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! targetObject.material.materials ) {\n\n\t\t\t\t\t\terror( 'PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttargetObject = targetObject.material.materials;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'bones':\n\n\t\t\t\t\tif ( ! targetObject.skeleton ) {\n\n\t\t\t\t\t\terror( 'PropertyBinding: Can not bind to bones as node does not have a skeleton.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// potential future optimization: skip this if propertyIndex is already an integer\n\t\t\t\t\t// and convert the integer string to a true integer.\n\n\t\t\t\t\ttargetObject = targetObject.skeleton.bones;\n\n\t\t\t\t\t// support resolving morphTarget names into indices.\n\t\t\t\t\tfor ( let i = 0; i \u003c targetObject.length; i ++ ) {\n\n\t\t\t\t\t\tif ( targetObject[ i ].name === objectIndex ) {\n\n\t\t\t\t\t\t\tobjectIndex = i;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'map':\n\n\t\t\t\t\tif ( 'map' in targetObject ) {\n\n\t\t\t\t\t\ttargetObject = targetObject.map;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! targetObject.material ) {\n\n\t\t\t\t\t\terror( 'PropertyBinding: Can not bind to material as node does not have a material.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! targetObject.material.map ) {\n\n\t\t\t\t\t\terror( 'PropertyBinding: Can not bind to material.map as node.material does not have a map.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttargetObject = targetObject.material.map;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tif ( targetObject[ objectName ] === undefined ) {\n\n\t\t\t\t\t\terror( 'PropertyBinding: Can not bind to objectName of node undefined.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttargetObject = targetObject[ objectName ];\n\n\t\t\t}\n\n\n\t\t\tif ( objectIndex !== undefined ) {\n\n\t\t\t\tif ( targetObject[ objectIndex ] === undefined ) {\n\n\t\t\t\t\terror( 'PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.', this, targetObject );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\ttargetObject = targetObject[ objectIndex ];\n\n\t\t\t}\n\n\t\t}\n\n\t\t// resolve property\n\t\tconst nodeProperty = targetObject[ propertyName ];\n\n\t\tif ( nodeProperty === undefined ) {\n\n\t\t\tconst nodeName = parsedPath.nodeName;\n\n\t\t\terror( 'PropertyBinding: Trying to update property for track: ' + nodeName +\n\t\t\t\t'.' + propertyName + ' but it wasn\\'t found.', targetObject );\n\t\t\treturn;\n\n\t\t}\n\n\t\t// determine versioning scheme\n\t\tlet versioning = this.Versioning.None;\n\n\t\tthis.targetObject = targetObject;\n\n\t\tif ( targetObject.isMaterial === true ) {\n\n\t\t\tversioning = this.Versioning.NeedsUpdate;\n\n\t\t} else if ( targetObject.isObject3D === true ) {\n\n\t\t\tversioning = this.Versioning.MatrixWorldNeedsUpdate;\n\n\t\t}\n\n\t\t// determine how the property gets bound\n\t\tlet bindingType = this.BindingType.Direct;\n\n\t\tif ( propertyIndex !== undefined ) {\n\n\t\t\t// access a sub element of the property array (only primitives are supported right now)\n\n\t\t\tif ( propertyName === 'morphTargetInfluences' ) {\n\n\t\t\t\t// potential optimization, skip this if propertyIndex is already an integer, and convert the integer string to a true integer.\n\n\t\t\t\t// support resolving morphTarget names into indices.\n\t\t\t\tif ( ! targetObject.geometry ) {\n\n\t\t\t\t\terror( 'PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.', this );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tif ( ! targetObject.geometry.morphAttributes ) {\n\n\t\t\t\t\terror( 'PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.', this );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tif ( targetObject.morphTargetDictionary[ propertyIndex ] !== undefined ) {\n\n\t\t\t\t\tpropertyIndex = targetObject.morphTargetDictionary[ propertyIndex ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbindingType = this.BindingType.ArrayElement;\n\n\t\t\tthis.resolvedProperty = nodeProperty;\n\t\t\tthis.propertyIndex = propertyIndex;\n\n\t\t} else if ( nodeProperty.fromArray !== undefined \u0026\u0026 nodeProperty.toArray !== undefined ) {\n\n\t\t\t// must use copy for Object3D.Euler/Quaternion\n\n\t\t\tbindingType = this.BindingType.HasFromToArray;\n\n\t\t\tthis.resolvedProperty = nodeProperty;\n\n\t\t} else if ( Array.isArray( nodeProperty ) ) {\n\n\t\t\tbindingType = this.BindingType.EntireArray;\n\n\t\t\tthis.resolvedProperty = nodeProperty;\n\n\t\t} else {\n\n\t\t\tthis.propertyName = propertyName;\n\n\t\t}\n\n\t\t// select getter / setter\n\t\tthis.getValue = this.GetterByBindingType[ bindingType ];\n\t\tthis.setValue = this.SetterByBindingTypeAndVersioning[ bindingType ][ versioning ];\n\n\t}\n\n\t/**\n\t * Unbinds the property.\n\t */\n\tunbind() {\n\n\t\tthis.node = null;\n\n\t\t// back to the prototype version of getValue / setValue\n\t\t// note: avoiding to mutate the shape of 'this' via 'delete'\n\t\tthis.getValue = this._getValue_unbound;\n\t\tthis.setValue = this._setValue_unbound;\n\n\t}\n\n}\n\nPropertyBinding.Composite = Composite;\n\nPropertyBinding.prototype.BindingType = {\n\tDirect: 0,\n\tEntireArray: 1,\n\tArrayElement: 2,\n\tHasFromToArray: 3\n};\n\nPropertyBinding.prototype.Versioning = {\n\tNone: 0,\n\tNeedsUpdate: 1,\n\tMatrixWorldNeedsUpdate: 2\n};\n\nPropertyBinding.prototype.GetterByBindingType = [\n\n\tPropertyBinding.prototype._getValue_direct,\n\tPropertyBinding.prototype._getValue_array,\n\tPropertyBinding.prototype._getValue_arrayElement,\n\tPropertyBinding.prototype._getValue_toArray,\n\n];\n\nPropertyBinding.prototype.SetterByBindingTypeAndVersioning = [\n\n\t[\n\t\t// Direct\n\t\tPropertyBinding.prototype._setValue_direct,\n\t\tPropertyBinding.prototype._setValue_direct_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate,\n\n\t], [\n\n\t\t// EntireArray\n\n\t\tPropertyBinding.prototype._setValue_array,\n\t\tPropertyBinding.prototype._setValue_array_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate,\n\n\t], [\n\n\t\t// ArrayElement\n\t\tPropertyBinding.prototype._setValue_arrayElement,\n\t\tPropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate,\n\n\t], [\n\n\t\t// HasToFromArray\n\t\tPropertyBinding.prototype._setValue_fromArray,\n\t\tPropertyBinding.prototype._setValue_fromArray_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate,\n\n\t]\n\n];\n\n/**\n * A group of objects that receives a shared animation state.\n *\n * Usage:\n *\n * - Add objects you would otherwise pass as 'root' to the\n * constructor or the .clipAction method of AnimationMixer.\n * - Instead pass this object as 'root'.\n * - You can also add and remove objects later when the mixer is running.\n *\n * Note:\n *\n * - Objects of this class appear as one object to the mixer,\n * so cache control of the individual objects must be done on the group.\n *\n * Limitation:\n *\n * - The animated properties must be compatible among the all objects in the group.\n * - A single property can either be controlled through a target group or directly, but not both.\n */\nclass AnimationObjectGroup {\n\n\t/**\n\t * Constructs a new animation group.\n\t *\n\t * @param {...Object3D} arguments - An arbitrary number of 3D objects that share the same animation state.\n\t */\n\tconstructor() {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isAnimationObjectGroup = true;\n\n\t\t/**\n\t\t * The UUID of the 3D object.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.uuid = generateUUID();\n\n\t\t// cached objects followed by the active ones\n\t\tthis._objects = Array.prototype.slice.call( arguments );\n\n\t\tthis.nCachedObjects_ = 0; // threshold\n\t\t// note: read by PropertyBinding.Composite\n\n\t\tconst indices = {};\n\t\tthis._indicesByUUID = indices; // for bookkeeping\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tindices[ arguments[ i ].uuid ] = i;\n\n\t\t}\n\n\t\tthis._paths = []; // inside: string\n\t\tthis._parsedPaths = []; // inside: { we don't care, here }\n\t\tthis._bindings = []; // inside: Array\u003c PropertyBinding \u003e\n\t\tthis._bindingsIndicesByPath = {}; // inside: indices in these arrays\n\n\t\tconst scope = this;\n\n\t\tthis.stats = {\n\n\t\t\tobjects: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._objects.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn this.total - scope.nCachedObjects_;\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tget bindingsPerObject() {\n\n\t\t\t\treturn scope._bindings.length;\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\t/**\n\t * Adds an arbitrary number of objects to this animation group.\n\t *\n\t * @param {...Object3D} arguments - The 3D objects to add.\n\t */\n\tadd() {\n\n\t\tconst objects = this._objects,\n\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\tpaths = this._paths,\n\t\t\tparsedPaths = this._parsedPaths,\n\t\t\tbindings = this._bindings,\n\t\t\tnBindings = bindings.length;\n\n\t\tlet knownObject = undefined,\n\t\t\tnObjects = objects.length,\n\t\t\tnCachedObjects = this.nCachedObjects_;\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tconst object = arguments[ i ],\n\t\t\t\tuuid = object.uuid;\n\t\t\tlet index = indicesByUUID[ uuid ];\n\n\t\t\tif ( index === undefined ) {\n\n\t\t\t\t// unknown object -\u003e add it to the ACTIVE region\n\n\t\t\t\tindex = nObjects ++;\n\t\t\t\tindicesByUUID[ uuid ] = index;\n\t\t\t\tobjects.push( object );\n\n\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\tbindings[ j ].push( new PropertyBinding( object, paths[ j ], parsedPaths[ j ] ) );\n\n\t\t\t\t}\n\n\t\t\t} else if ( index \u003c nCachedObjects ) {\n\n\t\t\t\tknownObject = objects[ index ];\n\n\t\t\t\t// move existing object to the ACTIVE region\n\n\t\t\t\tconst firstActiveIndex = -- nCachedObjects,\n\t\t\t\t\tlastCachedObject = objects[ firstActiveIndex ];\n\n\t\t\t\tindicesByUUID[ lastCachedObject.uuid ] = index;\n\t\t\t\tobjects[ index ] = lastCachedObject;\n\n\t\t\t\tindicesByUUID[ uuid ] = firstActiveIndex;\n\t\t\t\tobjects[ firstActiveIndex ] = object;\n\n\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\tconst bindingsForPath = bindings[ j ],\n\t\t\t\t\t\tlastCached = bindingsForPath[ firstActiveIndex ];\n\n\t\t\t\t\tlet binding = bindingsForPath[ index ];\n\n\t\t\t\t\tbindingsForPath[ index ] = lastCached;\n\n\t\t\t\t\tif ( binding === undefined ) {\n\n\t\t\t\t\t\t// since we do not bother to create new bindings\n\t\t\t\t\t\t// for objects that are cached, the binding may\n\t\t\t\t\t\t// or may not exist\n\n\t\t\t\t\t\tbinding = new PropertyBinding( object, paths[ j ], parsedPaths[ j ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbindingsForPath[ firstActiveIndex ] = binding;\n\n\t\t\t\t}\n\n\t\t\t} else if ( objects[ index ] !== knownObject ) {\n\n\t\t\t\terror( 'AnimationObjectGroup: Different objects with the same UUID ' +\n\t\t\t\t\t'detected. Clean the caches or recreate your infrastructure when reloading scenes.' );\n\n\t\t\t} // else the object is already where we want it to be\n\n\t\t} // for arguments\n\n\t\tthis.nCachedObjects_ = nCachedObjects;\n\n\t}\n\n\t/**\n\t * Removes an arbitrary number of objects to this animation group\n\t *\n\t * @param {...Object3D} arguments - The 3D objects to remove.\n\t */\n\tremove() {\n\n\t\tconst objects = this._objects,\n\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\tbindings = this._bindings,\n\t\t\tnBindings = bindings.length;\n\n\t\tlet nCachedObjects = this.nCachedObjects_;\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tconst object = arguments[ i ],\n\t\t\t\tuuid = object.uuid,\n\t\t\t\tindex = indicesByUUID[ uuid ];\n\n\t\t\tif ( index !== undefined \u0026\u0026 index \u003e= nCachedObjects ) {\n\n\t\t\t\t// move existing object into the CACHED region\n\n\t\t\t\tconst lastCachedIndex = nCachedObjects ++,\n\t\t\t\t\tfirstActiveObject = objects[ lastCachedIndex ];\n\n\t\t\t\tindicesByUUID[ firstActiveObject.uuid ] = index;\n\t\t\t\tobjects[ index ] = firstActiveObject;\n\n\t\t\t\tindicesByUUID[ uuid ] = lastCachedIndex;\n\t\t\t\tobjects[ lastCachedIndex ] = object;\n\n\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\tconst bindingsForPath = bindings[ j ],\n\t\t\t\t\t\tfirstActive = bindingsForPath[ lastCachedIndex ],\n\t\t\t\t\t\tbinding = bindingsForPath[ index ];\n\n\t\t\t\t\tbindingsForPath[ index ] = firstActive;\n\t\t\t\t\tbindingsForPath[ lastCachedIndex ] = binding;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} // for arguments\n\n\t\tthis.nCachedObjects_ = nCachedObjects;\n\n\t}\n\n\t/**\n\t * Deallocates all memory resources for the passed 3D objects of this animation group.\n\t *\n\t * @param {...Object3D} arguments - The 3D objects to uncache.\n\t */\n\tuncache() {\n\n\t\tconst objects = this._objects,\n\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\tbindings = this._bindings,\n\t\t\tnBindings = bindings.length;\n\n\t\tlet nCachedObjects = this.nCachedObjects_,\n\t\t\tnObjects = objects.length;\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tconst object = arguments[ i ],\n\t\t\t\tuuid = object.uuid,\n\t\t\t\tindex = indicesByUUID[ uuid ];\n\n\t\t\tif ( index !== undefined ) {\n\n\t\t\t\tdelete indicesByUUID[ uuid ];\n\n\t\t\t\tif ( index \u003c nCachedObjects ) {\n\n\t\t\t\t\t// object is cached, shrink the CACHED region\n\n\t\t\t\t\tconst firstActiveIndex = -- nCachedObjects,\n\t\t\t\t\t\tlastCachedObject = objects[ firstActiveIndex ],\n\t\t\t\t\t\tlastIndex = -- nObjects,\n\t\t\t\t\t\tlastObject = objects[ lastIndex ];\n\n\t\t\t\t\t// last cached object takes this object's place\n\t\t\t\t\tindicesByUUID[ lastCachedObject.uuid ] = index;\n\t\t\t\t\tobjects[ index ] = lastCachedObject;\n\n\t\t\t\t\t// last object goes to the activated slot and pop\n\t\t\t\t\tindicesByUUID[ lastObject.uuid ] = firstActiveIndex;\n\t\t\t\t\tobjects[ firstActiveIndex ] = lastObject;\n\t\t\t\t\tobjects.pop();\n\n\t\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\t\tconst bindingsForPath = bindings[ j ],\n\t\t\t\t\t\t\tlastCached = bindingsForPath[ firstActiveIndex ],\n\t\t\t\t\t\t\tlast = bindingsForPath[ lastIndex ];\n\n\t\t\t\t\t\tbindingsForPath[ index ] = lastCached;\n\t\t\t\t\t\tbindingsForPath[ firstActiveIndex ] = last;\n\t\t\t\t\t\tbindingsForPath.pop();\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// object is active, just swap with the last and pop\n\n\t\t\t\t\tconst lastIndex = -- nObjects,\n\t\t\t\t\t\tlastObject = objects[ lastIndex ];\n\n\t\t\t\t\tif ( lastIndex \u003e 0 ) {\n\n\t\t\t\t\t\tindicesByUUID[ lastObject.uuid ] = index;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tobjects[ index ] = lastObject;\n\t\t\t\t\tobjects.pop();\n\n\t\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\t\tconst bindingsForPath = bindings[ j ];\n\n\t\t\t\t\t\tbindingsForPath[ index ] = bindingsForPath[ lastIndex ];\n\t\t\t\t\t\tbindingsForPath.pop();\n\n\t\t\t\t\t}\n\n\t\t\t\t} // cached or active\n\n\t\t\t} // if object is known\n\n\t\t} // for arguments\n\n\t\tthis.nCachedObjects_ = nCachedObjects;\n\n\t}\n\n\t// Internal interface used by befriended PropertyBinding.Composite:\n\n\tsubscribe_( path, parsedPath ) {\n\n\t\t// returns an array of bindings for the given path that is changed\n\t\t// according to the contained objects in the group\n\n\t\tconst indicesByPath = this._bindingsIndicesByPath;\n\t\tlet index = indicesByPath[ path ];\n\t\tconst bindings = this._bindings;\n\n\t\tif ( index !== undefined ) return bindings[ index ];\n\n\t\tconst paths = this._paths,\n\t\t\tparsedPaths = this._parsedPaths,\n\t\t\tobjects = this._objects,\n\t\t\tnObjects = objects.length,\n\t\t\tnCachedObjects = this.nCachedObjects_,\n\t\t\tbindingsForPath = new Array( nObjects );\n\n\t\tindex = bindings.length;\n\n\t\tindicesByPath[ path ] = index;\n\n\t\tpaths.push( path );\n\t\tparsedPaths.push( parsedPath );\n\t\tbindings.push( bindingsForPath );\n\n\t\tfor ( let i = nCachedObjects, n = objects.length; i !== n; ++ i ) {\n\n\t\t\tconst object = objects[ i ];\n\t\t\tbindingsForPath[ i ] = new PropertyBinding( object, path, parsedPath );\n\n\t\t}\n\n\t\treturn bindingsForPath;\n\n\t}\n\n\tunsubscribe_( path ) {\n\n\t\t// tells the group to forget about a property path and no longer\n\t\t// update the array previously obtained with 'subscribe_'\n\n\t\tconst indicesByPath = this._bindingsIndicesByPath,\n\t\t\tindex = indicesByPath[ path ];\n\n\t\tif ( index !== undefined ) {\n\n\t\t\tconst paths = this._paths,\n\t\t\t\tparsedPaths = this._parsedPaths,\n\t\t\t\tbindings = this._bindings,\n\t\t\t\tlastBindingsIndex = bindings.length - 1,\n\t\t\t\tlastBindings = bindings[ lastBindingsIndex ],\n\t\t\t\tlastBindingsPath = path[ lastBindingsIndex ];\n\n\t\t\tindicesByPath[ lastBindingsPath ] = index;\n\n\t\t\tbindings[ index ] = lastBindings;\n\t\t\tbindings.pop();\n\n\t\t\tparsedPaths[ index ] = parsedPaths[ lastBindingsIndex ];\n\t\t\tparsedPaths.pop();\n\n\t\t\tpaths[ index ] = paths[ lastBindingsIndex ];\n\t\t\tpaths.pop();\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * An instance of `AnimationAction` schedules the playback of an animation which is\n * stored in {@link AnimationClip}.\n */\nclass AnimationAction {\n\n\t/**\n\t * Constructs a new animation action.\n\t *\n\t * @param {AnimationMixer} mixer - The mixer that is controlled by this action.\n\t * @param {AnimationClip} clip - The animation clip that holds the actual keyframes.\n\t * @param {?Object3D} [localRoot=null] - The root object on which this action is performed.\n\t * @param {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} [blendMode] - The blend mode.\n\t */\n\tconstructor( mixer, clip, localRoot = null, blendMode = clip.blendMode ) {\n\n\t\tthis._mixer = mixer;\n\t\tthis._clip = clip;\n\t\tthis._localRoot = localRoot;\n\n\t\t/**\n\t\t * Defines how the animation is blended/combined when two or more animations\n\t\t * are simultaneously played.\n\t\t *\n\t\t * @type {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)}\n\t\t */\n\t\tthis.blendMode = blendMode;\n\n\t\tconst tracks = clip.tracks,\n\t\t\tnTracks = tracks.length,\n\t\t\tinterpolants = new Array( nTracks );\n\n\t\tconst interpolantSettings = {\n\t\t\tendingStart: ZeroCurvatureEnding,\n\t\t\tendingEnd: ZeroCurvatureEnding\n\t\t};\n\n\t\tfor ( let i = 0; i !== nTracks; ++ i ) {\n\n\t\t\tconst interpolant = tracks[ i ].createInterpolant( null );\n\t\t\tinterpolants[ i ] = interpolant;\n\t\t\tinterpolant.settings = interpolantSettings;\n\n\t\t}\n\n\t\tthis._interpolantSettings = interpolantSettings;\n\n\t\tthis._interpolants = interpolants; // bound by the mixer\n\n\t\t// inside: PropertyMixer (managed by the mixer)\n\t\tthis._propertyBindings = new Array( nTracks );\n\n\t\tthis._cacheIndex = null; // for the memory manager\n\t\tthis._byClipCacheIndex = null; // for the memory manager\n\n\t\tthis._timeScaleInterpolant = null;\n\t\tthis._weightInterpolant = null;\n\n\t\t/**\n\t\t * The loop mode, set via {@link AnimationAction#setLoop}.\n\t\t *\n\t\t * @type {(LoopRepeat|LoopOnce|LoopPingPong)}\n\t\t * @default LoopRepeat\n\t\t */\n\t\tthis.loop = LoopRepeat;\n\t\tthis._loopCount = -1;\n\n\t\t// global mixer time when the action is to be started\n\t\t// it's set back to 'null' upon start of the action\n\t\tthis._startTime = null;\n\n\t\t/**\n\t\t * The local time of this action (in seconds, starting with `0`).\n\t\t *\n\t\t * The value gets clamped or wrapped to `[0,clip.duration]` (according to the\n\t\t * loop state).\n\t\t *\n\t\t * @type {number}\n\t\t * @default Infinity\n\t\t */\n\t\tthis.time = 0;\n\n\t\t/**\n\t\t * Scaling factor for the {@link AnimationAction#time}. A value of `0` causes the\n\t\t * animation to pause. Negative values cause the animation to play backwards.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.timeScale = 1;\n\t\tthis._effectiveTimeScale = 1;\n\n\t\t/**\n\t\t * The degree of influence of this action (in the interval `[0, 1]`). Values\n\t\t * between `0` (no impact) and `1` (full impact) can be used to blend between\n\t\t * several actions.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.weight = 1;\n\t\tthis._effectiveWeight = 1;\n\n\t\t/**\n\t\t * The number of repetitions of the performed clip over the course of this action.\n\t\t * Can be set via {@link AnimationAction#setLoop}.\n\t\t *\n\t\t * Setting this number has no effect if {@link AnimationAction#loop} is set to\n\t\t * `THREE:LoopOnce`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default Infinity\n\t\t */\n\t\tthis.repetitions = Infinity;\n\n\t\t/**\n\t\t * If set to `true`, the playback of the action is paused.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.paused = false;\n\n\t\t/**\n\t\t * If set to `false`, the action is disabled so it has no impact.\n\t\t *\n\t\t * When the action is re-enabled, the animation continues from its current\n\t\t * time (setting `enabled` to `false` doesn't reset the action).\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.enabled = true;\n\n\t\t/**\n\t\t * If set to true the animation will automatically be paused on its last frame.\n\t\t *\n\t\t * If set to false, {@link AnimationAction#enabled} will automatically be switched\n\t\t * to `false` when the last loop of the action has finished, so that this action has\n\t\t * no further impact.\n\t\t *\n\t\t * Note: This member has no impact if the action is interrupted (it\n\t\t * has only an effect if its last loop has really finished).\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.clampWhenFinished = false;\n\n\t\t/**\n\t\t * Enables smooth interpolation without separate clips for start, loop and end.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.zeroSlopeAtStart = true;\n\n\t\t/**\n\t\t * Enables smooth interpolation without separate clips for start, loop and end.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.zeroSlopeAtEnd = true;\n\n\t}\n\n\t/**\n\t * Starts the playback of the animation.\n\t *\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tplay() {\n\n\t\tthis._mixer._activateAction( this );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Stops the playback of the animation.\n\t *\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tstop() {\n\n\t\tthis._mixer._deactivateAction( this );\n\n\t\treturn this.reset();\n\n\t}\n\n\t/**\n\t * Resets the playback of the animation.\n\t *\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\treset() {\n\n\t\tthis.paused = false;\n\t\tthis.enabled = true;\n\n\t\tthis.time = 0; // restart clip\n\t\tthis._loopCount = -1;// forget previous loops\n\t\tthis._startTime = null;// forget scheduling\n\n\t\treturn this.stopFading().stopWarping();\n\n\t}\n\n\t/**\n\t * Returns `true` if the animation is running.\n\t *\n\t * @return {boolean} Whether the animation is running or not.\n\t */\n\tisRunning() {\n\n\t\treturn this.enabled \u0026\u0026 ! this.paused \u0026\u0026 this.timeScale !== 0 \u0026\u0026\n\t\t\tthis._startTime === null \u0026\u0026 this._mixer._isActiveAction( this );\n\n\t}\n\n\t/**\n\t * Returns `true` when {@link AnimationAction#play} has been called.\n\t *\n\t * @return {boolean} Whether the animation is scheduled or not.\n\t */\n\tisScheduled() {\n\n\t\treturn this._mixer._isActiveAction( this );\n\n\t}\n\n\t/**\n\t * Defines the time when the animation should start.\n\t *\n\t * @param {number} time - The start time in seconds.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tstartAt( time ) {\n\n\t\tthis._startTime = time;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Configures the loop settings for this action.\n\t *\n\t * @param {(LoopRepeat|LoopOnce|LoopPingPong)} mode - The loop mode.\n\t * @param {number} repetitions - The number of repetitions.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tsetLoop( mode, repetitions ) {\n\n\t\tthis.loop = mode;\n\t\tthis.repetitions = repetitions;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the effective weight of this action.\n\t *\n\t * An action has no effect and thus an effective weight of zero when the\n\t * action is disabled.\n\t *\n\t * @param {number} weight - The weight to set.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tsetEffectiveWeight( weight ) {\n\n\t\tthis.weight = weight;\n\n\t\t// note: same logic as when updated at runtime\n\t\tthis._effectiveWeight = this.enabled ? weight : 0;\n\n\t\treturn this.stopFading();\n\n\t}\n\n\t/**\n\t * Returns the effective weight of this action.\n\t *\n\t * @return {number} The effective weight.\n\t */\n\tgetEffectiveWeight() {\n\n\t\treturn this._effectiveWeight;\n\n\t}\n\n\t/**\n\t * Fades the animation in by increasing its weight gradually from `0` to `1`,\n\t * within the passed time interval.\n\t *\n\t * @param {number} duration - The duration of the fade.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tfadeIn( duration ) {\n\n\t\treturn this._scheduleFading( duration, 0, 1 );\n\n\t}\n\n\t/**\n\t * Fades the animation out by decreasing its weight gradually from `1` to `0`,\n\t * within the passed time interval.\n\t *\n\t * @param {number} duration - The duration of the fade.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tfadeOut( duration ) {\n\n\t\treturn this._scheduleFading( duration, 1, 0 );\n\n\t}\n\n\t/**\n\t * Causes this action to fade in and the given action to fade out,\n\t * within the passed time interval.\n\t *\n\t * @param {AnimationAction} fadeOutAction - The animation action to fade out.\n\t * @param {number} duration - The duration of the fade.\n\t * @param {boolean} [warp=false] - Whether warping should be used or not.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tcrossFadeFrom( fadeOutAction, duration, warp = false ) {\n\n\t\tfadeOutAction.fadeOut( duration );\n\t\tthis.fadeIn( duration );\n\n\t\tif ( warp === true ) {\n\n\t\t\tconst fadeInDuration = this._clip.duration,\n\t\t\t\tfadeOutDuration = fadeOutAction._clip.duration,\n\n\t\t\t\tstartEndRatio = fadeOutDuration / fadeInDuration,\n\t\t\t\tendStartRatio = fadeInDuration / fadeOutDuration;\n\n\t\t\tfadeOutAction.warp( 1.0, startEndRatio, duration );\n\t\t\tthis.warp( endStartRatio, 1.0, duration );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Causes this action to fade out and the given action to fade in,\n\t * within the passed time interval.\n\t *\n\t * @param {AnimationAction} fadeInAction - The animation action to fade in.\n\t * @param {number} duration - The duration of the fade.\n\t * @param {boolean} [warp=false] - Whether warping should be used or not.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tcrossFadeTo( fadeInAction, duration, warp = false ) {\n\n\t\treturn fadeInAction.crossFadeFrom( this, duration, warp );\n\n\t}\n\n\t/**\n\t * Stops any fading which is applied to this action.\n\t *\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tstopFading() {\n\n\t\tconst weightInterpolant = this._weightInterpolant;\n\n\t\tif ( weightInterpolant !== null ) {\n\n\t\t\tthis._weightInterpolant = null;\n\t\t\tthis._mixer._takeBackControlInterpolant( weightInterpolant );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the effective time scale of this action.\n\t *\n\t * An action has no effect and thus an effective time scale of zero when the\n\t * action is paused.\n\t *\n\t * @param {number} timeScale - The time scale to set.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tsetEffectiveTimeScale( timeScale ) {\n\n\t\tthis.timeScale = timeScale;\n\t\tthis._effectiveTimeScale = this.paused ? 0 : timeScale;\n\n\t\treturn this.stopWarping();\n\n\t}\n\n\t/**\n\t * Returns the effective time scale of this action.\n\t *\n\t * @return {number} The effective time scale.\n\t */\n\tgetEffectiveTimeScale() {\n\n\t\treturn this._effectiveTimeScale;\n\n\t}\n\n\t/**\n\t * Sets the duration for a single loop of this action.\n\t *\n\t * @param {number} duration - The duration to set.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tsetDuration( duration ) {\n\n\t\tthis.timeScale = this._clip.duration / duration;\n\n\t\treturn this.stopWarping();\n\n\t}\n\n\t/**\n\t * Synchronizes this action with the passed other action.\n\t *\n\t * @param {AnimationAction} action - The action to sync with.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tsyncWith( action ) {\n\n\t\tthis.time = action.time;\n\t\tthis.timeScale = action.timeScale;\n\n\t\treturn this.stopWarping();\n\n\t}\n\n\t/**\n\t * Decelerates this animation's speed to `0` within the passed time interval.\n\t *\n\t * @param {number} duration - The duration.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\thalt( duration ) {\n\n\t\treturn this.warp( this._effectiveTimeScale, 0, duration );\n\n\t}\n\n\t/**\n\t * Changes the playback speed, within the passed time interval, by modifying\n\t * {@link AnimationAction#timeScale} gradually from `startTimeScale` to\n\t * `endTimeScale`.\n\t *\n\t * @param {number} startTimeScale - The start time scale.\n\t * @param {number} endTimeScale - The end time scale.\n\t * @param {number} duration - The duration.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\twarp( startTimeScale, endTimeScale, duration ) {\n\n\t\tconst mixer = this._mixer,\n\t\t\tnow = mixer.time,\n\t\t\ttimeScale = this.timeScale;\n\n\t\tlet interpolant = this._timeScaleInterpolant;\n\n\t\tif ( interpolant === null ) {\n\n\t\t\tinterpolant = mixer._lendControlInterpolant();\n\t\t\tthis._timeScaleInterpolant = interpolant;\n\n\t\t}\n\n\t\tconst times = interpolant.parameterPositions,\n\t\t\tvalues = interpolant.sampleValues;\n\n\t\ttimes[ 0 ] = now;\n\t\ttimes[ 1 ] = now + duration;\n\n\t\tvalues[ 0 ] = startTimeScale / timeScale;\n\t\tvalues[ 1 ] = endTimeScale / timeScale;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Stops any scheduled warping which is applied to this action.\n\t *\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tstopWarping() {\n\n\t\tconst timeScaleInterpolant = this._timeScaleInterpolant;\n\n\t\tif ( timeScaleInterpolant !== null ) {\n\n\t\t\tthis._timeScaleInterpolant = null;\n\t\t\tthis._mixer._takeBackControlInterpolant( timeScaleInterpolant );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the animation mixer of this animation action.\n\t *\n\t * @return {AnimationMixer} The animation mixer.\n\t */\n\tgetMixer() {\n\n\t\treturn this._mixer;\n\n\t}\n\n\t/**\n\t * Returns the animation clip of this animation action.\n\t *\n\t * @return {AnimationClip} The animation clip.\n\t */\n\tgetClip() {\n\n\t\treturn this._clip;\n\n\t}\n\n\t/**\n\t * Returns the root object of this animation action.\n\t *\n\t * @return {Object3D} The root object.\n\t */\n\tgetRoot() {\n\n\t\treturn this._localRoot || this._mixer._root;\n\n\t}\n\n\t// Interna\n\n\t_update( time, deltaTime, timeDirection, accuIndex ) {\n\n\t\t// called by the mixer\n\n\t\tif ( ! this.enabled ) {\n\n\t\t\t// call ._updateWeight() to update ._effectiveWeight\n\n\t\t\tthis._updateWeight( time );\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst startTime = this._startTime;\n\n\t\tif ( startTime !== null ) {\n\n\t\t\t// check for scheduled start of action\n\n\t\t\tconst timeRunning = ( time - startTime ) * timeDirection;\n\t\t\tif ( timeRunning \u003c 0 || timeDirection === 0 ) {\n\n\t\t\t\tdeltaTime = 0;\n\n\t\t\t} else {\n\n\n\t\t\t\tthis._startTime = null; // unschedule\n\t\t\t\tdeltaTime = timeDirection * timeRunning;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// apply time scale and advance time\n\n\t\tdeltaTime *= this._updateTimeScale( time );\n\t\tconst clipTime = this._updateTime( deltaTime );\n\n\t\t// note: _updateTime may disable the action resulting in\n\t\t// an effective weight of 0\n\n\t\tconst weight = this._updateWeight( time );\n\n\t\tif ( weight \u003e 0 ) {\n\n\t\t\tconst interpolants = this._interpolants;\n\t\t\tconst propertyMixers = this._propertyBindings;\n\n\t\t\tswitch ( this.blendMode ) {\n\n\t\t\t\tcase AdditiveAnimationBlendMode:\n\n\t\t\t\t\tfor ( let j = 0, m = interpolants.length; j !== m; ++ j ) {\n\n\t\t\t\t\t\tinterpolants[ j ].evaluate( clipTime );\n\t\t\t\t\t\tpropertyMixers[ j ].accumulateAdditive( weight );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase NormalAnimationBlendMode:\n\t\t\t\tdefault:\n\n\t\t\t\t\tfor ( let j = 0, m = interpolants.length; j !== m; ++ j ) {\n\n\t\t\t\t\t\tinterpolants[ j ].evaluate( clipTime );\n\t\t\t\t\t\tpropertyMixers[ j ].accumulate( accuIndex, weight );\n\n\t\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_updateWeight( time ) {\n\n\t\tlet weight = 0;\n\n\t\tif ( this.enabled ) {\n\n\t\t\tweight = this.weight;\n\t\t\tconst interpolant = this._weightInterpolant;\n\n\t\t\tif ( interpolant !== null ) {\n\n\t\t\t\tconst interpolantValue = interpolant.evaluate( time )[ 0 ];\n\n\t\t\t\tweight *= interpolantValue;\n\n\t\t\t\tif ( time \u003e interpolant.parameterPositions[ 1 ] ) {\n\n\t\t\t\t\tthis.stopFading();\n\n\t\t\t\t\tif ( interpolantValue === 0 ) {\n\n\t\t\t\t\t\t// faded out, disable\n\t\t\t\t\t\tthis.enabled = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis._effectiveWeight = weight;\n\t\treturn weight;\n\n\t}\n\n\t_updateTimeScale( time ) {\n\n\t\tlet timeScale = 0;\n\n\t\tif ( ! this.paused ) {\n\n\t\t\ttimeScale = this.timeScale;\n\n\t\t\tconst interpolant = this._timeScaleInterpolant;\n\n\t\t\tif ( interpolant !== null ) {\n\n\t\t\t\tconst interpolantValue = interpolant.evaluate( time )[ 0 ];\n\n\t\t\t\ttimeScale *= interpolantValue;\n\n\t\t\t\tif ( time \u003e interpolant.parameterPositions[ 1 ] ) {\n\n\t\t\t\t\tthis.stopWarping();\n\n\t\t\t\t\tif ( timeScale === 0 ) {\n\n\t\t\t\t\t\t// motion has halted, pause\n\t\t\t\t\t\tthis.paused = true;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// warp done - apply final time scale\n\t\t\t\t\t\tthis.timeScale = timeScale;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis._effectiveTimeScale = timeScale;\n\t\treturn timeScale;\n\n\t}\n\n\t_updateTime( deltaTime ) {\n\n\t\tconst duration = this._clip.duration;\n\t\tconst loop = this.loop;\n\n\t\tlet time = this.time + deltaTime;\n\t\tlet loopCount = this._loopCount;\n\n\t\tconst pingPong = ( loop === LoopPingPong );\n\n\t\tif ( deltaTime === 0 ) {\n\n\t\t\tif ( loopCount === -1 ) return time;\n\n\t\t\treturn ( pingPong \u0026\u0026 ( loopCount \u0026 1 ) === 1 ) ? duration - time : time;\n\n\t\t}\n\n\t\tif ( loop === LoopOnce ) {\n\n\t\t\tif ( loopCount === -1 ) {\n\n\t\t\t\t// just started\n\n\t\t\t\tthis._loopCount = 0;\n\t\t\t\tthis._setEndings( true, true, false );\n\n\t\t\t}\n\n\t\t\thandle_stop: {\n\n\t\t\t\tif ( time \u003e= duration ) {\n\n\t\t\t\t\ttime = duration;\n\n\t\t\t\t} else if ( time \u003c 0 ) {\n\n\t\t\t\t\ttime = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\tbreak handle_stop;\n\n\t\t\t\t}\n\n\t\t\t\tif ( this.clampWhenFinished ) this.paused = true;\n\t\t\t\telse this.enabled = false;\n\n\t\t\t\tthis.time = time;\n\n\t\t\t\tthis._mixer.dispatchEvent( {\n\t\t\t\t\ttype: 'finished', action: this,\n\t\t\t\t\tdirection: deltaTime \u003c 0 ? -1 : 1\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t} else { // repetitive Repeat or PingPong\n\n\t\t\tif ( loopCount === -1 ) {\n\n\t\t\t\t// just started\n\n\t\t\t\tif ( deltaTime \u003e= 0 ) {\n\n\t\t\t\t\tloopCount = 0;\n\n\t\t\t\t\tthis._setEndings( true, this.repetitions === 0, pingPong );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// when looping in reverse direction, the initial\n\t\t\t\t\t// transition through zero counts as a repetition,\n\t\t\t\t\t// so leave loopCount at -1\n\n\t\t\t\t\tthis._setEndings( this.repetitions === 0, true, pingPong );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( time \u003e= duration || time \u003c 0 ) {\n\n\t\t\t\t// wrap around\n\n\t\t\t\tconst loopDelta = Math.floor( time / duration ); // signed\n\t\t\t\ttime -= duration * loopDelta;\n\n\t\t\t\tloopCount += Math.abs( loopDelta );\n\n\t\t\t\tconst pending = this.repetitions - loopCount;\n\n\t\t\t\tif ( pending \u003c= 0 ) {\n\n\t\t\t\t\t// have to stop (switch state, clamp time, fire event)\n\n\t\t\t\t\tif ( this.clampWhenFinished ) this.paused = true;\n\t\t\t\t\telse this.enabled = false;\n\n\t\t\t\t\ttime = deltaTime \u003e 0 ? duration : 0;\n\n\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\tthis._mixer.dispatchEvent( {\n\t\t\t\t\t\ttype: 'finished', action: this,\n\t\t\t\t\t\tdirection: deltaTime \u003e 0 ? 1 : -1\n\t\t\t\t\t} );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// keep running\n\n\t\t\t\t\tif ( pending === 1 ) {\n\n\t\t\t\t\t\t// entering the last round\n\n\t\t\t\t\t\tconst atStart = deltaTime \u003c 0;\n\t\t\t\t\t\tthis._setEndings( atStart, ! atStart, pingPong );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthis._setEndings( false, false, pingPong );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._loopCount = loopCount;\n\n\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\tthis._mixer.dispatchEvent( {\n\t\t\t\t\t\ttype: 'loop', action: this, loopDelta: loopDelta\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tthis.time = time;\n\n\t\t\t}\n\n\t\t\tif ( pingPong \u0026\u0026 ( loopCount \u0026 1 ) === 1 ) {\n\n\t\t\t\t// invert time for the \"pong round\"\n\n\t\t\t\treturn duration - time;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn time;\n\n\t}\n\n\t_setEndings( atStart, atEnd, pingPong ) {\n\n\t\tconst settings = this._interpolantSettings;\n\n\t\tif ( pingPong ) {\n\n\t\t\tsettings.endingStart = ZeroSlopeEnding;\n\t\t\tsettings.endingEnd = ZeroSlopeEnding;\n\n\t\t} else {\n\n\t\t\t// assuming for LoopOnce atStart == atEnd == true\n\n\t\t\tif ( atStart ) {\n\n\t\t\t\tsettings.endingStart = this.zeroSlopeAtStart ? ZeroSlopeEnding : ZeroCurvatureEnding;\n\n\t\t\t} else {\n\n\t\t\t\tsettings.endingStart = WrapAroundEnding;\n\n\t\t\t}\n\n\t\t\tif ( atEnd ) {\n\n\t\t\t\tsettings.endingEnd = this.zeroSlopeAtEnd ? ZeroSlopeEnding : ZeroCurvatureEnding;\n\n\t\t\t} else {\n\n\t\t\t\tsettings.endingEnd \t = WrapAroundEnding;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_scheduleFading( duration, weightNow, weightThen ) {\n\n\t\tconst mixer = this._mixer, now = mixer.time;\n\t\tlet interpolant = this._weightInterpolant;\n\n\t\tif ( interpolant === null ) {\n\n\t\t\tinterpolant = mixer._lendControlInterpolant();\n\t\t\tthis._weightInterpolant = interpolant;\n\n\t\t}\n\n\t\tconst times = interpolant.parameterPositions,\n\t\t\tvalues = interpolant.sampleValues;\n\n\t\ttimes[ 0 ] = now;\n\t\tvalues[ 0 ] = weightNow;\n\t\ttimes[ 1 ] = now + duration;\n\t\tvalues[ 1 ] = weightThen;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _controlInterpolantsResultBuffer = new Float32Array( 1 );\n\n/**\n * `AnimationMixer` is a player for animations on a particular object in\n * the scene. When multiple objects in the scene are animated independently,\n * one `AnimationMixer` may be used for each object.\n */\nclass AnimationMixer extends EventDispatcher {\n\n\t/**\n\t * Constructs a new animation mixer.\n\t *\n\t * @param {Object3D} root - The object whose animations shall be played by this mixer.\n\t */\n\tconstructor( root ) {\n\n\t\tsuper();\n\n\t\tthis._root = root;\n\t\tthis._initMemoryManager();\n\t\tthis._accuIndex = 0;\n\n\t\t/**\n\t\t * The global mixer time (in seconds; starting with `0` on the mixer's creation).\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.time = 0;\n\n\t\t/**\n\t\t * A scaling factor for the global time.\n\t\t *\n\t\t * Note: Setting this member to `0` and later back to `1` is a\n\t\t * possibility to pause/unpause all actions that are controlled by this\n\t\t * mixer.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.timeScale = 1.0;\n\n\t}\n\n\t_bindAction( action, prototypeAction ) {\n\n\t\tconst root = action._localRoot || this._root,\n\t\t\ttracks = action._clip.tracks,\n\t\t\tnTracks = tracks.length,\n\t\t\tbindings = action._propertyBindings,\n\t\t\tinterpolants = action._interpolants,\n\t\t\trootUuid = root.uuid,\n\t\t\tbindingsByRoot = this._bindingsByRootAndName;\n\n\t\tlet bindingsByName = bindingsByRoot[ rootUuid ];\n\n\t\tif ( bindingsByName === undefined ) {\n\n\t\t\tbindingsByName = {};\n\t\t\tbindingsByRoot[ rootUuid ] = bindingsByName;\n\n\t\t}\n\n\t\tfor ( let i = 0; i !== nTracks; ++ i ) {\n\n\t\t\tconst track = tracks[ i ],\n\t\t\t\ttrackName = track.name;\n\n\t\t\tlet binding = bindingsByName[ trackName ];\n\n\t\t\tif ( binding !== undefined ) {\n\n\t\t\t\t++ binding.referenceCount;\n\t\t\t\tbindings[ i ] = binding;\n\n\t\t\t} else {\n\n\t\t\t\tbinding = bindings[ i ];\n\n\t\t\t\tif ( binding !== undefined ) {\n\n\t\t\t\t\t// existing binding, make sure the cache knows\n\n\t\t\t\t\tif ( binding._cacheIndex === null ) {\n\n\t\t\t\t\t\t++ binding.referenceCount;\n\t\t\t\t\t\tthis._addInactiveBinding( binding, rootUuid, trackName );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\tconst path = prototypeAction \u0026\u0026 prototypeAction.\n\t\t\t\t\t_propertyBindings[ i ].binding.parsedPath;\n\n\t\t\t\tbinding = new PropertyMixer(\n\t\t\t\t\tPropertyBinding.create( root, trackName, path ),\n\t\t\t\t\ttrack.ValueTypeName, track.getValueSize() );\n\n\t\t\t\t++ binding.referenceCount;\n\t\t\t\tthis._addInactiveBinding( binding, rootUuid, trackName );\n\n\t\t\t\tbindings[ i ] = binding;\n\n\t\t\t}\n\n\t\t\tinterpolants[ i ].resultBuffer = binding.buffer;\n\n\t\t}\n\n\t}\n\n\t_activateAction( action ) {\n\n\t\tif ( ! this._isActiveAction( action ) ) {\n\n\t\t\tif ( action._cacheIndex === null ) {\n\n\t\t\t\t// this action has been forgotten by the cache, but the user\n\t\t\t\t// appears to be still using it -\u003e rebind\n\n\t\t\t\tconst rootUuid = ( action._localRoot || this._root ).uuid,\n\t\t\t\t\tclipUuid = action._clip.uuid,\n\t\t\t\t\tactionsForClip = this._actionsByClip[ clipUuid ];\n\n\t\t\t\tthis._bindAction( action,\n\t\t\t\t\tactionsForClip \u0026\u0026 actionsForClip.knownActions[ 0 ] );\n\n\t\t\t\tthis._addInactiveAction( action, clipUuid, rootUuid );\n\n\t\t\t}\n\n\t\t\tconst bindings = action._propertyBindings;\n\n\t\t\t// increment reference counts / sort out state\n\t\t\tfor ( let i = 0, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\t\tconst binding = bindings[ i ];\n\n\t\t\t\tif ( binding.useCount ++ === 0 ) {\n\n\t\t\t\t\tthis._lendBinding( binding );\n\t\t\t\t\tbinding.saveOriginalState();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis._lendAction( action );\n\n\t\t}\n\n\t}\n\n\t_deactivateAction( action ) {\n\n\t\tif ( this._isActiveAction( action ) ) {\n\n\t\t\tconst bindings = action._propertyBindings;\n\n\t\t\t// decrement reference counts / sort out state\n\t\t\tfor ( let i = 0, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\t\tconst binding = bindings[ i ];\n\n\t\t\t\tif ( -- binding.useCount === 0 ) {\n\n\t\t\t\t\tbinding.restoreOriginalState();\n\t\t\t\t\tthis._takeBackBinding( binding );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis._takeBackAction( action );\n\n\t\t}\n\n\t}\n\n\t// Memory manager\n\n\t_initMemoryManager() {\n\n\t\tthis._actions = []; // 'nActiveActions' followed by inactive ones\n\t\tthis._nActiveActions = 0;\n\n\t\tthis._actionsByClip = {};\n\t\t// inside:\n\t\t// {\n\t\t// \tknownActions: Array\u003c AnimationAction \u003e - used as prototypes\n\t\t// \tactionByRoot: AnimationAction - lookup\n\t\t// }\n\n\n\t\tthis._bindings = []; // 'nActiveBindings' followed by inactive ones\n\t\tthis._nActiveBindings = 0;\n\n\t\tthis._bindingsByRootAndName = {}; // inside: Map\u003c name, PropertyMixer \u003e\n\n\n\t\tthis._controlInterpolants = []; // same game as above\n\t\tthis._nActiveControlInterpolants = 0;\n\n\t\tconst scope = this;\n\n\t\tthis.stats = {\n\n\t\t\tactions: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._actions.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn scope._nActiveActions;\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tbindings: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._bindings.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn scope._nActiveBindings;\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tcontrolInterpolants: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._controlInterpolants.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn scope._nActiveControlInterpolants;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\t// Memory management for AnimationAction objects\n\n\t_isActiveAction( action ) {\n\n\t\tconst index = action._cacheIndex;\n\t\treturn index !== null \u0026\u0026 index \u003c this._nActiveActions;\n\n\t}\n\n\t_addInactiveAction( action, clipUuid, rootUuid ) {\n\n\t\tconst actions = this._actions,\n\t\t\tactionsByClip = this._actionsByClip;\n\n\t\tlet actionsForClip = actionsByClip[ clipUuid ];\n\n\t\tif ( actionsForClip === undefined ) {\n\n\t\t\tactionsForClip = {\n\n\t\t\t\tknownActions: [ action ],\n\t\t\t\tactionByRoot: {}\n\n\t\t\t};\n\n\t\t\taction._byClipCacheIndex = 0;\n\n\t\t\tactionsByClip[ clipUuid ] = actionsForClip;\n\n\t\t} else {\n\n\t\t\tconst knownActions = actionsForClip.knownActions;\n\n\t\t\taction._byClipCacheIndex = knownActions.length;\n\t\t\tknownActions.push( action );\n\n\t\t}\n\n\t\taction._cacheIndex = actions.length;\n\t\tactions.push( action );\n\n\t\tactionsForClip.actionByRoot[ rootUuid ] = action;\n\n\t}\n\n\t_removeInactiveAction( action ) {\n\n\t\tconst actions = this._actions,\n\t\t\tlastInactiveAction = actions[ actions.length - 1 ],\n\t\t\tcacheIndex = action._cacheIndex;\n\n\t\tlastInactiveAction._cacheIndex = cacheIndex;\n\t\tactions[ cacheIndex ] = lastInactiveAction;\n\t\tactions.pop();\n\n\t\taction._cacheIndex = null;\n\n\n\t\tconst clipUuid = action._clip.uuid,\n\t\t\tactionsByClip = this._actionsByClip,\n\t\t\tactionsForClip = actionsByClip[ clipUuid ],\n\t\t\tknownActionsForClip = actionsForClip.knownActions,\n\n\t\t\tlastKnownAction =\n\t\t\t\tknownActionsForClip[ knownActionsForClip.length - 1 ],\n\n\t\t\tbyClipCacheIndex = action._byClipCacheIndex;\n\n\t\tlastKnownAction._byClipCacheIndex = byClipCacheIndex;\n\t\tknownActionsForClip[ byClipCacheIndex ] = lastKnownAction;\n\t\tknownActionsForClip.pop();\n\n\t\taction._byClipCacheIndex = null;\n\n\n\t\tconst actionByRoot = actionsForClip.actionByRoot,\n\t\t\trootUuid = ( action._localRoot || this._root ).uuid;\n\n\t\tdelete actionByRoot[ rootUuid ];\n\n\t\tif ( knownActionsForClip.length === 0 ) {\n\n\t\t\tdelete actionsByClip[ clipUuid ];\n\n\t\t}\n\n\t\tthis._removeInactiveBindingsForAction( action );\n\n\t}\n\n\t_removeInactiveBindingsForAction( action ) {\n\n\t\tconst bindings = action._propertyBindings;\n\n\t\tfor ( let i = 0, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tconst binding = bindings[ i ];\n\n\t\t\tif ( -- binding.referenceCount === 0 ) {\n\n\t\t\t\tthis._removeInactiveBinding( binding );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_lendAction( action ) {\n\n\t\t// [ active actions |  inactive actions  ]\n\t\t// [  active actions \u003e| inactive actions ]\n\t\t//                 s        a\n\t\t//                  \u003c-swap-\u003e\n\t\t//                 a        s\n\n\t\tconst actions = this._actions,\n\t\t\tprevIndex = action._cacheIndex,\n\n\t\t\tlastActiveIndex = this._nActiveActions ++,\n\n\t\t\tfirstInactiveAction = actions[ lastActiveIndex ];\n\n\t\taction._cacheIndex = lastActiveIndex;\n\t\tactions[ lastActiveIndex ] = action;\n\n\t\tfirstInactiveAction._cacheIndex = prevIndex;\n\t\tactions[ prevIndex ] = firstInactiveAction;\n\n\t}\n\n\t_takeBackAction( action ) {\n\n\t\t// [  active actions  | inactive actions ]\n\t\t// [ active actions |\u003c inactive actions  ]\n\t\t//        a        s\n\t\t//         \u003c-swap-\u003e\n\t\t//        s        a\n\n\t\tconst actions = this._actions,\n\t\t\tprevIndex = action._cacheIndex,\n\n\t\t\tfirstInactiveIndex = -- this._nActiveActions,\n\n\t\t\tlastActiveAction = actions[ firstInactiveIndex ];\n\n\t\taction._cacheIndex = firstInactiveIndex;\n\t\tactions[ firstInactiveIndex ] = action;\n\n\t\tlastActiveAction._cacheIndex = prevIndex;\n\t\tactions[ prevIndex ] = lastActiveAction;\n\n\t}\n\n\t// Memory management for PropertyMixer objects\n\n\t_addInactiveBinding( binding, rootUuid, trackName ) {\n\n\t\tconst bindingsByRoot = this._bindingsByRootAndName,\n\t\t\tbindings = this._bindings;\n\n\t\tlet bindingByName = bindingsByRoot[ rootUuid ];\n\n\t\tif ( bindingByName === undefined ) {\n\n\t\t\tbindingByName = {};\n\t\t\tbindingsByRoot[ rootUuid ] = bindingByName;\n\n\t\t}\n\n\t\tbindingByName[ trackName ] = binding;\n\n\t\tbinding._cacheIndex = bindings.length;\n\t\tbindings.push( binding );\n\n\t}\n\n\t_removeInactiveBinding( binding ) {\n\n\t\tconst bindings = this._bindings,\n\t\t\tpropBinding = binding.binding,\n\t\t\trootUuid = propBinding.rootNode.uuid,\n\t\t\ttrackName = propBinding.path,\n\t\t\tbindingsByRoot = this._bindingsByRootAndName,\n\t\t\tbindingByName = bindingsByRoot[ rootUuid ],\n\n\t\t\tlastInactiveBinding = bindings[ bindings.length - 1 ],\n\t\t\tcacheIndex = binding._cacheIndex;\n\n\t\tlastInactiveBinding._cacheIndex = cacheIndex;\n\t\tbindings[ cacheIndex ] = lastInactiveBinding;\n\t\tbindings.pop();\n\n\t\tdelete bindingByName[ trackName ];\n\n\t\tif ( Object.keys( bindingByName ).length === 0 ) {\n\n\t\t\tdelete bindingsByRoot[ rootUuid ];\n\n\t\t}\n\n\t}\n\n\t_lendBinding( binding ) {\n\n\t\tconst bindings = this._bindings,\n\t\t\tprevIndex = binding._cacheIndex,\n\n\t\t\tlastActiveIndex = this._nActiveBindings ++,\n\n\t\t\tfirstInactiveBinding = bindings[ lastActiveIndex ];\n\n\t\tbinding._cacheIndex = lastActiveIndex;\n\t\tbindings[ lastActiveIndex ] = binding;\n\n\t\tfirstInactiveBinding._cacheIndex = prevIndex;\n\t\tbindings[ prevIndex ] = firstInactiveBinding;\n\n\t}\n\n\t_takeBackBinding( binding ) {\n\n\t\tconst bindings = this._bindings,\n\t\t\tprevIndex = binding._cacheIndex,\n\n\t\t\tfirstInactiveIndex = -- this._nActiveBindings,\n\n\t\t\tlastActiveBinding = bindings[ firstInactiveIndex ];\n\n\t\tbinding._cacheIndex = firstInactiveIndex;\n\t\tbindings[ firstInactiveIndex ] = binding;\n\n\t\tlastActiveBinding._cacheIndex = prevIndex;\n\t\tbindings[ prevIndex ] = lastActiveBinding;\n\n\t}\n\n\n\t// Memory management of Interpolants for weight and time scale\n\n\t_lendControlInterpolant() {\n\n\t\tconst interpolants = this._controlInterpolants,\n\t\t\tlastActiveIndex = this._nActiveControlInterpolants ++;\n\n\t\tlet interpolant = interpolants[ lastActiveIndex ];\n\n\t\tif ( interpolant === undefined ) {\n\n\t\t\tinterpolant = new LinearInterpolant(\n\t\t\t\tnew Float32Array( 2 ), new Float32Array( 2 ),\n\t\t\t\t1, _controlInterpolantsResultBuffer );\n\n\t\t\tinterpolant.__cacheIndex = lastActiveIndex;\n\t\t\tinterpolants[ lastActiveIndex ] = interpolant;\n\n\t\t}\n\n\t\treturn interpolant;\n\n\t}\n\n\t_takeBackControlInterpolant( interpolant ) {\n\n\t\tconst interpolants = this._controlInterpolants,\n\t\t\tprevIndex = interpolant.__cacheIndex,\n\n\t\t\tfirstInactiveIndex = -- this._nActiveControlInterpolants,\n\n\t\t\tlastActiveInterpolant = interpolants[ firstInactiveIndex ];\n\n\t\tinterpolant.__cacheIndex = firstInactiveIndex;\n\t\tinterpolants[ firstInactiveIndex ] = interpolant;\n\n\t\tlastActiveInterpolant.__cacheIndex = prevIndex;\n\t\tinterpolants[ prevIndex ] = lastActiveInterpolant;\n\n\t}\n\n\t/**\n\t * Returns an instance of {@link AnimationAction} for the passed clip.\n\t *\n\t * If an action fitting the clip and root parameters doesn't yet exist, it\n\t * will be created by this method. Calling this method several times with the\n\t * same clip and root parameters always returns the same action.\n\t *\n\t * @param {AnimationClip|string} clip - An animation clip or alternatively the name of the animation clip.\n\t * @param {Object3D} [optionalRoot] - An alternative root object.\n\t * @param {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} [blendMode] - The blend mode.\n\t * @return {?AnimationAction} The animation action.\n\t */\n\tclipAction( clip, optionalRoot, blendMode ) {\n\n\t\tconst root = optionalRoot || this._root,\n\t\t\trootUuid = root.uuid;\n\n\t\tlet clipObject = typeof clip === 'string' ? AnimationClip.findByName( root, clip ) : clip;\n\n\t\tconst clipUuid = clipObject !== null ? clipObject.uuid : clip;\n\n\t\tconst actionsForClip = this._actionsByClip[ clipUuid ];\n\t\tlet prototypeAction = null;\n\n\t\tif ( blendMode === undefined ) {\n\n\t\t\tif ( clipObject !== null ) {\n\n\t\t\t\tblendMode = clipObject.blendMode;\n\n\t\t\t} else {\n\n\t\t\t\tblendMode = NormalAnimationBlendMode;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( actionsForClip !== undefined ) {\n\n\t\t\tconst existingAction = actionsForClip.actionByRoot[ rootUuid ];\n\n\t\t\tif ( existingAction !== undefined \u0026\u0026 existingAction.blendMode === blendMode ) {\n\n\t\t\t\treturn existingAction;\n\n\t\t\t}\n\n\t\t\t// we know the clip, so we don't have to parse all\n\t\t\t// the bindings again but can just copy\n\t\t\tprototypeAction = actionsForClip.knownActions[ 0 ];\n\n\t\t\t// also, take the clip from the prototype action\n\t\t\tif ( clipObject === null )\n\t\t\t\tclipObject = prototypeAction._clip;\n\n\t\t}\n\n\t\t// clip must be known when specified via string\n\t\tif ( clipObject === null ) return null;\n\n\t\t// allocate all resources required to run it\n\t\tconst newAction = new AnimationAction( this, clipObject, optionalRoot, blendMode );\n\n\t\tthis._bindAction( newAction, prototypeAction );\n\n\t\t// and make the action known to the memory manager\n\t\tthis._addInactiveAction( newAction, clipUuid, rootUuid );\n\n\t\treturn newAction;\n\n\t}\n\n\t/**\n\t * Returns an existing animation action for the passed clip.\n\t *\n\t * @param {AnimationClip|string} clip - An animation clip or alternatively the name of the animation clip.\n\t * @param {Object3D} [optionalRoot] - An alternative root object.\n\t * @return {?AnimationAction} The animation action. Returns `null` if no action was found.\n\t */\n\texistingAction( clip, optionalRoot ) {\n\n\t\tconst root = optionalRoot || this._root,\n\t\t\trootUuid = root.uuid,\n\n\t\t\tclipObject = typeof clip === 'string' ?\n\t\t\t\tAnimationClip.findByName( root, clip ) : clip,\n\n\t\t\tclipUuid = clipObject ? clipObject.uuid : clip,\n\n\t\t\tactionsForClip = this._actionsByClip[ clipUuid ];\n\n\t\tif ( actionsForClip !== undefined ) {\n\n\t\t\treturn actionsForClip.actionByRoot[ rootUuid ] || null;\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\t/**\n\t * Deactivates all previously scheduled actions on this mixer.\n\t *\n\t * @return {AnimationMixer} A reference to this animation mixer.\n\t */\n\tstopAllAction() {\n\n\t\tconst actions = this._actions,\n\t\t\tnActions = this._nActiveActions;\n\n\t\tfor ( let i = nActions - 1; i \u003e= 0; -- i ) {\n\n\t\t\tactions[ i ].stop();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Advances the global mixer time and updates the animation.\n\t *\n\t * This is usually done in the render loop by passing the delta\n\t * time from {@link Clock} or {@link Timer}.\n\t *\n\t * @param {number} deltaTime - The delta time in seconds.\n\t * @return {AnimationMixer} A reference to this animation mixer.\n\t */\n\tupdate( deltaTime ) {\n\n\t\tdeltaTime *= this.timeScale;\n\n\t\tconst actions = this._actions,\n\t\t\tnActions = this._nActiveActions,\n\n\t\t\ttime = this.time += deltaTime,\n\t\t\ttimeDirection = Math.sign( deltaTime ),\n\n\t\t\taccuIndex = this._accuIndex ^= 1;\n\n\t\t// run active actions\n\n\t\tfor ( let i = 0; i !== nActions; ++ i ) {\n\n\t\t\tconst action = actions[ i ];\n\n\t\t\taction._update( time, deltaTime, timeDirection, accuIndex );\n\n\t\t}\n\n\t\t// update scene graph\n\n\t\tconst bindings = this._bindings,\n\t\t\tnBindings = this._nActiveBindings;\n\n\t\tfor ( let i = 0; i !== nBindings; ++ i ) {\n\n\t\t\tbindings[ i ].apply( accuIndex );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the global mixer to a specific time and updates the animation accordingly.\n\t *\n\t * This is useful when you need to jump to an exact time in an animation. The\n\t * input parameter will be scaled by {@link AnimationMixer#timeScale}\n\t *\n\t * @param {number} time - The time to set in seconds.\n\t * @return {AnimationMixer} A reference to this animation mixer.\n\t */\n\tsetTime( time ) {\n\n\t\tthis.time = 0; // Zero out time attribute for AnimationMixer object;\n\t\tfor ( let i = 0; i \u003c this._actions.length; i ++ ) {\n\n\t\t\tthis._actions[ i ].time = 0; // Zero out time attribute for all associated AnimationAction objects.\n\n\t\t}\n\n\t\treturn this.update( time ); // Update used to set exact time. Returns \"this\" AnimationMixer object.\n\n\t}\n\n\t/**\n\t * Returns this mixer's root object.\n\t *\n\t * @return {Object3D} The mixer's root object.\n\t */\n\tgetRoot() {\n\n\t\treturn this._root;\n\n\t}\n\n\t/**\n\t * Deallocates all memory resources for a clip. Before using this method make\n\t * sure to call {@link AnimationAction#stop} for all related actions.\n\t *\n\t * @param {AnimationClip} clip - The clip to uncache.\n\t */\n\tuncacheClip( clip ) {\n\n\t\tconst actions = this._actions,\n\t\t\tclipUuid = clip.uuid,\n\t\t\tactionsByClip = this._actionsByClip,\n\t\t\tactionsForClip = actionsByClip[ clipUuid ];\n\n\t\tif ( actionsForClip !== undefined ) {\n\n\t\t\t// note: just calling _removeInactiveAction would mess up the\n\t\t\t// iteration state and also require updating the state we can\n\t\t\t// just throw away\n\n\t\t\tconst actionsToRemove = actionsForClip.knownActions;\n\n\t\t\tfor ( let i = 0, n = actionsToRemove.length; i !== n; ++ i ) {\n\n\t\t\t\tconst action = actionsToRemove[ i ];\n\n\t\t\t\tthis._deactivateAction( action );\n\n\t\t\t\tconst cacheIndex = action._cacheIndex,\n\t\t\t\t\tlastInactiveAction = actions[ actions.length - 1 ];\n\n\t\t\t\taction._cacheIndex = null;\n\t\t\t\taction._byClipCacheIndex = null;\n\n\t\t\t\tlastInactiveAction._cacheIndex = cacheIndex;\n\t\t\t\tactions[ cacheIndex ] = lastInactiveAction;\n\t\t\t\tactions.pop();\n\n\t\t\t\tthis._removeInactiveBindingsForAction( action );\n\n\t\t\t}\n\n\t\t\tdelete actionsByClip[ clipUuid ];\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Deallocates all memory resources for a root object. Before using this\n\t * method make sure to call {@link AnimationAction#stop} for all related\n\t * actions or alternatively {@link AnimationMixer#stopAllAction} when the\n\t * mixer operates on a single root.\n\t *\n\t * @param {Object3D} root - The root object to uncache.\n\t */\n\tuncacheRoot( root ) {\n\n\t\tconst rootUuid = root.uuid,\n\t\t\tactionsByClip = this._actionsByClip;\n\n\t\tfor ( const clipUuid in actionsByClip ) {\n\n\t\t\tconst actionByRoot = actionsByClip[ clipUuid ].actionByRoot,\n\t\t\t\taction = actionByRoot[ rootUuid ];\n\n\t\t\tif ( action !== undefined ) {\n\n\t\t\t\tthis._deactivateAction( action );\n\t\t\t\tthis._removeInactiveAction( action );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst bindingsByRoot = this._bindingsByRootAndName,\n\t\t\tbindingByName = bindingsByRoot[ rootUuid ];\n\n\t\tif ( bindingByName !== undefined ) {\n\n\t\t\tfor ( const trackName in bindingByName ) {\n\n\t\t\t\tconst binding = bindingByName[ trackName ];\n\t\t\t\tbinding.restoreOriginalState();\n\t\t\t\tthis._removeInactiveBinding( binding );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Deallocates all memory resources for an action. The action is identified by the\n\t * given clip and an optional root object. Before using this method make\n\t * sure to call {@link AnimationAction#stop} to deactivate the action.\n\t *\n\t * @param {AnimationClip|string} clip - An animation clip or alternatively the name of the animation clip.\n\t * @param {Object3D} [optionalRoot] - An alternative root object.\n\t */\n\tuncacheAction( clip, optionalRoot ) {\n\n\t\tconst action = this.existingAction( clip, optionalRoot );\n\n\t\tif ( action !== null ) {\n\n\t\t\tthis._deactivateAction( action );\n\t\t\tthis._removeInactiveAction( action );\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * Represents a 3D render target.\n *\n * @augments RenderTarget\n */\nclass RenderTarget3D extends RenderTarget {\n\n\t/**\n\t * Constructs a new 3D render target.\n\t *\n\t * @param {number} [width=1] - The width of the render target.\n\t * @param {number} [height=1] - The height of the render target.\n\t * @param {number} [depth=1] - The height of the render target.\n\t * @param {RenderTarget~Options} [options] - The configuration object.\n\t */\n\tconstructor( width = 1, height = 1, depth = 1, options = {} ) {\n\n\t\tsuper( width, height, options );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isRenderTarget3D = true;\n\n\t\tthis.depth = depth;\n\n\t\t/**\n\t\t * Overwritten with a different texture type.\n\t\t *\n\t\t * @type {Data3DTexture}\n\t\t */\n\t\tthis.texture = new Data3DTexture( null, width, height, depth );\n\t\tthis._setTextureOptions( options );\n\n\t\tthis.texture.isRenderTargetTexture = true;\n\n\t}\n\n}\n\n/**\n * Represents a uniform which is a global shader variable. They are passed to shader programs.\n *\n * When declaring a uniform of a {@link ShaderMaterial}, it is declared by value or by object.\n * ```js\n * uniforms: {\n * \ttime: { value: 1.0 },\n * \tresolution: new Uniform( new Vector2() )\n * };\n * ```\n * Since this class can only be used in context of {@link ShaderMaterial}, it is only supported\n * in {@link WebGLRenderer}.\n */\nclass Uniform {\n\n\t/**\n\t * Constructs a new uniform.\n\t *\n\t * @param {any} value - The uniform value.\n\t */\n\tconstructor( value ) {\n\n\t\t/**\n\t\t * The uniform value.\n\t\t *\n\t\t * @type {any}\n\t\t */\n\t\tthis.value = value;\n\n\t}\n\n\t/**\n\t * Returns a new uniform with copied values from this instance.\n\t * If the value has a `clone()` method, the value is cloned as well.\n\t *\n\t * @return {Uniform} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new Uniform( this.value.clone === undefined ? this.value : this.value.clone() );\n\n\t}\n\n}\n\nlet _id = 0;\n\n/**\n * A class for managing multiple uniforms in a single group. The renderer will process\n * such a definition as a single UBO.\n *\n * Since this class can only be used in context of {@link ShaderMaterial}, it is only supported\n * in {@link WebGLRenderer}.\n *\n * @augments EventDispatcher\n */\nclass UniformsGroup extends EventDispatcher {\n\n\t/**\n\t * Constructs a new uniforms group.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isUniformsGroup = true;\n\n\t\t/**\n\t\t * The ID of the 3D object.\n\t\t *\n\t\t * @name UniformsGroup#id\n\t\t * @type {number}\n\t\t * @readonly\n\t\t */\n\t\tObject.defineProperty( this, 'id', { value: _id ++ } );\n\n\t\t/**\n\t\t * The name of the uniforms group.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\n\t\t/**\n\t\t * The buffer usage.\n\t\t *\n\t\t * @type {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)}\n\t\t * @default StaticDrawUsage\n\t\t */\n\t\tthis.usage = StaticDrawUsage;\n\n\t\t/**\n\t\t * An array holding the uniforms.\n\t\t *\n\t\t * @type {Array\u003cUniform\u003e}\n\t\t */\n\t\tthis.uniforms = [];\n\n\t}\n\n\t/**\n\t * Adds the given uniform to this uniforms group.\n\t *\n\t * @param {Uniform} uniform - The uniform to add.\n\t * @return {UniformsGroup} A reference to this uniforms group.\n\t */\n\tadd( uniform ) {\n\n\t\tthis.uniforms.push( uniform );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Removes the given uniform from this uniforms group.\n\t *\n\t * @param {Uniform} uniform - The uniform to remove.\n\t * @return {UniformsGroup} A reference to this uniforms group.\n\t */\n\tremove( uniform ) {\n\n\t\tconst index = this.uniforms.indexOf( uniform );\n\n\t\tif ( index !== -1 ) this.uniforms.splice( index, 1 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the name of this uniforms group.\n\t *\n\t * @param {string} name - The name to set.\n\t * @return {UniformsGroup} A reference to this uniforms group.\n\t */\n\tsetName( name ) {\n\n\t\tthis.name = name;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the usage of this uniforms group.\n\t *\n\t * @param {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)} value - The usage to set.\n\t * @return {UniformsGroup} A reference to this uniforms group.\n\t */\n\tsetUsage( value ) {\n\n\t\tthis.usage = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t *\n\t * @fires Texture#dispose\n\t */\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n\t/**\n\t * Copies the values of the given uniforms group to this instance.\n\t *\n\t * @param {UniformsGroup} source - The uniforms group to copy.\n\t * @return {UniformsGroup} A reference to this uniforms group.\n\t */\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\t\tthis.usage = source.usage;\n\n\t\tconst uniformsSource = source.uniforms;\n\n\t\tthis.uniforms.length = 0;\n\n\t\tfor ( let i = 0, l = uniformsSource.length; i \u003c l; i ++ ) {\n\n\t\t\tconst uniforms = Array.isArray( uniformsSource[ i ] ) ? uniformsSource[ i ] : [ uniformsSource[ i ] ];\n\n\t\t\tfor ( let j = 0; j \u003c uniforms.length; j ++ ) {\n\n\t\t\t\tthis.uniforms.push( uniforms[ j ].clone() );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new uniforms group with copied values from this instance.\n\t *\n\t * @return {UniformsGroup} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\n/**\n * An instanced version of an interleaved buffer.\n *\n * @augments InterleavedBuffer\n */\nclass InstancedInterleavedBuffer extends InterleavedBuffer {\n\n\t/**\n\t * Constructs a new instanced interleaved buffer.\n\t *\n\t * @param {TypedArray} array - A typed array with a shared buffer storing attribute data.\n\t * @param {number} stride - The number of typed-array elements per vertex.\n\t * @param {number} [meshPerAttribute=1] - Defines how often a value of this interleaved buffer should be repeated.\n\t */\n\tconstructor( array, stride, meshPerAttribute = 1 ) {\n\n\t\tsuper( array, stride );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isInstancedInterleavedBuffer = true;\n\n\t\t/**\n\t\t * Defines how often a value of this buffer attribute should be repeated,\n\t\t * see {@link InstancedBufferAttribute#meshPerAttribute}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.meshPerAttribute = meshPerAttribute;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.meshPerAttribute = source.meshPerAttribute;\n\n\t\treturn this;\n\n\t}\n\n\tclone( data ) {\n\n\t\tconst ib = super.clone( data );\n\n\t\tib.meshPerAttribute = this.meshPerAttribute;\n\n\t\treturn ib;\n\n\t}\n\n\ttoJSON( data ) {\n\n\t\tconst json = super.toJSON( data );\n\n\t\tjson.isInstancedInterleavedBuffer = true;\n\t\tjson.meshPerAttribute = this.meshPerAttribute;\n\n\t\treturn json;\n\n\t}\n\n}\n\n/**\n * An alternative version of a buffer attribute with more control over the VBO.\n *\n * The renderer does not construct a VBO for this kind of attribute. Instead, it uses\n * whatever VBO is passed in constructor and can later be altered via the `buffer` property.\n *\n * The most common use case for this class is when some kind of GPGPU calculation interferes\n * or even produces the VBOs in question.\n *\n * Notice that this class can only be used with {@link WebGLRenderer}.\n */\nclass GLBufferAttribute {\n\n\t/**\n\t * Constructs a new GL buffer attribute.\n\t *\n\t * @param {WebGLBuffer} buffer - The native WebGL buffer.\n\t * @param {number} type - The native data type (e.g. `gl.FLOAT`).\n\t * @param {number} itemSize - The item size.\n\t * @param {number} elementSize - The corresponding size (in bytes) for the given `type` parameter.\n\t * @param {number} count - The expected number of vertices in VBO.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( buffer, type, itemSize, elementSize, count, normalized = false ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isGLBufferAttribute = true;\n\n\t\t/**\n\t\t * The name of the buffer attribute.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\n\t\t/**\n\t\t * The native WebGL buffer.\n\t\t *\n\t\t * @type {WebGLBuffer}\n\t\t */\n\t\tthis.buffer = buffer;\n\n\t\t/**\n\t\t * The native data type.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.type = type;\n\n\t\t/**\n\t\t * The item size, see {@link BufferAttribute#itemSize}.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.itemSize = itemSize;\n\n\t\t/**\n\t\t * The corresponding size (in bytes) for the given `type` parameter.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.elementSize = elementSize;\n\n\t\t/**\n\t\t * The expected number of vertices in VBO.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.count = count;\n\n\t\t/**\n\t\t * Applies to integer data only. Indicates how the underlying data in the buffer maps to\n\t\t * the values in the GLSL code. For instance, if `buffer` contains data of `gl.UNSIGNED_SHORT`,\n\t\t * and `normalized` is `true`, the values `0 - +65535` in the buffer data will be mapped to\n\t\t * `0.0f - +1.0f` in the GLSL attribute. If `normalized` is `false`, the values will be converted\n\t\t * to floats unmodified, i.e. `65535` becomes `65535.0f`.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tthis.normalized = normalized;\n\n\t\t/**\n\t\t * A version number, incremented every time the `needsUpdate` is set to `true`.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.version = 0;\n\n\t}\n\n\t/**\n\t * Flag to indicate that this attribute has changed and should be re-sent to\n\t * the GPU. Set this to `true` when you modify the value of the array.\n\t *\n\t * @type {number}\n\t * @default false\n\t * @param {boolean} value\n\t */\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\t/**\n\t * Sets the given native WebGL buffer.\n\t *\n\t * @param {WebGLBuffer} buffer - The buffer to set.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetBuffer( buffer ) {\n\n\t\tthis.buffer = buffer;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given native data type and element size.\n\t *\n\t * @param {number} type - The native data type (e.g. `gl.FLOAT`).\n\t * @param {number} elementSize - The corresponding size (in bytes) for the given `type` parameter.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetType( type, elementSize ) {\n\n\t\tthis.type = type;\n\t\tthis.elementSize = elementSize;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the item size.\n\t *\n\t * @param {number} itemSize - The item size.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetItemSize( itemSize ) {\n\n\t\tthis.itemSize = itemSize;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the count (the expected number of vertices in VBO).\n\t *\n\t * @param {number} count - The count.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetCount( count ) {\n\n\t\tthis.count = count;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _matrix = /*@__PURE__*/ new Matrix4();\n\n/**\n * This class is designed to assist with raycasting. Raycasting is used for\n * mouse picking (working out what objects in the 3d space the mouse is over)\n * amongst other things.\n */\nclass Raycaster {\n\n\t/**\n\t * Constructs a new raycaster.\n\t *\n\t * @param {Vector3} origin - The origin vector where the ray casts from.\n\t * @param {Vector3} direction - The (normalized) direction vector that gives direction to the ray.\n\t * @param {number} [near=0] - All results returned are further away than near. Near can't be negative.\n\t * @param {number} [far=Infinity] - All results returned are closer than far. Far can't be lower than near.\n\t */\n\tconstructor( origin, direction, near = 0, far = Infinity ) {\n\n\t\t/**\n\t\t * The ray used for raycasting.\n\t\t *\n\t\t * @type {Ray}\n\t\t */\n\t\tthis.ray = new Ray( origin, direction );\n\n\t\t/**\n\t\t * All results returned are further away than near. Near can't be negative.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.near = near;\n\n\t\t/**\n\t\t * All results returned are closer than far. Far can't be lower than near.\n\t\t *\n\t\t * @type {number}\n\t\t * @default Infinity\n\t\t */\n\t\tthis.far = far;\n\n\t\t/**\n\t\t * The camera to use when raycasting against view-dependent objects such as\n\t\t * billboarded objects like sprites. This field can be set manually or\n\t\t * is set when calling `setFromCamera()`.\n\t\t *\n\t\t * @type {?Camera}\n\t\t * @default null\n\t\t */\n\t\tthis.camera = null;\n\n\t\t/**\n\t\t * Allows to selectively ignore 3D objects when performing intersection tests.\n\t\t * The following code example ensures that only 3D objects on layer `1` will be\n\t\t * honored by raycaster.\n\t\t * ```js\n\t\t * raycaster.layers.set( 1 );\n\t\t * object.layers.enable( 1 );\n\t\t * ```\n\t\t *\n\t\t * @type {Layers}\n\t\t */\n\t\tthis.layers = new Layers();\n\n\n\t\t/**\n\t\t * A parameter object that configures the raycasting. It has the structure:\n\t\t *\n\t\t * ```\n\t\t * {\n\t\t * \tMesh: {},\n\t\t * \tLine: { threshold: 1 },\n\t\t * \tLOD: {},\n\t\t * \tPoints: { threshold: 1 },\n\t\t * \tSprite: {}\n\t\t * }\n\t\t * ```\n\t\t * Where `threshold` is the precision of the raycaster when intersecting objects, in world units.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.params = {\n\t\t\tMesh: {},\n\t\t\tLine: { threshold: 1 },\n\t\t\tLOD: {},\n\t\t\tPoints: { threshold: 1 },\n\t\t\tSprite: {}\n\t\t};\n\n\t}\n\n\t/**\n\t * Updates the ray with a new origin and direction by copying the values from the arguments.\n\t *\n\t * @param {Vector3} origin - The origin vector where the ray casts from.\n\t * @param {Vector3} direction - The (normalized) direction vector that gives direction to the ray.\n\t */\n\tset( origin, direction ) {\n\n\t\t// direction is assumed to be normalized (for accurate distance calculations)\n\n\t\tthis.ray.set( origin, direction );\n\n\t}\n\n\t/**\n\t * Uses the given coordinates and camera to compute a new origin and direction for the internal ray.\n\t *\n\t * @param {Vector2} coords - 2D coordinates of the mouse, in normalized device coordinates (NDC).\n\t * X and Y components should be between `-1` and `1`.\n\t * @param {Camera} camera - The camera from which the ray should originate.\n\t */\n\tsetFromCamera( coords, camera ) {\n\n\t\tif ( camera.isPerspectiveCamera ) {\n\n\t\t\tthis.ray.origin.setFromMatrixPosition( camera.matrixWorld );\n\t\t\tthis.ray.direction.set( coords.x, coords.y, 0.5 ).unproject( camera ).sub( this.ray.origin ).normalize();\n\t\t\tthis.camera = camera;\n\n\t\t} else if ( camera.isOrthographicCamera ) {\n\n\t\t\tthis.ray.origin.set( coords.x, coords.y, ( camera.near + camera.far ) / ( camera.near - camera.far ) ).unproject( camera ); // set origin in plane of camera\n\t\t\tthis.ray.direction.set( 0, 0, -1 ).transformDirection( camera.matrixWorld );\n\t\t\tthis.camera = camera;\n\n\t\t} else {\n\n\t\t\terror( 'Raycaster: Unsupported camera type: ' + camera.type );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Uses the given WebXR controller to compute a new origin and direction for the internal ray.\n\t *\n\t * @param {WebXRController} controller - The controller to copy the position and direction from.\n\t * @return {Raycaster} A reference to this raycaster.\n\t */\n\tsetFromXRController( controller ) {\n\n\t\t_matrix.identity().extractRotation( controller.matrixWorld );\n\n\t\tthis.ray.origin.setFromMatrixPosition( controller.matrixWorld );\n\t\tthis.ray.direction.set( 0, 0, -1 ).applyMatrix4( _matrix );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The intersection point of a raycaster intersection test.\n\t * @typedef {Object} Raycaster~Intersection\n\t * @property {number} distance - The distance from the ray's origin to the intersection point.\n\t * @property {number} distanceToRay -  Some 3D objects e.g. {@link Points} provide the distance of the\n\t * intersection to the nearest point on the ray. For other objects it will be `undefined`.\n\t * @property {Vector3} point - The intersection point, in world coordinates.\n\t * @property {Object} face - The face that has been intersected.\n\t * @property {number} faceIndex - The face index.\n\t * @property {Object3D} object - The 3D object that has been intersected.\n\t * @property {Vector2} uv - U,V coordinates at point of intersection.\n\t * @property {Vector2} uv1 - Second set of U,V coordinates at point of intersection.\n\t * @property {Vector3} normal - Interpolated normal vector at point of intersection.\n\t * @property {number} instanceId - The index number of the instance where the ray\n\t * intersects the {@link InstancedMesh}.\n\t */\n\n\t/**\n\t * Checks all intersection between the ray and the object with or without the\n\t * descendants. Intersections are returned sorted by distance, closest first.\n\t *\n\t * `Raycaster` delegates to the `raycast()` method of the passed 3D object, when\n\t * evaluating whether the ray intersects the object or not. This allows meshes to respond\n\t * differently to ray casting than lines or points.\n\t *\n\t * Note that for meshes, faces must be pointed towards the origin of the ray in order\n\t * to be detected; intersections of the ray passing through the back of a face will not\n\t * be detected. To raycast against both faces of an object, you'll want to set  {@link Material#side}\n\t * to `THREE.DoubleSide`.\n\t *\n\t * @param {Object3D} object - The 3D object to check for intersection with the ray.\n\t * @param {boolean} [recursive=true] - If set to `true`, it also checks all descendants.\n\t * Otherwise it only checks intersection with the object.\n\t * @param {Array\u003cRaycaster~Intersection\u003e} [intersects=[]] The target array that holds the result of the method.\n\t * @return {Array\u003cRaycaster~Intersection\u003e} An array holding the intersection points.\n\t */\n\tintersectObject( object, recursive = true, intersects = [] ) {\n\n\t\tintersect( object, this, intersects, recursive );\n\n\t\tintersects.sort( ascSort );\n\n\t\treturn intersects;\n\n\t}\n\n\t/**\n\t * Checks all intersection between the ray and the objects with or without\n\t * the descendants. Intersections are returned sorted by distance, closest first.\n\t *\n\t * @param {Array\u003cObject3D\u003e} objects - The 3D objects to check for intersection with the ray.\n\t * @param {boolean} [recursive=true] - If set to `true`, it also checks all descendants.\n\t * Otherwise it only checks intersection with the object.\n\t * @param {Array\u003cRaycaster~Intersection\u003e} [intersects=[]] The target array that holds the result of the method.\n\t * @return {Array\u003cRaycaster~Intersection\u003e} An array holding the intersection points.\n\t */\n\tintersectObjects( objects, recursive = true, intersects = [] ) {\n\n\t\tfor ( let i = 0, l = objects.length; i \u003c l; i ++ ) {\n\n\t\t\tintersect( objects[ i ], this, intersects, recursive );\n\n\t\t}\n\n\t\tintersects.sort( ascSort );\n\n\t\treturn intersects;\n\n\t}\n\n}\n\nfunction ascSort( a, b ) {\n\n\treturn a.distance - b.distance;\n\n}\n\nfunction intersect( object, raycaster, intersects, recursive ) {\n\n\tlet propagate = true;\n\n\tif ( object.layers.test( raycaster.layers ) ) {\n\n\t\tconst result = object.raycast( raycaster, intersects );\n\n\t\tif ( result === false ) propagate = false;\n\n\t}\n\n\tif ( propagate === true \u0026\u0026 recursive === true ) {\n\n\t\tconst children = object.children;\n\n\t\tfor ( let i = 0, l = children.length; i \u003c l; i ++ ) {\n\n\t\t\tintersect( children[ i ], raycaster, intersects, true );\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * This class is an alternative to {@link Clock} with a different API design and behavior.\n * The goal is to avoid the conceptual flaws that became apparent in `Clock` over time.\n *\n * - `Timer` has an `update()` method that updates its internal state. That makes it possible to\n * call `getDelta()` and `getElapsed()` multiple times per simulation step without getting different values.\n * - The class can make use of the Page Visibility API to avoid large time delta values when the app\n * is inactive (e.g. tab switched or browser hidden).\n *\n * ```js\n * const timer = new Timer();\n * timer.connect( document ); // use Page Visibility API\n * ```\n */\nclass Timer {\n\n\t/**\n\t * Constructs a new timer.\n\t */\n\tconstructor() {\n\n\t\tthis._previousTime = 0;\n\t\tthis._currentTime = 0;\n\t\tthis._startTime = performance.now();\n\n\t\tthis._delta = 0;\n\t\tthis._elapsed = 0;\n\n\t\tthis._timescale = 1;\n\n\t\tthis._document = null;\n\t\tthis._pageVisibilityHandler = null;\n\n\t}\n\n\t/**\n\t * Connect the timer to the given document.Calling this method is not mandatory to\n\t * use the timer but enables the usage of the Page Visibility API to avoid large time\n\t * delta values.\n\t *\n\t * @param {Document} document - The document.\n\t */\n\tconnect( document ) {\n\n\t\tthis._document = document;\n\n\t\t// use Page Visibility API to avoid large time delta values\n\n\t\tif ( document.hidden !== undefined ) {\n\n\t\t\tthis._pageVisibilityHandler = handleVisibilityChange.bind( this );\n\n\t\t\tdocument.addEventListener( 'visibilitychange', this._pageVisibilityHandler, false );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Disconnects the timer from the DOM and also disables the usage of the Page Visibility API.\n\t */\n\tdisconnect() {\n\n\t\tif ( this._pageVisibilityHandler !== null ) {\n\n\t\t\tthis._document.removeEventListener( 'visibilitychange', this._pageVisibilityHandler );\n\t\t\tthis._pageVisibilityHandler = null;\n\n\t\t}\n\n\t\tthis._document = null;\n\n\t}\n\n\t/**\n\t * Returns the time delta in seconds.\n\t *\n\t * @return {number} The time delta in second.\n\t */\n\tgetDelta() {\n\n\t\treturn this._delta / 1000;\n\n\t}\n\n\t/**\n\t * Returns the elapsed time in seconds.\n\t *\n\t * @return {number} The elapsed time in second.\n\t */\n\tgetElapsed() {\n\n\t\treturn this._elapsed / 1000;\n\n\t}\n\n\t/**\n\t * Returns the timescale.\n\t *\n\t * @return {number} The timescale.\n\t */\n\tgetTimescale() {\n\n\t\treturn this._timescale;\n\n\t}\n\n\t/**\n\t * Sets the given timescale which scale the time delta computation\n\t * in `update()`.\n\t *\n\t * @param {number} timescale - The timescale to set.\n\t * @return {Timer} A reference to this timer.\n\t */\n\tsetTimescale( timescale ) {\n\n\t\tthis._timescale = timescale;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Resets the time computation for the current simulation step.\n\t *\n\t * @return {Timer} A reference to this timer.\n\t */\n\treset() {\n\n\t\tthis._currentTime = performance.now() - this._startTime;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Can be used to free all internal resources. Usually called when\n\t * the timer instance isn't required anymore.\n\t */\n\tdispose() {\n\n\t\tthis.disconnect();\n\n\t}\n\n\t/**\n\t * Updates the internal state of the timer. This method should be called\n\t * once per simulation step and before you perform queries against the timer\n\t * (e.g. via `getDelta()`).\n\t *\n\t * @param {number} timestamp - The current time in milliseconds. Can be obtained\n\t * from the `requestAnimationFrame` callback argument. If not provided, the current\n\t * time will be determined with `performance.now`.\n\t * @return {Timer} A reference to this timer.\n\t */\n\tupdate( timestamp ) {\n\n\t\tif ( this._pageVisibilityHandler !== null \u0026\u0026 this._document.hidden === true ) {\n\n\t\t\tthis._delta = 0;\n\n\t\t} else {\n\n\t\t\tthis._previousTime = this._currentTime;\n\t\t\tthis._currentTime = ( timestamp !== undefined ? timestamp : performance.now() ) - this._startTime;\n\n\t\t\tthis._delta = ( this._currentTime - this._previousTime ) * this._timescale;\n\t\t\tthis._elapsed += this._delta; // _elapsed is the accumulation of all previous deltas\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nfunction handleVisibilityChange() {\n\n\tif ( this._document.hidden === false ) this.reset();\n\n}\n\n/**\n * This class can be used to represent points in 3D space as\n * [Spherical coordinates](https://en.wikipedia.org/wiki/Spherical_coordinate_system).\n */\nclass Spherical {\n\n\t/**\n\t * Constructs a new spherical.\n\t *\n\t * @param {number} [radius=1] - The radius, or the Euclidean distance (straight-line distance) from the point to the origin.\n\t * @param {number} [phi=0] - The polar angle in radians from the y (up) axis.\n\t * @param {number} [theta=0] - The equator/azimuthal angle in radians around the y (up) axis.\n\t */\n\tconstructor( radius = 1, phi = 0, theta = 0 ) {\n\n\t\t/**\n\t\t * The radius, or the Euclidean distance (straight-line distance) from the point to the origin.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.radius = radius;\n\n\t\t/**\n\t\t * The polar angle in radians from the y (up) axis.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.phi = phi;\n\n\t\t/**\n\t\t * The equator/azimuthal angle in radians around the y (up) axis.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.theta = theta;\n\n\t}\n\n\t/**\n\t * Sets the spherical components by copying the given values.\n\t *\n\t * @param {number} radius - The radius.\n\t * @param {number} phi - The polar angle.\n\t * @param {number} theta - The azimuthal angle.\n\t * @return {Spherical} A reference to this spherical.\n\t */\n\tset( radius, phi, theta ) {\n\n\t\tthis.radius = radius;\n\t\tthis.phi = phi;\n\t\tthis.theta = theta;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the values of the given spherical to this instance.\n\t *\n\t * @param {Spherical} other - The spherical to copy.\n\t * @return {Spherical} A reference to this spherical.\n\t */\n\tcopy( other ) {\n\n\t\tthis.radius = other.radius;\n\t\tthis.phi = other.phi;\n\t\tthis.theta = other.theta;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Restricts the polar angle [page:.phi phi] to be between `0.000001` and pi -\n\t * `0.000001`.\n\t *\n\t * @return {Spherical} A reference to this spherical.\n\t */\n\tmakeSafe() {\n\n\t\tconst EPS = 0.000001;\n\t\tthis.phi = clamp( this.phi, EPS, Math.PI - EPS );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the spherical components from the given vector which is assumed to hold\n\t * Cartesian coordinates.\n\t *\n\t * @param {Vector3} v - The vector to set.\n\t * @return {Spherical} A reference to this spherical.\n\t */\n\tsetFromVector3( v ) {\n\n\t\treturn this.setFromCartesianCoords( v.x, v.y, v.z );\n\n\t}\n\n\t/**\n\t * Sets the spherical components from the given Cartesian coordinates.\n\t *\n\t * @param {number} x - The x value.\n\t * @param {number} y - The y value.\n\t * @param {number} z - The z value.\n\t * @return {Spherical} A reference to this spherical.\n\t */\n\tsetFromCartesianCoords( x, y, z ) {\n\n\t\tthis.radius = Math.sqrt( x * x + y * y + z * z );\n\n\t\tif ( this.radius === 0 ) {\n\n\t\t\tthis.theta = 0;\n\t\t\tthis.phi = 0;\n\n\t\t} else {\n\n\t\t\tthis.theta = Math.atan2( x, z );\n\t\t\tthis.phi = Math.acos( clamp( y / this.radius, -1, 1 ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new spherical with copied values from this instance.\n\t *\n\t * @return {Spherical} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\n/**\n * This class can be used to represent points in 3D space as\n * [Cylindrical coordinates](https://en.wikipedia.org/wiki/Cylindrical_coordinate_system).\n */\nclass Cylindrical {\n\n\t/**\n\t * Constructs a new cylindrical.\n\t *\n\t * @param {number} [radius=1] - The distance from the origin to a point in the x-z plane.\n\t * @param {number} [theta=0] - A counterclockwise angle in the x-z plane measured in radians from the positive z-axis.\n\t * @param {number} [y=0] - The height above the x-z plane.\n\t */\n\tconstructor( radius = 1, theta = 0, y = 0 ) {\n\n\t\t/**\n\t\t * The distance from the origin to a point in the x-z plane.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.radius = radius;\n\n\t\t/**\n\t\t * A counterclockwise angle in the x-z plane measured in radians from the positive z-axis.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.theta = theta;\n\n\t\t/**\n\t\t * The height above the x-z plane.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.y = y;\n\n\t}\n\n\t/**\n\t * Sets the cylindrical components by copying the given values.\n\t *\n\t * @param {number} radius - The radius.\n\t * @param {number} theta - The theta angle.\n\t * @param {number} y - The height value.\n\t * @return {Cylindrical} A reference to this cylindrical.\n\t */\n\tset( radius, theta, y ) {\n\n\t\tthis.radius = radius;\n\t\tthis.theta = theta;\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the values of the given cylindrical to this instance.\n\t *\n\t * @param {Cylindrical} other - The cylindrical to copy.\n\t * @return {Cylindrical} A reference to this cylindrical.\n\t */\n\tcopy( other ) {\n\n\t\tthis.radius = other.radius;\n\t\tthis.theta = other.theta;\n\t\tthis.y = other.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the cylindrical components from the given vector which is assumed to hold\n\t * Cartesian coordinates.\n\t *\n\t * @param {Vector3} v - The vector to set.\n\t * @return {Cylindrical} A reference to this cylindrical.\n\t */\n\tsetFromVector3( v ) {\n\n\t\treturn this.setFromCartesianCoords( v.x, v.y, v.z );\n\n\t}\n\n\t/**\n\t * Sets the cylindrical components from the given Cartesian coordinates.\n\t *\n\t * @param {number} x - The x value.\n\t * @param {number} y - The x value.\n\t * @param {number} z - The x value.\n\t * @return {Cylindrical} A reference to this cylindrical.\n\t */\n\tsetFromCartesianCoords( x, y, z ) {\n\n\t\tthis.radius = Math.sqrt( x * x + z * z );\n\t\tthis.theta = Math.atan2( x, z );\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new cylindrical with copied values from this instance.\n\t *\n\t * @return {Cylindrical} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\n/**\n * Represents a 2x2 matrix.\n *\n * A Note on Row-Major and Column-Major Ordering:\n *\n * The constructor and {@link Matrix2#set} method take arguments in\n * [row-major](https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order)\n * order, while internally they are stored in the {@link Matrix2#elements} array in column-major order.\n * This means that calling:\n * ```js\n * const m = new THREE.Matrix2();\n * m.set( 11, 12,\n *        21, 22 );\n * ```\n * will result in the elements array containing:\n * ```js\n * m.elements = [ 11, 21,\n *                12, 22 ];\n * ```\n * and internally all calculations are performed using column-major ordering.\n * However, as the actual ordering makes no difference mathematically and\n * most people are used to thinking about matrices in row-major order, the\n * three.js documentation shows matrices in row-major order. Just bear in\n * mind that if you are reading the source code, you'll have to take the\n * transpose of any matrices outlined here to make sense of the calculations.\n */\nclass Matrix2 {\n\n\t/**\n\t * Constructs a new 2x2 matrix. The arguments are supposed to be\n\t * in row-major order. If no arguments are provided, the constructor\n\t * initializes the matrix as an identity matrix.\n\t *\n\t * @param {number} [n11] - 1-1 matrix element.\n\t * @param {number} [n12] - 1-2 matrix element.\n\t * @param {number} [n21] - 2-1 matrix element.\n\t * @param {number} [n22] - 2-2 matrix element.\n\t */\n\tconstructor( n11, n12, n21, n22 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tMatrix2.prototype.isMatrix2 = true;\n\n\t\t/**\n\t\t * A column-major list of matrix values.\n\t\t *\n\t\t * @type {Array\u003cnumber\u003e}\n\t\t */\n\t\tthis.elements = [\n\t\t\t1, 0,\n\t\t\t0, 1,\n\t\t];\n\n\t\tif ( n11 !== undefined ) {\n\n\t\t\tthis.set( n11, n12, n21, n22 );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Sets this matrix to the 2x2 identity matrix.\n\t *\n\t * @return {Matrix2} A reference to this matrix.\n\t */\n\tidentity() {\n\n\t\tthis.set(\n\t\t\t1, 0,\n\t\t\t0, 1,\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the elements of the matrix from the given array.\n\t *\n\t * @param {Array\u003cnumber\u003e} array - The matrix elements in column-major order.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Matrix2} A reference to this matrix.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tfor ( let i = 0; i \u003c 4; i ++ ) {\n\n\t\t\tthis.elements[ i ] = array[ i + offset ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the elements of the matrix.The arguments are supposed to be\n\t * in row-major order.\n\t *\n\t * @param {number} n11 - 1-1 matrix element.\n\t * @param {number} n12 - 1-2 matrix element.\n\t * @param {number} n21 - 2-1 matrix element.\n\t * @param {number} n22 - 2-2 matrix element.\n\t * @return {Matrix2} A reference to this matrix.\n\t */\n\tset( n11, n12, n21, n22 ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] = n11; te[ 2 ] = n12;\n\t\tte[ 1 ] = n21; te[ 3 ] = n22;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _vector$4 = /*@__PURE__*/ new Vector2();\n\n/**\n * Represents an axis-aligned bounding box (AABB) in 2D space.\n */\nclass Box2 {\n\n\t/**\n\t * Constructs a new bounding box.\n\t *\n\t * @param {Vector2} [min=(Infinity,Infinity)] - A vector representing the lower boundary of the box.\n\t * @param {Vector2} [max=(-Infinity,-Infinity)] - A vector representing the upper boundary of the box.\n\t */\n\tconstructor( min = new Vector2( + Infinity, + Infinity ), max = new Vector2( - Infinity, - Infinity ) ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isBox2 = true;\n\n\t\t/**\n\t\t * The lower boundary of the box.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.min = min;\n\n\t\t/**\n\t\t * The upper boundary of the box.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.max = max;\n\n\t}\n\n\t/**\n\t * Sets the lower and upper boundaries of this box.\n\t * Please note that this method only copies the values from the given objects.\n\t *\n\t * @param {Vector2} min - The lower boundary of the box.\n\t * @param {Vector2} max - The upper boundary of the box.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\tset( min, max ) {\n\n\t\tthis.min.copy( min );\n\t\tthis.max.copy( max );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the upper and lower bounds of this box so it encloses the position data\n\t * in the given array.\n\t *\n\t * @param {Array\u003cVector2\u003e} points - An array holding 2D position data as instances of {@link Vector2}.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\tsetFromPoints( points ) {\n\n\t\tthis.makeEmpty();\n\n\t\tfor ( let i = 0, il = points.length; i \u003c il; i ++ ) {\n\n\t\t\tthis.expandByPoint( points[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Centers this box on the given center vector and sets this box's width, height and\n\t * depth to the given size values.\n\t *\n\t * @param {Vector2} center - The center of the box.\n\t * @param {Vector2} size - The x and y dimensions of the box.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\tsetFromCenterAndSize( center, size ) {\n\n\t\tconst halfSize = _vector$4.copy( size ).multiplyScalar( 0.5 );\n\t\tthis.min.copy( center ).sub( halfSize );\n\t\tthis.max.copy( center ).add( halfSize );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new box with copied values from this instance.\n\t *\n\t * @return {Box2} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Copies the values of the given box to this instance.\n\t *\n\t * @param {Box2} box - The box to copy.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\tcopy( box ) {\n\n\t\tthis.min.copy( box.min );\n\t\tthis.max.copy( box.max );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Makes this box empty which means in encloses a zero space in 2D.\n\t *\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\tmakeEmpty() {\n\n\t\tthis.min.x = this.min.y = + Infinity;\n\t\tthis.max.x = this.max.y = - Infinity;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns true if this box includes zero points within its bounds.\n\t * Note that a box with equal lower and upper bounds still includes one\n\t * point, the one both bounds share.\n\t *\n\t * @return {boolean} Whether this box is empty or not.\n\t */\n\tisEmpty() {\n\n\t\t// this is a more robust check for empty than ( volume \u003c= 0 ) because volume can get positive with two negative axes\n\n\t\treturn ( this.max.x \u003c this.min.x ) || ( this.max.y \u003c this.min.y );\n\n\t}\n\n\t/**\n\t * Returns the center point of this box.\n\t *\n\t * @param {Vector2} target - The target vector that is used to store the method's result.\n\t * @return {Vector2} The center point.\n\t */\n\tgetCenter( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 );\n\n\t}\n\n\t/**\n\t * Returns the dimensions of this box.\n\t *\n\t * @param {Vector2} target - The target vector that is used to store the method's result.\n\t * @return {Vector2} The size.\n\t */\n\tgetSize( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0 ) : target.subVectors( this.max, this.min );\n\n\t}\n\n\t/**\n\t * Expands the boundaries of this box to include the given point.\n\t *\n\t * @param {Vector2} point - The point that should be included by the bounding box.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\texpandByPoint( point ) {\n\n\t\tthis.min.min( point );\n\t\tthis.max.max( point );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Expands this box equilaterally by the given vector. The width of this\n\t * box will be expanded by the x component of the vector in both\n\t * directions. The height of this box will be expanded by the y component of\n\t * the vector in both directions.\n\t *\n\t * @param {Vector2} vector - The vector that should expand the bounding box.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\texpandByVector( vector ) {\n\n\t\tthis.min.sub( vector );\n\t\tthis.max.add( vector );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Expands each dimension of the box by the given scalar. If negative, the\n\t * dimensions of the box will be contracted.\n\t *\n\t * @param {number} scalar - The scalar value that should expand the bounding box.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\texpandByScalar( scalar ) {\n\n\t\tthis.min.addScalar( - scalar );\n\t\tthis.max.addScalar( scalar );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if the given point lies within or on the boundaries of this box.\n\t *\n\t * @param {Vector2} point - The point to test.\n\t * @return {boolean} Whether the bounding box contains the given point or not.\n\t */\n\tcontainsPoint( point ) {\n\n\t\treturn point.x \u003e= this.min.x \u0026\u0026 point.x \u003c= this.max.x \u0026\u0026\n\t\t\tpoint.y \u003e= this.min.y \u0026\u0026 point.y \u003c= this.max.y;\n\n\t}\n\n\t/**\n\t * Returns `true` if this bounding box includes the entirety of the given bounding box.\n\t * If this box and the given one are identical, this function also returns `true`.\n\t *\n\t * @param {Box2} box - The bounding box to test.\n\t * @return {boolean} Whether the bounding box contains the given bounding box or not.\n\t */\n\tcontainsBox( box ) {\n\n\t\treturn this.min.x \u003c= box.min.x \u0026\u0026 box.max.x \u003c= this.max.x \u0026\u0026\n\t\t\tthis.min.y \u003c= box.min.y \u0026\u0026 box.max.y \u003c= this.max.y;\n\n\t}\n\n\t/**\n\t * Returns a point as a proportion of this box's width and height.\n\t *\n\t * @param {Vector2} point - A point in 2D space.\n\t * @param {Vector2} target - The target vector that is used to store the method's result.\n\t * @return {Vector2} A point as a proportion of this box's width and height.\n\t */\n\tgetParameter( point, target ) {\n\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\n\t\treturn target.set(\n\t\t\t( point.x - this.min.x ) / ( this.max.x - this.min.x ),\n\t\t\t( point.y - this.min.y ) / ( this.max.y - this.min.y )\n\t\t);\n\n\t}\n\n\t/**\n\t * Returns `true` if the given bounding box intersects with this bounding box.\n\t *\n\t * @param {Box2} box - The bounding box to test.\n\t * @return {boolean} Whether the given bounding box intersects with this bounding box.\n\t */\n\tintersectsBox( box ) {\n\n\t\t// using 4 splitting planes to rule out intersections\n\n\t\treturn box.max.x \u003e= this.min.x \u0026\u0026 box.min.x \u003c= this.max.x \u0026\u0026\n\t\t\tbox.max.y \u003e= this.min.y \u0026\u0026 box.min.y \u003c= this.max.y;\n\n\t}\n\n\t/**\n\t * Clamps the given point within the bounds of this box.\n\t *\n\t * @param {Vector2} point - The point to clamp.\n\t * @param {Vector2} target - The target vector that is used to store the method's result.\n\t * @return {Vector2} The clamped point.\n\t */\n\tclampPoint( point, target ) {\n\n\t\treturn target.copy( point ).clamp( this.min, this.max );\n\n\t}\n\n\t/**\n\t * Returns the euclidean distance from any edge of this box to the specified point. If\n\t * the given point lies inside of this box, the distance will be `0`.\n\t *\n\t * @param {Vector2} point - The point to compute the distance to.\n\t * @return {number} The euclidean distance.\n\t */\n\tdistanceToPoint( point ) {\n\n\t\treturn this.clampPoint( point, _vector$4 ).distanceTo( point );\n\n\t}\n\n\t/**\n\t * Computes the intersection of this bounding box and the given one, setting the upper\n\t * bound of this box to the lesser of the two boxes' upper bounds and the\n\t * lower bound of this box to the greater of the two boxes' lower bounds. If\n\t * there's no overlap, makes this box empty.\n\t *\n\t * @param {Box2} box - The bounding box to intersect with.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\tintersect( box ) {\n\n\t\tthis.min.max( box.min );\n\t\tthis.max.min( box.max );\n\n\t\tif ( this.isEmpty() ) this.makeEmpty();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes the union of this box and another and the given one, setting the upper\n\t * bound of this box to the greater of the two boxes' upper bounds and the\n\t * lower bound of this box to the lesser of the two boxes' lower bounds.\n\t *\n\t * @param {Box2} box - The bounding box that will be unioned with this instance.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\tunion( box ) {\n\n\t\tthis.min.min( box.min );\n\t\tthis.max.max( box.max );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given offset to both the upper and lower bounds of this bounding box,\n\t * effectively moving it in 2D space.\n\t *\n\t * @param {Vector2} offset - The offset that should be used to translate the bounding box.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\ttranslate( offset ) {\n\n\t\tthis.min.add( offset );\n\t\tthis.max.add( offset );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this bounding box is equal with the given one.\n\t *\n\t * @param {Box2} box - The box to test for equality.\n\t * @return {boolean} Whether this bounding box is equal with the given one.\n\t */\n\tequals( box ) {\n\n\t\treturn box.min.equals( this.min ) \u0026\u0026 box.max.equals( this.max );\n\n\t}\n\n}\n\nconst _startP = /*@__PURE__*/ new Vector3();\nconst _startEnd = /*@__PURE__*/ new Vector3();\n\nconst _d1 = /*@__PURE__*/ new Vector3();\nconst _d2 = /*@__PURE__*/ new Vector3();\nconst _r = /*@__PURE__*/ new Vector3();\nconst _c1 = /*@__PURE__*/ new Vector3();\nconst _c2 = /*@__PURE__*/ new Vector3();\n\n/**\n * An analytical line segment in 3D space represented by a start and end point.\n */\nclass Line3 {\n\n\t/**\n\t * Constructs a new line segment.\n\t *\n\t * @param {Vector3} [start=(0,0,0)] - Start of the line segment.\n\t * @param {Vector3} [end=(0,0,0)] - End of the line segment.\n\t */\n\tconstructor( start = new Vector3(), end = new Vector3() ) {\n\n\t\t/**\n\t\t * Start of the line segment.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.start = start;\n\n\t\t/**\n\t\t * End of the line segment.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.end = end;\n\n\t}\n\n\t/**\n\t * Sets the start and end values by copying the given vectors.\n\t *\n\t * @param {Vector3} start - The start point.\n\t * @param {Vector3} end - The end point.\n\t * @return {Line3} A reference to this line segment.\n\t */\n\tset( start, end ) {\n\n\t\tthis.start.copy( start );\n\t\tthis.end.copy( end );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the values of the given line segment to this instance.\n\t *\n\t * @param {Line3} line - The line segment to copy.\n\t * @return {Line3} A reference to this line segment.\n\t */\n\tcopy( line ) {\n\n\t\tthis.start.copy( line.start );\n\t\tthis.end.copy( line.end );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the center of the line segment.\n\t *\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The center point.\n\t */\n\tgetCenter( target ) {\n\n\t\treturn target.addVectors( this.start, this.end ).multiplyScalar( 0.5 );\n\n\t}\n\n\t/**\n\t * Returns the delta vector of the line segment's start and end point.\n\t *\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The delta vector.\n\t */\n\tdelta( target ) {\n\n\t\treturn target.subVectors( this.end, this.start );\n\n\t}\n\n\t/**\n\t * Returns the squared Euclidean distance between the line' start and end point.\n\t *\n\t * @return {number} The squared Euclidean distance.\n\t */\n\tdistanceSq() {\n\n\t\treturn this.start.distanceToSquared( this.end );\n\n\t}\n\n\t/**\n\t * Returns the Euclidean distance between the line' start and end point.\n\t *\n\t * @return {number} The Euclidean distance.\n\t */\n\tdistance() {\n\n\t\treturn this.start.distanceTo( this.end );\n\n\t}\n\n\t/**\n\t * Returns a vector at a certain position along the line segment.\n\t *\n\t * @param {number} t - A value between `[0,1]` to represent a position along the line segment.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The delta vector.\n\t */\n\tat( t, target ) {\n\n\t\treturn this.delta( target ).multiplyScalar( t ).add( this.start );\n\n\t}\n\n\t/**\n\t * Returns a point parameter based on the closest point as projected on the line segment.\n\t *\n\t * @param {Vector3} point - The point for which to return a point parameter.\n\t * @param {boolean} clampToLine - Whether to clamp the result to the range `[0,1]` or not.\n\t * @return {number} The point parameter.\n\t */\n\tclosestPointToPointParameter( point, clampToLine ) {\n\n\t\t_startP.subVectors( point, this.start );\n\t\t_startEnd.subVectors( this.end, this.start );\n\n\t\tconst startEnd2 = _startEnd.dot( _startEnd );\n\t\tconst startEnd_startP = _startEnd.dot( _startP );\n\n\t\tlet t = startEnd_startP / startEnd2;\n\n\t\tif ( clampToLine ) {\n\n\t\t\tt = clamp( t, 0, 1 );\n\n\t\t}\n\n\t\treturn t;\n\n\t}\n\n\t/**\n\t * Returns the closest point on the line for a given point.\n\t *\n\t * @param {Vector3} point - The point to compute the closest point on the line for.\n\t * @param {boolean} clampToLine - Whether to clamp the result to the range `[0,1]` or not.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The closest point on the line.\n\t */\n\tclosestPointToPoint( point, clampToLine, target ) {\n\n\t\tconst t = this.closestPointToPointParameter( point, clampToLine );\n\n\t\treturn this.delta( target ).multiplyScalar( t ).add( this.start );\n\n\t}\n\n\t/**\n\t * Returns the closest squared distance between this line segment and the given one.\n\t *\n\t * @param {Line3} line - The line segment to compute the closest squared distance to.\n\t * @param {Vector3} [c1] - The closest point on this line segment.\n\t * @param {Vector3} [c2] - The closest point on the given line segment.\n\t * @return {number} The squared distance between this line segment and the given one.\n\t */\n\tdistanceSqToLine3( line, c1 = _c1, c2 = _c2 ) {\n\n\t\t// from Real-Time Collision Detection by Christer Ericson, chapter 5.1.9\n\n\t\t// Computes closest points C1 and C2 of S1(s)=P1+s*(Q1-P1) and\n\t\t// S2(t)=P2+t*(Q2-P2), returning s and t. Function result is squared\n\t\t// distance between between S1(s) and S2(t)\n\n\t\tconst EPSILON = 1e-8 * 1e-8; // must be squared since we compare squared length\n\t\tlet s, t;\n\n\t\tconst p1 = this.start;\n\t\tconst p2 = line.start;\n\t\tconst q1 = this.end;\n\t\tconst q2 = line.end;\n\n\t\t_d1.subVectors( q1, p1 ); // Direction vector of segment S1\n\t\t_d2.subVectors( q2, p2 ); // Direction vector of segment S2\n\t\t_r.subVectors( p1, p2 );\n\n\t\tconst a = _d1.dot( _d1 ); // Squared length of segment S1, always nonnegative\n\t\tconst e = _d2.dot( _d2 ); // Squared length of segment S2, always nonnegative\n\t\tconst f = _d2.dot( _r );\n\n\t\t// Check if either or both segments degenerate into points\n\n\t\tif ( a \u003c= EPSILON \u0026\u0026 e \u003c= EPSILON ) {\n\n\t\t\t// Both segments degenerate into points\n\n\t\t\tc1.copy( p1 );\n\t\t\tc2.copy( p2 );\n\n\t\t\tc1.sub( c2 );\n\n\t\t\treturn c1.dot( c1 );\n\n\t\t}\n\n\t\tif ( a \u003c= EPSILON ) {\n\n\t\t\t// First segment degenerates into a point\n\n\t\t\ts = 0;\n\t\t\tt = f / e; // s = 0 =\u003e t = (b*s + f) / e = f / e\n\t\t\tt = clamp( t, 0, 1 );\n\n\n\t\t} else {\n\n\t\t\tconst c = _d1.dot( _r );\n\n\t\t\tif ( e \u003c= EPSILON ) {\n\n\t\t\t\t// Second segment degenerates into a point\n\n\t\t\t\tt = 0;\n\t\t\t\ts = clamp( - c / a, 0, 1 ); // t = 0 =\u003e s = (b*t - c) / a = -c / a\n\n\t\t\t} else {\n\n\t\t\t\t// The general nondegenerate case starts here\n\n\t\t\t\tconst b = _d1.dot( _d2 );\n\t\t\t\tconst denom = a * e - b * b; // Always nonnegative\n\n\t\t\t\t// If segments not parallel, compute closest point on L1 to L2 and\n\t\t\t\t// clamp to segment S1. Else pick arbitrary s (here 0)\n\n\t\t\t\tif ( denom !== 0 ) {\n\n\t\t\t\t\ts = clamp( ( b * f - c * e ) / denom, 0, 1 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\ts = 0;\n\n\t\t\t\t}\n\n\t\t\t\t// Compute point on L2 closest to S1(s) using\n\t\t\t\t// t = Dot((P1 + D1*s) - P2,D2) / Dot(D2,D2) = (b*s + f) / e\n\n\t\t\t\tt = ( b * s + f ) / e;\n\n\t\t\t\t// If t in [0,1] done. Else clamp t, recompute s for the new value\n\t\t\t\t// of t using s = Dot((P2 + D2*t) - P1,D1) / Dot(D1,D1)= (t*b - c) / a\n\t\t\t\t// and clamp s to [0, 1]\n\n\t\t\t\tif ( t \u003c 0 ) {\n\n\t\t\t\t\tt = 0.;\n\t\t\t\t\ts = clamp( - c / a, 0, 1 );\n\n\t\t\t\t} else if ( t \u003e 1 ) {\n\n\t\t\t\t\tt = 1;\n\t\t\t\t\ts = clamp( ( b - c ) / a, 0, 1 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tc1.copy( p1 ).add( _d1.multiplyScalar( s ) );\n\t\tc2.copy( p2 ).add( _d2.multiplyScalar( t ) );\n\n\t\tc1.sub( c2 );\n\n\t\treturn c1.dot( c1 );\n\n\t}\n\n\t/**\n\t * Applies a 4x4 transformation matrix to this line segment.\n\t *\n\t * @param {Matrix4} matrix - The transformation matrix.\n\t * @return {Line3} A reference to this line segment.\n\t */\n\tapplyMatrix4( matrix ) {\n\n\t\tthis.start.applyMatrix4( matrix );\n\t\tthis.end.applyMatrix4( matrix );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this line segment is equal with the given one.\n\t *\n\t * @param {Line3} line - The line segment to test for equality.\n\t * @return {boolean} Whether this line segment is equal with the given one.\n\t */\n\tequals( line ) {\n\n\t\treturn line.start.equals( this.start ) \u0026\u0026 line.end.equals( this.end );\n\n\t}\n\n\t/**\n\t * Returns a new line segment with copied values from this instance.\n\t *\n\t * @return {Line3} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _vector$3 = /*@__PURE__*/ new Vector3();\n\n/**\n * This displays a cone shaped helper object for a {@link SpotLight}.\n *\n * ```js\n * const spotLight = new THREE.SpotLight( 0xffffff );\n * spotLight.position.set( 10, 10, 10 );\n * scene.add( spotLight );\n *\n * const spotLightHelper = new THREE.SpotLightHelper( spotLight );\n * scene.add( spotLightHelper );\n * ```\n *\n * @augments Object3D\n */\nclass SpotLightHelper extends Object3D {\n\n\t/**\n\t * Constructs a new spot light helper.\n\t *\n\t * @param {HemisphereLight} light - The light to be visualized.\n\t * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take\n\t * the color of the light.\n\t */\n\tconstructor( light, color ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * The light being visualized.\n\t\t *\n\t\t * @type {SpotLight}\n\t\t */\n\t\tthis.light = light;\n\n\t\tthis.matrixAutoUpdate = false;\n\n\t\t/**\n\t\t * The color parameter passed in the constructor.\n\t\t * If not set, the helper will take the color of the light.\n\t\t *\n\t\t * @type {number|Color|string}\n\t\t */\n\t\tthis.color = color;\n\n\t\tthis.type = 'SpotLightHelper';\n\n\t\tconst geometry = new BufferGeometry();\n\n\t\tconst positions = [\n\t\t\t0, 0, 0, \t0, 0, 1,\n\t\t\t0, 0, 0, \t1, 0, 1,\n\t\t\t0, 0, 0,\t-1, 0, 1,\n\t\t\t0, 0, 0, \t0, 1, 1,\n\t\t\t0, 0, 0, \t0, -1, 1\n\t\t];\n\n\t\tfor ( let i = 0, j = 1, l = 32; i \u003c l; i ++, j ++ ) {\n\n\t\t\tconst p1 = ( i / l ) * Math.PI * 2;\n\t\t\tconst p2 = ( j / l ) * Math.PI * 2;\n\n\t\t\tpositions.push(\n\t\t\t\tMath.cos( p1 ), Math.sin( p1 ), 1,\n\t\t\t\tMath.cos( p2 ), Math.sin( p2 ), 1\n\t\t\t);\n\n\t\t}\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { fog: false, toneMapped: false } );\n\n\t\tthis.cone = new LineSegments( geometry, material );\n\t\tthis.add( this.cone );\n\n\t\tthis.update();\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.cone.geometry.dispose();\n\t\tthis.cone.material.dispose();\n\n\t}\n\n\t/**\n\t * Updates the helper to match the position and direction of the\n\t * light being visualized.\n\t */\n\tupdate() {\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\t\tthis.light.target.updateWorldMatrix( true, false );\n\n\t\t// update the local matrix based on the parent and light target transforms\n\t\tif ( this.parent ) {\n\n\t\t\tthis.parent.updateWorldMatrix( true );\n\n\t\t\tthis.matrix\n\t\t\t\t.copy( this.parent.matrixWorld )\n\t\t\t\t.invert()\n\t\t\t\t.multiply( this.light.matrixWorld );\n\n\t\t} else {\n\n\t\t\tthis.matrix.copy( this.light.matrixWorld );\n\n\t\t}\n\n\t\tthis.matrixWorld.copy( this.light.matrixWorld );\n\n\t\tconst coneLength = this.light.distance ? this.light.distance : 1000;\n\t\tconst coneWidth = coneLength * Math.tan( this.light.angle );\n\n\t\tthis.cone.scale.set( coneWidth, coneWidth, coneLength );\n\n\t\t_vector$3.setFromMatrixPosition( this.light.target.matrixWorld );\n\n\t\tthis.cone.lookAt( _vector$3 );\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.cone.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tthis.cone.material.color.copy( this.light.color );\n\n\t\t}\n\n\t}\n\n}\n\nconst _vector$2 = /*@__PURE__*/ new Vector3();\nconst _boneMatrix = /*@__PURE__*/ new Matrix4();\nconst _matrixWorldInv = /*@__PURE__*/ new Matrix4();\n\n/**\n * A helper object to assist with visualizing a {@link Skeleton}.\n *\n * ```js\n * const helper = new THREE.SkeletonHelper( skinnedMesh );\n * scene.add( helper );\n * ```\n *\n * @augments LineSegments\n */\nclass SkeletonHelper extends LineSegments {\n\n\t/**\n\t * Constructs a new skeleton helper.\n\t *\n\t * @param {Object3D} object -  Usually an instance of {@link SkinnedMesh}. However, any 3D object\n\t * can be used if it represents a hierarchy of bones (see {@link Bone}).\n\t */\n\tconstructor( object ) {\n\n\t\tconst bones = getBoneList( object );\n\n\t\tconst geometry = new BufferGeometry();\n\n\t\tconst vertices = [];\n\t\tconst colors = [];\n\n\t\tfor ( let i = 0; i \u003c bones.length; i ++ ) {\n\n\t\t\tconst bone = bones[ i ];\n\n\t\t\tif ( bone.parent \u0026\u0026 bone.parent.isBone ) {\n\n\t\t\t\tvertices.push( 0, 0, 0 );\n\t\t\t\tvertices.push( 0, 0, 0 );\n\t\t\t\tcolors.push( 0, 0, 0 );\n\t\t\t\tcolors.push( 0, 0, 0 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, depthTest: false, depthWrite: false, toneMapped: false, transparent: true } );\n\n\t\tsuper( geometry, material );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSkeletonHelper = true;\n\n\t\tthis.type = 'SkeletonHelper';\n\n\t\t/**\n\t\t * The object being visualized.\n\t\t *\n\t\t * @type {Object3D}\n\t\t */\n\t\tthis.root = object;\n\n\t\t/**\n\t\t * The list of bones that the helper visualizes.\n\t\t *\n\t\t * @type {Array\u003cBone\u003e}\n\t\t */\n\t\tthis.bones = bones;\n\n\t\tthis.matrix = object.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\t// colors\n\n\t\tconst color1 = new Color( 0x0000ff );\n\t\tconst color2 = new Color( 0x00ff00 );\n\n\t\tthis.setColors( color1, color2 );\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tconst bones = this.bones;\n\n\t\tconst geometry = this.geometry;\n\t\tconst position = geometry.getAttribute( 'position' );\n\n\t\t_matrixWorldInv.copy( this.root.matrixWorld ).invert();\n\n\t\tfor ( let i = 0, j = 0; i \u003c bones.length; i ++ ) {\n\n\t\t\tconst bone = bones[ i ];\n\n\t\t\tif ( bone.parent \u0026\u0026 bone.parent.isBone ) {\n\n\t\t\t\t_boneMatrix.multiplyMatrices( _matrixWorldInv, bone.matrixWorld );\n\t\t\t\t_vector$2.setFromMatrixPosition( _boneMatrix );\n\t\t\t\tposition.setXYZ( j, _vector$2.x, _vector$2.y, _vector$2.z );\n\n\t\t\t\t_boneMatrix.multiplyMatrices( _matrixWorldInv, bone.parent.matrixWorld );\n\t\t\t\t_vector$2.setFromMatrixPosition( _boneMatrix );\n\t\t\t\tposition.setXYZ( j + 1, _vector$2.x, _vector$2.y, _vector$2.z );\n\n\t\t\t\tj += 2;\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometry.getAttribute( 'position' ).needsUpdate = true;\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t}\n\n\t/**\n\t * Defines the colors of the helper.\n\t *\n\t * @param {Color} color1 - The first line color for each bone.\n\t * @param {Color} color2 - The second line color for each bone.\n\t * @return {SkeletonHelper} A reference to this helper.\n\t */\n\tsetColors( color1, color2 ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst colorAttribute = geometry.getAttribute( 'color' );\n\n\t\tfor ( let i = 0; i \u003c colorAttribute.count; i += 2 ) {\n\n\t\t\tcolorAttribute.setXYZ( i, color1.r, color1.g, color1.b );\n\t\t\tcolorAttribute.setXYZ( i + 1, color2.r, color2.g, color2.b );\n\n\t\t}\n\n\t\tcolorAttribute.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\n\nfunction getBoneList( object ) {\n\n\tconst boneList = [];\n\n\tif ( object.isBone === true ) {\n\n\t\tboneList.push( object );\n\n\t}\n\n\tfor ( let i = 0; i \u003c object.children.length; i ++ ) {\n\n\t\tboneList.push( ...getBoneList( object.children[ i ] ) );\n\n\t}\n\n\treturn boneList;\n\n}\n\n/**\n * This displays a helper object consisting of a spherical mesh for\n * visualizing an instance of {@link PointLight}.\n *\n * ```js\n * const pointLight = new THREE.PointLight( 0xff0000, 1, 100 );\n * pointLight.position.set( 10, 10, 10 );\n * scene.add( pointLight );\n *\n * const sphereSize = 1;\n * const pointLightHelper = new THREE.PointLightHelper( pointLight, sphereSize );\n * scene.add( pointLightHelper );\n * ```\n *\n * @augments Mesh\n */\nclass PointLightHelper extends Mesh {\n\n\t/**\n\t * Constructs a new point light helper.\n\t *\n\t * @param {PointLight} light - The light to be visualized.\n\t * @param {number} [sphereSize=1] - The size of the sphere helper.\n\t * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take\n\t * the color of the light.\n\t */\n\tconstructor( light, sphereSize, color ) {\n\n\t\tconst geometry = new SphereGeometry( sphereSize, 4, 2 );\n\t\tconst material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\t/**\n\t\t * The light being visualized.\n\t\t *\n\t\t * @type {PointLight}\n\t\t */\n\t\tthis.light = light;\n\n\t\t/**\n\t\t * The color parameter passed in the constructor.\n\t\t * If not set, the helper will take the color of the light.\n\t\t *\n\t\t * @type {number|Color|string}\n\t\t */\n\t\tthis.color = color;\n\n\t\tthis.type = 'PointLightHelper';\n\n\t\tthis.matrix = this.light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.update();\n\n\n\t\t/*\n\t// TODO: delete this comment?\n\tconst distanceGeometry = new THREE.IcosahedronGeometry( 1, 2 );\n\tconst distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } );\n\n\tthis.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial );\n\tthis.lightDistance = new THREE.Mesh( distanceGeometry, distanceMaterial );\n\n\tconst d = light.distance;\n\n\tif ( d === 0.0 ) {\n\n\t\tthis.lightDistance.visible = false;\n\n\t} else {\n\n\t\tthis.lightDistance.scale.set( d, d, d );\n\n\t}\n\n\tthis.add( this.lightDistance );\n\t*/\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n\t/**\n\t * Updates the helper to match the position of the\n\t * light being visualized.\n\t */\n\tupdate() {\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tthis.material.color.copy( this.light.color );\n\n\t\t}\n\n\t\t/*\n\t\tconst d = this.light.distance;\n\n\t\tif ( d === 0.0 ) {\n\n\t\t\tthis.lightDistance.visible = false;\n\n\t\t} else {\n\n\t\t\tthis.lightDistance.visible = true;\n\t\t\tthis.lightDistance.scale.set( d, d, d );\n\n\t\t}\n\t\t*/\n\n\t}\n\n}\n\nconst _vector$1 = /*@__PURE__*/ new Vector3();\nconst _color1 = /*@__PURE__*/ new Color();\nconst _color2 = /*@__PURE__*/ new Color();\n\n/**\n * Creates a visual aid consisting of a spherical mesh for a\n * given {@link HemisphereLight}.\n *\n * ```js\n * const light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 );\n * const helper = new THREE.HemisphereLightHelper( light, 5 );\n * scene.add( helper );\n * ```\n *\n * @augments Object3D\n */\nclass HemisphereLightHelper extends Object3D {\n\n\t/**\n\t * Constructs a new hemisphere light helper.\n\t *\n\t * @param {HemisphereLight} light - The light to be visualized.\n\t * @param {number} [size=1] - The size of the mesh used to visualize the light.\n\t * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take\n\t * the color of the light.\n\t */\n\tconstructor( light, size, color ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * The light being visualized.\n\t\t *\n\t\t * @type {HemisphereLight}\n\t\t */\n\t\tthis.light = light;\n\n\t\tthis.matrix = light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\t/**\n\t\t * The color parameter passed in the constructor.\n\t\t * If not set, the helper will take the color of the light.\n\t\t *\n\t\t * @type {number|Color|string}\n\t\t */\n\t\tthis.color = color;\n\n\t\tthis.type = 'HemisphereLightHelper';\n\n\t\tconst geometry = new OctahedronGeometry( size );\n\t\tgeometry.rotateY( Math.PI * 0.5 );\n\n\t\tthis.material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } );\n\t\tif ( this.color === undefined ) this.material.vertexColors = true;\n\n\t\tconst position = geometry.getAttribute( 'position' );\n\t\tconst colors = new Float32Array( position.count * 3 );\n\n\t\tgeometry.setAttribute( 'color', new BufferAttribute( colors, 3 ) );\n\n\t\tthis.add( new Mesh( geometry, this.material ) );\n\n\t\tthis.update();\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.children[ 0 ].geometry.dispose();\n\t\tthis.children[ 0 ].material.dispose();\n\n\t}\n\n\t/**\n\t * Updates the helper to match the position and direction of the\n\t * light being visualized.\n\t */\n\tupdate() {\n\n\t\tconst mesh = this.children[ 0 ];\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tconst colors = mesh.geometry.getAttribute( 'color' );\n\n\t\t\t_color1.copy( this.light.color );\n\t\t\t_color2.copy( this.light.groundColor );\n\n\t\t\tfor ( let i = 0, l = colors.count; i \u003c l; i ++ ) {\n\n\t\t\t\tconst color = ( i \u003c ( l / 2 ) ) ? _color1 : _color2;\n\n\t\t\t\tcolors.setXYZ( i, color.r, color.g, color.b );\n\n\t\t\t}\n\n\t\t\tcolors.needsUpdate = true;\n\n\t\t}\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\n\t\tmesh.lookAt( _vector$1.setFromMatrixPosition( this.light.matrixWorld ).negate() );\n\n\t}\n\n}\n\n/**\n * The helper is an object to define grids. Grids are two-dimensional\n * arrays of lines.\n *\n * ```js\n * const size = 10;\n * const divisions = 10;\n *\n * const gridHelper = new THREE.GridHelper( size, divisions );\n * scene.add( gridHelper );\n * ```\n *\n * @augments LineSegments\n */\nclass GridHelper extends LineSegments {\n\n\t/**\n\t * Constructs a new grid helper.\n\t *\n\t * @param {number} [size=10] - The size of the grid.\n\t * @param {number} [divisions=10] - The number of divisions across the grid.\n\t * @param {number|Color|string} [color1=0x444444] - The color of the center line.\n\t * @param {number|Color|string} [color2=0x888888] - The color of the lines of the grid.\n\t */\n\tconstructor( size = 10, divisions = 10, color1 = 0x444444, color2 = 0x888888 ) {\n\n\t\tcolor1 = new Color( color1 );\n\t\tcolor2 = new Color( color2 );\n\n\t\tconst center = divisions / 2;\n\t\tconst step = size / divisions;\n\t\tconst halfSize = size / 2;\n\n\t\tconst vertices = [], colors = [];\n\n\t\tfor ( let i = 0, j = 0, k = - halfSize; i \u003c= divisions; i ++, k += step ) {\n\n\t\t\tvertices.push( - halfSize, 0, k, halfSize, 0, k );\n\t\t\tvertices.push( k, 0, - halfSize, k, 0, halfSize );\n\n\t\t\tconst color = i === center ? color1 : color2;\n\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\n\t\t}\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'GridHelper';\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\n/**\n * This helper is an object to define polar grids. Grids are\n * two-dimensional arrays of lines.\n *\n * ```js\n * const radius = 10;\n * const sectors = 16;\n * const rings = 8;\n * const divisions = 64;\n *\n * const helper = new THREE.PolarGridHelper( radius, sectors, rings, divisions );\n * scene.add( helper );\n * ```\n *\n * @augments LineSegments\n */\nclass PolarGridHelper extends LineSegments {\n\n\t/**\n\t * Constructs a new polar grid helper.\n\t *\n\t * @param {number} [radius=10] - The radius of the polar grid. This can be any positive number.\n\t * @param {number} [sectors=16] - The number of sectors the grid will be divided into. This can be any positive integer.\n\t * @param {number} [rings=16] - The number of rings. This can be any positive integer.\n\t * @param {number} [divisions=64] - The number of line segments used for each circle. This can be any positive integer.\n\t * @param {number|Color|string} [color1=0x444444] - The first color used for grid elements.\n\t * @param {number|Color|string} [color2=0x888888] -  The second color used for grid elements.\n\t */\n\tconstructor( radius = 10, sectors = 16, rings = 8, divisions = 64, color1 = 0x444444, color2 = 0x888888 ) {\n\n\t\tcolor1 = new Color( color1 );\n\t\tcolor2 = new Color( color2 );\n\n\t\tconst vertices = [];\n\t\tconst colors = [];\n\n\t\t// create the sectors\n\n\t\tif ( sectors \u003e 1 ) {\n\n\t\t\tfor ( let i = 0; i \u003c sectors; i ++ ) {\n\n\t\t\t\tconst v = ( i / sectors ) * ( Math.PI * 2 );\n\n\t\t\t\tconst x = Math.sin( v ) * radius;\n\t\t\t\tconst z = Math.cos( v ) * radius;\n\n\t\t\t\tvertices.push( 0, 0, 0 );\n\t\t\t\tvertices.push( x, 0, z );\n\n\t\t\t\tconst color = ( i \u0026 1 ) ? color1 : color2;\n\n\t\t\t\tcolors.push( color.r, color.g, color.b );\n\t\t\t\tcolors.push( color.r, color.g, color.b );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// create the rings\n\n\t\tfor ( let i = 0; i \u003c rings; i ++ ) {\n\n\t\t\tconst color = ( i \u0026 1 ) ? color1 : color2;\n\n\t\t\tconst r = radius - ( radius / rings * i );\n\n\t\t\tfor ( let j = 0; j \u003c divisions; j ++ ) {\n\n\t\t\t\t// first vertex\n\n\t\t\t\tlet v = ( j / divisions ) * ( Math.PI * 2 );\n\n\t\t\t\tlet x = Math.sin( v ) * r;\n\t\t\t\tlet z = Math.cos( v ) * r;\n\n\t\t\t\tvertices.push( x, 0, z );\n\t\t\t\tcolors.push( color.r, color.g, color.b );\n\n\t\t\t\t// second vertex\n\n\t\t\t\tv = ( ( j + 1 ) / divisions ) * ( Math.PI * 2 );\n\n\t\t\t\tx = Math.sin( v ) * r;\n\t\t\t\tz = Math.cos( v ) * r;\n\n\t\t\t\tvertices.push( x, 0, z );\n\t\t\t\tcolors.push( color.r, color.g, color.b );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'PolarGridHelper';\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\nconst _v1 = /*@__PURE__*/ new Vector3();\nconst _v2 = /*@__PURE__*/ new Vector3();\nconst _v3 = /*@__PURE__*/ new Vector3();\n\n/**\n * Helper object to assist with visualizing a {@link DirectionalLight}'s\n * effect on the scene. This consists of plane and a line representing the\n * light's position and direction.\n *\n * ```js\n * const light = new THREE.DirectionalLight( 0xFFFFFF );\n * scene.add( light );\n *\n * const helper = new THREE.DirectionalLightHelper( light, 5 );\n * scene.add( helper );\n * ```\n *\n * @augments Object3D\n */\nclass DirectionalLightHelper extends Object3D {\n\n\t/**\n\t * Constructs a new directional light helper.\n\t *\n\t * @param {DirectionalLight} light - The light to be visualized.\n\t * @param {number} [size=1] - The dimensions of the plane.\n\t * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take\n\t * the color of the light.\n\t */\n\tconstructor( light, size, color ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * The light being visualized.\n\t\t *\n\t\t * @type {DirectionalLight}\n\t\t */\n\t\tthis.light = light;\n\n\t\tthis.matrix = light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\t/**\n\t\t * The color parameter passed in the constructor.\n\t\t * If not set, the helper will take the color of the light.\n\t\t *\n\t\t * @type {number|Color|string}\n\t\t */\n\t\tthis.color = color;\n\n\t\tthis.type = 'DirectionalLightHelper';\n\n\t\tif ( size === undefined ) size = 1;\n\n\t\tlet geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( [\n\t\t\t- size, size, 0,\n\t\t\tsize, size, 0,\n\t\t\tsize, - size, 0,\n\t\t\t- size, - size, 0,\n\t\t\t- size, size, 0\n\t\t], 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { fog: false, toneMapped: false } );\n\n\t\t/**\n\t\t * Contains the line showing the location of the directional light.\n\t\t *\n\t\t * @type {Line}\n\t\t */\n\t\tthis.lightPlane = new Line( geometry, material );\n\t\tthis.add( this.lightPlane );\n\n\t\tgeometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) );\n\n\t\t/**\n\t\t * Represents the target line of the directional light.\n\t\t *\n\t\t * @type {Line}\n\t\t */\n\t\tthis.targetLine = new Line( geometry, material );\n\t\tthis.add( this.targetLine );\n\n\t\tthis.update();\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.lightPlane.geometry.dispose();\n\t\tthis.lightPlane.material.dispose();\n\t\tthis.targetLine.geometry.dispose();\n\t\tthis.targetLine.material.dispose();\n\n\t}\n\n\t/**\n\t * Updates the helper to match the position and direction of the\n\t * light being visualized.\n\t */\n\tupdate() {\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\t\tthis.light.target.updateWorldMatrix( true, false );\n\n\t\t_v1.setFromMatrixPosition( this.light.matrixWorld );\n\t\t_v2.setFromMatrixPosition( this.light.target.matrixWorld );\n\t\t_v3.subVectors( _v2, _v1 );\n\n\t\tthis.lightPlane.lookAt( _v2 );\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.lightPlane.material.color.set( this.color );\n\t\t\tthis.targetLine.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tthis.lightPlane.material.color.copy( this.light.color );\n\t\t\tthis.targetLine.material.color.copy( this.light.color );\n\n\t\t}\n\n\t\tthis.targetLine.lookAt( _v2 );\n\t\tthis.targetLine.scale.z = _v3.length();\n\n\t}\n\n}\n\nconst _vector = /*@__PURE__*/ new Vector3();\nconst _camera = /*@__PURE__*/ new Camera();\n\n/**\n * This helps with visualizing what a camera contains in its frustum. It\n * visualizes the frustum of a camera using a line segments.\n *\n * Based on frustum visualization in [lightgl.js shadowmap example](https://github.com/evanw/lightgl.js/blob/master/tests/shadowmap.html).\n *\n * `CameraHelper` must be a child of the scene.\n *\n * ```js\n * const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );\n * const helper = new THREE.CameraHelper( camera );\n * scene.add( helper );\n * ```\n *\n * @augments LineSegments\n */\nclass CameraHelper extends LineSegments {\n\n\t/**\n\t * Constructs a new arrow helper.\n\t *\n\t * @param {Camera} camera - The camera to visualize.\n\t */\n\tconstructor( camera ) {\n\n\t\tconst geometry = new BufferGeometry();\n\t\tconst material = new LineBasicMaterial( { color: 0xffffff, vertexColors: true, toneMapped: false } );\n\n\t\tconst vertices = [];\n\t\tconst colors = [];\n\n\t\tconst pointMap = {};\n\n\t\t// near\n\n\t\taddLine( 'n1', 'n2' );\n\t\taddLine( 'n2', 'n4' );\n\t\taddLine( 'n4', 'n3' );\n\t\taddLine( 'n3', 'n1' );\n\n\t\t// far\n\n\t\taddLine( 'f1', 'f2' );\n\t\taddLine( 'f2', 'f4' );\n\t\taddLine( 'f4', 'f3' );\n\t\taddLine( 'f3', 'f1' );\n\n\t\t// sides\n\n\t\taddLine( 'n1', 'f1' );\n\t\taddLine( 'n2', 'f2' );\n\t\taddLine( 'n3', 'f3' );\n\t\taddLine( 'n4', 'f4' );\n\n\t\t// cone\n\n\t\taddLine( 'p', 'n1' );\n\t\taddLine( 'p', 'n2' );\n\t\taddLine( 'p', 'n3' );\n\t\taddLine( 'p', 'n4' );\n\n\t\t// up\n\n\t\taddLine( 'u1', 'u2' );\n\t\taddLine( 'u2', 'u3' );\n\t\taddLine( 'u3', 'u1' );\n\n\t\t// target\n\n\t\taddLine( 'c', 't' );\n\t\taddLine( 'p', 'c' );\n\n\t\t// cross\n\n\t\taddLine( 'cn1', 'cn2' );\n\t\taddLine( 'cn3', 'cn4' );\n\n\t\taddLine( 'cf1', 'cf2' );\n\t\taddLine( 'cf3', 'cf4' );\n\n\t\tfunction addLine( a, b ) {\n\n\t\t\taddPoint( a );\n\t\t\taddPoint( b );\n\n\t\t}\n\n\t\tfunction addPoint( id ) {\n\n\t\t\tvertices.push( 0, 0, 0 );\n\t\t\tcolors.push( 0, 0, 0 );\n\n\t\t\tif ( pointMap[ id ] === undefined ) {\n\n\t\t\t\tpointMap[ id ] = [];\n\n\t\t\t}\n\n\t\t\tpointMap[ id ].push( ( vertices.length / 3 ) - 1 );\n\n\t\t}\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'CameraHelper';\n\n\t\t/**\n\t\t * The camera being visualized.\n\t\t *\n\t\t * @type {Camera}\n\t\t */\n\t\tthis.camera = camera;\n\t\tif ( this.camera.updateProjectionMatrix ) this.camera.updateProjectionMatrix();\n\n\t\tthis.matrix = camera.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\t/**\n\t\t * This contains the points used to visualize the camera.\n\t\t *\n\t\t * @type {Object\u003cstring,Array\u003cnumber\u003e\u003e}\n\t\t */\n\t\tthis.pointMap = pointMap;\n\n\t\tthis.update();\n\n\t\t// colors\n\n\t\tconst colorFrustum = new Color( 0xffaa00 );\n\t\tconst colorCone = new Color( 0xff0000 );\n\t\tconst colorUp = new Color( 0x00aaff );\n\t\tconst colorTarget = new Color( 0xffffff );\n\t\tconst colorCross = new Color( 0x333333 );\n\n\t\tthis.setColors( colorFrustum, colorCone, colorUp, colorTarget, colorCross );\n\n\t}\n\n\t/**\n\t * Defines the colors of the helper.\n\t *\n\t * @param {Color} frustum - The frustum line color.\n\t * @param {Color} cone - The cone line color.\n\t * @param {Color} up - The up line color.\n\t * @param {Color} target - The target line color.\n\t * @param {Color} cross - The cross line color.\n\t * @return {CameraHelper} A reference to this helper.\n\t */\n\tsetColors( frustum, cone, up, target, cross ) {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst colorAttribute = geometry.getAttribute( 'color' );\n\n\t\t// near\n\n\t\tcolorAttribute.setXYZ( 0, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 1, frustum.r, frustum.g, frustum.b ); // n1, n2\n\t\tcolorAttribute.setXYZ( 2, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 3, frustum.r, frustum.g, frustum.b ); // n2, n4\n\t\tcolorAttribute.setXYZ( 4, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 5, frustum.r, frustum.g, frustum.b ); // n4, n3\n\t\tcolorAttribute.setXYZ( 6, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 7, frustum.r, frustum.g, frustum.b ); // n3, n1\n\n\t\t// far\n\n\t\tcolorAttribute.setXYZ( 8, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 9, frustum.r, frustum.g, frustum.b ); // f1, f2\n\t\tcolorAttribute.setXYZ( 10, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 11, frustum.r, frustum.g, frustum.b ); // f2, f4\n\t\tcolorAttribute.setXYZ( 12, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 13, frustum.r, frustum.g, frustum.b ); // f4, f3\n\t\tcolorAttribute.setXYZ( 14, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 15, frustum.r, frustum.g, frustum.b ); // f3, f1\n\n\t\t// sides\n\n\t\tcolorAttribute.setXYZ( 16, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 17, frustum.r, frustum.g, frustum.b ); // n1, f1\n\t\tcolorAttribute.setXYZ( 18, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 19, frustum.r, frustum.g, frustum.b ); // n2, f2\n\t\tcolorAttribute.setXYZ( 20, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 21, frustum.r, frustum.g, frustum.b ); // n3, f3\n\t\tcolorAttribute.setXYZ( 22, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 23, frustum.r, frustum.g, frustum.b ); // n4, f4\n\n\t\t// cone\n\n\t\tcolorAttribute.setXYZ( 24, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 25, cone.r, cone.g, cone.b ); // p, n1\n\t\tcolorAttribute.setXYZ( 26, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 27, cone.r, cone.g, cone.b ); // p, n2\n\t\tcolorAttribute.setXYZ( 28, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 29, cone.r, cone.g, cone.b ); // p, n3\n\t\tcolorAttribute.setXYZ( 30, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 31, cone.r, cone.g, cone.b ); // p, n4\n\n\t\t// up\n\n\t\tcolorAttribute.setXYZ( 32, up.r, up.g, up.b ); colorAttribute.setXYZ( 33, up.r, up.g, up.b ); // u1, u2\n\t\tcolorAttribute.setXYZ( 34, up.r, up.g, up.b ); colorAttribute.setXYZ( 35, up.r, up.g, up.b ); // u2, u3\n\t\tcolorAttribute.setXYZ( 36, up.r, up.g, up.b ); colorAttribute.setXYZ( 37, up.r, up.g, up.b ); // u3, u1\n\n\t\t// target\n\n\t\tcolorAttribute.setXYZ( 38, target.r, target.g, target.b ); colorAttribute.setXYZ( 39, target.r, target.g, target.b ); // c, t\n\t\tcolorAttribute.setXYZ( 40, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 41, cross.r, cross.g, cross.b ); // p, c\n\n\t\t// cross\n\n\t\tcolorAttribute.setXYZ( 42, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 43, cross.r, cross.g, cross.b ); // cn1, cn2\n\t\tcolorAttribute.setXYZ( 44, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 45, cross.r, cross.g, cross.b ); // cn3, cn4\n\n\t\tcolorAttribute.setXYZ( 46, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 47, cross.r, cross.g, cross.b ); // cf1, cf2\n\t\tcolorAttribute.setXYZ( 48, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 49, cross.r, cross.g, cross.b ); // cf3, cf4\n\n\t\tcolorAttribute.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Updates the helper based on the projection matrix of the camera.\n\t */\n\tupdate() {\n\n\t\tconst geometry = this.geometry;\n\t\tconst pointMap = this.pointMap;\n\n\t\tconst w = 1, h = 1;\n\n\t\tlet nearZ, farZ;\n\n\t\t// we need just camera projection matrix inverse\n\t\t// world matrix must be identity\n\n\t\t_camera.projectionMatrixInverse.copy( this.camera.projectionMatrixInverse );\n\n\t\t// Adjust z values based on coordinate system\n\n\t\tif ( this.camera.reversedDepth === true ) {\n\n\t\t\tnearZ = 1;\n\t\t\tfarZ = 0;\n\n\t\t} else {\n\n\t\t\tif ( this.camera.coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\t\tnearZ = -1;\n\t\t\t\tfarZ = 1;\n\n\t\t\t} else if ( this.camera.coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\t\tnearZ = 0;\n\t\t\t\tfarZ = 1;\n\n\t\t\t} else {\n\n\t\t\t\tthrow new Error( 'THREE.CameraHelper.update(): Invalid coordinate system: ' + this.camera.coordinateSystem );\n\n\t\t\t}\n\n\t\t}\n\n\n\t\t// center / target\n\t\tsetPoint( 'c', pointMap, geometry, _camera, 0, 0, nearZ );\n\t\tsetPoint( 't', pointMap, geometry, _camera, 0, 0, farZ );\n\n\t\t// near\n\n\t\tsetPoint( 'n1', pointMap, geometry, _camera, - w, - h, nearZ );\n\t\tsetPoint( 'n2', pointMap, geometry, _camera, w, - h, nearZ );\n\t\tsetPoint( 'n3', pointMap, geometry, _camera, - w, h, nearZ );\n\t\tsetPoint( 'n4', pointMap, geometry, _camera, w, h, nearZ );\n\n\t\t// far\n\n\t\tsetPoint( 'f1', pointMap, geometry, _camera, - w, - h, farZ );\n\t\tsetPoint( 'f2', pointMap, geometry, _camera, w, - h, farZ );\n\t\tsetPoint( 'f3', pointMap, geometry, _camera, - w, h, farZ );\n\t\tsetPoint( 'f4', pointMap, geometry, _camera, w, h, farZ );\n\n\t\t// up\n\n\t\tsetPoint( 'u1', pointMap, geometry, _camera, w * 0.7, h * 1.1, nearZ );\n\t\tsetPoint( 'u2', pointMap, geometry, _camera, - w * 0.7, h * 1.1, nearZ );\n\t\tsetPoint( 'u3', pointMap, geometry, _camera, 0, h * 2, nearZ );\n\n\t\t// cross\n\n\t\tsetPoint( 'cf1', pointMap, geometry, _camera, - w, 0, farZ );\n\t\tsetPoint( 'cf2', pointMap, geometry, _camera, w, 0, farZ );\n\t\tsetPoint( 'cf3', pointMap, geometry, _camera, 0, - h, farZ );\n\t\tsetPoint( 'cf4', pointMap, geometry, _camera, 0, h, farZ );\n\n\t\tsetPoint( 'cn1', pointMap, geometry, _camera, - w, 0, nearZ );\n\t\tsetPoint( 'cn2', pointMap, geometry, _camera, w, 0, nearZ );\n\t\tsetPoint( 'cn3', pointMap, geometry, _camera, 0, - h, nearZ );\n\t\tsetPoint( 'cn4', pointMap, geometry, _camera, 0, h, nearZ );\n\n\t\tgeometry.getAttribute( 'position' ).needsUpdate = true;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\n\nfunction setPoint( point, pointMap, geometry, camera, x, y, z ) {\n\n\t_vector.set( x, y, z ).unproject( camera );\n\n\tconst points = pointMap[ point ];\n\n\tif ( points !== undefined ) {\n\n\t\tconst position = geometry.getAttribute( 'position' );\n\n\t\tfor ( let i = 0, l = points.length; i \u003c l; i ++ ) {\n\n\t\t\tposition.setXYZ( points[ i ], _vector.x, _vector.y, _vector.z );\n\n\t\t}\n\n\t}\n\n}\n\nconst _box = /*@__PURE__*/ new Box3();\n\n/**\n * Helper object to graphically show the world-axis-aligned bounding box\n * around an object. The actual bounding box is handled with {@link Box3},\n * this is just a visual helper for debugging. It can be automatically\n * resized with {@link BoxHelper#update} when the object it's created from\n * is transformed. Note that the object must have a geometry for this to work,\n * so it won't work with sprites.\n *\n * ```js\n * const sphere = new THREE.SphereGeometry();\n * const object = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( 0xff0000 ) );\n * const box = new THREE.BoxHelper( object, 0xffff00 );\n * scene.add( box );\n * ```\n *\n * @augments LineSegments\n */\nclass BoxHelper extends LineSegments {\n\n\t/**\n\t * Constructs a new box helper.\n\t *\n\t * @param {Object3D} [object] - The 3D object to show the world-axis-aligned bounding box.\n\t * @param {number|Color|string} [color=0xffff00] - The box's color.\n\t */\n\tconstructor( object, color = 0xffff00 ) {\n\n\t\tconst indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] );\n\t\tconst positions = new Float32Array( 8 * 3 );\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setIndex( new BufferAttribute( indices, 1 ) );\n\t\tgeometry.setAttribute( 'position', new BufferAttribute( positions, 3 ) );\n\n\t\tsuper( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\n\t\t/**\n\t\t * The 3D object being visualized.\n\t\t *\n\t\t * @type {Object3D}\n\t\t */\n\t\tthis.object = object;\n\t\tthis.type = 'BoxHelper';\n\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.update();\n\n\t}\n\n\t/**\n\t * Updates the helper's geometry to match the dimensions of the object,\n\t * including any children.\n\t */\n\tupdate() {\n\n\t\tif ( this.object !== undefined ) {\n\n\t\t\t_box.setFromObject( this.object );\n\n\t\t}\n\n\t\tif ( _box.isEmpty() ) return;\n\n\t\tconst min = _box.min;\n\t\tconst max = _box.max;\n\n\t\t/*\n\t\t\t5____4\n\t\t1/___0/|\n\t\t| 6__|_7\n\t\t2/___3/\n\n\t\t0: max.x, max.y, max.z\n\t\t1: min.x, max.y, max.z\n\t\t2: min.x, min.y, max.z\n\t\t3: max.x, min.y, max.z\n\t\t4: max.x, max.y, min.z\n\t\t5: min.x, max.y, min.z\n\t\t6: min.x, min.y, min.z\n\t\t7: max.x, min.y, min.z\n\t\t*/\n\n\t\tconst position = this.geometry.attributes.position;\n\t\tconst array = position.array;\n\n\t\tarray[ 0 ] = max.x; array[ 1 ] = max.y; array[ 2 ] = max.z;\n\t\tarray[ 3 ] = min.x; array[ 4 ] = max.y; array[ 5 ] = max.z;\n\t\tarray[ 6 ] = min.x; array[ 7 ] = min.y; array[ 8 ] = max.z;\n\t\tarray[ 9 ] = max.x; array[ 10 ] = min.y; array[ 11 ] = max.z;\n\t\tarray[ 12 ] = max.x; array[ 13 ] = max.y; array[ 14 ] = min.z;\n\t\tarray[ 15 ] = min.x; array[ 16 ] = max.y; array[ 17 ] = min.z;\n\t\tarray[ 18 ] = min.x; array[ 19 ] = min.y; array[ 20 ] = min.z;\n\t\tarray[ 21 ] = max.x; array[ 22 ] = min.y; array[ 23 ] = min.z;\n\n\t\tposition.needsUpdate = true;\n\n\t\tthis.geometry.computeBoundingSphere();\n\n\t}\n\n\t/**\n\t * Updates the wireframe box for the passed object.\n\t *\n\t * @param {Object3D} object - The 3D object to create the helper for.\n\t * @return {BoxHelper} A reference to this instance.\n\t */\n\tsetFromObject( object ) {\n\n\t\tthis.object = object;\n\t\tthis.update();\n\n\t\treturn this;\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.object = source.object;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\n/**\n * A helper object to visualize an instance of {@link Box3}.\n *\n * ```js\n * const box = new THREE.Box3();\n * box.setFromCenterAndSize( new THREE.Vector3( 1, 1, 1 ), new THREE.Vector3( 2, 1, 3 ) );\n *\n * const helper = new THREE.Box3Helper( box, 0xffff00 );\n * scene.add( helper )\n * ```\n *\n * @augments LineSegments\n */\nclass Box3Helper extends LineSegments {\n\n\t/**\n\t * Constructs a new box3 helper.\n\t *\n\t * @param {Box3} box - The box to visualize.\n\t * @param {number|Color|string} [color=0xffff00] - The box's color.\n\t */\n\tconstructor( box, color = 0xffff00 ) {\n\n\t\tconst indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] );\n\n\t\tconst positions = [ 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1 ];\n\n\t\tconst geometry = new BufferGeometry();\n\n\t\tgeometry.setIndex( new BufferAttribute( indices, 1 ) );\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );\n\n\t\tsuper( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\n\t\t/**\n\t\t * The box being visualized.\n\t\t *\n\t\t * @type {Box3}\n\t\t */\n\t\tthis.box = box;\n\n\t\tthis.type = 'Box3Helper';\n\n\t\tthis.geometry.computeBoundingSphere();\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tconst box = this.box;\n\n\t\tif ( box.isEmpty() ) return;\n\n\t\tbox.getCenter( this.position );\n\n\t\tbox.getSize( this.scale );\n\n\t\tthis.scale.multiplyScalar( 0.5 );\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\n/**\n * A helper object to visualize an instance of {@link Plane}.\n *\n * ```js\n * const plane = new THREE.Plane( new THREE.Vector3( 1, 1, 0.2 ), 3 );\n * const helper = new THREE.PlaneHelper( plane, 1, 0xffff00 );\n * scene.add( helper );\n * ```\n *\n * @augments Line\n */\nclass PlaneHelper extends Line {\n\n\t/**\n\t * Constructs a new plane helper.\n\t *\n\t * @param {Plane} plane - The plane to be visualized.\n\t * @param {number} [size=1] - The side length of plane helper.\n\t * @param {number|Color|string} [hex=0xffff00] - The helper's color.\n\t */\n\tconstructor( plane, size = 1, hex = 0xffff00 ) {\n\n\t\tconst color = hex;\n\n\t\tconst positions = [ 1, -1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0 ];\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );\n\t\tgeometry.computeBoundingSphere();\n\n\t\tsuper( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\n\t\tthis.type = 'PlaneHelper';\n\n\t\t/**\n\t\t * The plane being visualized.\n\t\t *\n\t\t * @type {Plane}\n\t\t */\n\t\tthis.plane = plane;\n\n\t\t/**\n\t\t * The side length of plane helper.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.size = size;\n\n\t\tconst positions2 = [ 1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0 ];\n\n\t\tconst geometry2 = new BufferGeometry();\n\t\tgeometry2.setAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) );\n\t\tgeometry2.computeBoundingSphere();\n\n\t\tthis.add( new Mesh( geometry2, new MeshBasicMaterial( { color: color, opacity: 0.2, transparent: true, depthWrite: false, toneMapped: false } ) ) );\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tthis.position.set( 0, 0, 0 );\n\n\t\tthis.scale.set( 0.5 * this.size, 0.5 * this.size, 1 );\n\n\t\tthis.lookAt( this.plane.normal );\n\n\t\tthis.translateZ( - this.plane.constant );\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t}\n\n\t/**\n\t * Updates the helper to match the position and direction of the\n\t * light being visualized.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\t\tthis.children[ 0 ].geometry.dispose();\n\t\tthis.children[ 0 ].material.dispose();\n\n\t}\n\n}\n\nconst _axis = /*@__PURE__*/ new Vector3();\nlet _lineGeometry, _coneGeometry;\n\n/**\n * An 3D arrow object for visualizing directions.\n *\n * ```js\n * const dir = new THREE.Vector3( 1, 2, 0 );\n *\n * //normalize the direction vector (convert to vector of length 1)\n * dir.normalize();\n *\n * const origin = new THREE.Vector3( 0, 0, 0 );\n * const length = 1;\n * const hex = 0xffff00;\n *\n * const arrowHelper = new THREE.ArrowHelper( dir, origin, length, hex );\n * scene.add( arrowHelper );\n * ```\n *\n * @augments Object3D\n */\nclass ArrowHelper extends Object3D {\n\n\t/**\n\t * Constructs a new arrow helper.\n\t *\n\t * @param {Vector3} [dir=(0, 0, 1)] - The (normalized) direction vector.\n\t * @param {Vector3} [origin=(0, 0, 0)] - Point at which the arrow starts.\n\t * @param {number} [length=1] - Length of the arrow in world units.\n\t * @param {(number|Color|string)} [color=0xffff00] - Color of the arrow.\n\t * @param {number} [headLength=length*0.2] - The length of the head of the arrow.\n\t * @param {number} [headWidth=headLength*0.2] - The width of the head of the arrow.\n\t */\n\tconstructor( dir = new Vector3( 0, 0, 1 ), origin = new Vector3( 0, 0, 0 ), length = 1, color = 0xffff00, headLength = length * 0.2, headWidth = headLength * 0.2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'ArrowHelper';\n\n\t\tif ( _lineGeometry === undefined ) {\n\n\t\t\t_lineGeometry = new BufferGeometry();\n\t\t\t_lineGeometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) );\n\n\t\t\t_coneGeometry = new ConeGeometry( 0.5, 1, 5, 1 );\n\t\t\t_coneGeometry.translate( 0, -0.5, 0 );\n\n\t\t}\n\n\t\tthis.position.copy( origin );\n\n\t\t/**\n\t\t * The line part of the arrow helper.\n\t\t *\n\t\t * @type {Line}\n\t\t */\n\t\tthis.line = new Line( _lineGeometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\t\tthis.line.matrixAutoUpdate = false;\n\t\tthis.add( this.line );\n\n\t\t/**\n\t\t * The cone part of the arrow helper.\n\t\t *\n\t\t * @type {Mesh}\n\t\t */\n\t\tthis.cone = new Mesh( _coneGeometry, new MeshBasicMaterial( { color: color, toneMapped: false } ) );\n\t\tthis.cone.matrixAutoUpdate = false;\n\t\tthis.add( this.cone );\n\n\t\tthis.setDirection( dir );\n\t\tthis.setLength( length, headLength, headWidth );\n\n\t}\n\n\t/**\n\t * Sets the direction of the helper.\n\t *\n\t * @param {Vector3} dir - The normalized direction vector.\n\t */\n\tsetDirection( dir ) {\n\n\t\t// dir is assumed to be normalized\n\n\t\tif ( dir.y \u003e 0.99999 ) {\n\n\t\t\tthis.quaternion.set( 0, 0, 0, 1 );\n\n\t\t} else if ( dir.y \u003c -0.99999 ) {\n\n\t\t\tthis.quaternion.set( 1, 0, 0, 0 );\n\n\t\t} else {\n\n\t\t\t_axis.set( dir.z, 0, - dir.x ).normalize();\n\n\t\t\tconst radians = Math.acos( dir.y );\n\n\t\t\tthis.quaternion.setFromAxisAngle( _axis, radians );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Sets the length of the helper.\n\t *\n\t * @param {number} length - Length of the arrow in world units.\n\t * @param {number} [headLength=length*0.2] - The length of the head of the arrow.\n\t * @param {number} [headWidth=headLength*0.2] - The width of the head of the arrow.\n\t */\n\tsetLength( length, headLength = length * 0.2, headWidth = headLength * 0.2 ) {\n\n\t\tthis.line.scale.set( 1, Math.max( 0.0001, length - headLength ), 1 ); // see #17458\n\t\tthis.line.updateMatrix();\n\n\t\tthis.cone.scale.set( headWidth, headLength, headWidth );\n\t\tthis.cone.position.y = length;\n\t\tthis.cone.updateMatrix();\n\n\t}\n\n\t/**\n\t * Sets the color of the helper.\n\t *\n\t * @param {number|Color|string} color - The color to set.\n\t */\n\tsetColor( color ) {\n\n\t\tthis.line.material.color.set( color );\n\t\tthis.cone.material.color.set( color );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source, false );\n\n\t\tthis.line.copy( source.line );\n\t\tthis.cone.copy( source.cone );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.line.geometry.dispose();\n\t\tthis.line.material.dispose();\n\t\tthis.cone.geometry.dispose();\n\t\tthis.cone.material.dispose();\n\n\t}\n\n}\n\n/**\n * An axis object to visualize the 3 axes in a simple way.\n * The X axis is red. The Y axis is green. The Z axis is blue.\n *\n * ```js\n * const axesHelper = new THREE.AxesHelper( 5 );\n * scene.add( axesHelper );\n * ```\n *\n * @augments LineSegments\n */\nclass AxesHelper extends LineSegments {\n\n\t/**\n\t * Constructs a new axes helper.\n\t *\n\t * @param {number} [size=1] - Size of the lines representing the axes.\n\t */\n\tconstructor( size = 1 ) {\n\n\t\tconst vertices = [\n\t\t\t0, 0, 0,\tsize, 0, 0,\n\t\t\t0, 0, 0,\t0, size, 0,\n\t\t\t0, 0, 0,\t0, 0, size\n\t\t];\n\n\t\tconst colors = [\n\t\t\t1, 0, 0,\t1, 0.6, 0,\n\t\t\t0, 1, 0,\t0.6, 1, 0,\n\t\t\t0, 0, 1,\t0, 0.6, 1\n\t\t];\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'AxesHelper';\n\n\t}\n\n\t/**\n\t * Defines the colors of the axes helper.\n\t *\n\t * @param {number|Color|string} xAxisColor - The color for the x axis.\n\t * @param {number|Color|string} yAxisColor - The color for the y axis.\n\t * @param {number|Color|string} zAxisColor - The color for the z axis.\n\t * @return {AxesHelper} A reference to this axes helper.\n\t */\n\tsetColors( xAxisColor, yAxisColor, zAxisColor ) {\n\n\t\tconst color = new Color();\n\t\tconst array = this.geometry.attributes.color.array;\n\n\t\tcolor.set( xAxisColor );\n\t\tcolor.toArray( array, 0 );\n\t\tcolor.toArray( array, 3 );\n\n\t\tcolor.set( yAxisColor );\n\t\tcolor.toArray( array, 6 );\n\t\tcolor.toArray( array, 9 );\n\n\t\tcolor.set( zAxisColor );\n\t\tcolor.toArray( array, 12 );\n\t\tcolor.toArray( array, 15 );\n\n\t\tthis.geometry.attributes.color.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\n/**\n * This class is used to convert a series of paths to an array of\n * shapes. It is specifically used in context of fonts and SVG.\n */\nclass ShapePath {\n\n\t/**\n\t * Constructs a new shape path.\n\t */\n\tconstructor() {\n\n\t\tthis.type = 'ShapePath';\n\n\t\t/**\n\t\t * The color of the shape.\n\t\t *\n\t\t * @type {Color}\n\t\t */\n\t\tthis.color = new Color();\n\n\t\t/**\n\t\t * The paths that have been generated for this shape.\n\t\t *\n\t\t * @type {Array\u003cPath\u003e}\n\t\t * @default null\n\t\t */\n\t\tthis.subPaths = [];\n\n\t\t/**\n\t\t * The current path that is being generated.\n\t\t *\n\t\t * @type {?Path}\n\t\t * @default null\n\t\t */\n\t\tthis.currentPath = null;\n\n\t}\n\n\t/**\n\t * Creates a new path and moves it current point to the given one.\n\t *\n\t * @param {number} x - The x coordinate.\n\t * @param {number} y - The y coordinate.\n\t * @return {ShapePath} A reference to this shape path.\n\t */\n\tmoveTo( x, y ) {\n\n\t\tthis.currentPath = new Path();\n\t\tthis.subPaths.push( this.currentPath );\n\t\tthis.currentPath.moveTo( x, y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an instance of {@link LineCurve} to the path by connecting\n\t * the current point with the given one.\n\t *\n\t * @param {number} x - The x coordinate of the end point.\n\t * @param {number} y - The y coordinate of the end point.\n\t * @return {ShapePath} A reference to this shape path.\n\t */\n\tlineTo( x, y ) {\n\n\t\tthis.currentPath.lineTo( x, y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an instance of {@link QuadraticBezierCurve} to the path by connecting\n\t * the current point with the given one.\n\t *\n\t * @param {number} aCPx - The x coordinate of the control point.\n\t * @param {number} aCPy - The y coordinate of the control point.\n\t * @param {number} aX - The x coordinate of the end point.\n\t * @param {number} aY - The y coordinate of the end point.\n\t * @return {ShapePath} A reference to this shape path.\n\t */\n\tquadraticCurveTo( aCPx, aCPy, aX, aY ) {\n\n\t\tthis.currentPath.quadraticCurveTo( aCPx, aCPy, aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an instance of {@link CubicBezierCurve} to the path by connecting\n\t * the current point with the given one.\n\t *\n\t * @param {number} aCP1x - The x coordinate of the first control point.\n\t * @param {number} aCP1y - The y coordinate of the first control point.\n\t * @param {number} aCP2x - The x coordinate of the second control point.\n\t * @param {number} aCP2y - The y coordinate of the second control point.\n\t * @param {number} aX - The x coordinate of the end point.\n\t * @param {number} aY - The y coordinate of the end point.\n\t * @return {ShapePath} A reference to this shape path.\n\t */\n\tbezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) {\n\n\t\tthis.currentPath.bezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an instance of {@link SplineCurve} to the path by connecting\n\t * the current point with the given list of points.\n\t *\n\t * @param {Array\u003cVector2\u003e} pts - An array of points in 2D space.\n\t * @return {ShapePath} A reference to this shape path.\n\t */\n\tsplineThru( pts ) {\n\n\t\tthis.currentPath.splineThru( pts );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Converts the paths into an array of shapes.\n\t *\n\t * @param {boolean} isCCW - By default solid shapes are  defined clockwise (CW) and holes are defined counterclockwise (CCW).\n\t * If this flag is set to `true`, then those are flipped.\n\t * @return {Array\u003cShape\u003e} An array of shapes.\n\t */\n\ttoShapes( isCCW ) {\n\n\t\tfunction toShapesNoHoles( inSubpaths ) {\n\n\t\t\tconst shapes = [];\n\n\t\t\tfor ( let i = 0, l = inSubpaths.length; i \u003c l; i ++ ) {\n\n\t\t\t\tconst tmpPath = inSubpaths[ i ];\n\n\t\t\t\tconst tmpShape = new Shape();\n\t\t\t\ttmpShape.curves = tmpPath.curves;\n\n\t\t\t\tshapes.push( tmpShape );\n\n\t\t\t}\n\n\t\t\treturn shapes;\n\n\t\t}\n\n\t\tfunction isPointInsidePolygon( inPt, inPolygon ) {\n\n\t\t\tconst polyLen = inPolygon.length;\n\n\t\t\t// inPt on polygon contour =\u003e immediate success    or\n\t\t\t// toggling of inside/outside at every single! intersection point of an edge\n\t\t\t//  with the horizontal line through inPt, left of inPt\n\t\t\t//  not counting lowerY endpoints of edges and whole edges on that line\n\t\t\tlet inside = false;\n\t\t\tfor ( let p = polyLen - 1, q = 0; q \u003c polyLen; p = q ++ ) {\n\n\t\t\t\tlet edgeLowPt = inPolygon[ p ];\n\t\t\t\tlet edgeHighPt = inPolygon[ q ];\n\n\t\t\t\tlet edgeDx = edgeHighPt.x - edgeLowPt.x;\n\t\t\t\tlet edgeDy = edgeHighPt.y - edgeLowPt.y;\n\n\t\t\t\tif ( Math.abs( edgeDy ) \u003e Number.EPSILON ) {\n\n\t\t\t\t\t// not parallel\n\t\t\t\t\tif ( edgeDy \u003c 0 ) {\n\n\t\t\t\t\t\tedgeLowPt = inPolygon[ q ]; edgeDx = - edgeDx;\n\t\t\t\t\t\tedgeHighPt = inPolygon[ p ]; edgeDy = - edgeDy;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ( inPt.y \u003c edgeLowPt.y ) || ( inPt.y \u003e edgeHighPt.y ) ) \t\tcontinue;\n\n\t\t\t\t\tif ( inPt.y === edgeLowPt.y ) {\n\n\t\t\t\t\t\tif ( inPt.x === edgeLowPt.x )\t\treturn\ttrue;\t\t// inPt is on contour ?\n\t\t\t\t\t\t// continue;\t\t\t\t// no intersection or edgeLowPt =\u003e doesn't count !!!\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconst perpEdge = edgeDy * ( inPt.x - edgeLowPt.x ) - edgeDx * ( inPt.y - edgeLowPt.y );\n\t\t\t\t\t\tif ( perpEdge === 0 )\t\t\t\treturn\ttrue;\t\t// inPt is on contour ?\n\t\t\t\t\t\tif ( perpEdge \u003c 0 ) \t\t\t\tcontinue;\n\t\t\t\t\t\tinside = ! inside;\t\t// true intersection left of inPt\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// parallel or collinear\n\t\t\t\t\tif ( inPt.y !== edgeLowPt.y ) \t\tcontinue;\t\t\t// parallel\n\t\t\t\t\t// edge lies on the same horizontal line as inPt\n\t\t\t\t\tif ( ( ( edgeHighPt.x \u003c= inPt.x ) \u0026\u0026 ( inPt.x \u003c= edgeLowPt.x ) ) ||\n\t\t\t\t\t\t ( ( edgeLowPt.x \u003c= inPt.x ) \u0026\u0026 ( inPt.x \u003c= edgeHighPt.x ) ) )\t\treturn\ttrue;\t// inPt: Point on contour !\n\t\t\t\t\t// continue;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn\tinside;\n\n\t\t}\n\n\t\tconst isClockWise = ShapeUtils.isClockWise;\n\n\t\tconst subPaths = this.subPaths;\n\t\tif ( subPaths.length === 0 ) return [];\n\n\t\tlet solid, tmpPath, tmpShape;\n\t\tconst shapes = [];\n\n\t\tif ( subPaths.length === 1 ) {\n\n\t\t\ttmpPath = subPaths[ 0 ];\n\t\t\ttmpShape = new Shape();\n\t\t\ttmpShape.curves = tmpPath.curves;\n\t\t\tshapes.push( tmpShape );\n\t\t\treturn shapes;\n\n\t\t}\n\n\t\tlet holesFirst = ! isClockWise( subPaths[ 0 ].getPoints() );\n\t\tholesFirst = isCCW ? ! holesFirst : holesFirst;\n\n\t\t// log(\"Holes first\", holesFirst);\n\n\t\tconst betterShapeHoles = [];\n\t\tconst newShapes = [];\n\t\tlet newShapeHoles = [];\n\t\tlet mainIdx = 0;\n\t\tlet tmpPoints;\n\n\t\tnewShapes[ mainIdx ] = undefined;\n\t\tnewShapeHoles[ mainIdx ] = [];\n\n\t\tfor ( let i = 0, l = subPaths.length; i \u003c l; i ++ ) {\n\n\t\t\ttmpPath = subPaths[ i ];\n\t\t\ttmpPoints = tmpPath.getPoints();\n\t\t\tsolid = isClockWise( tmpPoints );\n\t\t\tsolid = isCCW ? ! solid : solid;\n\n\t\t\tif ( solid ) {\n\n\t\t\t\tif ( ( ! holesFirst ) \u0026\u0026 ( newShapes[ mainIdx ] ) )\tmainIdx ++;\n\n\t\t\t\tnewShapes[ mainIdx ] = { s: new Shape(), p: tmpPoints };\n\t\t\t\tnewShapes[ mainIdx ].s.curves = tmpPath.curves;\n\n\t\t\t\tif ( holesFirst )\tmainIdx ++;\n\t\t\t\tnewShapeHoles[ mainIdx ] = [];\n\n\t\t\t\t//log('cw', i);\n\n\t\t\t} else {\n\n\t\t\t\tnewShapeHoles[ mainIdx ].push( { h: tmpPath, p: tmpPoints[ 0 ] } );\n\n\t\t\t\t//log('ccw', i);\n\n\t\t\t}\n\n\t\t}\n\n\t\t// only Holes? -\u003e probably all Shapes with wrong orientation\n\t\tif ( ! newShapes[ 0 ] )\treturn\ttoShapesNoHoles( subPaths );\n\n\n\t\tif ( newShapes.length \u003e 1 ) {\n\n\t\t\tlet ambiguous = false;\n\t\t\tlet toChange = 0;\n\n\t\t\tfor ( let sIdx = 0, sLen = newShapes.length; sIdx \u003c sLen; sIdx ++ ) {\n\n\t\t\t\tbetterShapeHoles[ sIdx ] = [];\n\n\t\t\t}\n\n\t\t\tfor ( let sIdx = 0, sLen = newShapes.length; sIdx \u003c sLen; sIdx ++ ) {\n\n\t\t\t\tconst sho = newShapeHoles[ sIdx ];\n\n\t\t\t\tfor ( let hIdx = 0; hIdx \u003c sho.length; hIdx ++ ) {\n\n\t\t\t\t\tconst ho = sho[ hIdx ];\n\t\t\t\t\tlet hole_unassigned = true;\n\n\t\t\t\t\tfor ( let s2Idx = 0; s2Idx \u003c newShapes.length; s2Idx ++ ) {\n\n\t\t\t\t\t\tif ( isPointInsidePolygon( ho.p, newShapes[ s2Idx ].p ) ) {\n\n\t\t\t\t\t\t\tif ( sIdx !== s2Idx )\ttoChange ++;\n\n\t\t\t\t\t\t\tif ( hole_unassigned ) {\n\n\t\t\t\t\t\t\t\thole_unassigned = false;\n\t\t\t\t\t\t\t\tbetterShapeHoles[ s2Idx ].push( ho );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tambiguous = true;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( hole_unassigned ) {\n\n\t\t\t\t\t\tbetterShapeHoles[ sIdx ].push( ho );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( toChange \u003e 0 \u0026\u0026 ambiguous === false ) {\n\n\t\t\t\tnewShapeHoles = betterShapeHoles;\n\n\t\t\t}\n\n\t\t}\n\n\t\tlet tmpHoles;\n\n\t\tfor ( let i = 0, il = newShapes.length; i \u003c il; i ++ ) {\n\n\t\t\ttmpShape = newShapes[ i ].s;\n\t\t\tshapes.push( tmpShape );\n\t\t\ttmpHoles = newShapeHoles[ i ];\n\n\t\t\tfor ( let j = 0, jl = tmpHoles.length; j \u003c jl; j ++ ) {\n\n\t\t\t\ttmpShape.holes.push( tmpHoles[ j ].h );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//log(\"shape\", shapes);\n\n\t\treturn shapes;\n\n\t}\n\n}\n\n/**\n * Abstract base class for controls.\n *\n * @abstract\n * @augments EventDispatcher\n */\nclass Controls extends EventDispatcher {\n\n\t/**\n\t * Constructs a new controls instance.\n\t *\n\t * @param {Object3D} object - The object that is managed by the controls.\n\t * @param {?HTMLElement} domElement - The HTML element used for event listeners.\n\t */\n\tconstructor( object, domElement = null ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * The object that is managed by the controls.\n\t\t *\n\t\t * @type {Object3D}\n\t\t */\n\t\tthis.object = object;\n\n\t\t/**\n\t\t * The HTML element used for event listeners.\n\t\t *\n\t\t * @type {?HTMLElement}\n\t\t * @default null\n\t\t */\n\t\tthis.domElement = domElement;\n\n\t\t/**\n\t\t * Whether the controls responds to user input or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.enabled = true;\n\n\t\t/**\n\t\t * The internal state of the controls.\n\t\t *\n\t\t * @type {number}\n\t\t * @default -1\n\t\t */\n\t\tthis.state = -1;\n\n\t\t/**\n\t\t * This object defines the keyboard input of the controls.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.keys = {};\n\n\t\t/**\n\t\t * This object defines what type of actions are assigned to the available mouse buttons.\n\t\t * It depends on the control implementation what kind of mouse buttons and actions are supported.\n\t\t *\n\t\t * @type {{LEFT: ?number, MIDDLE: ?number, RIGHT: ?number}}\n\t\t */\n\t\tthis.mouseButtons = { LEFT: null, MIDDLE: null, RIGHT: null };\n\n\t\t/**\n\t\t * This object defines what type of actions are assigned to what kind of touch interaction.\n\t\t * It depends on the control implementation what kind of touch interaction and actions are supported.\n\t\t *\n\t\t * @type {{ONE: ?number, TWO: ?number}}\n\t\t */\n\t\tthis.touches = { ONE: null, TWO: null };\n\n\t}\n\n\t/**\n\t * Connects the controls to the DOM. This method has so called \"side effects\" since\n\t * it adds the module's event listeners to the DOM.\n\t *\n\t * @param {HTMLElement} element - The DOM element to connect to.\n\t */\n\tconnect( element ) {\n\n\t\tif ( element === undefined ) {\n\n\t\t\twarn( 'Controls: connect() now requires an element.' ); // @deprecated, the warning can be removed with r185\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.domElement !== null ) this.disconnect();\n\n\t\tthis.domElement = element;\n\n\t}\n\n\t/**\n\t * Disconnects the controls from the DOM.\n\t */\n\tdisconnect() {}\n\n\t/**\n\t * Call this method if you no longer want use to the controls. It frees all internal\n\t * resources and removes all event listeners.\n\t */\n\tdispose() {}\n\n\t/**\n\t * Controls should implement this method if they have to update their internal state\n\t * per simulation step.\n\t *\n\t * @param {number} [delta] - The time delta in seconds.\n\t */\n\tupdate( /* delta */ ) {}\n\n}\n\n/**\n * Scales the texture as large as possible within its surface without cropping\n * or stretching the texture. The method preserves the original aspect ratio of\n * the texture. Akin to CSS `object-fit: contain`\n *\n * @param {Texture} texture - The texture.\n * @param {number} aspect - The texture's aspect ratio.\n * @return {Texture} The updated texture.\n */\nfunction contain( texture, aspect ) {\n\n\tconst imageAspect = ( texture.image \u0026\u0026 texture.image.width ) ? texture.image.width / texture.image.height : 1;\n\n\tif ( imageAspect \u003e aspect ) {\n\n\t\ttexture.repeat.x = 1;\n\t\ttexture.repeat.y = imageAspect / aspect;\n\n\t\ttexture.offset.x = 0;\n\t\ttexture.offset.y = ( 1 - texture.repeat.y ) / 2;\n\n\t} else {\n\n\t\ttexture.repeat.x = aspect / imageAspect;\n\t\ttexture.repeat.y = 1;\n\n\t\ttexture.offset.x = ( 1 - texture.repeat.x ) / 2;\n\t\ttexture.offset.y = 0;\n\n\t}\n\n\treturn texture;\n\n}\n\n/**\n * Scales the texture to the smallest possible size to fill the surface, leaving\n * no empty space. The method preserves the original aspect ratio of the texture.\n * Akin to CSS `object-fit: cover`.\n *\n * @param {Texture} texture - The texture.\n * @param {number} aspect - The texture's aspect ratio.\n * @return {Texture} The updated texture.\n */\nfunction cover( texture, aspect ) {\n\n\tconst imageAspect = ( texture.image \u0026\u0026 texture.image.width ) ? texture.image.width / texture.image.height : 1;\n\n\tif ( imageAspect \u003e aspect ) {\n\n\t\ttexture.repeat.x = aspect / imageAspect;\n\t\ttexture.repeat.y = 1;\n\n\t\ttexture.offset.x = ( 1 - texture.repeat.x ) / 2;\n\t\ttexture.offset.y = 0;\n\n\t} else {\n\n\t\ttexture.repeat.x = 1;\n\t\ttexture.repeat.y = imageAspect / aspect;\n\n\t\ttexture.offset.x = 0;\n\t\ttexture.offset.y = ( 1 - texture.repeat.y ) / 2;\n\n\t}\n\n\treturn texture;\n\n}\n\n/**\n * Configures the texture to the default transformation. Akin to CSS `object-fit: fill`.\n *\n * @param {Texture} texture - The texture.\n * @return {Texture} The updated texture.\n */\nfunction fill( texture ) {\n\n\ttexture.repeat.x = 1;\n\ttexture.repeat.y = 1;\n\n\ttexture.offset.x = 0;\n\ttexture.offset.y = 0;\n\n\treturn texture;\n\n}\n\n/**\n * Determines how many bytes must be used to represent the texture.\n *\n * @param {number} width - The width of the texture.\n * @param {number} height - The height of the texture.\n * @param {number} format - The texture's format.\n * @param {number} type - The texture's type.\n * @return {number} The byte length.\n */\nfunction getByteLength( width, height, format, type ) {\n\n\tconst typeByteLength = getTextureTypeByteLength( type );\n\n\tswitch ( format ) {\n\n\t\t// https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml\n\t\tcase AlphaFormat:\n\t\t\treturn width * height;\n\t\tcase RedFormat:\n\t\t\treturn ( ( width * height ) / typeByteLength.components ) * typeByteLength.byteLength;\n\t\tcase RedIntegerFormat:\n\t\t\treturn ( ( width * height ) / typeByteLength.components ) * typeByteLength.byteLength;\n\t\tcase RGFormat:\n\t\t\treturn ( ( width * height * 2 ) / typeByteLength.components ) * typeByteLength.byteLength;\n\t\tcase RGIntegerFormat:\n\t\t\treturn ( ( width * height * 2 ) / typeByteLength.components ) * typeByteLength.byteLength;\n\t\tcase RGBFormat:\n\t\t\treturn ( ( width * height * 3 ) / typeByteLength.components ) * typeByteLength.byteLength;\n\t\tcase RGBAFormat:\n\t\t\treturn ( ( width * height * 4 ) / typeByteLength.components ) * typeByteLength.byteLength;\n\t\tcase RGBAIntegerFormat:\n\t\t\treturn ( ( width * height * 4 ) / typeByteLength.components ) * typeByteLength.byteLength;\n\n\t\t// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_s3tc_srgb/\n\t\tcase RGB_S3TC_DXT1_Format:\n\t\tcase RGBA_S3TC_DXT1_Format:\n\t\t\treturn Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 8;\n\t\tcase RGBA_S3TC_DXT3_Format:\n\t\tcase RGBA_S3TC_DXT5_Format:\n\t\t\treturn Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 16;\n\n\t\t// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_pvrtc/\n\t\tcase RGB_PVRTC_2BPPV1_Format:\n\t\tcase RGBA_PVRTC_2BPPV1_Format:\n\t\t\treturn ( Math.max( width, 16 ) * Math.max( height, 8 ) ) / 4;\n\t\tcase RGB_PVRTC_4BPPV1_Format:\n\t\tcase RGBA_PVRTC_4BPPV1_Format:\n\t\t\treturn ( Math.max( width, 8 ) * Math.max( height, 8 ) ) / 2;\n\n\t\t// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_etc/\n\t\tcase RGB_ETC1_Format:\n\t\tcase RGB_ETC2_Format:\n\t\tcase R11_EAC_Format:\n\t\tcase SIGNED_R11_EAC_Format:\n\t\t\treturn Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 8;\n\t\tcase RGBA_ETC2_EAC_Format:\n\t\tcase RG11_EAC_Format:\n\t\tcase SIGNED_RG11_EAC_Format:\n\t\t\treturn Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 16;\n\n\t\t// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_astc/\n\t\tcase RGBA_ASTC_4x4_Format:\n\t\t\treturn Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 16;\n\t\tcase RGBA_ASTC_5x4_Format:\n\t\t\treturn Math.floor( ( width + 4 ) / 5 ) * Math.floor( ( height + 3 ) / 4 ) * 16;\n\t\tcase RGBA_ASTC_5x5_Format:\n\t\t\treturn Math.floor( ( width + 4 ) / 5 ) * Math.floor( ( height + 4 ) / 5 ) * 16;\n\t\tcase RGBA_ASTC_6x5_Format:\n\t\t\treturn Math.floor( ( width + 5 ) / 6 ) * Math.floor( ( height + 4 ) / 5 ) * 16;\n\t\tcase RGBA_ASTC_6x6_Format:\n\t\t\treturn Math.floor( ( width + 5 ) / 6 ) * Math.floor( ( height + 5 ) / 6 ) * 16;\n\t\tcase RGBA_ASTC_8x5_Format:\n\t\t\treturn Math.floor( ( width + 7 ) / 8 ) * Math.floor( ( height + 4 ) / 5 ) * 16;\n\t\tcase RGBA_ASTC_8x6_Format:\n\t\t\treturn Math.floor( ( width + 7 ) / 8 ) * Math.floor( ( height + 5 ) / 6 ) * 16;\n\t\tcase RGBA_ASTC_8x8_Format:\n\t\t\treturn Math.floor( ( width + 7 ) / 8 ) * Math.floor( ( height + 7 ) / 8 ) * 16;\n\t\tcase RGBA_ASTC_10x5_Format:\n\t\t\treturn Math.floor( ( width + 9 ) / 10 ) * Math.floor( ( height + 4 ) / 5 ) * 16;\n\t\tcase RGBA_ASTC_10x6_Format:\n\t\t\treturn Math.floor( ( width + 9 ) / 10 ) * Math.floor( ( height + 5 ) / 6 ) * 16;\n\t\tcase RGBA_ASTC_10x8_Format:\n\t\t\treturn Math.floor( ( width + 9 ) / 10 ) * Math.floor( ( height + 7 ) / 8 ) * 16;\n\t\tcase RGBA_ASTC_10x10_Format:\n\t\t\treturn Math.floor( ( width + 9 ) / 10 ) * Math.floor( ( height + 9 ) / 10 ) * 16;\n\t\tcase RGBA_ASTC_12x10_Format:\n\t\t\treturn Math.floor( ( width + 11 ) / 12 ) * Math.floor( ( height + 9 ) / 10 ) * 16;\n\t\tcase RGBA_ASTC_12x12_Format:\n\t\t\treturn Math.floor( ( width + 11 ) / 12 ) * Math.floor( ( height + 11 ) / 12 ) * 16;\n\n\t\t// https://registry.khronos.org/webgl/extensions/EXT_texture_compression_bptc/\n\t\tcase RGBA_BPTC_Format:\n\t\tcase RGB_BPTC_SIGNED_Format:\n\t\tcase RGB_BPTC_UNSIGNED_Format:\n\t\t\treturn Math.ceil( width / 4 ) * Math.ceil( height / 4 ) * 16;\n\n\t\t// https://registry.khronos.org/webgl/extensions/EXT_texture_compression_rgtc/\n\t\tcase RED_RGTC1_Format:\n\t\tcase SIGNED_RED_RGTC1_Format:\n\t\t\treturn Math.ceil( width / 4 ) * Math.ceil( height / 4 ) * 8;\n\t\tcase RED_GREEN_RGTC2_Format:\n\t\tcase SIGNED_RED_GREEN_RGTC2_Format:\n\t\t\treturn Math.ceil( width / 4 ) * Math.ceil( height / 4 ) * 16;\n\n\t}\n\n\tthrow new Error(\n\t\t`Unable to determine texture byte length for ${format} format.`,\n\t);\n\n}\n\nfunction getTextureTypeByteLength( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase UnsignedByteType:\n\t\tcase ByteType:\n\t\t\treturn { byteLength: 1, components: 1 };\n\t\tcase UnsignedShortType:\n\t\tcase ShortType:\n\t\tcase HalfFloatType:\n\t\t\treturn { byteLength: 2, components: 1 };\n\t\tcase UnsignedShort4444Type:\n\t\tcase UnsignedShort5551Type:\n\t\t\treturn { byteLength: 2, components: 4 };\n\t\tcase UnsignedIntType:\n\t\tcase IntType:\n\t\tcase FloatType:\n\t\t\treturn { byteLength: 4, components: 1 };\n\t\tcase UnsignedInt5999Type:\n\t\tcase UnsignedInt101111Type:\n\t\t\treturn { byteLength: 4, components: 3 };\n\n\t}\n\n\tthrow new Error( `Unknown texture type ${type}.` );\n\n}\n\n/**\n * A class containing utility functions for textures.\n *\n * @hideconstructor\n */\nclass TextureUtils {\n\n\t/**\n\t * Scales the texture as large as possible within its surface without cropping\n\t * or stretching the texture. The method preserves the original aspect ratio of\n\t * the texture. Akin to CSS `object-fit: contain`\n\t *\n\t * @param {Texture} texture - The texture.\n\t * @param {number} aspect - The texture's aspect ratio.\n\t * @return {Texture} The updated texture.\n\t */\n\tstatic contain( texture, aspect ) {\n\n\t\treturn contain( texture, aspect );\n\n\t}\n\n\t/**\n\t * Scales the texture to the smallest possible size to fill the surface, leaving\n\t * no empty space. The method preserves the original aspect ratio of the texture.\n\t * Akin to CSS `object-fit: cover`.\n\t *\n\t * @param {Texture} texture - The texture.\n\t * @param {number} aspect - The texture's aspect ratio.\n\t * @return {Texture} The updated texture.\n\t */\n\tstatic cover( texture, aspect ) {\n\n\t\treturn cover( texture, aspect );\n\n\t}\n\n\t/**\n\t * Configures the texture to the default transformation. Akin to CSS `object-fit: fill`.\n\t *\n\t * @param {Texture} texture - The texture.\n\t * @return {Texture} The updated texture.\n\t */\n\tstatic fill( texture ) {\n\n\t\treturn fill( texture );\n\n\t}\n\n\t/**\n\t * Determines how many bytes must be used to represent the texture.\n\t *\n\t * @param {number} width - The width of the texture.\n\t * @param {number} height - The height of the texture.\n\t * @param {number} format - The texture's format.\n\t * @param {number} type - The texture's type.\n\t * @return {number} The byte length.\n\t */\n\tstatic getByteLength( width, height, format, type ) {\n\n\t\treturn getByteLength( width, height, format, type );\n\n\t}\n\n}\n\nif ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {\n\n\t__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {\n\t\trevision: REVISION,\n\t} } ) );\n\n}\n\nif ( typeof window !== 'undefined' ) {\n\n\tif ( window.__THREE__ ) {\n\n\t\twarn( 'WARNING: Multiple instances of Three.js being imported.' );\n\n\t} else {\n\n\t\twindow.__THREE__ = REVISION;\n\n\t}\n\n}\n\nexport { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AgXToneMapping, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, AttachedBindMode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, BatchedMesh, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, ConstantAlphaFactor, ConstantColorFactor, Controls, CubeCamera, CubeDepthTexture, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderGeometry, Cylindrical, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualCompare, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExternalTexture, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, FrustumArray, GLBufferAttribute, GLSL1, GLSL3, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InterpolationSamplingMode, InterpolationSamplingType, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, LinearTransfer, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, MOUSE, Material, MaterialLoader, MathUtils, Matrix2, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeutralToneMapping, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoNormalPacking, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NormalGAPacking, NormalRGPacking, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronGeometry, OneFactor, OneMinusConstantAlphaFactor, OneMinusConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, Path, PerspectiveCamera, Plane, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, R11_EAC_Format, RAD2DEG, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RG11_EAC_Format, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBDepthPacking, RGBFormat, RGBIntegerFormat, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGDepthPacking, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RenderTarget, RenderTarget3D, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingGeometry, SIGNED_R11_EAC_Format, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SIGNED_RG11_EAC_Format, SRGBColorSpace, SRGBTransfer, Scene, ShaderMaterial, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronGeometry, Texture, TextureLoader, TextureUtils, Timer, TimestampQuery, TorusGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, UniformsUtils, UnsignedByteType, UnsignedInt101111Type, UnsignedInt248Type, UnsignedInt5999Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, VideoFrameTexture, VideoTexture, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCoordinateSystem, WebGLCubeRenderTarget, WebGLRenderTarget, WebGPUCoordinateSystem, WebXRController, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, arrayNeedsUint32, cloneUniforms, createCanvasElement, createElementNS, error, getByteLength, getConsoleFunction, getUnlitUniformColorSpace, isTypedArray, log, mergeUniforms, probeAsync, setConsoleFunction, warn, warnOnce };\n"],"version":3}
