@xeokit/xeokit-sdk 2.4.0-alpha-100 → 2.4.0-alpha-104
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/dist/xeokit-sdk.cjs.js +159 -151
- package/dist/xeokit-sdk.es.js +159 -151
- package/dist/xeokit-sdk.es5.js +44 -42
- package/dist/xeokit-sdk.min.cjs.js +4 -4
- package/dist/xeokit-sdk.min.es.js +4 -4
- package/dist/xeokit-sdk.min.es5.js +3 -3
- package/package.json +1 -1
- package/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsMouseControl.js +0 -1
- package/src/plugins/NavCubePlugin/CubeTextureCanvas.js +4 -4
- package/src/viewer/scene/Bitmap/Bitmap.js +4 -1
- package/src/viewer/scene/CameraControl/lib/handlers/MousePickHandler.js +2 -1
- package/src/viewer/scene/LineSet/LineSet.js +7 -4
- package/src/viewer/scene/LineSet/LineSet.new.js +160 -0
- package/src/viewer/scene/model/MeshClusteringManager.js +31 -0
- package/src/viewer/scene/model/SceneModel.js +1 -1
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureColorRenderer.js +3 -3
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureEdgesColorRenderer.js +2 -3
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureEdgesRenderer.js +5 -7
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureSnapDepthBufInitRenderer.js +4 -2
- package/src/viewer/scene/model/vbo/snapBatching/SnapBatchingDepthBufInitRenderer.js +4 -2
- package/src/viewer/scene/model/vbo/snapInstancing/SnapInstancingDepthBufInitRenderer.js +4 -2
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -45987,7 +45987,10 @@ class Bitmap extends Component {
|
|
|
45987
45987
|
this._rtcPos = math.vec3();
|
|
45988
45988
|
this._imageSize = math.vec2();
|
|
45989
45989
|
|
|
45990
|
-
this._texture = new Texture(this
|
|
45990
|
+
this._texture = new Texture(this, {
|
|
45991
|
+
flipY: true
|
|
45992
|
+
});
|
|
45993
|
+
|
|
45991
45994
|
this._image = new Image();
|
|
45992
45995
|
|
|
45993
45996
|
if (this._type !== "jpg" && this._type !== "png") {
|
|
@@ -46360,6 +46363,116 @@ class Bitmap extends Component {
|
|
|
46360
46363
|
}
|
|
46361
46364
|
}
|
|
46362
46365
|
|
|
46366
|
+
const tempVec3a$v = math.vec3();
|
|
46367
|
+
const tempVec3b$q = math.vec3();
|
|
46368
|
+
const tempMat4a$h = math.mat4();
|
|
46369
|
+
|
|
46370
|
+
/**
|
|
46371
|
+
* @private
|
|
46372
|
+
*/
|
|
46373
|
+
class FrustumPlane {
|
|
46374
|
+
|
|
46375
|
+
constructor() {
|
|
46376
|
+
this.normal = math.vec3();
|
|
46377
|
+
this.offset = 0;
|
|
46378
|
+
this.testVertex = math.vec3();
|
|
46379
|
+
}
|
|
46380
|
+
|
|
46381
|
+
set(nx, ny, nz, offset) {
|
|
46382
|
+
const s = 1.0 / Math.sqrt(nx * nx + ny * ny + nz * nz);
|
|
46383
|
+
this.normal[0] = nx * s;
|
|
46384
|
+
this.normal[1] = ny * s;
|
|
46385
|
+
this.normal[2] = nz * s;
|
|
46386
|
+
this.offset = offset * s;
|
|
46387
|
+
this.testVertex[0] = (this.normal[0] >= 0.0) ? 1 : 0;
|
|
46388
|
+
this.testVertex[1] = (this.normal[1] >= 0.0) ? 1 : 0;
|
|
46389
|
+
this.testVertex[2] = (this.normal[2] >= 0.0) ? 1 : 0;
|
|
46390
|
+
}
|
|
46391
|
+
}
|
|
46392
|
+
|
|
46393
|
+
/**
|
|
46394
|
+
* @private
|
|
46395
|
+
*/
|
|
46396
|
+
class Frustum {
|
|
46397
|
+
constructor() {
|
|
46398
|
+
this.planes = [
|
|
46399
|
+
new FrustumPlane(), new FrustumPlane(), new FrustumPlane(),
|
|
46400
|
+
new FrustumPlane(), new FrustumPlane(), new FrustumPlane()
|
|
46401
|
+
];
|
|
46402
|
+
}
|
|
46403
|
+
}
|
|
46404
|
+
|
|
46405
|
+
Frustum.INSIDE = 0;
|
|
46406
|
+
Frustum.INTERSECT = 1;
|
|
46407
|
+
Frustum.OUTSIDE = 2;
|
|
46408
|
+
|
|
46409
|
+
/** @private */
|
|
46410
|
+
function setFrustum(frustum, viewMat, projMat) {
|
|
46411
|
+
|
|
46412
|
+
const m = math.mulMat4(projMat, viewMat, tempMat4a$h);
|
|
46413
|
+
|
|
46414
|
+
const m0 = m[0];
|
|
46415
|
+
const m1 = m[1];
|
|
46416
|
+
const m2 = m[2];
|
|
46417
|
+
const m3 = m[3];
|
|
46418
|
+
const m4 = m[4];
|
|
46419
|
+
const m5 = m[5];
|
|
46420
|
+
const m6 = m[6];
|
|
46421
|
+
const m7 = m[7];
|
|
46422
|
+
const m8 = m[8];
|
|
46423
|
+
const m9 = m[9];
|
|
46424
|
+
const m10 = m[10];
|
|
46425
|
+
const m11 = m[11];
|
|
46426
|
+
const m12 = m[12];
|
|
46427
|
+
const m13 = m[13];
|
|
46428
|
+
const m14 = m[14];
|
|
46429
|
+
const m15 = m[15];
|
|
46430
|
+
|
|
46431
|
+
frustum.planes[0].set(m3 - m0, m7 - m4, m11 - m8, m15 - m12);
|
|
46432
|
+
frustum.planes[1].set(m3 + m0, m7 + m4, m11 + m8, m15 + m12);
|
|
46433
|
+
frustum.planes[2].set(m3 - m1, m7 - m5, m11 - m9, m15 - m13);
|
|
46434
|
+
frustum.planes[3].set(m3 + m1, m7 + m5, m11 + m9, m15 + m13);
|
|
46435
|
+
frustum.planes[4].set(m3 - m2, m7 - m6, m11 - m10, m15 - m14);
|
|
46436
|
+
frustum.planes[5].set(m3 + m2, m7 + m6, m11 + m10, m15 + m14);
|
|
46437
|
+
}
|
|
46438
|
+
|
|
46439
|
+
/** @private */
|
|
46440
|
+
function frustumIntersectsAABB3(frustum, aabb) {
|
|
46441
|
+
|
|
46442
|
+
let ret = Frustum.INSIDE;
|
|
46443
|
+
|
|
46444
|
+
const min = tempVec3a$v;
|
|
46445
|
+
const max = tempVec3b$q;
|
|
46446
|
+
|
|
46447
|
+
min[0] = aabb[0];
|
|
46448
|
+
min[1] = aabb[1];
|
|
46449
|
+
min[2] = aabb[2];
|
|
46450
|
+
max[0] = aabb[3];
|
|
46451
|
+
max[1] = aabb[4];
|
|
46452
|
+
max[2] = aabb[5];
|
|
46453
|
+
|
|
46454
|
+
const bminmax = [min, max];
|
|
46455
|
+
|
|
46456
|
+
for (let i = 0; i < 6; ++i) {
|
|
46457
|
+
const plane = frustum.planes[i];
|
|
46458
|
+
if (((plane.normal[0] * bminmax[plane.testVertex[0]][0]) +
|
|
46459
|
+
(plane.normal[1] * bminmax[plane.testVertex[1]][1]) +
|
|
46460
|
+
(plane.normal[2] * bminmax[plane.testVertex[2]][2]) +
|
|
46461
|
+
(plane.offset)) < 0.0) {
|
|
46462
|
+
return Frustum.OUTSIDE;
|
|
46463
|
+
}
|
|
46464
|
+
|
|
46465
|
+
if (((plane.normal[0] * bminmax[1 - plane.testVertex[0]][0]) +
|
|
46466
|
+
(plane.normal[1] * bminmax[1 - plane.testVertex[1]][1]) +
|
|
46467
|
+
(plane.normal[2] * bminmax[1 - plane.testVertex[2]][2]) +
|
|
46468
|
+
(plane.offset)) < 0.0) {
|
|
46469
|
+
ret = Frustum.INTERSECT;
|
|
46470
|
+
}
|
|
46471
|
+
}
|
|
46472
|
+
|
|
46473
|
+
return ret;
|
|
46474
|
+
}
|
|
46475
|
+
|
|
46363
46476
|
/**
|
|
46364
46477
|
* A set of 3D line segments.
|
|
46365
46478
|
*
|
|
@@ -46434,8 +46547,10 @@ class LineSet extends Component {
|
|
|
46434
46547
|
super(owner, cfg);
|
|
46435
46548
|
|
|
46436
46549
|
this._positions = cfg.positions || [];
|
|
46437
|
-
|
|
46438
|
-
|
|
46550
|
+
const rtcPositions = new Float32Array(this._positions.length);
|
|
46551
|
+
const rtcCenter = math.vec3();
|
|
46552
|
+
const cellSize = 100;
|
|
46553
|
+
const rtcNeeded = worldToRTCPositions(this._positions, new Float32Array(this._positions.length), rtcCenter, cellSize);
|
|
46439
46554
|
|
|
46440
46555
|
if (cfg.indices) {
|
|
46441
46556
|
this._indices = cfg.indices;
|
|
@@ -46453,9 +46568,9 @@ class LineSet extends Component {
|
|
|
46453
46568
|
collidable: cfg.collidable,
|
|
46454
46569
|
geometry: new VBOGeometry(this, {
|
|
46455
46570
|
primitive: "lines",
|
|
46456
|
-
positions: this._positions,
|
|
46571
|
+
positions: rtcNeeded ? rtcPositions : this._positions,
|
|
46457
46572
|
indices: this._indices,
|
|
46458
|
-
origin:
|
|
46573
|
+
origin: rtcNeeded ? rtcCenter : null
|
|
46459
46574
|
}),
|
|
46460
46575
|
material: new PhongMaterial(this, {
|
|
46461
46576
|
diffuse: cfg.color || [0, 0, 0],
|
|
@@ -46518,8 +46633,8 @@ class LineSet extends Component {
|
|
|
46518
46633
|
}
|
|
46519
46634
|
|
|
46520
46635
|
const tempVec3$5 = math.vec3();
|
|
46521
|
-
const tempVec3a$
|
|
46522
|
-
const tempVec3b$
|
|
46636
|
+
const tempVec3a$u = math.vec3();
|
|
46637
|
+
const tempVec3b$p = math.vec3();
|
|
46523
46638
|
const tempVec3c$m = math.vec3();
|
|
46524
46639
|
|
|
46525
46640
|
/**
|
|
@@ -47199,8 +47314,8 @@ class BCFViewpointsPlugin extends Plugin {
|
|
|
47199
47314
|
bcfViewpoint.bitmaps.forEach(function (e) {
|
|
47200
47315
|
const bitmap_type = e.bitmap_type || "jpg"; // "jpg" | "png"
|
|
47201
47316
|
const bitmap_data = e.bitmap_data; // base64
|
|
47202
|
-
let location = xyzObjectToArray(e.location, tempVec3a$
|
|
47203
|
-
let normal = xyzObjectToArray(e.normal, tempVec3b$
|
|
47317
|
+
let location = xyzObjectToArray(e.location, tempVec3a$u);
|
|
47318
|
+
let normal = xyzObjectToArray(e.normal, tempVec3b$p);
|
|
47204
47319
|
let up = xyzObjectToArray(e.up, tempVec3c$m);
|
|
47205
47320
|
let height = e.height || 1;
|
|
47206
47321
|
if (!bitmap_type) {
|
|
@@ -48715,7 +48830,6 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
|
|
|
48715
48830
|
this.pointerLens.visible = false;
|
|
48716
48831
|
}
|
|
48717
48832
|
this.reset();
|
|
48718
|
-
this.viewer;
|
|
48719
48833
|
const canvas = this.scene.canvas.canvas;
|
|
48720
48834
|
canvas.removeEventListener("mousedown", this._onMouseDown);
|
|
48721
48835
|
canvas.removeEventListener("mouseup", this._onMouseUp);
|
|
@@ -50597,7 +50711,7 @@ class SplineCurve extends Curve {
|
|
|
50597
50711
|
}
|
|
50598
50712
|
}
|
|
50599
50713
|
|
|
50600
|
-
const tempVec3a$
|
|
50714
|
+
const tempVec3a$t = math.vec3();
|
|
50601
50715
|
|
|
50602
50716
|
/**
|
|
50603
50717
|
* @desc Defines a sequence of frames along which a {@link CameraPathAnimation} can animate a {@link Camera}.
|
|
@@ -50729,9 +50843,9 @@ class CameraPath extends Component {
|
|
|
50729
50843
|
t = t / (this._frames[this._frames.length - 1].t - this._frames[0].t);
|
|
50730
50844
|
t = t < 0.0 ? 0.0 : (t > 1.0 ? 1.0 : t);
|
|
50731
50845
|
|
|
50732
|
-
camera.eye = this._eyeCurve.getPoint(t, tempVec3a$
|
|
50733
|
-
camera.look = this._lookCurve.getPoint(t, tempVec3a$
|
|
50734
|
-
camera.up = this._upCurve.getPoint(t, tempVec3a$
|
|
50846
|
+
camera.eye = this._eyeCurve.getPoint(t, tempVec3a$t);
|
|
50847
|
+
camera.look = this._lookCurve.getPoint(t, tempVec3a$t);
|
|
50848
|
+
camera.up = this._upCurve.getPoint(t, tempVec3a$t);
|
|
50735
50849
|
}
|
|
50736
50850
|
|
|
50737
50851
|
/**
|
|
@@ -51770,7 +51884,7 @@ CameraPathAnimation.PLAYING = 2;
|
|
|
51770
51884
|
CameraPathAnimation.PLAYING_TO = 3;
|
|
51771
51885
|
|
|
51772
51886
|
const tempVec3$3 = math.vec3();
|
|
51773
|
-
const tempVec3b$
|
|
51887
|
+
const tempVec3b$o = math.vec3();
|
|
51774
51888
|
math.vec3();
|
|
51775
51889
|
const zeroVec$2 = math.vec3([0, -1, 0]);
|
|
51776
51890
|
const tempQuat = math.vec4([0, 0, 0, 1]);
|
|
@@ -52198,7 +52312,7 @@ class ImagePlane extends Component {
|
|
|
52198
52312
|
const dist = -math.dotVec3(negDir, tempVec3$3);
|
|
52199
52313
|
|
|
52200
52314
|
math.normalizeVec3(negDir);
|
|
52201
|
-
math.mulVec3Scalar(negDir, dist, tempVec3b$
|
|
52315
|
+
math.mulVec3Scalar(negDir, dist, tempVec3b$o);
|
|
52202
52316
|
math.vec3PairToQuaternion(zeroVec$2, dir, tempQuat);
|
|
52203
52317
|
|
|
52204
52318
|
this._node.quaternion = tempQuat;
|
|
@@ -53364,116 +53478,6 @@ class SpriteMarker extends Marker {
|
|
|
53364
53478
|
}
|
|
53365
53479
|
}
|
|
53366
53480
|
|
|
53367
|
-
const tempVec3a$t = math.vec3();
|
|
53368
|
-
const tempVec3b$o = math.vec3();
|
|
53369
|
-
const tempMat4a$h = math.mat4();
|
|
53370
|
-
|
|
53371
|
-
/**
|
|
53372
|
-
* @private
|
|
53373
|
-
*/
|
|
53374
|
-
class FrustumPlane {
|
|
53375
|
-
|
|
53376
|
-
constructor() {
|
|
53377
|
-
this.normal = math.vec3();
|
|
53378
|
-
this.offset = 0;
|
|
53379
|
-
this.testVertex = math.vec3();
|
|
53380
|
-
}
|
|
53381
|
-
|
|
53382
|
-
set(nx, ny, nz, offset) {
|
|
53383
|
-
const s = 1.0 / Math.sqrt(nx * nx + ny * ny + nz * nz);
|
|
53384
|
-
this.normal[0] = nx * s;
|
|
53385
|
-
this.normal[1] = ny * s;
|
|
53386
|
-
this.normal[2] = nz * s;
|
|
53387
|
-
this.offset = offset * s;
|
|
53388
|
-
this.testVertex[0] = (this.normal[0] >= 0.0) ? 1 : 0;
|
|
53389
|
-
this.testVertex[1] = (this.normal[1] >= 0.0) ? 1 : 0;
|
|
53390
|
-
this.testVertex[2] = (this.normal[2] >= 0.0) ? 1 : 0;
|
|
53391
|
-
}
|
|
53392
|
-
}
|
|
53393
|
-
|
|
53394
|
-
/**
|
|
53395
|
-
* @private
|
|
53396
|
-
*/
|
|
53397
|
-
class Frustum {
|
|
53398
|
-
constructor() {
|
|
53399
|
-
this.planes = [
|
|
53400
|
-
new FrustumPlane(), new FrustumPlane(), new FrustumPlane(),
|
|
53401
|
-
new FrustumPlane(), new FrustumPlane(), new FrustumPlane()
|
|
53402
|
-
];
|
|
53403
|
-
}
|
|
53404
|
-
}
|
|
53405
|
-
|
|
53406
|
-
Frustum.INSIDE = 0;
|
|
53407
|
-
Frustum.INTERSECT = 1;
|
|
53408
|
-
Frustum.OUTSIDE = 2;
|
|
53409
|
-
|
|
53410
|
-
/** @private */
|
|
53411
|
-
function setFrustum(frustum, viewMat, projMat) {
|
|
53412
|
-
|
|
53413
|
-
const m = math.mulMat4(projMat, viewMat, tempMat4a$h);
|
|
53414
|
-
|
|
53415
|
-
const m0 = m[0];
|
|
53416
|
-
const m1 = m[1];
|
|
53417
|
-
const m2 = m[2];
|
|
53418
|
-
const m3 = m[3];
|
|
53419
|
-
const m4 = m[4];
|
|
53420
|
-
const m5 = m[5];
|
|
53421
|
-
const m6 = m[6];
|
|
53422
|
-
const m7 = m[7];
|
|
53423
|
-
const m8 = m[8];
|
|
53424
|
-
const m9 = m[9];
|
|
53425
|
-
const m10 = m[10];
|
|
53426
|
-
const m11 = m[11];
|
|
53427
|
-
const m12 = m[12];
|
|
53428
|
-
const m13 = m[13];
|
|
53429
|
-
const m14 = m[14];
|
|
53430
|
-
const m15 = m[15];
|
|
53431
|
-
|
|
53432
|
-
frustum.planes[0].set(m3 - m0, m7 - m4, m11 - m8, m15 - m12);
|
|
53433
|
-
frustum.planes[1].set(m3 + m0, m7 + m4, m11 + m8, m15 + m12);
|
|
53434
|
-
frustum.planes[2].set(m3 - m1, m7 - m5, m11 - m9, m15 - m13);
|
|
53435
|
-
frustum.planes[3].set(m3 + m1, m7 + m5, m11 + m9, m15 + m13);
|
|
53436
|
-
frustum.planes[4].set(m3 - m2, m7 - m6, m11 - m10, m15 - m14);
|
|
53437
|
-
frustum.planes[5].set(m3 + m2, m7 + m6, m11 + m10, m15 + m14);
|
|
53438
|
-
}
|
|
53439
|
-
|
|
53440
|
-
/** @private */
|
|
53441
|
-
function frustumIntersectsAABB3(frustum, aabb) {
|
|
53442
|
-
|
|
53443
|
-
let ret = Frustum.INSIDE;
|
|
53444
|
-
|
|
53445
|
-
const min = tempVec3a$t;
|
|
53446
|
-
const max = tempVec3b$o;
|
|
53447
|
-
|
|
53448
|
-
min[0] = aabb[0];
|
|
53449
|
-
min[1] = aabb[1];
|
|
53450
|
-
min[2] = aabb[2];
|
|
53451
|
-
max[0] = aabb[3];
|
|
53452
|
-
max[1] = aabb[4];
|
|
53453
|
-
max[2] = aabb[5];
|
|
53454
|
-
|
|
53455
|
-
const bminmax = [min, max];
|
|
53456
|
-
|
|
53457
|
-
for (let i = 0; i < 6; ++i) {
|
|
53458
|
-
const plane = frustum.planes[i];
|
|
53459
|
-
if (((plane.normal[0] * bminmax[plane.testVertex[0]][0]) +
|
|
53460
|
-
(plane.normal[1] * bminmax[plane.testVertex[1]][1]) +
|
|
53461
|
-
(plane.normal[2] * bminmax[plane.testVertex[2]][2]) +
|
|
53462
|
-
(plane.offset)) < 0.0) {
|
|
53463
|
-
return Frustum.OUTSIDE;
|
|
53464
|
-
}
|
|
53465
|
-
|
|
53466
|
-
if (((plane.normal[0] * bminmax[1 - plane.testVertex[0]][0]) +
|
|
53467
|
-
(plane.normal[1] * bminmax[1 - plane.testVertex[1]][1]) +
|
|
53468
|
-
(plane.normal[2] * bminmax[1 - plane.testVertex[2]][2]) +
|
|
53469
|
-
(plane.offset)) < 0.0) {
|
|
53470
|
-
ret = Frustum.INTERSECT;
|
|
53471
|
-
}
|
|
53472
|
-
}
|
|
53473
|
-
|
|
53474
|
-
return ret;
|
|
53475
|
-
}
|
|
53476
|
-
|
|
53477
53481
|
/**
|
|
53478
53482
|
* @desc Saves and restores the state of a {@link Scene}'s {@link Camera}.
|
|
53479
53483
|
*
|
|
@@ -59180,7 +59184,6 @@ class SnapBatchingDepthBufInitRenderer extends VBOSceneModelRenderer {
|
|
|
59180
59184
|
src.push("float tmp = clipPos.w;");
|
|
59181
59185
|
src.push("clipPos.xyzw /= tmp;");
|
|
59182
59186
|
src.push("clipPos.xy = remapClipPos(clipPos.xy);");
|
|
59183
|
-
src.push("clipPos.z += 0.0001;"); // small Z offset
|
|
59184
59187
|
src.push("clipPos.xyzw *= tmp;");
|
|
59185
59188
|
{
|
|
59186
59189
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
@@ -59238,7 +59241,10 @@ class SnapBatchingDepthBufInitRenderer extends VBOSceneModelRenderer {
|
|
|
59238
59241
|
src.push(" }");
|
|
59239
59242
|
}
|
|
59240
59243
|
{
|
|
59241
|
-
src.push("
|
|
59244
|
+
src.push(" float dx = dFdx(vFragDepth);");
|
|
59245
|
+
src.push(" float dy = dFdy(vFragDepth);");
|
|
59246
|
+
src.push(" float diff = sqrt(dx*dx+dy*dy);");
|
|
59247
|
+
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth + diff ) * logDepthBufFC * 0.5;");
|
|
59242
59248
|
}
|
|
59243
59249
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, -layerNumber);");
|
|
59244
59250
|
src.push("}");
|
|
@@ -64266,7 +64272,6 @@ class SnapInstancingDepthBufInitRenderer extends VBOSceneModelRenderer {
|
|
|
64266
64272
|
src.push("float tmp = clipPos.w;");
|
|
64267
64273
|
src.push("clipPos.xyzw /= tmp;");
|
|
64268
64274
|
src.push("clipPos.xy = remapClipPos(clipPos.xy);");
|
|
64269
|
-
src.push("clipPos.z += 0.0001;"); // small Z offset
|
|
64270
64275
|
src.push("clipPos.xyzw *= tmp;");
|
|
64271
64276
|
{
|
|
64272
64277
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
@@ -64324,7 +64329,10 @@ class SnapInstancingDepthBufInitRenderer extends VBOSceneModelRenderer {
|
|
|
64324
64329
|
src.push("}");
|
|
64325
64330
|
}
|
|
64326
64331
|
{
|
|
64327
|
-
src.push("
|
|
64332
|
+
src.push(" float dx = dFdx(vFragDepth);");
|
|
64333
|
+
src.push(" float dy = dFdy(vFragDepth);");
|
|
64334
|
+
src.push(" float diff = sqrt(dx*dx+dy*dy);");
|
|
64335
|
+
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth + diff ) * logDepthBufFC * 0.5;");
|
|
64328
64336
|
}
|
|
64329
64337
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, -layerNumber);");
|
|
64330
64338
|
src.push("}");
|
|
@@ -73272,9 +73280,9 @@ class TrianglesDataTextureColorRenderer {
|
|
|
73272
73280
|
|
|
73273
73281
|
src.push("uniform int renderPass;");
|
|
73274
73282
|
|
|
73275
|
-
if (scene.entityOffsetsEnabled) {
|
|
73276
|
-
|
|
73277
|
-
}
|
|
73283
|
+
// if (scene.entityOffsetsEnabled) {
|
|
73284
|
+
// src.push("in vec3 offset;");
|
|
73285
|
+
// }
|
|
73278
73286
|
|
|
73279
73287
|
src.push("uniform mat4 sceneModelWorldMatrix;");
|
|
73280
73288
|
src.push("uniform mat4 viewMatrix;");
|
|
@@ -74040,7 +74048,6 @@ const defaultColor = new Float32Array([0, 0, 0, 1]);
|
|
|
74040
74048
|
|
|
74041
74049
|
const tempVec3a$i = math.vec3();
|
|
74042
74050
|
const tempVec3b$e = math.vec3();
|
|
74043
|
-
math.vec3();
|
|
74044
74051
|
const tempVec3d$8 = math.vec3();
|
|
74045
74052
|
const tempMat4a$9 = math.mat4();
|
|
74046
74053
|
|
|
@@ -74103,8 +74110,7 @@ class TrianglesDataTextureEdgesRenderer {
|
|
|
74103
74110
|
if (gotOrigin || gotPosition) {
|
|
74104
74111
|
const rtcOrigin = tempVec3a$i;
|
|
74105
74112
|
if (gotOrigin) {
|
|
74106
|
-
const rotatedOrigin = tempVec3b$e;
|
|
74107
|
-
math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
|
|
74113
|
+
const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3b$e);
|
|
74108
74114
|
rtcOrigin[0] = rotatedOrigin[0];
|
|
74109
74115
|
rtcOrigin[1] = rotatedOrigin[1];
|
|
74110
74116
|
rtcOrigin[2] = rotatedOrigin[2];
|
|
@@ -74286,9 +74292,9 @@ class TrianglesDataTextureEdgesRenderer {
|
|
|
74286
74292
|
|
|
74287
74293
|
src.push("uniform int renderPass;");
|
|
74288
74294
|
|
|
74289
|
-
if (scene.entityOffsetsEnabled) {
|
|
74290
|
-
|
|
74291
|
-
}
|
|
74295
|
+
// if (scene.entityOffsetsEnabled) {
|
|
74296
|
+
// src.push("in vec3 offset;");
|
|
74297
|
+
// }
|
|
74292
74298
|
|
|
74293
74299
|
src.push("uniform mat4 sceneModelWorldMatrix;");
|
|
74294
74300
|
src.push("uniform mat4 viewMatrix;");
|
|
@@ -74373,7 +74379,7 @@ class TrianglesDataTextureEdgesRenderer {
|
|
|
74373
74379
|
// get XYZ offset
|
|
74374
74380
|
src.push("vec4 offset = vec4(texelFetch (uTexturePerObjectIdOffsets, objectIndexCoords, 0).rgb, 0.0);");
|
|
74375
74381
|
|
|
74376
|
-
src.push("worldPosition.xyz = worldPosition.xyz + offset.xyz;");
|
|
74382
|
+
src.push("worldPosition.xyz = worldPosition.xyz + offset.xyz + vec3(110.0,50.0, 10.0);");
|
|
74377
74383
|
|
|
74378
74384
|
src.push(" vec4 viewPosition = viewMatrix * worldPosition; ");
|
|
74379
74385
|
|
|
@@ -74523,8 +74529,7 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
74523
74529
|
if (gotOrigin || gotPosition) {
|
|
74524
74530
|
const rtcOrigin = tempVec3a$h;
|
|
74525
74531
|
if (gotOrigin) {
|
|
74526
|
-
const rotatedOrigin = tempVec3b$d;
|
|
74527
|
-
math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
|
|
74532
|
+
const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3b$d);
|
|
74528
74533
|
rtcOrigin[0] = rotatedOrigin[0];
|
|
74529
74534
|
rtcOrigin[1] = rotatedOrigin[1];
|
|
74530
74535
|
rtcOrigin[2] = rotatedOrigin[2];
|
|
@@ -74791,7 +74796,7 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
74791
74796
|
// get XYZ offset
|
|
74792
74797
|
src.push("vec4 offset = vec4(texelFetch (uTexturePerObjectIdOffsets, objectIndexCoords, 0).rgb, 0.0);");
|
|
74793
74798
|
|
|
74794
|
-
|
|
74799
|
+
src.push("worldPosition.xyz = worldPosition.xyz + offset.xyz;");
|
|
74795
74800
|
|
|
74796
74801
|
src.push(" vec4 viewPosition = viewMatrix * worldPosition; ");
|
|
74797
74802
|
|
|
@@ -76559,7 +76564,6 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
76559
76564
|
src.push("float tmp = clipPos.w;");
|
|
76560
76565
|
src.push("clipPos.xyzw /= tmp;");
|
|
76561
76566
|
src.push("clipPos.xy = remapClipPos(clipPos.xy);");
|
|
76562
|
-
src.push("clipPos.z += 0.0001;"); // small Z offset
|
|
76563
76567
|
src.push("clipPos.xyzw *= tmp;");
|
|
76564
76568
|
{
|
|
76565
76569
|
src.push("vFragDepth = 1.0 + clipPos.w;");
|
|
@@ -76617,7 +76621,10 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
76617
76621
|
src.push(" }");
|
|
76618
76622
|
}
|
|
76619
76623
|
{
|
|
76620
|
-
src.push("
|
|
76624
|
+
src.push(" float dx = dFdx(vFragDepth);");
|
|
76625
|
+
src.push(" float dy = dFdy(vFragDepth);");
|
|
76626
|
+
src.push(" float diff = sqrt(dx*dx+dy*dy);");
|
|
76627
|
+
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth + diff ) * logDepthBufFC * 0.5;");
|
|
76621
76628
|
}
|
|
76622
76629
|
src.push("outCoords = ivec4(relativeToOriginPosition.xyz * uCoordinateScaler.xyz, - uLayerNumber);");
|
|
76623
76630
|
src.push("}");
|
|
@@ -82916,7 +82923,7 @@ class SceneModel extends Component {
|
|
|
82916
82923
|
cfg.primitive = "triangles";
|
|
82917
82924
|
}
|
|
82918
82925
|
if (cfg.primitive !== "points" && cfg.primitive !== "lines" && cfg.primitive !== "triangles" && cfg.primitive !== "solid" && cfg.primitive !== "surface") {
|
|
82919
|
-
this.error(`[createGeometry] Unsupported value for 'primitive': '${primitive}' - supported values are 'points', 'lines', 'triangles', 'solid' and 'surface'. Defaulting to 'triangles'.`);
|
|
82926
|
+
this.error(`[createGeometry] Unsupported value for 'primitive': '${cfg.primitive}' - supported values are 'points', 'lines', 'triangles', 'solid' and 'surface'. Defaulting to 'triangles'.`);
|
|
82920
82927
|
return;
|
|
82921
82928
|
}
|
|
82922
82929
|
if (!cfg.positions && !cfg.positionsCompressed && !cfg.buckets) {
|
|
@@ -85866,12 +85873,13 @@ class MousePickHandler {
|
|
|
85866
85873
|
}
|
|
85867
85874
|
|
|
85868
85875
|
const hoverSubs = cameraControl.hasSubs("hover");
|
|
85876
|
+
const hoverEnterSubs = cameraControl.hasSubs("hoverEnter");
|
|
85869
85877
|
const hoverOutSubs = cameraControl.hasSubs("hoverOut");
|
|
85870
85878
|
const hoverOffSubs = cameraControl.hasSubs("hoverOff");
|
|
85871
85879
|
const hoverSurfaceSubs = cameraControl.hasSubs("hoverSurface");
|
|
85872
85880
|
const hoverSnapOrSurfaceSubs = cameraControl.hasSubs("hoverSnapOrSurface");
|
|
85873
85881
|
|
|
85874
|
-
if (hoverSubs || hoverOutSubs || hoverOffSubs || hoverSurfaceSubs || hoverSnapOrSurfaceSubs) {
|
|
85882
|
+
if (hoverSubs || hoverEnterSubs || hoverOutSubs || hoverOffSubs || hoverSurfaceSubs || hoverSnapOrSurfaceSubs) {
|
|
85875
85883
|
|
|
85876
85884
|
pickController.pickCursorPos = states.pointerCanvasPos;
|
|
85877
85885
|
pickController.schedulePickEntity = true;
|
|
@@ -106898,8 +106906,8 @@ function CubeTextureCanvas(viewer, navCubeScene, cfg = {}) {
|
|
|
106898
106906
|
const facesZUp = [
|
|
106899
106907
|
{boundary: [6, 6, 6, 6], color: cfg.frontColor || cfg.color || "#55FF55"},
|
|
106900
106908
|
{boundary: [18, 6, 6, 6], color: cfg.backColor || cfg.color || "#55FF55"},
|
|
106901
|
-
{boundary: [12, 6, 6, 6], color: cfg.
|
|
106902
|
-
{boundary: [0, 6, 6, 6], color: cfg.
|
|
106909
|
+
{boundary: [12, 6, 6, 6], color: cfg.rightColor || cfg.color || "#FF5555"},
|
|
106910
|
+
{boundary: [0, 6, 6, 6], color: cfg.leftColor || cfg.color || "#FF5555"},
|
|
106903
106911
|
{boundary: [6, 0, 6, 6], color: cfg.topColor || cfg.color || "#7777FF"},
|
|
106904
106912
|
{boundary: [6, 12, 6, 6], color: cfg.bottomColor || cfg.color || "#7777FF"}
|
|
106905
106913
|
];
|
|
@@ -106936,8 +106944,8 @@ function CubeTextureCanvas(viewer, navCubeScene, cfg = {}) {
|
|
|
106936
106944
|
[
|
|
106937
106945
|
{boundary: [6, 6, 6, 6], color: cfg.frontColor || cfg.color || "#55FF55"},
|
|
106938
106946
|
{boundary: [18, 6, 6, 6], color: cfg.backColor || cfg.color || "#55FF55"},
|
|
106939
|
-
{boundary: [12, 6, 6, 6], color: cfg.
|
|
106940
|
-
{boundary: [0, 6, 6, 6], color: cfg.
|
|
106947
|
+
{boundary: [12, 6, 6, 6], color: cfg.rightColor || cfg.color || "#FF5555"},
|
|
106948
|
+
{boundary: [0, 6, 6, 6], color: cfg.leftColor || cfg.color || "#FF5555"},
|
|
106941
106949
|
{boundary: [6, 0, 6, 6], color: cfg.topColor || cfg.color || "#7777FF"},
|
|
106942
106950
|
{boundary: [6, 12, 6, 6], color: cfg.bottomColor || cfg.color || "#7777FF"}
|
|
106943
106951
|
];
|