@realsee/five 6.0.0-alpha.71 → 6.0.0-alpha.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/line/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 12/20/2023
5
- * Version: 6.0.0-alpha.71
4
+ * Generated: 12/28/2023
5
+ * Version: 6.0.0-alpha.73
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,165 +252,90 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */import * as THREE from "three";
256
- var extendStatics = function(d, b) {
257
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
258
- d2.__proto__ = b2;
259
- } || function(d2, b2) {
260
- for (var p in b2)
261
- if (Object.prototype.hasOwnProperty.call(b2, p))
262
- d2[p] = b2[p];
263
- };
264
- return extendStatics(d, b);
255
+ */import * as i from "three";
256
+ var E = function(a, o) {
257
+ return E = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, n) {
258
+ t.__proto__ = n;
259
+ } || function(t, n) {
260
+ for (var e in n)
261
+ Object.prototype.hasOwnProperty.call(n, e) && (t[e] = n[e]);
262
+ }, E(a, o);
265
263
  };
266
- function __extends(d, b) {
267
- if (typeof b !== "function" && b !== null)
268
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
269
- extendStatics(d, b);
270
- function __() {
271
- this.constructor = d;
264
+ function A(a, o) {
265
+ if (typeof o != "function" && o !== null)
266
+ throw new TypeError("Class extends value " + String(o) + " is not a constructor or null");
267
+ E(a, o);
268
+ function t() {
269
+ this.constructor = a;
272
270
  }
273
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
271
+ a.prototype = o === null ? Object.create(o) : (t.prototype = o.prototype, new t());
274
272
  }
275
- typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
276
- var e = new Error(message);
277
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
278
- };
279
- var LineSegmentsGeometry = (
273
+ var B = (
280
274
  /** @class */
281
- function(_super) {
282
- __extends(LineSegmentsGeometry2, _super);
283
- function LineSegmentsGeometry2() {
284
- var _this = _super.call(this) || this;
285
- _this.type = "LineSegmentsGeometry";
286
- var positions = [-1, 2, 0, 1, 2, 0, -1, 1, 0, 1, 1, 0, -1, 0, 0, 1, 0, 0, -1, -1, 0, 1, -1, 0];
287
- var uvs = [-1, 2, 1, 2, -1, 1, 1, 1, -1, -1, 1, -1, -1, -2, 1, -2];
288
- var index = [0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5];
289
- _this.setIndex(index);
290
- _this.setAttribute("position", new THREE.Float32BufferAttribute(positions, 3));
291
- _this.setAttribute("uv", new THREE.Float32BufferAttribute(uvs, 2));
292
- return _this;
275
+ function(a) {
276
+ A(o, a);
277
+ function o() {
278
+ var t = a.call(this) || this;
279
+ t.type = "LineSegmentsGeometry";
280
+ var n = [-1, 2, 0, 1, 2, 0, -1, 1, 0, 1, 1, 0, -1, 0, 0, 1, 0, 0, -1, -1, 0, 1, -1, 0], e = [-1, 2, 1, 2, -1, 1, 1, 1, -1, -1, 1, -1, -1, -2, 1, -2], r = [0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5];
281
+ return t.setIndex(r), t.setAttribute("position", new i.Float32BufferAttribute(n, 3)), t.setAttribute("uv", new i.Float32BufferAttribute(e, 2)), t;
293
282
  }
294
- LineSegmentsGeometry2.prototype.applyMatrix4 = function(matrix) {
295
- var start = this.attributes.instanceStart;
296
- var end = this.attributes.instanceEnd;
297
- if (start !== void 0) {
298
- start.applyMatrix4(matrix);
299
- end.applyMatrix4(matrix);
300
- start.needsUpdate = true;
301
- }
302
- if (this.boundingBox !== null) {
303
- this.computeBoundingBox();
304
- }
305
- if (this.boundingSphere !== null) {
306
- this.computeBoundingSphere();
307
- }
308
- return this;
309
- };
310
- LineSegmentsGeometry2.prototype.setPositions = function(array) {
311
- var lineSegments;
312
- if (array instanceof Float32Array) {
313
- lineSegments = array;
314
- } else if (Array.isArray(array)) {
315
- lineSegments = new Float32Array(array);
316
- } else {
317
- lineSegments = new Float32Array();
318
- }
319
- var instanceBuffer = new THREE.InstancedInterleavedBuffer(lineSegments, 6, 1);
320
- this.setAttribute("instanceStart", new THREE.InterleavedBufferAttribute(instanceBuffer, 3, 0));
321
- this.setAttribute("instanceEnd", new THREE.InterleavedBufferAttribute(instanceBuffer, 3, 3));
322
- this.computeBoundingBox();
323
- this.computeBoundingSphere();
324
- return this;
325
- };
326
- LineSegmentsGeometry2.prototype.setColors = function(array) {
327
- var colors;
328
- if (array instanceof Float32Array) {
329
- colors = array;
330
- } else if (Array.isArray(array)) {
331
- colors = new Float32Array(array);
332
- } else {
333
- colors = new Float32Array();
334
- }
335
- var instanceColorBuffer = new THREE.InstancedInterleavedBuffer(colors, 6, 1);
336
- this.setAttribute("instanceColorStart", new THREE.InterleavedBufferAttribute(instanceColorBuffer, 3, 0));
337
- this.setAttribute("instanceColorEnd", new THREE.InterleavedBufferAttribute(instanceColorBuffer, 3, 3));
338
- return this;
339
- };
340
- LineSegmentsGeometry2.prototype.fromWireframeGeometry = function(geometry) {
341
- this.setPositions(geometry.attributes.position.array);
283
+ return o.prototype.applyMatrix4 = function(t) {
284
+ var n = this.attributes.instanceStart, e = this.attributes.instanceEnd;
285
+ return n !== void 0 && (n.applyMatrix4(t), e.applyMatrix4(t), n.needsUpdate = !0), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this;
286
+ }, o.prototype.setPositions = function(t) {
287
+ var n;
288
+ t instanceof Float32Array ? n = t : Array.isArray(t) ? n = new Float32Array(t) : n = new Float32Array();
289
+ var e = new i.InstancedInterleavedBuffer(n, 6, 1);
290
+ return this.setAttribute("instanceStart", new i.InterleavedBufferAttribute(e, 3, 0)), this.setAttribute("instanceEnd", new i.InterleavedBufferAttribute(e, 3, 3)), this.computeBoundingBox(), this.computeBoundingSphere(), this;
291
+ }, o.prototype.setColors = function(t) {
292
+ var n;
293
+ t instanceof Float32Array ? n = t : Array.isArray(t) ? n = new Float32Array(t) : n = new Float32Array();
294
+ var e = new i.InstancedInterleavedBuffer(n, 6, 1);
295
+ return this.setAttribute("instanceColorStart", new i.InterleavedBufferAttribute(e, 3, 0)), this.setAttribute("instanceColorEnd", new i.InterleavedBufferAttribute(e, 3, 3)), this;
296
+ }, o.prototype.fromWireframeGeometry = function(t) {
297
+ return this.setPositions(t.attributes.position.array), this;
298
+ }, o.prototype.fromEdgesGeometry = function(t) {
299
+ return this.setPositions(t.attributes.position.array), this;
300
+ }, o.prototype.fromMesh = function(t) {
301
+ return this.fromWireframeGeometry(new i.WireframeGeometry(t.geometry)), this;
302
+ }, o.prototype.fromLineSegments = function(t) {
303
+ var n = t.geometry;
304
+ if (n instanceof i.Geometry) {
305
+ var e = new i.BufferGeometry().fromGeometry(n);
306
+ this.setPositions(e.attributes.position.array);
307
+ } else
308
+ n instanceof i.BufferGeometry && this.setPositions(n.attributes.position.array);
342
309
  return this;
343
- };
344
- LineSegmentsGeometry2.prototype.fromEdgesGeometry = function(geometry) {
345
- this.setPositions(geometry.attributes.position.array);
346
- return this;
347
- };
348
- LineSegmentsGeometry2.prototype.fromMesh = function(mesh) {
349
- this.fromWireframeGeometry(new THREE.WireframeGeometry(mesh.geometry));
350
- return this;
351
- };
352
- LineSegmentsGeometry2.prototype.fromLineSegments = function(lineSegments) {
353
- var geometry = lineSegments.geometry;
354
- if (geometry instanceof THREE.Geometry) {
355
- var bufferGeometry = new THREE.BufferGeometry().fromGeometry(geometry);
356
- this.setPositions(bufferGeometry.attributes.position.array);
357
- } else if (geometry instanceof THREE.BufferGeometry) {
358
- this.setPositions(geometry.attributes.position.array);
359
- }
360
- return this;
361
- };
362
- LineSegmentsGeometry2.prototype.computeBoundingBox = function() {
363
- if (this.boundingBox === null) {
364
- this.boundingBox = new THREE.Box3();
365
- }
366
- var start = this.attributes.instanceStart;
367
- var end = this.attributes.instanceEnd;
368
- if (start !== void 0 && end !== void 0) {
369
- var box = new THREE.Box3();
370
- this.boundingBox.setFromBufferAttribute(start);
371
- box.setFromBufferAttribute(end);
372
- this.boundingBox.union(box);
310
+ }, o.prototype.computeBoundingBox = function() {
311
+ this.boundingBox === null && (this.boundingBox = new i.Box3());
312
+ var t = this.attributes.instanceStart, n = this.attributes.instanceEnd;
313
+ if (t !== void 0 && n !== void 0) {
314
+ var e = new i.Box3();
315
+ this.boundingBox.setFromBufferAttribute(t), e.setFromBufferAttribute(n), this.boundingBox.union(e);
373
316
  }
374
- };
375
- LineSegmentsGeometry2.prototype.computeBoundingSphere = function() {
376
- if (this.boundingSphere === null) {
377
- this.boundingSphere = new THREE.Sphere();
378
- }
379
- if (this.boundingBox === null) {
380
- this.computeBoundingBox();
381
- }
382
- var start = this.attributes.instanceStart;
383
- var end = this.attributes.instanceEnd;
384
- if (start !== void 0 && end !== void 0) {
385
- var center = this.boundingSphere.center;
386
- this.boundingBox.getCenter(center);
387
- var maxRadiusSq = 0;
388
- var vector = new THREE.Vector3();
389
- for (var i = 0, il = start.count; i < il; i++) {
390
- vector.fromBufferAttribute(start, i);
391
- maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(vector));
392
- vector.fromBufferAttribute(end, i);
393
- maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(vector));
394
- }
395
- this.boundingSphere.radius = Math.sqrt(maxRadiusSq);
396
- if (isNaN(this.boundingSphere.radius)) {
397
- console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.", this);
398
- }
317
+ }, o.prototype.computeBoundingSphere = function() {
318
+ this.boundingSphere === null && (this.boundingSphere = new i.Sphere()), this.boundingBox === null && this.computeBoundingBox();
319
+ var t = this.attributes.instanceStart, n = this.attributes.instanceEnd;
320
+ if (t !== void 0 && n !== void 0) {
321
+ var e = this.boundingSphere.center;
322
+ this.boundingBox.getCenter(e);
323
+ for (var r = 0, s = new i.Vector3(), c = 0, p = t.count; c < p; c++)
324
+ s.fromBufferAttribute(t, c), r = Math.max(r, e.distanceToSquared(s)), s.fromBufferAttribute(n, c), r = Math.max(r, e.distanceToSquared(s));
325
+ this.boundingSphere.radius = Math.sqrt(r), isNaN(this.boundingSphere.radius) && console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.", this);
399
326
  }
400
- };
401
- LineSegmentsGeometry2.prototype.toJSON = function() {
402
- };
403
- return LineSegmentsGeometry2;
404
- }(THREE.InstancedBufferGeometry)
327
+ }, o.prototype.toJSON = function() {
328
+ }, o;
329
+ }(i.InstancedBufferGeometry)
405
330
  );
406
- Object.assign(LineSegmentsGeometry.prototype, { isLineSegmentsGeometry: true });
407
- var lineShader = {
408
- uniforms: THREE.UniformsUtils.merge([
409
- THREE.UniformsLib.common,
410
- THREE.UniformsLib.fog,
331
+ Object.assign(B.prototype, { isLineSegmentsGeometry: !0 });
332
+ var x = {
333
+ uniforms: i.UniformsUtils.merge([
334
+ i.UniformsLib.common,
335
+ i.UniformsLib.fog,
411
336
  {
412
337
  linewidth: { value: 1 },
413
- resolution: { value: new THREE.Vector2(1, 1) },
338
+ resolution: { value: new i.Vector2(1, 1) },
414
339
  dashScale: { value: 1 },
415
340
  dashSize: { value: 1 },
416
341
  gapSize: { value: 1 },
@@ -418,373 +343,434 @@ var lineShader = {
418
343
  opacity: { value: 1 }
419
344
  }
420
345
  ]),
421
- vertexShader: "\n #include <common>\n #include <color_pars_vertex>\n #include <fog_pars_vertex>\n #include <logdepthbuf_pars_vertex>\n #include <clipping_planes_pars_vertex>\n\n uniform float linewidth;\n uniform vec2 resolution;\n\n attribute vec3 instanceStart;\n attribute vec3 instanceEnd;\n\n attribute vec3 instanceColorStart;\n attribute vec3 instanceColorEnd;\n\n varying vec2 vUv;\n\n #ifdef USE_DASH\n\n uniform float dashScale;\n attribute float instanceDistanceStart;\n attribute float instanceDistanceEnd;\n varying float vLineDistance;\n\n #endif\n\n void trimSegment( const in vec4 start, inout vec4 end ) {\n\n // trim end segment so it terminates between the camera plane and the near plane\n\n // conservative estimate of the near plane\n float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n float nearEstimate = - 0.5 * b / a;\n\n float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n end.xyz = mix( start.xyz, end.xyz, alpha );\n\n }\n\n void main() {\n\n #ifdef USE_COLOR\n\n vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n #endif\n\n #ifdef USE_DASH\n\n vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n #endif\n\n float aspect = resolution.x / resolution.y;\n\n vUv = uv;\n\n // camera space\n vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n // special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n // but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n // perhaps there is a more elegant solution -- WestLangley\n\n bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n if ( perspective ) {\n\n if ( start.z < 0.0 && end.z >= 0.0 ) {\n\n trimSegment( start, end );\n\n } else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n trimSegment( end, start );\n\n }\n\n }\n\n // clip space\n vec4 clipStart = projectionMatrix * start;\n vec4 clipEnd = projectionMatrix * end;\n\n // ndc space\n vec2 ndcStart = clipStart.xy / clipStart.w;\n vec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n // direction\n vec2 dir = ndcEnd - ndcStart;\n\n // account for clip-space aspect ratio\n dir.x *= aspect;\n dir = normalize( dir );\n\n // perpendicular to dir\n vec2 offset = vec2( dir.y, - dir.x );\n\n // undo aspect ratio adjustment\n dir.x /= aspect;\n offset.x /= aspect;\n\n // sign flip\n if ( position.x < 0.0 ) offset *= - 1.0;\n\n // endcaps\n if ( position.y < 0.0 ) {\n\n offset += - dir;\n\n } else if ( position.y > 1.0 ) {\n\n offset += dir;\n\n }\n\n // adjust for linewidth\n offset *= linewidth;\n\n // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n offset /= resolution.y;\n\n // select end\n vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n // back to clip space\n offset *= clip.w;\n\n clip.xy += offset;\n\n gl_Position = clip;\n\n vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n\n }\n ",
422
- fragmentShader: "\n uniform vec3 diffuse;\n uniform float opacity;\n\n #ifdef USE_DASH\n\n uniform float dashSize;\n uniform float gapSize;\n\n #endif\n\n varying float vLineDistance;\n\n #include <common>\n #include <color_pars_fragment>\n #include <fog_pars_fragment>\n #include <logdepthbuf_pars_fragment>\n #include <clipping_planes_pars_fragment>\n\n varying vec2 vUv;\n\n void main() {\n\n #include <clipping_planes_fragment>\n\n #ifdef USE_DASH\n\n if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n if ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n #endif\n\n if ( abs( vUv.y ) > 1.0 ) {\n\n float a = vUv.x;\n float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n float len2 = a * a + b * b;\n\n if ( len2 > 1.0 ) discard;\n\n }\n\n vec4 diffuseColor = vec4( diffuse, opacity );\n\n #include <logdepthbuf_fragment>\n #include <color_fragment>\n\n gl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n #include <tonemapping_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n\n }\n "
423
- };
424
- var LineMaterial = (
346
+ vertexShader: `
347
+ #include <common>
348
+ #include <color_pars_vertex>
349
+ #include <fog_pars_vertex>
350
+ #include <logdepthbuf_pars_vertex>
351
+ #include <clipping_planes_pars_vertex>
352
+
353
+ uniform float linewidth;
354
+ uniform vec2 resolution;
355
+
356
+ attribute vec3 instanceStart;
357
+ attribute vec3 instanceEnd;
358
+
359
+ attribute vec3 instanceColorStart;
360
+ attribute vec3 instanceColorEnd;
361
+
362
+ varying vec2 vUv;
363
+
364
+ #ifdef USE_DASH
365
+
366
+ uniform float dashScale;
367
+ attribute float instanceDistanceStart;
368
+ attribute float instanceDistanceEnd;
369
+ varying float vLineDistance;
370
+
371
+ #endif
372
+
373
+ void trimSegment( const in vec4 start, inout vec4 end ) {
374
+
375
+ // trim end segment so it terminates between the camera plane and the near plane
376
+
377
+ // conservative estimate of the near plane
378
+ float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
379
+ float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
380
+ float nearEstimate = - 0.5 * b / a;
381
+
382
+ float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );
383
+
384
+ end.xyz = mix( start.xyz, end.xyz, alpha );
385
+
386
+ }
387
+
388
+ void main() {
389
+
390
+ #ifdef USE_COLOR
391
+
392
+ vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;
393
+
394
+ #endif
395
+
396
+ #ifdef USE_DASH
397
+
398
+ vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
399
+
400
+ #endif
401
+
402
+ float aspect = resolution.x / resolution.y;
403
+
404
+ vUv = uv;
405
+
406
+ // camera space
407
+ vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
408
+ vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );
409
+
410
+ // special case for perspective projection, and segments that terminate either in, or behind, the camera plane
411
+ // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
412
+ // but we need to perform ndc-space calculations in the shader, so we must address this issue directly
413
+ // perhaps there is a more elegant solution -- WestLangley
414
+
415
+ bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column
416
+
417
+ if ( perspective ) {
418
+
419
+ if ( start.z < 0.0 && end.z >= 0.0 ) {
420
+
421
+ trimSegment( start, end );
422
+
423
+ } else if ( end.z < 0.0 && start.z >= 0.0 ) {
424
+
425
+ trimSegment( end, start );
426
+
427
+ }
428
+
429
+ }
430
+
431
+ // clip space
432
+ vec4 clipStart = projectionMatrix * start;
433
+ vec4 clipEnd = projectionMatrix * end;
434
+
435
+ // ndc space
436
+ vec2 ndcStart = clipStart.xy / clipStart.w;
437
+ vec2 ndcEnd = clipEnd.xy / clipEnd.w;
438
+
439
+ // direction
440
+ vec2 dir = ndcEnd - ndcStart;
441
+
442
+ // account for clip-space aspect ratio
443
+ dir.x *= aspect;
444
+ dir = normalize( dir );
445
+
446
+ // perpendicular to dir
447
+ vec2 offset = vec2( dir.y, - dir.x );
448
+
449
+ // undo aspect ratio adjustment
450
+ dir.x /= aspect;
451
+ offset.x /= aspect;
452
+
453
+ // sign flip
454
+ if ( position.x < 0.0 ) offset *= - 1.0;
455
+
456
+ // endcaps
457
+ if ( position.y < 0.0 ) {
458
+
459
+ offset += - dir;
460
+
461
+ } else if ( position.y > 1.0 ) {
462
+
463
+ offset += dir;
464
+
465
+ }
466
+
467
+ // adjust for linewidth
468
+ offset *= linewidth;
469
+
470
+ // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
471
+ offset /= resolution.y;
472
+
473
+ // select end
474
+ vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
475
+
476
+ // back to clip space
477
+ offset *= clip.w;
478
+
479
+ clip.xy += offset;
480
+
481
+ gl_Position = clip;
482
+
483
+ vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation
484
+
485
+ #include <logdepthbuf_vertex>
486
+ #include <clipping_planes_vertex>
487
+ #include <fog_vertex>
488
+
489
+ }
490
+ `,
491
+ fragmentShader: `
492
+ uniform vec3 diffuse;
493
+ uniform float opacity;
494
+
495
+ #ifdef USE_DASH
496
+
497
+ uniform float dashSize;
498
+ uniform float gapSize;
499
+
500
+ #endif
501
+
502
+ varying float vLineDistance;
503
+
504
+ #include <common>
505
+ #include <color_pars_fragment>
506
+ #include <fog_pars_fragment>
507
+ #include <logdepthbuf_pars_fragment>
508
+ #include <clipping_planes_pars_fragment>
509
+
510
+ varying vec2 vUv;
511
+
512
+ void main() {
513
+
514
+ #include <clipping_planes_fragment>
515
+
516
+ #ifdef USE_DASH
517
+
518
+ if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
519
+
520
+ if ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
521
+
522
+ #endif
523
+
524
+ if ( abs( vUv.y ) > 1.0 ) {
525
+
526
+ float a = vUv.x;
527
+ float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
528
+ float len2 = a * a + b * b;
529
+
530
+ if ( len2 > 1.0 ) discard;
531
+
532
+ }
533
+
534
+ vec4 diffuseColor = vec4( diffuse, opacity );
535
+
536
+ #include <logdepthbuf_fragment>
537
+ #include <color_fragment>
538
+
539
+ gl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );
540
+
541
+ #include <tonemapping_fragment>
542
+ #include <fog_fragment>
543
+ #include <premultiplied_alpha_fragment>
544
+
545
+ }
546
+ `
547
+ }, L = (
425
548
  /** @class */
426
- function(_super) {
427
- __extends(LineMaterial2, _super);
428
- function LineMaterial2(parameters) {
429
- var _this = _super.call(this, {
430
- uniforms: THREE.UniformsUtils.clone(lineShader.uniforms),
431
- vertexShader: lineShader.vertexShader,
432
- fragmentShader: lineShader.fragmentShader,
433
- clipping: true
549
+ function(a) {
550
+ A(o, a);
551
+ function o(t) {
552
+ var n = a.call(this, {
553
+ uniforms: i.UniformsUtils.clone(x.uniforms),
554
+ vertexShader: x.vertexShader,
555
+ fragmentShader: x.fragmentShader,
556
+ clipping: !0
434
557
  // required for clipping support
435
558
  }) || this;
436
- _this.type = "LineMaterial";
437
- _this.dashed = false;
438
- Object.defineProperties(_this, {
559
+ return n.type = "LineMaterial", n.dashed = !1, Object.defineProperties(n, {
439
560
  color: {
440
- enumerable: true,
561
+ enumerable: !0,
441
562
  get: function() {
442
563
  return this.uniforms.diffuse.value;
443
564
  },
444
- set: function(value) {
445
- this.uniforms.diffuse.value = value;
565
+ set: function(e) {
566
+ this.uniforms.diffuse.value = e;
446
567
  }
447
568
  },
448
569
  linewidth: {
449
- enumerable: true,
570
+ enumerable: !0,
450
571
  get: function() {
451
572
  return this.uniforms.linewidth.value;
452
573
  },
453
- set: function(value) {
454
- this.uniforms.linewidth.value = value;
574
+ set: function(e) {
575
+ this.uniforms.linewidth.value = e;
455
576
  }
456
577
  },
457
578
  dashScale: {
458
- enumerable: true,
579
+ enumerable: !0,
459
580
  get: function() {
460
581
  return this.uniforms.dashScale.value;
461
582
  },
462
- set: function(value) {
463
- this.uniforms.dashScale.value = value;
583
+ set: function(e) {
584
+ this.uniforms.dashScale.value = e;
464
585
  }
465
586
  },
466
587
  dashSize: {
467
- enumerable: true,
588
+ enumerable: !0,
468
589
  get: function() {
469
590
  return this.uniforms.dashSize.value;
470
591
  },
471
- set: function(value) {
472
- this.uniforms.dashSize.value = value;
592
+ set: function(e) {
593
+ this.uniforms.dashSize.value = e;
473
594
  }
474
595
  },
475
596
  gapSize: {
476
- enumerable: true,
597
+ enumerable: !0,
477
598
  get: function() {
478
599
  return this.uniforms.gapSize.value;
479
600
  },
480
- set: function(value) {
481
- this.uniforms.gapSize.value = value;
601
+ set: function(e) {
602
+ this.uniforms.gapSize.value = e;
482
603
  }
483
604
  },
484
605
  opacity: {
485
- enumerable: true,
606
+ enumerable: !0,
486
607
  get: function() {
487
608
  return this.uniforms.opacity.value;
488
609
  },
489
- set: function(value) {
490
- this.uniforms.opacity.value = value;
610
+ set: function(e) {
611
+ this.uniforms.opacity.value = e;
491
612
  }
492
613
  },
493
614
  resolution: {
494
- enumerable: true,
615
+ enumerable: !0,
495
616
  get: function() {
496
617
  return this.uniforms.resolution.value;
497
618
  },
498
- set: function(value) {
499
- this.uniforms.resolution.value.copy(value);
619
+ set: function(e) {
620
+ this.uniforms.resolution.value.copy(e);
500
621
  }
501
622
  }
502
- });
503
- _this.setValues(parameters);
504
- return _this;
623
+ }), n.setValues(t), n;
505
624
  }
506
- return LineMaterial2;
507
- }(THREE.ShaderMaterial)
625
+ return o;
626
+ }(i.ShaderMaterial)
508
627
  );
509
- Object.assign(LineMaterial.prototype, { isLineMaterial: true });
510
- var LineSegments2 = (
628
+ Object.assign(L.prototype, { isLineMaterial: !0 });
629
+ var F = (
511
630
  /** @class */
512
- function(_super) {
513
- __extends(LineSegments22, _super);
514
- function LineSegments22(geometry, material) {
515
- var _this = _super.call(this) || this;
516
- _this.type = "LineSegments2";
517
- _this.geometry = geometry !== void 0 ? geometry : new LineSegmentsGeometry();
518
- _this.material = material !== void 0 ? material : new LineMaterial({ color: Math.random() * 16777215 });
519
- return _this;
631
+ function(a) {
632
+ A(o, a);
633
+ function o(t, n) {
634
+ var e = a.call(this) || this;
635
+ return e.type = "LineSegments2", e.geometry = t !== void 0 ? t : new B(), e.material = n !== void 0 ? n : new L({ color: Math.random() * 16777215 }), e;
520
636
  }
521
- LineSegments22.prototype.computeLineDistances = function() {
522
- var geometry = this.geometry;
523
- var instanceStart = geometry.attributes.instanceStart;
524
- var instanceEnd = geometry.attributes.instanceEnd;
525
- var lineDistances = new Float32Array(2 * instanceStart.count);
526
- var start = new THREE.Vector3();
527
- var end = new THREE.Vector3();
528
- for (var i = 0, j = 0, l = instanceStart.count; i < l; i++, j += 2) {
529
- start.fromBufferAttribute(instanceStart, i);
530
- end.fromBufferAttribute(instanceEnd, i);
531
- lineDistances[j] = j === 0 ? 0 : lineDistances[j - 1];
532
- lineDistances[j + 1] = lineDistances[j] + start.distanceTo(end);
533
- }
534
- var instanceDistanceBuffer = new THREE.InstancedInterleavedBuffer(lineDistances, 2, 1);
535
- geometry.setAttribute("instanceDistanceStart", new THREE.InterleavedBufferAttribute(instanceDistanceBuffer, 1, 0));
536
- geometry.setAttribute("instanceDistanceEnd", new THREE.InterleavedBufferAttribute(instanceDistanceBuffer, 1, 1));
537
- return this;
538
- };
539
- LineSegments22.prototype.raycast = function(raycaster, intersects) {
540
- if (raycaster.camera === null) {
541
- console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');
542
- }
543
- var ray = raycaster.ray;
544
- var camera = raycaster.camera;
545
- var projectionMatrix = camera.projectionMatrix;
546
- var geometry = this.geometry;
547
- var material = this.material;
548
- var resolution = material.resolution;
549
- var lineWidth = material.linewidth;
550
- var instanceStart = geometry.attributes.instanceStart;
551
- var instanceEnd = geometry.attributes.instanceEnd;
552
- var start = new THREE.Vector4();
553
- var end = new THREE.Vector4();
554
- var ssOrigin = new THREE.Vector4();
555
- var ssOrigin3 = new THREE.Vector3();
556
- var mvMatrix = new THREE.Matrix4();
557
- var line = new THREE.Line3();
558
- var closestPoint = new THREE.Vector3();
559
- ray.at(1, ssOrigin);
560
- ssOrigin.w = 1;
561
- ssOrigin.applyMatrix4(camera.matrixWorldInverse);
562
- ssOrigin.applyMatrix4(projectionMatrix);
563
- ssOrigin.multiplyScalar(1 / ssOrigin.w);
564
- ssOrigin.x *= resolution.x / 2;
565
- ssOrigin.y *= resolution.y / 2;
566
- ssOrigin.z = 0;
567
- ssOrigin3.copy(ssOrigin);
568
- var matrixWorld = this.matrixWorld;
569
- mvMatrix.multiplyMatrices(camera.matrixWorldInverse, matrixWorld);
570
- for (var i = 0, l = instanceStart.count; i < l; i++) {
571
- start.fromBufferAttribute(instanceStart, i);
572
- end.fromBufferAttribute(instanceEnd, i);
573
- start.w = 1;
574
- end.w = 1;
575
- start.applyMatrix4(mvMatrix);
576
- end.applyMatrix4(mvMatrix);
577
- start.applyMatrix4(projectionMatrix);
578
- end.applyMatrix4(projectionMatrix);
579
- start.multiplyScalar(1 / start.w);
580
- end.multiplyScalar(1 / end.w);
581
- var isBehindCameraNear = start.z < -1 && end.z < -1;
582
- var isPastCameraFar = start.z > 1 && end.z > 1;
583
- if (isBehindCameraNear || isPastCameraFar) {
584
- continue;
585
- }
586
- start.x *= resolution.x / 2;
587
- start.y *= resolution.y / 2;
588
- end.x *= resolution.x / 2;
589
- end.y *= resolution.y / 2;
590
- line.start.copy(start);
591
- line.start.z = 0;
592
- line.end.copy(end);
593
- line.end.z = 0;
594
- var param = line.closestPointToPointParameter(ssOrigin3, true);
595
- line.at(param, closestPoint);
596
- var zPos = THREE.MathUtils.lerp(start.z, end.z, param);
597
- var isInClipSpace = zPos >= -1 && zPos <= 1;
598
- var isInside = ssOrigin3.distanceTo(closestPoint) < lineWidth * 0.5;
599
- if (isInClipSpace && isInside) {
600
- line.start.fromBufferAttribute(instanceStart, i);
601
- line.end.fromBufferAttribute(instanceEnd, i);
602
- line.start.applyMatrix4(matrixWorld);
603
- line.end.applyMatrix4(matrixWorld);
604
- var pointOnLine = new THREE.Vector3();
605
- var point = new THREE.Vector3();
606
- ray.distanceSqToSegment(line.start, line.end, point, pointOnLine);
607
- intersects.push({
608
- point,
609
- pointOnLine,
610
- distance: ray.origin.distanceTo(point),
611
- object: this,
612
- faceIndex: i
613
- });
637
+ return o.prototype.computeLineDistances = function() {
638
+ for (var t = this.geometry, n = t.attributes.instanceStart, e = t.attributes.instanceEnd, r = new Float32Array(2 * n.count), s = new i.Vector3(), c = new i.Vector3(), p = 0, u = 0, y = n.count; p < y; p++, u += 2)
639
+ s.fromBufferAttribute(n, p), c.fromBufferAttribute(e, p), r[u] = u === 0 ? 0 : r[u - 1], r[u + 1] = r[u] + s.distanceTo(c);
640
+ var m = new i.InstancedInterleavedBuffer(r, 2, 1);
641
+ return t.setAttribute("instanceDistanceStart", new i.InterleavedBufferAttribute(m, 1, 0)), t.setAttribute("instanceDistanceEnd", new i.InterleavedBufferAttribute(m, 1, 1)), this;
642
+ }, o.prototype.raycast = function(t, n) {
643
+ t.camera === null && console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');
644
+ var e = t.ray, r = t.camera, s = r.projectionMatrix, c = this.geometry, p = this.material, u = p.resolution, y = p.linewidth, m = c.attributes.instanceStart, M = c.attributes.instanceEnd, l = new i.Vector4(), f = new i.Vector4(), v = new i.Vector4(), g = new i.Vector3(), S = new i.Matrix4(), d = new i.Line3(), C = new i.Vector3();
645
+ e.at(1, v), v.w = 1, v.applyMatrix4(r.matrixWorldInverse), v.applyMatrix4(s), v.multiplyScalar(1 / v.w), v.x *= u.x / 2, v.y *= u.y / 2, v.z = 0, g.copy(v);
646
+ var w = this.matrixWorld;
647
+ S.multiplyMatrices(r.matrixWorldInverse, w);
648
+ for (var h = 0, N = m.count; h < N; h++) {
649
+ l.fromBufferAttribute(m, h), f.fromBufferAttribute(M, h), l.w = 1, f.w = 1, l.applyMatrix4(S), f.applyMatrix4(S), l.applyMatrix4(s), f.applyMatrix4(s), l.multiplyScalar(1 / l.w), f.multiplyScalar(1 / f.w);
650
+ var _ = l.z < -1 && f.z < -1, G = l.z > 1 && f.z > 1;
651
+ if (!(_ || G)) {
652
+ l.x *= u.x / 2, l.y *= u.y / 2, f.x *= u.x / 2, f.y *= u.y / 2, d.start.copy(l), d.start.z = 0, d.end.copy(f), d.end.z = 0;
653
+ var U = d.closestPointToPointParameter(g, !0);
654
+ d.at(U, C);
655
+ var z = i.MathUtils.lerp(l.z, f.z, U), W = z >= -1 && z <= 1, j = g.distanceTo(C) < y * 0.5;
656
+ if (W && j) {
657
+ d.start.fromBufferAttribute(m, h), d.end.fromBufferAttribute(M, h), d.start.applyMatrix4(w), d.end.applyMatrix4(w);
658
+ var P = new i.Vector3(), b = new i.Vector3();
659
+ e.distanceSqToSegment(d.start, d.end, b, P), n.push({
660
+ point: b,
661
+ pointOnLine: P,
662
+ distance: e.origin.distanceTo(b),
663
+ object: this,
664
+ faceIndex: h
665
+ });
666
+ }
614
667
  }
615
668
  }
616
- };
617
- return LineSegments22;
618
- }(THREE.Mesh)
669
+ }, o;
670
+ }(i.Mesh)
619
671
  );
620
- Object.assign(LineSegments2.prototype, { isLineSegments2: true });
621
- var Line2 = (
672
+ Object.assign(F.prototype, { isLineSegments2: !0 });
673
+ var I = (
622
674
  /** @class */
623
- function(_super) {
624
- __extends(Line22, _super);
625
- function Line22(geometry, material) {
626
- var _this = _super.call(this, geometry, material) || this;
627
- _this.type = "Line2";
628
- return _this;
675
+ function(a) {
676
+ A(o, a);
677
+ function o(t, n) {
678
+ var e = a.call(this, t, n) || this;
679
+ return e.type = "Line2", e;
629
680
  }
630
- return Line22;
631
- }(LineSegments2)
681
+ return o;
682
+ }(F)
632
683
  );
633
- Object.assign(Line2.prototype, { isLine2: true });
634
- var LineGeometry = (
684
+ Object.assign(I.prototype, { isLine2: !0 });
685
+ var O = (
635
686
  /** @class */
636
- function(_super) {
637
- __extends(LineGeometry2, _super);
638
- function LineGeometry2() {
639
- var _this = _super.call(this) || this;
640
- _this.type = "LineGeometry";
641
- return _this;
687
+ function(a) {
688
+ A(o, a);
689
+ function o() {
690
+ var t = a.call(this) || this;
691
+ return t.type = "LineGeometry", t;
642
692
  }
643
- LineGeometry2.prototype.setPositions = function(array) {
644
- var length = array.length - 3;
645
- var points = new Float32Array(2 * length);
646
- for (var i = 0; i < length; i += 3) {
647
- points[2 * i] = array[i];
648
- points[2 * i + 1] = array[i + 1];
649
- points[2 * i + 2] = array[i + 2];
650
- points[2 * i + 3] = array[i + 3];
651
- points[2 * i + 4] = array[i + 4];
652
- points[2 * i + 5] = array[i + 5];
653
- }
654
- _super.prototype.setPositions.call(this, points);
693
+ return o.prototype.setPositions = function(t) {
694
+ for (var n = t.length - 3, e = new Float32Array(2 * n), r = 0; r < n; r += 3)
695
+ e[2 * r] = t[r], e[2 * r + 1] = t[r + 1], e[2 * r + 2] = t[r + 2], e[2 * r + 3] = t[r + 3], e[2 * r + 4] = t[r + 4], e[2 * r + 5] = t[r + 5];
696
+ return a.prototype.setPositions.call(this, e), this;
697
+ }, o.prototype.setColors = function(t) {
698
+ for (var n = t.length - 3, e = new Float32Array(2 * n), r = 0; r < n; r += 3)
699
+ e[2 * r] = t[r], e[2 * r + 1] = t[r + 1], e[2 * r + 2] = t[r + 2], e[2 * r + 3] = t[r + 3], e[2 * r + 4] = t[r + 4], e[2 * r + 5] = t[r + 5];
700
+ return a.prototype.setColors.call(this, e), this;
701
+ }, o.prototype.fromLine = function(t) {
702
+ var n = t.geometry;
703
+ if (n instanceof i.Geometry) {
704
+ var e = new i.BufferGeometry().fromGeometry(n);
705
+ this.setPositions(e.attributes.position.array);
706
+ } else
707
+ n instanceof i.BufferGeometry && this.setPositions(n.attributes.position.array);
655
708
  return this;
656
- };
657
- LineGeometry2.prototype.setColors = function(array) {
658
- var length = array.length - 3;
659
- var colors = new Float32Array(2 * length);
660
- for (var i = 0; i < length; i += 3) {
661
- colors[2 * i] = array[i];
662
- colors[2 * i + 1] = array[i + 1];
663
- colors[2 * i + 2] = array[i + 2];
664
- colors[2 * i + 3] = array[i + 3];
665
- colors[2 * i + 4] = array[i + 4];
666
- colors[2 * i + 5] = array[i + 5];
667
- }
668
- _super.prototype.setColors.call(this, colors);
709
+ }, o.prototype.copy = function() {
669
710
  return this;
670
- };
671
- LineGeometry2.prototype.fromLine = function(line) {
672
- var geometry = line.geometry;
673
- if (geometry instanceof THREE.Geometry) {
674
- var bufferGeometry = new THREE.BufferGeometry().fromGeometry(geometry);
675
- this.setPositions(bufferGeometry.attributes.position.array);
676
- } else if (geometry instanceof THREE.BufferGeometry) {
677
- this.setPositions(geometry.attributes.position.array);
678
- }
679
- return this;
680
- };
681
- LineGeometry2.prototype.copy = function() {
682
- return this;
683
- };
684
- return LineGeometry2;
685
- }(LineSegmentsGeometry)
711
+ }, o;
712
+ }(B)
686
713
  );
687
- Object.assign(LineGeometry.prototype, { isLineGeometry: true });
688
- var circleImageURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==";
689
- var DEFAULT_COLOR = 14467195;
690
- var POINT_SIZE = 8;
691
- var DEFAULT_LINEWIDTH = 2;
692
- var DEFAULT_DASHSCALE = 20;
693
- var sharedCircleTexture = null;
694
- var FiveLine = (
714
+ Object.assign(O.prototype, { isLineGeometry: !0 });
715
+ var T = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==", V = 14467195, H = 8, R = 2, k = 20, D = null, Q = (
695
716
  /** @class */
696
- function(_super) {
697
- __extends(FiveLine2, _super);
698
- function FiveLine2(vector0, vector1) {
699
- if (vector0 === void 0) {
700
- vector0 = new THREE.Vector3();
701
- }
702
- if (vector1 === void 0) {
703
- vector1 = new THREE.Vector3();
704
- }
705
- var _this = _super.call(this) || this;
706
- _this.type = "FiveLine";
707
- _this.needsRender = true;
708
- var lineGeometry = new LineGeometry();
709
- var lineMaterial = new LineMaterial({
710
- color: DEFAULT_COLOR,
711
- linewidth: DEFAULT_LINEWIDTH,
712
- dashScale: DEFAULT_DASHSCALE,
713
- dashed: false
717
+ function(a) {
718
+ A(o, a);
719
+ function o(t, n) {
720
+ t === void 0 && (t = new i.Vector3()), n === void 0 && (n = new i.Vector3());
721
+ var e = a.call(this) || this;
722
+ e.type = "FiveLine", e.needsRender = !0;
723
+ var r = new O(), s = new L({
724
+ color: V,
725
+ linewidth: R,
726
+ dashScale: k,
727
+ dashed: !1
714
728
  });
715
- _this.line = new Line2(lineGeometry, lineMaterial);
716
- var pointsGeometry = new THREE.BufferGeometry();
717
- var pointsMaterial = new THREE.PointsMaterial({
718
- color: DEFAULT_COLOR,
719
- size: POINT_SIZE,
720
- map: sharedCircleTexture || (sharedCircleTexture = new THREE.TextureLoader().load(circleImageURL)),
721
- sizeAttenuation: false,
722
- transparent: true
729
+ e.line = new I(r, s);
730
+ var c = new i.BufferGeometry(), p = new i.PointsMaterial({
731
+ color: V,
732
+ size: H,
733
+ map: D || (D = new i.TextureLoader().load(T)),
734
+ sizeAttenuation: !1,
735
+ transparent: !0
723
736
  });
724
- _this.points = new THREE.Points(pointsGeometry, pointsMaterial);
725
- _this.points.renderOrder = 11;
726
- _this.points.frustumCulled = false;
727
- _this.setPoints(vector0, vector1);
728
- _this.add(_this.line, _this.points);
729
- return _this;
737
+ return e.points = new i.Points(c, p), e.points.renderOrder = 11, e.points.frustumCulled = !1, e.setPoints(t, n), e.add(e.line, e.points), e;
730
738
  }
731
- Object.defineProperty(FiveLine2, "version", {
739
+ return Object.defineProperty(o, "version", {
732
740
  get: function() {
733
- return "6.0.0-alpha.71";
741
+ return "6.0.0-alpha.73";
734
742
  },
735
- enumerable: false,
736
- configurable: true
737
- });
738
- FiveLine2.prototype.setPoints = function(vector0, vector1) {
739
- var positions = [].concat(vector0.toArray(), vector1.toArray());
740
- this.points.geometry.setAttribute("position", new THREE.BufferAttribute(new Float32Array(positions), 3));
741
- this.line.geometry.setPositions(positions);
742
- this.line.computeLineDistances();
743
- this.needsRender = true;
744
- };
745
- FiveLine2.prototype.getPoints = function() {
746
- var array = this.points.geometry.attributes.position.array;
743
+ enumerable: !1,
744
+ configurable: !0
745
+ }), o.prototype.setPoints = function(t, n) {
746
+ var e = [].concat(t.toArray(), n.toArray());
747
+ this.points.geometry.setAttribute("position", new i.BufferAttribute(new Float32Array(e), 3)), this.line.geometry.setPositions(e), this.line.computeLineDistances(), this.needsRender = !0;
748
+ }, o.prototype.getPoints = function() {
749
+ var t = this.points.geometry.attributes.position.array;
747
750
  return [
748
- new THREE.Vector3(array[0], array[1], array[2]),
749
- new THREE.Vector3(array[3], array[4], array[5])
751
+ new i.Vector3(t[0], t[1], t[2]),
752
+ new i.Vector3(t[3], t[4], t[5])
750
753
  ];
751
- };
752
- FiveLine2.prototype.setMaterial = function(map) {
753
- var lineMaterial = this.line.material;
754
- for (var name_1 in map) {
755
- if (!map.hasOwnProperty(name_1))
756
- continue;
757
- var value = map[name_1];
758
- if (name_1 === "dashed") {
759
- lineMaterial.dashed = value;
760
- if (value) {
761
- lineMaterial.defines.USE_DASH = "";
762
- } else {
763
- delete lineMaterial.defines.USE_DASH;
764
- }
765
- lineMaterial.needsUpdate = true;
766
- } else {
767
- lineMaterial[name_1] = map[name_1];
754
+ }, o.prototype.setMaterial = function(t) {
755
+ var n = this.line.material;
756
+ for (var e in t)
757
+ if (t.hasOwnProperty(e)) {
758
+ var r = t[e];
759
+ e === "dashed" ? (n.dashed = r, r ? n.defines.USE_DASH = "" : delete n.defines.USE_DASH, n.needsUpdate = !0) : n[e] = t[e];
768
760
  }
769
- }
770
- this.needsRender = true;
771
- };
772
- FiveLine2.prototype.setResolution = function(width, height) {
773
- var resolution = this.line.material.resolution;
774
- if (resolution.x !== width || resolution.y !== height) {
775
- resolution.set(width, height);
776
- this.needsRender = true;
777
- }
778
- };
779
- return FiveLine2;
780
- }(THREE.Object3D)
761
+ this.needsRender = !0;
762
+ }, o.prototype.setResolution = function(t, n) {
763
+ var e = this.line.material.resolution;
764
+ (e.x !== t || e.y !== n) && (e.set(t, n), this.needsRender = !0);
765
+ }, o;
766
+ }(i.Object3D)
781
767
  );
782
- Object.assign(FiveLine.prototype, { isFiveLine: true });
768
+ Object.assign(Q.prototype, { isFiveLine: !0 });
783
769
  export {
784
- FiveLine as Line,
785
- LineGeometry,
786
- LineMaterial,
787
- LineSegmentsGeometry,
788
- Line2 as THREE_Line2,
789
- LineSegments2 as THREE_LineSegments2
770
+ Q as Line,
771
+ O as LineGeometry,
772
+ L as LineMaterial,
773
+ B as LineSegmentsGeometry,
774
+ I as THREE_Line2,
775
+ F as THREE_LineSegments2
790
776
  };