@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/README.md +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/five.Model.html +22 -22
- package/docs/classes/five.ModelViewLayer.html +13 -0
- package/docs/classes/five.TextureLoader.html +2 -2
- package/docs/classes/five.Tile3DModel.html +1 -2
- package/docs/classes/five.TileCubeTextureTarget.html +1 -1
- package/docs/classes/five.TileNode.html +2 -1
- package/docs/functions/five.loadPbm.html +1 -1
- package/docs/index.html +2 -2
- package/docs/modules/five.html +1 -0
- package/docs/types/five.Models.html +2 -1
- package/five/index.d.ts +27 -20
- package/five/index.js +1691 -18
- package/five/index.mjs +17524 -30520
- package/gltf-loader/index.js +9 -3
- package/gltf-loader/index.mjs +990 -1978
- package/line/index.js +202 -3
- package/line/index.mjs +434 -448
- package/package.json +3 -2
- package/react/index.js +3 -3
- package/react/index.mjs +614 -935
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +92 -157
- package/umd/five-gltf-loader.js +9 -3
- package/umd/five-line.js +202 -3
- package/umd/five-react.js +3 -3
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +287 -3
- package/umd/five-vue.js +3 -3
- package/umd/five.js +1778 -105
- package/vfx/index.js +287 -3
- package/vfx/index.mjs +591 -531
- package/vue/index.js +3 -3
- package/vue/index.mjs +230 -371
package/line/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 12/
|
|
5
|
-
* Version: 6.0.0-alpha.
|
|
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
|
|
256
|
-
var
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
} || function(
|
|
260
|
-
for (var
|
|
261
|
-
|
|
262
|
-
|
|
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
|
|
267
|
-
if (typeof
|
|
268
|
-
throw new TypeError("Class extends value " + String(
|
|
269
|
-
|
|
270
|
-
function
|
|
271
|
-
this.constructor =
|
|
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
|
-
|
|
271
|
+
a.prototype = o === null ? Object.create(o) : (t.prototype = o.prototype, new t());
|
|
274
272
|
}
|
|
275
|
-
|
|
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(
|
|
282
|
-
|
|
283
|
-
function
|
|
284
|
-
var
|
|
285
|
-
|
|
286
|
-
var
|
|
287
|
-
|
|
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
|
-
|
|
295
|
-
var
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
return this;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}
|
|
319
|
-
|
|
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
|
-
|
|
345
|
-
this.
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
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
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
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
|
-
|
|
402
|
-
|
|
403
|
-
return LineSegmentsGeometry2;
|
|
404
|
-
}(THREE.InstancedBufferGeometry)
|
|
327
|
+
}, o.prototype.toJSON = function() {
|
|
328
|
+
}, o;
|
|
329
|
+
}(i.InstancedBufferGeometry)
|
|
405
330
|
);
|
|
406
|
-
Object.assign(
|
|
407
|
-
var
|
|
408
|
-
uniforms:
|
|
409
|
-
|
|
410
|
-
|
|
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
|
|
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:
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
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(
|
|
427
|
-
|
|
428
|
-
function
|
|
429
|
-
var
|
|
430
|
-
uniforms:
|
|
431
|
-
vertexShader:
|
|
432
|
-
fragmentShader:
|
|
433
|
-
clipping:
|
|
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
|
-
|
|
437
|
-
_this.dashed = false;
|
|
438
|
-
Object.defineProperties(_this, {
|
|
559
|
+
return n.type = "LineMaterial", n.dashed = !1, Object.defineProperties(n, {
|
|
439
560
|
color: {
|
|
440
|
-
enumerable:
|
|
561
|
+
enumerable: !0,
|
|
441
562
|
get: function() {
|
|
442
563
|
return this.uniforms.diffuse.value;
|
|
443
564
|
},
|
|
444
|
-
set: function(
|
|
445
|
-
this.uniforms.diffuse.value =
|
|
565
|
+
set: function(e) {
|
|
566
|
+
this.uniforms.diffuse.value = e;
|
|
446
567
|
}
|
|
447
568
|
},
|
|
448
569
|
linewidth: {
|
|
449
|
-
enumerable:
|
|
570
|
+
enumerable: !0,
|
|
450
571
|
get: function() {
|
|
451
572
|
return this.uniforms.linewidth.value;
|
|
452
573
|
},
|
|
453
|
-
set: function(
|
|
454
|
-
this.uniforms.linewidth.value =
|
|
574
|
+
set: function(e) {
|
|
575
|
+
this.uniforms.linewidth.value = e;
|
|
455
576
|
}
|
|
456
577
|
},
|
|
457
578
|
dashScale: {
|
|
458
|
-
enumerable:
|
|
579
|
+
enumerable: !0,
|
|
459
580
|
get: function() {
|
|
460
581
|
return this.uniforms.dashScale.value;
|
|
461
582
|
},
|
|
462
|
-
set: function(
|
|
463
|
-
this.uniforms.dashScale.value =
|
|
583
|
+
set: function(e) {
|
|
584
|
+
this.uniforms.dashScale.value = e;
|
|
464
585
|
}
|
|
465
586
|
},
|
|
466
587
|
dashSize: {
|
|
467
|
-
enumerable:
|
|
588
|
+
enumerable: !0,
|
|
468
589
|
get: function() {
|
|
469
590
|
return this.uniforms.dashSize.value;
|
|
470
591
|
},
|
|
471
|
-
set: function(
|
|
472
|
-
this.uniforms.dashSize.value =
|
|
592
|
+
set: function(e) {
|
|
593
|
+
this.uniforms.dashSize.value = e;
|
|
473
594
|
}
|
|
474
595
|
},
|
|
475
596
|
gapSize: {
|
|
476
|
-
enumerable:
|
|
597
|
+
enumerable: !0,
|
|
477
598
|
get: function() {
|
|
478
599
|
return this.uniforms.gapSize.value;
|
|
479
600
|
},
|
|
480
|
-
set: function(
|
|
481
|
-
this.uniforms.gapSize.value =
|
|
601
|
+
set: function(e) {
|
|
602
|
+
this.uniforms.gapSize.value = e;
|
|
482
603
|
}
|
|
483
604
|
},
|
|
484
605
|
opacity: {
|
|
485
|
-
enumerable:
|
|
606
|
+
enumerable: !0,
|
|
486
607
|
get: function() {
|
|
487
608
|
return this.uniforms.opacity.value;
|
|
488
609
|
},
|
|
489
|
-
set: function(
|
|
490
|
-
this.uniforms.opacity.value =
|
|
610
|
+
set: function(e) {
|
|
611
|
+
this.uniforms.opacity.value = e;
|
|
491
612
|
}
|
|
492
613
|
},
|
|
493
614
|
resolution: {
|
|
494
|
-
enumerable:
|
|
615
|
+
enumerable: !0,
|
|
495
616
|
get: function() {
|
|
496
617
|
return this.uniforms.resolution.value;
|
|
497
618
|
},
|
|
498
|
-
set: function(
|
|
499
|
-
this.uniforms.resolution.value.copy(
|
|
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
|
|
507
|
-
}(
|
|
625
|
+
return o;
|
|
626
|
+
}(i.ShaderMaterial)
|
|
508
627
|
);
|
|
509
|
-
Object.assign(
|
|
510
|
-
var
|
|
628
|
+
Object.assign(L.prototype, { isLineMaterial: !0 });
|
|
629
|
+
var F = (
|
|
511
630
|
/** @class */
|
|
512
|
-
function(
|
|
513
|
-
|
|
514
|
-
function
|
|
515
|
-
var
|
|
516
|
-
|
|
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
|
-
|
|
522
|
-
var
|
|
523
|
-
|
|
524
|
-
var
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
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
|
-
|
|
618
|
-
}(THREE.Mesh)
|
|
669
|
+
}, o;
|
|
670
|
+
}(i.Mesh)
|
|
619
671
|
);
|
|
620
|
-
Object.assign(
|
|
621
|
-
var
|
|
672
|
+
Object.assign(F.prototype, { isLineSegments2: !0 });
|
|
673
|
+
var I = (
|
|
622
674
|
/** @class */
|
|
623
|
-
function(
|
|
624
|
-
|
|
625
|
-
function
|
|
626
|
-
var
|
|
627
|
-
|
|
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
|
|
631
|
-
}(
|
|
681
|
+
return o;
|
|
682
|
+
}(F)
|
|
632
683
|
);
|
|
633
|
-
Object.assign(
|
|
634
|
-
var
|
|
684
|
+
Object.assign(I.prototype, { isLine2: !0 });
|
|
685
|
+
var O = (
|
|
635
686
|
/** @class */
|
|
636
|
-
function(
|
|
637
|
-
|
|
638
|
-
function
|
|
639
|
-
var
|
|
640
|
-
|
|
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
|
-
|
|
644
|
-
var
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
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
|
-
|
|
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(
|
|
688
|
-
var
|
|
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(
|
|
697
|
-
|
|
698
|
-
function
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
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
|
-
|
|
716
|
-
var
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
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
|
-
|
|
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(
|
|
739
|
+
return Object.defineProperty(o, "version", {
|
|
732
740
|
get: function() {
|
|
733
|
-
return "6.0.0-alpha.
|
|
741
|
+
return "6.0.0-alpha.73";
|
|
734
742
|
},
|
|
735
|
-
enumerable:
|
|
736
|
-
configurable:
|
|
737
|
-
})
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
this.
|
|
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
|
|
749
|
-
new
|
|
751
|
+
new i.Vector3(t[0], t[1], t[2]),
|
|
752
|
+
new i.Vector3(t[3], t[4], t[5])
|
|
750
753
|
];
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
var
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
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
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
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(
|
|
768
|
+
Object.assign(Q.prototype, { isFiveLine: !0 });
|
|
783
769
|
export {
|
|
784
|
-
|
|
785
|
-
LineGeometry,
|
|
786
|
-
LineMaterial,
|
|
787
|
-
LineSegmentsGeometry,
|
|
788
|
-
|
|
789
|
-
|
|
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
|
};
|