three-stdlib 2.32.0 → 2.32.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"LineSegments2.js","sources":["../../src/lines/LineSegments2.js"],"sourcesContent":["import {\n Box3,\n InstancedInterleavedBuffer,\n InterleavedBufferAttribute,\n Line3,\n MathUtils,\n Matrix4,\n Mesh,\n Sphere,\n Vector3,\n Vector4,\n} from 'three'\nimport { LineSegmentsGeometry } from '../lines/LineSegmentsGeometry'\nimport { LineMaterial } from '../lines/LineMaterial'\n\nconst _viewport = new Vector4();\n\nconst _start = new Vector3()\nconst _end = new Vector3()\n\nconst _start4 = new Vector4()\nconst _end4 = new Vector4()\n\nconst _ssOrigin = new Vector4()\nconst _ssOrigin3 = new Vector3()\nconst _mvMatrix = new Matrix4()\nconst _line = new Line3()\nconst _closestPoint = new Vector3()\n\nconst _box = new Box3()\nconst _sphere = new Sphere()\nconst _clipToWorldVector = new Vector4()\n\nlet _ray, _lineWidth\n\n// Returns the margin required to expand by in world space given the distance from the camera,\n// line width, resolution, and camera projection\nfunction getWorldSpaceHalfWidth(camera, distance, resolution) {\n // transform into clip space, adjust the x and y values by the pixel width offset, then\n // transform back into world space to get world offset. Note clip space is [-1, 1] so full\n // width does not need to be halved.\n _clipToWorldVector.set(0, 0, -distance, 1.0).applyMatrix4(camera.projectionMatrix)\n _clipToWorldVector.multiplyScalar(1.0 / _clipToWorldVector.w)\n _clipToWorldVector.x = _lineWidth / resolution.width\n _clipToWorldVector.y = _lineWidth / resolution.height\n _clipToWorldVector.applyMatrix4(camera.projectionMatrixInverse)\n _clipToWorldVector.multiplyScalar(1.0 / _clipToWorldVector.w)\n\n return Math.abs(Math.max(_clipToWorldVector.x, _clipToWorldVector.y))\n}\n\nfunction raycastWorldUnits(lineSegments, intersects) {\n\n const matrixWorld = lineSegments.matrixWorld;\n const geometry = lineSegments.geometry;\n const instanceStart = geometry.attributes.instanceStart;\n const instanceEnd = geometry.attributes.instanceEnd;\n const segmentCount = Math.min(geometry.instanceCount, instanceStart.count);\n\n for (let i = 0, l = segmentCount; i < l; i++) {\n _line.start.fromBufferAttribute(instanceStart, i)\n _line.end.fromBufferAttribute(instanceEnd, i)\n\n _line.applyMatrix4(matrixWorld);\n\n const pointOnLine = new Vector3()\n const point = new Vector3()\n\n _ray.distanceSqToSegment(_line.start, _line.end, point, pointOnLine)\n const isInside = point.distanceTo(pointOnLine) < _lineWidth * 0.5\n\n if (isInside) {\n intersects.push({\n point,\n pointOnLine,\n distance: _ray.origin.distanceTo(point),\n object: lineSegments,\n face: null,\n faceIndex: i,\n uv: null,\n uv2: null,\n })\n }\n }\n}\n\nfunction raycastScreenSpace(lineSegments, camera, intersects) {\n const projectionMatrix = camera.projectionMatrix\n const material = lineSegments.material\n const resolution = material.resolution\n const matrixWorld = lineSegments.matrixWorld\n\n const geometry = lineSegments.geometry\n const instanceStart = geometry.attributes.instanceStart\n const instanceEnd = geometry.attributes.instanceEnd\n const segmentCount = Math.min(geometry.instanceCount, instanceStart.count);\n\n const near = -camera.near\n\n //\n\n // pick a point 1 unit out along the ray to avoid the ray origin\n // sitting at the camera origin which will cause \"w\" to be 0 when\n // applying the projection matrix.\n _ray.at(1, _ssOrigin)\n\n // ndc space [ - 1.0, 1.0 ]\n _ssOrigin.w = 1\n _ssOrigin.applyMatrix4(camera.matrixWorldInverse)\n _ssOrigin.applyMatrix4(projectionMatrix)\n _ssOrigin.multiplyScalar(1 / _ssOrigin.w)\n\n // screen space\n _ssOrigin.x *= resolution.x / 2\n _ssOrigin.y *= resolution.y / 2\n _ssOrigin.z = 0\n\n _ssOrigin3.copy(_ssOrigin)\n\n _mvMatrix.multiplyMatrices(camera.matrixWorldInverse, matrixWorld)\n\n for (let i = 0, l = segmentCount; i < l; i++) {\n _start4.fromBufferAttribute(instanceStart, i)\n _end4.fromBufferAttribute(instanceEnd, i)\n\n _start4.w = 1\n _end4.w = 1\n\n // camera space\n _start4.applyMatrix4(_mvMatrix)\n _end4.applyMatrix4(_mvMatrix)\n\n // skip the segment if it's entirely behind the camera\n const isBehindCameraNear = _start4.z > near && _end4.z > near\n if (isBehindCameraNear) {\n continue\n }\n\n // trim the segment if it extends behind camera near\n if (_start4.z > near) {\n const deltaDist = _start4.z - _end4.z\n const t = (_start4.z - near) / deltaDist\n _start4.lerp(_end4, t)\n } else if (_end4.z > near) {\n const deltaDist = _end4.z - _start4.z\n const t = (_end4.z - near) / deltaDist\n _end4.lerp(_start4, t)\n }\n\n // clip space\n _start4.applyMatrix4(projectionMatrix)\n _end4.applyMatrix4(projectionMatrix)\n\n // ndc space [ - 1.0, 1.0 ]\n _start4.multiplyScalar(1 / _start4.w)\n _end4.multiplyScalar(1 / _end4.w)\n\n // screen space\n _start4.x *= resolution.x / 2\n _start4.y *= resolution.y / 2\n\n _end4.x *= resolution.x / 2\n _end4.y *= resolution.y / 2\n\n // create 2d segment\n _line.start.copy(_start4)\n _line.start.z = 0\n\n _line.end.copy(_end4)\n _line.end.z = 0\n\n // get closest point on ray to segment\n const param = _line.closestPointToPointParameter(_ssOrigin3, true)\n _line.at(param, _closestPoint)\n\n // check if the intersection point is within clip space\n const zPos = MathUtils.lerp(_start4.z, _end4.z, param)\n const isInClipSpace = zPos >= -1 && zPos <= 1\n\n const isInside = _ssOrigin3.distanceTo(_closestPoint) < _lineWidth * 0.5\n\n if (isInClipSpace && isInside) {\n _line.start.fromBufferAttribute(instanceStart, i)\n _line.end.fromBufferAttribute(instanceEnd, i)\n\n _line.start.applyMatrix4(matrixWorld)\n _line.end.applyMatrix4(matrixWorld)\n\n const pointOnLine = new Vector3()\n const point = new Vector3()\n\n _ray.distanceSqToSegment(_line.start, _line.end, point, pointOnLine)\n\n intersects.push({\n point: point,\n pointOnLine: pointOnLine,\n distance: _ray.origin.distanceTo(point),\n object: lineSegments,\n face: null,\n faceIndex: i,\n uv: null,\n uv2: null,\n })\n }\n }\n}\n\nclass LineSegments2 extends Mesh {\n constructor(geometry = new LineSegmentsGeometry(), material = new LineMaterial({ color: Math.random() * 0xffffff })) {\n super(geometry, material)\n\n this.isLineSegments2 = true\n\n this.type = 'LineSegments2'\n }\n\n // for backwards-compatibility, but could be a method of LineSegmentsGeometry...\n\n computeLineDistances() {\n const geometry = this.geometry\n\n const instanceStart = geometry.attributes.instanceStart\n const instanceEnd = geometry.attributes.instanceEnd\n const lineDistances = new Float32Array(2 * instanceStart.count)\n\n for (let i = 0, j = 0, l = instanceStart.count; i < l; i++, j += 2) {\n _start.fromBufferAttribute(instanceStart, i)\n _end.fromBufferAttribute(instanceEnd, i)\n\n lineDistances[j] = j === 0 ? 0 : lineDistances[j - 1]\n lineDistances[j + 1] = lineDistances[j] + _start.distanceTo(_end)\n }\n\n const instanceDistanceBuffer = new InstancedInterleavedBuffer(lineDistances, 2, 1) // d0, d1\n\n geometry.setAttribute('instanceDistanceStart', new InterleavedBufferAttribute(instanceDistanceBuffer, 1, 0)) // d0\n geometry.setAttribute('instanceDistanceEnd', new InterleavedBufferAttribute(instanceDistanceBuffer, 1, 1)) // d1\n\n return this\n }\n\n raycast(raycaster, intersects) {\n const worldUnits = this.material.worldUnits\n const camera = raycaster.camera\n\n if (camera === null && !worldUnits) {\n console.error(\n 'LineSegments2: \"Raycaster.camera\" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.',\n )\n }\n\n const threshold = raycaster.params.Line2 !== undefined ? raycaster.params.Line2.threshold || 0 : 0\n\n _ray = raycaster.ray\n\n const matrixWorld = this.matrixWorld\n const geometry = this.geometry\n const material = this.material\n\n _lineWidth = material.linewidth + threshold\n\n // check if we intersect the sphere bounds\n if (geometry.boundingSphere === null) {\n geometry.computeBoundingSphere()\n }\n\n _sphere.copy(geometry.boundingSphere).applyMatrix4(matrixWorld)\n\n // increase the sphere bounds by the worst case line screen space width\n let sphereMargin\n if (worldUnits) {\n sphereMargin = _lineWidth * 0.5\n } else {\n const distanceToSphere = Math.max(camera.near, _sphere.distanceToPoint(_ray.origin))\n sphereMargin = getWorldSpaceHalfWidth(camera, distanceToSphere, material.resolution)\n }\n\n _sphere.radius += sphereMargin\n\n if (_ray.intersectsSphere(_sphere) === false) {\n return\n }\n\n // check if we intersect the box bounds\n if (geometry.boundingBox === null) {\n geometry.computeBoundingBox()\n }\n\n _box.copy(geometry.boundingBox).applyMatrix4(matrixWorld)\n\n // increase the box bounds by the worst case line width\n let boxMargin\n if (worldUnits) {\n boxMargin = _lineWidth * 0.5\n } else {\n const distanceToBox = Math.max(camera.near, _box.distanceToPoint(_ray.origin))\n boxMargin = getWorldSpaceHalfWidth(camera, distanceToBox, material.resolution)\n }\n\n _box.expandByScalar(boxMargin)\n\n if (_ray.intersectsBox(_box) === false) {\n return\n }\n\n if (worldUnits) {\n raycastWorldUnits(this, intersects)\n } else {\n raycastScreenSpace(this, camera, intersects)\n }\n }\n\n onBeforeRender(renderer) {\n\n const uniforms = this.material.uniforms;\n\n if (uniforms && uniforms.resolution) {\n\n renderer.getViewport(_viewport);\n this.material.uniforms.resolution.value.set(_viewport.z, _viewport.w);\n\n }\n\n }\n}\n\nexport { LineSegments2 }\n"],"names":[],"mappings":";;;AAeA,MAAM,YAAY,IAAI;AAEtB,MAAM,SAAS,IAAI,QAAS;AAC5B,MAAM,OAAO,IAAI,QAAS;AAE1B,MAAM,UAAU,IAAI,QAAS;AAC7B,MAAM,QAAQ,IAAI,QAAS;AAE3B,MAAM,YAAY,IAAI,QAAS;AAC/B,MAAM,aAAa,IAAI,QAAS;AAChC,MAAM,YAAY,IAAI,QAAS;AAC/B,MAAM,QAAQ,IAAI,MAAO;AACzB,MAAM,gBAAgB,IAAI,QAAS;AAEnC,MAAM,OAAO,IAAI,KAAM;AACvB,MAAM,UAAU,IAAI,OAAQ;AAC5B,MAAM,qBAAqB,IAAI,QAAS;AAExC,IAAI,MAAM;AAIV,SAAS,uBAAuB,QAAQ,UAAU,YAAY;AAI5D,qBAAmB,IAAI,GAAG,GAAG,CAAC,UAAU,CAAG,EAAE,aAAa,OAAO,gBAAgB;AACjF,qBAAmB,eAAe,IAAM,m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C;AAAA,IACD;AAGD,QAAI,SAAS,gBAAgB,MAAM;AACjC,eAAS,mBAAoB;AAAA,IAC9B;AAED,SAAK,KAAK,SAAS,WAAW,EAAE,aAAa,WAAW;AAGxD,QAAI;AACJ,QAAI,YAAY;AACd,kBAAY,aAAa;AAAA,IAC/B,OAAW;AACL,YAAM,gBAAgB,KAAK,IAAI,OAAO,MAAM,KAAK,gBAAgB,KAAK,MAAM,CAAC;AAC7E,kBAAY,uBAAuB,QAAQ,eAAe,SAAS,UAAU;AAAA,IAC9E;AAED,SAAK,eAAe,SAAS;AAE7B,QAAI,KAAK,cAAc,IAAI,MAAM,OAAO;AACtC;AAAA,IACD;AAED,QAAI,YAAY;AACd,wBAAkB,MAAM,UAAU;AAAA,IACxC,OAAW;AACL,yBAAmB,MAAM,QAAQ,UAAU;AAAA,IAC5C;AAAA,EACF;AAAA,EAED,eAAe,UAAU;AAEvB,UAAM,WAAW,KAAK,SAAS;AAE/B,QAAI,YAAY,SAAS,YAAY;AAEnC,eAAS,YAAY,SAAS;AAC9B,WAAK,SAAS,SAAS,WAAW,MAAM,IAAI,UAAU,GAAG,UAAU,CAAC;AAAA,IAErE;AAAA,EAEF;AACH;"}
1
+ {"version":3,"file":"LineSegments2.js","sources":["../../src/lines/LineSegments2.js"],"sourcesContent":["import {\n Box3,\n InstancedInterleavedBuffer,\n InterleavedBufferAttribute,\n Line3,\n MathUtils,\n Matrix4,\n Mesh,\n Sphere,\n Vector3,\n Vector4,\n} from 'three'\nimport { LineSegmentsGeometry } from '../lines/LineSegmentsGeometry'\nimport { LineMaterial } from '../lines/LineMaterial'\nimport { UV1 } from '../_polyfill/uv1'\n\nconst _viewport = new Vector4();\n\nconst _start = new Vector3()\nconst _end = new Vector3()\n\nconst _start4 = new Vector4()\nconst _end4 = new Vector4()\n\nconst _ssOrigin = new Vector4()\nconst _ssOrigin3 = new Vector3()\nconst _mvMatrix = new Matrix4()\nconst _line = new Line3()\nconst _closestPoint = new Vector3()\n\nconst _box = new Box3()\nconst _sphere = new Sphere()\nconst _clipToWorldVector = new Vector4()\n\nlet _ray, _lineWidth\n\n// Returns the margin required to expand by in world space given the distance from the camera,\n// line width, resolution, and camera projection\nfunction getWorldSpaceHalfWidth(camera, distance, resolution) {\n // transform into clip space, adjust the x and y values by the pixel width offset, then\n // transform back into world space to get world offset. Note clip space is [-1, 1] so full\n // width does not need to be halved.\n _clipToWorldVector.set(0, 0, -distance, 1.0).applyMatrix4(camera.projectionMatrix)\n _clipToWorldVector.multiplyScalar(1.0 / _clipToWorldVector.w)\n _clipToWorldVector.x = _lineWidth / resolution.width\n _clipToWorldVector.y = _lineWidth / resolution.height\n _clipToWorldVector.applyMatrix4(camera.projectionMatrixInverse)\n _clipToWorldVector.multiplyScalar(1.0 / _clipToWorldVector.w)\n\n return Math.abs(Math.max(_clipToWorldVector.x, _clipToWorldVector.y))\n}\n\nfunction raycastWorldUnits(lineSegments, intersects) {\n\n const matrixWorld = lineSegments.matrixWorld;\n const geometry = lineSegments.geometry;\n const instanceStart = geometry.attributes.instanceStart;\n const instanceEnd = geometry.attributes.instanceEnd;\n const segmentCount = Math.min(geometry.instanceCount, instanceStart.count);\n\n for (let i = 0, l = segmentCount; i < l; i++) {\n _line.start.fromBufferAttribute(instanceStart, i)\n _line.end.fromBufferAttribute(instanceEnd, i)\n\n _line.applyMatrix4(matrixWorld);\n\n const pointOnLine = new Vector3()\n const point = new Vector3()\n\n _ray.distanceSqToSegment(_line.start, _line.end, point, pointOnLine)\n const isInside = point.distanceTo(pointOnLine) < _lineWidth * 0.5\n\n if (isInside) {\n intersects.push({\n point,\n pointOnLine,\n distance: _ray.origin.distanceTo(point),\n object: lineSegments,\n face: null,\n faceIndex: i,\n uv: null,\n [UV1]: null,\n })\n }\n }\n}\n\nfunction raycastScreenSpace(lineSegments, camera, intersects) {\n const projectionMatrix = camera.projectionMatrix\n const material = lineSegments.material\n const resolution = material.resolution\n const matrixWorld = lineSegments.matrixWorld\n\n const geometry = lineSegments.geometry\n const instanceStart = geometry.attributes.instanceStart\n const instanceEnd = geometry.attributes.instanceEnd\n const segmentCount = Math.min(geometry.instanceCount, instanceStart.count);\n\n const near = -camera.near\n\n //\n\n // pick a point 1 unit out along the ray to avoid the ray origin\n // sitting at the camera origin which will cause \"w\" to be 0 when\n // applying the projection matrix.\n _ray.at(1, _ssOrigin)\n\n // ndc space [ - 1.0, 1.0 ]\n _ssOrigin.w = 1\n _ssOrigin.applyMatrix4(camera.matrixWorldInverse)\n _ssOrigin.applyMatrix4(projectionMatrix)\n _ssOrigin.multiplyScalar(1 / _ssOrigin.w)\n\n // screen space\n _ssOrigin.x *= resolution.x / 2\n _ssOrigin.y *= resolution.y / 2\n _ssOrigin.z = 0\n\n _ssOrigin3.copy(_ssOrigin)\n\n _mvMatrix.multiplyMatrices(camera.matrixWorldInverse, matrixWorld)\n\n for (let i = 0, l = segmentCount; i < l; i++) {\n _start4.fromBufferAttribute(instanceStart, i)\n _end4.fromBufferAttribute(instanceEnd, i)\n\n _start4.w = 1\n _end4.w = 1\n\n // camera space\n _start4.applyMatrix4(_mvMatrix)\n _end4.applyMatrix4(_mvMatrix)\n\n // skip the segment if it's entirely behind the camera\n const isBehindCameraNear = _start4.z > near && _end4.z > near\n if (isBehindCameraNear) {\n continue\n }\n\n // trim the segment if it extends behind camera near\n if (_start4.z > near) {\n const deltaDist = _start4.z - _end4.z\n const t = (_start4.z - near) / deltaDist\n _start4.lerp(_end4, t)\n } else if (_end4.z > near) {\n const deltaDist = _end4.z - _start4.z\n const t = (_end4.z - near) / deltaDist\n _end4.lerp(_start4, t)\n }\n\n // clip space\n _start4.applyMatrix4(projectionMatrix)\n _end4.applyMatrix4(projectionMatrix)\n\n // ndc space [ - 1.0, 1.0 ]\n _start4.multiplyScalar(1 / _start4.w)\n _end4.multiplyScalar(1 / _end4.w)\n\n // screen space\n _start4.x *= resolution.x / 2\n _start4.y *= resolution.y / 2\n\n _end4.x *= resolution.x / 2\n _end4.y *= resolution.y / 2\n\n // create 2d segment\n _line.start.copy(_start4)\n _line.start.z = 0\n\n _line.end.copy(_end4)\n _line.end.z = 0\n\n // get closest point on ray to segment\n const param = _line.closestPointToPointParameter(_ssOrigin3, true)\n _line.at(param, _closestPoint)\n\n // check if the intersection point is within clip space\n const zPos = MathUtils.lerp(_start4.z, _end4.z, param)\n const isInClipSpace = zPos >= -1 && zPos <= 1\n\n const isInside = _ssOrigin3.distanceTo(_closestPoint) < _lineWidth * 0.5\n\n if (isInClipSpace && isInside) {\n _line.start.fromBufferAttribute(instanceStart, i)\n _line.end.fromBufferAttribute(instanceEnd, i)\n\n _line.start.applyMatrix4(matrixWorld)\n _line.end.applyMatrix4(matrixWorld)\n\n const pointOnLine = new Vector3()\n const point = new Vector3()\n\n _ray.distanceSqToSegment(_line.start, _line.end, point, pointOnLine)\n\n intersects.push({\n point: point,\n pointOnLine: pointOnLine,\n distance: _ray.origin.distanceTo(point),\n object: lineSegments,\n face: null,\n faceIndex: i,\n uv: null,\n [UV1]: null,\n })\n }\n }\n}\n\nclass LineSegments2 extends Mesh {\n constructor(geometry = new LineSegmentsGeometry(), material = new LineMaterial({ color: Math.random() * 0xffffff })) {\n super(geometry, material)\n\n this.isLineSegments2 = true\n\n this.type = 'LineSegments2'\n }\n\n // for backwards-compatibility, but could be a method of LineSegmentsGeometry...\n\n computeLineDistances() {\n const geometry = this.geometry\n\n const instanceStart = geometry.attributes.instanceStart\n const instanceEnd = geometry.attributes.instanceEnd\n const lineDistances = new Float32Array(2 * instanceStart.count)\n\n for (let i = 0, j = 0, l = instanceStart.count; i < l; i++, j += 2) {\n _start.fromBufferAttribute(instanceStart, i)\n _end.fromBufferAttribute(instanceEnd, i)\n\n lineDistances[j] = j === 0 ? 0 : lineDistances[j - 1]\n lineDistances[j + 1] = lineDistances[j] + _start.distanceTo(_end)\n }\n\n const instanceDistanceBuffer = new InstancedInterleavedBuffer(lineDistances, 2, 1) // d0, d1\n\n geometry.setAttribute('instanceDistanceStart', new InterleavedBufferAttribute(instanceDistanceBuffer, 1, 0)) // d0\n geometry.setAttribute('instanceDistanceEnd', new InterleavedBufferAttribute(instanceDistanceBuffer, 1, 1)) // d1\n\n return this\n }\n\n raycast(raycaster, intersects) {\n const worldUnits = this.material.worldUnits\n const camera = raycaster.camera\n\n if (camera === null && !worldUnits) {\n console.error(\n 'LineSegments2: \"Raycaster.camera\" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.',\n )\n }\n\n const threshold = raycaster.params.Line2 !== undefined ? raycaster.params.Line2.threshold || 0 : 0\n\n _ray = raycaster.ray\n\n const matrixWorld = this.matrixWorld\n const geometry = this.geometry\n const material = this.material\n\n _lineWidth = material.linewidth + threshold\n\n // check if we intersect the sphere bounds\n if (geometry.boundingSphere === null) {\n geometry.computeBoundingSphere()\n }\n\n _sphere.copy(geometry.boundingSphere).applyMatrix4(matrixWorld)\n\n // increase the sphere bounds by the worst case line screen space width\n let sphereMargin\n if (worldUnits) {\n sphereMargin = _lineWidth * 0.5\n } else {\n const distanceToSphere = Math.max(camera.near, _sphere.distanceToPoint(_ray.origin))\n sphereMargin = getWorldSpaceHalfWidth(camera, distanceToSphere, material.resolution)\n }\n\n _sphere.radius += sphereMargin\n\n if (_ray.intersectsSphere(_sphere) === false) {\n return\n }\n\n // check if we intersect the box bounds\n if (geometry.boundingBox === null) {\n geometry.computeBoundingBox()\n }\n\n _box.copy(geometry.boundingBox).applyMatrix4(matrixWorld)\n\n // increase the box bounds by the worst case line width\n let boxMargin\n if (worldUnits) {\n boxMargin = _lineWidth * 0.5\n } else {\n const distanceToBox = Math.max(camera.near, _box.distanceToPoint(_ray.origin))\n boxMargin = getWorldSpaceHalfWidth(camera, distanceToBox, material.resolution)\n }\n\n _box.expandByScalar(boxMargin)\n\n if (_ray.intersectsBox(_box) === false) {\n return\n }\n\n if (worldUnits) {\n raycastWorldUnits(this, intersects)\n } else {\n raycastScreenSpace(this, camera, intersects)\n }\n }\n\n onBeforeRender(renderer) {\n\n const uniforms = this.material.uniforms;\n\n if (uniforms && uniforms.resolution) {\n\n renderer.getViewport(_viewport);\n this.material.uniforms.resolution.value.set(_viewport.z, _viewport.w);\n\n }\n\n }\n}\n\nexport { LineSegments2 }\n"],"names":[],"mappings":";;;;AAgBA,MAAM,YAAY,IAAI;AAEtB,MAAM,SAAS,IAAI,QAAS;AAC5B,MAAM,OAAO,IAAI,QAAS;AAE1B,MAAM,UAAU,IAAI,QAAS;AAC7B,MAAM,QAAQ,IAAI,QAAS;AAE3B,MAAM,YAAY,IAAI,QAAS;AAC/B,MAAM,aAAa,IAAI,QAAS;AAChC,MAAM,YAAY,IAAI,QAAS;AAC/B,MAAM,QAAQ,IAAI,MAAO;AACzB,MAAM,gBAAgB,IAAI,QAAS;AAEnC,MAAM,OAAO,IAAI,KAAM;AACvB,MAAM,UAAU,IAAI,OAAQ;AAC5B,MAAM,qBAAqB,IAAI,QAAS;AAExC,IAAI,MAAM;AAIV,SAAS,uBAAuB,QAAQ,UAAU,YAAY;AAI5D,qBAAmB,IAAI,GAAG,GAAG,CAAC,UAAU,CAAG,EAAE,aAAa,OAAO,gBAAgB;AACjF,qBAAmB,eAAe,IAAM,mBAAmB,CAAC;AAC5D,qBAAmB,IAAI,aAAa,WAAW;AAC/C,qBAAmB,IAAI,aAAa,WAAW;AAC/C,qBAAmB,aAAa,OAAO,uBAAuB;AAC9D,qBAAmB,eAAe,IAAM,mBAAmB,CAAC;AAE5D,SAAO,KAAK,IAAI,KAAK,IAAI,mBAAmB,GAAG,mBAAmB,CAAC,CAAC;AACtE;AAEA,SAAS,kBAAkB,cAAc,YAAY;AAEnD,QAAM,cAAc,aAAa;AACjC,QAAM,WAAW,aAAa;AAC9B,QAAM,gBAAgB,SAAS,WAAW;AAC1C,QAAM,cAAc,SAAS,WAAW;AACxC,QAAM,eAAe,KAAK,IAAI,SAAS,eAAe,cAAc,KAAK;AAEzE,WAAS,IAAI,GAAG,IAAI,cAAc,IAAI,GAAG,KAAK;AAC5C,UAAM,MAAM,oBAAoB,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AQ,UAAU;AAAA,IAC5C;AAAA,EACF;AAAA,EAED,eAAe,UAAU;AAEvB,UAAM,WAAW,KAAK,SAAS;AAE/B,QAAI,YAAY,SAAS,YAAY;AAEnC,eAAS,YAAY,SAAS;AAC9B,WAAK,SAAS,SAAS,WAAW,MAAM,IAAI,UAAU,GAAG,UAAU,CAAC;AAAA,IAErE;AAAA,EAEF;AACH;"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const THREE = require("three");
4
4
  const TGALoader = require("./TGALoader.cjs");
5
+ const uv1 = require("../_polyfill/uv1.cjs");
5
6
  class ColladaLoader extends THREE.Loader {
6
7
  constructor(manager) {
7
8
  super(manager);
@@ -1365,7 +1366,7 @@ class ColladaLoader extends THREE.Loader {
1365
1366
  const position2 = { array: [], stride: 0 };
1366
1367
  const normal = { array: [], stride: 0 };
1367
1368
  const uv = { array: [], stride: 0 };
1368
- const uv2 = { array: [], stride: 0 };
1369
+ const uv1$1 = { array: [], stride: 0 };
1369
1370
  const color = { array: [], stride: 0 };
1370
1371
  const skinIndex = { array: [], stride: 4 };
1371
1372
  const skinWeight = { array: [], stride: 4 };
@@ -1443,7 +1444,7 @@ class ColladaLoader extends THREE.Loader {
1443
1444
  uv.stride = sources[id].stride;
1444
1445
  break;
1445
1446
  case "TEXCOORD1":
1446
- buildGeometryData(primitive, sources[id], input.offset, uv2.array);
1447
+ buildGeometryData(primitive, sources[id], input.offset, uv1$1.array);
1447
1448
  uv.stride = sources[id].stride;
1448
1449
  break;
1449
1450
  default:
@@ -1464,8 +1465,8 @@ class ColladaLoader extends THREE.Loader {
1464
1465
  uv.stride = sources[input.id].stride;
1465
1466
  break;
1466
1467
  case "TEXCOORD1":
1467
- buildGeometryData(primitive, sources[input.id], input.offset, uv2.array);
1468
- uv2.stride = sources[input.id].stride;
1468
+ buildGeometryData(primitive, sources[input.id], input.offset, uv1$1.array);
1469
+ uv1$1.stride = sources[input.id].stride;
1469
1470
  break;
1470
1471
  }
1471
1472
  }
@@ -1480,8 +1481,8 @@ class ColladaLoader extends THREE.Loader {
1480
1481
  geometry.setAttribute("color", new THREE.Float32BufferAttribute(color.array, color.stride));
1481
1482
  if (uv.array.length > 0)
1482
1483
  geometry.setAttribute("uv", new THREE.Float32BufferAttribute(uv.array, uv.stride));
1483
- if (uv2.array.length > 0)
1484
- geometry.setAttribute("uv2", new THREE.Float32BufferAttribute(uv2.array, uv2.stride));
1484
+ if (uv1$1.array.length > 0)
1485
+ geometry.setAttribute(uv1.UV1, new THREE.Float32BufferAttribute(uv1$1.array, uv1$1.stride));
1485
1486
  if (skinIndex.array.length > 0) {
1486
1487
  geometry.setAttribute("skinIndex", new THREE.Float32BufferAttribute(skinIndex.array, skinIndex.stride));
1487
1488
  }