@xeokit/xeokit-sdk 2.4.0-alpha-80 → 2.4.0-alpha-81
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 +731 -306
- package/dist/xeokit-sdk.es.js +731 -306
- package/dist/xeokit-sdk.es5.js +175 -148
- package/dist/xeokit-sdk.min.cjs.js +6 -6
- package/dist/xeokit-sdk.min.es.js +4 -4
- package/dist/xeokit-sdk.min.es5.js +3 -3
- package/package.json +1 -1
- package/types/viewer/scene/webgl/PickResult.d.ts +12 -0
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -8204,7 +8204,7 @@ class Component {
|
|
|
8204
8204
|
}
|
|
8205
8205
|
}
|
|
8206
8206
|
|
|
8207
|
-
const tempVec3a$
|
|
8207
|
+
const tempVec3a$F = math.vec3();
|
|
8208
8208
|
|
|
8209
8209
|
/**
|
|
8210
8210
|
* Given a view matrix and a relative-to-center (RTC) coordinate origin, returns a view matrix
|
|
@@ -8284,7 +8284,7 @@ function worldToRTCPos(worldPos, rtcCenter, rtcPos) {
|
|
|
8284
8284
|
*/
|
|
8285
8285
|
function worldToRTCPositions(worldPositions, rtcPositions, rtcCenter, cellSize = 1000) {
|
|
8286
8286
|
|
|
8287
|
-
const center = math.getPositionsCenter(worldPositions, tempVec3a$
|
|
8287
|
+
const center = math.getPositionsCenter(worldPositions, tempVec3a$F);
|
|
8288
8288
|
|
|
8289
8289
|
const rtcCenterX = Math.round(center[0] / cellSize) * cellSize;
|
|
8290
8290
|
const rtcCenterY = Math.round(center[1] / cellSize) * cellSize;
|
|
@@ -8335,7 +8335,7 @@ function rtcToWorldPos(rtcCenter, rtcPos, worldPos) {
|
|
|
8335
8335
|
*/
|
|
8336
8336
|
function getPlaneRTCPos(dist, dir, rtcCenter, rtcPlanePos) {
|
|
8337
8337
|
const rtcCenterToPlaneDist = math.dotVec3(dir, rtcCenter) + dist;
|
|
8338
|
-
const dirNormalized = math.normalizeVec3(dir, tempVec3a$
|
|
8338
|
+
const dirNormalized = math.normalizeVec3(dir, tempVec3a$F);
|
|
8339
8339
|
math.mulVec3Scalar(dirNormalized, -rtcCenterToPlaneDist, rtcPlanePos);
|
|
8340
8340
|
return rtcPlanePos;
|
|
8341
8341
|
}
|
|
@@ -10635,15 +10635,18 @@ class AngleMeasurementsControl extends Component {
|
|
|
10635
10635
|
break;
|
|
10636
10636
|
case FINDING_CORNER:
|
|
10637
10637
|
this._currentAngleMeasurement.corner.worldPos = pickResult.worldPos;
|
|
10638
|
+
this._currentAngleMeasurement.originWireVisible = true;
|
|
10638
10639
|
this._currentAngleMeasurement.targetWireVisible = false;
|
|
10639
10640
|
this._currentAngleMeasurement.targetVisible = true;
|
|
10640
10641
|
this._currentAngleMeasurement.angleVisible = true;
|
|
10642
|
+
this._currentAngleMeasurement.cornerVisible = true;
|
|
10641
10643
|
this._state = FINDING_TARGET;
|
|
10642
10644
|
break;
|
|
10643
10645
|
case FINDING_TARGET:
|
|
10644
10646
|
this._currentAngleMeasurement.target.worldPos = pickResult.worldPos;
|
|
10645
10647
|
// this._currentAngleMeasurement.approximate = false;
|
|
10646
10648
|
this._currentAngleMeasurement.targetVisible = true;
|
|
10649
|
+
this._currentAngleMeasurement.targetWireVisible = true;
|
|
10647
10650
|
this._currentAngleMeasurement.angleVisible = true;
|
|
10648
10651
|
this._currentAngleMeasurement.clickable = true;
|
|
10649
10652
|
this.fire("measurementEnd", this._currentAngleMeasurement);
|
|
@@ -11509,9 +11512,9 @@ class Annotation extends Marker {
|
|
|
11509
11512
|
}
|
|
11510
11513
|
}
|
|
11511
11514
|
|
|
11512
|
-
const tempVec3a$
|
|
11513
|
-
const tempVec3b$
|
|
11514
|
-
const tempVec3c$
|
|
11515
|
+
const tempVec3a$E = math.vec3();
|
|
11516
|
+
const tempVec3b$r = math.vec3();
|
|
11517
|
+
const tempVec3c$n = math.vec3();
|
|
11515
11518
|
|
|
11516
11519
|
/**
|
|
11517
11520
|
* {@link Viewer} plugin that creates {@link Annotation}s.
|
|
@@ -11995,9 +11998,9 @@ class AnnotationsPlugin extends Plugin {
|
|
|
11995
11998
|
if (!pickResult.worldPos || !pickResult.worldNormal) {
|
|
11996
11999
|
this.error("Param 'pickResult' does not have both worldPos and worldNormal");
|
|
11997
12000
|
} else {
|
|
11998
|
-
const normalizedWorldNormal = math.normalizeVec3(pickResult.worldNormal, tempVec3a$
|
|
11999
|
-
const offsetVec = math.mulVec3Scalar(normalizedWorldNormal, this._surfaceOffset, tempVec3b$
|
|
12000
|
-
const offsetWorldPos = math.addVec3(pickResult.worldPos, offsetVec, tempVec3c$
|
|
12001
|
+
const normalizedWorldNormal = math.normalizeVec3(pickResult.worldNormal, tempVec3a$E);
|
|
12002
|
+
const offsetVec = math.mulVec3Scalar(normalizedWorldNormal, this._surfaceOffset, tempVec3b$r);
|
|
12003
|
+
const offsetWorldPos = math.addVec3(pickResult.worldPos, offsetVec, tempVec3c$n);
|
|
12001
12004
|
worldPos = offsetWorldPos;
|
|
12002
12005
|
entity = pickResult.entity;
|
|
12003
12006
|
}
|
|
@@ -13291,6 +13294,18 @@ class PickResult {
|
|
|
13291
13294
|
*/
|
|
13292
13295
|
this.touchInput = false;
|
|
13293
13296
|
|
|
13297
|
+
/**
|
|
13298
|
+
* True when snapped to the nearest vertex position.
|
|
13299
|
+
* @type {boolean}
|
|
13300
|
+
*/
|
|
13301
|
+
this.snappedToVertex = false;
|
|
13302
|
+
|
|
13303
|
+
/**
|
|
13304
|
+
* True when snapped to the nearest edge.
|
|
13305
|
+
* @type {boolean}
|
|
13306
|
+
*/
|
|
13307
|
+
this.snappedToEdge = false;
|
|
13308
|
+
|
|
13294
13309
|
this._canvasPos = new Int16Array([0, 0]);
|
|
13295
13310
|
this._origin = new Float64Array([0, 0, 0]);
|
|
13296
13311
|
this._direction = new Float64Array([0, 0, 0]);
|
|
@@ -13562,6 +13577,8 @@ class PickResult {
|
|
|
13562
13577
|
this._gotWorldNormal = false;
|
|
13563
13578
|
this._gotUV = false;
|
|
13564
13579
|
this.touchInput = false;
|
|
13580
|
+
this.snappedToVertex = false;
|
|
13581
|
+
this.snappedToEdge = false;
|
|
13565
13582
|
}
|
|
13566
13583
|
}
|
|
13567
13584
|
|
|
@@ -14160,7 +14177,7 @@ const MARKER_COLOR = math.vec3([1.0, 0.0, 0.0]);
|
|
|
14160
14177
|
const POINT_SIZE = 20;
|
|
14161
14178
|
const MARKER_SPRITE_CLIPZ_OFFSET = -0.001; // Amount that we offset sprite clip Z coords to raise them from surfaces
|
|
14162
14179
|
|
|
14163
|
-
const tempVec3a$
|
|
14180
|
+
const tempVec3a$D = math.vec3();
|
|
14164
14181
|
|
|
14165
14182
|
/**
|
|
14166
14183
|
* Manages occlusion testing. Private member of a Renderer.
|
|
@@ -14497,7 +14514,7 @@ class OcclusionTester {
|
|
|
14497
14514
|
gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
|
|
14498
14515
|
if (active) {
|
|
14499
14516
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
14500
|
-
gl.uniform3fv(sectionPlaneUniforms.pos, getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$
|
|
14517
|
+
gl.uniform3fv(sectionPlaneUniforms.pos, getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$D));
|
|
14501
14518
|
gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
|
|
14502
14519
|
}
|
|
14503
14520
|
}
|
|
@@ -19881,9 +19898,9 @@ class CustomProjection extends Component {
|
|
|
19881
19898
|
}
|
|
19882
19899
|
|
|
19883
19900
|
const tempVec3$7 = math.vec3();
|
|
19884
|
-
const tempVec3b$
|
|
19885
|
-
const tempVec3c$
|
|
19886
|
-
const tempVec3d$
|
|
19901
|
+
const tempVec3b$q = math.vec3();
|
|
19902
|
+
const tempVec3c$m = math.vec3();
|
|
19903
|
+
const tempVec3d$g = math.vec3();
|
|
19887
19904
|
const tempVec3e$8 = math.vec3();
|
|
19888
19905
|
const tempVec3f$2 = math.vec3();
|
|
19889
19906
|
const tempVec4a$d = math.vec4();
|
|
@@ -20194,9 +20211,9 @@ class Camera extends Component {
|
|
|
20194
20211
|
orbitYaw(angleInc) {
|
|
20195
20212
|
let lookEyeVec = math.subVec3(this._eye, this._look, tempVec3$7);
|
|
20196
20213
|
math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
|
|
20197
|
-
lookEyeVec = math.transformPoint3(tempMat, lookEyeVec, tempVec3b$
|
|
20198
|
-
this.eye = math.addVec3(this._look, lookEyeVec, tempVec3c$
|
|
20199
|
-
this.up = math.transformPoint3(tempMat, this._up, tempVec3d$
|
|
20214
|
+
lookEyeVec = math.transformPoint3(tempMat, lookEyeVec, tempVec3b$q);
|
|
20215
|
+
this.eye = math.addVec3(this._look, lookEyeVec, tempVec3c$m); // Set eye position as 'look' plus 'eye' vector
|
|
20216
|
+
this.up = math.transformPoint3(tempMat, this._up, tempVec3d$g); // Rotate 'up' vector
|
|
20200
20217
|
}
|
|
20201
20218
|
|
|
20202
20219
|
/**
|
|
@@ -20212,9 +20229,9 @@ class Camera extends Component {
|
|
|
20212
20229
|
}
|
|
20213
20230
|
}
|
|
20214
20231
|
let eye2 = math.subVec3(this._eye, this._look, tempVec3$7);
|
|
20215
|
-
const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b$
|
|
20232
|
+
const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b$q), math.normalizeVec3(this._up, tempVec3c$m));
|
|
20216
20233
|
math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
|
|
20217
|
-
eye2 = math.transformPoint3(tempMat, eye2, tempVec3d$
|
|
20234
|
+
eye2 = math.transformPoint3(tempMat, eye2, tempVec3d$g);
|
|
20218
20235
|
this.up = math.transformPoint3(tempMat, this._up, tempVec3e$8);
|
|
20219
20236
|
this.eye = math.addVec3(eye2, this._look, tempVec3f$2);
|
|
20220
20237
|
}
|
|
@@ -20227,10 +20244,10 @@ class Camera extends Component {
|
|
|
20227
20244
|
yaw(angleInc) {
|
|
20228
20245
|
let look2 = math.subVec3(this._look, this._eye, tempVec3$7);
|
|
20229
20246
|
math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
|
|
20230
|
-
look2 = math.transformPoint3(tempMat, look2, tempVec3b$
|
|
20231
|
-
this.look = math.addVec3(look2, this._eye, tempVec3c$
|
|
20247
|
+
look2 = math.transformPoint3(tempMat, look2, tempVec3b$q);
|
|
20248
|
+
this.look = math.addVec3(look2, this._eye, tempVec3c$m);
|
|
20232
20249
|
if (this._gimbalLock) {
|
|
20233
|
-
this.up = math.transformPoint3(tempMat, this._up, tempVec3d$
|
|
20250
|
+
this.up = math.transformPoint3(tempMat, this._up, tempVec3d$g);
|
|
20234
20251
|
}
|
|
20235
20252
|
}
|
|
20236
20253
|
|
|
@@ -20247,10 +20264,10 @@ class Camera extends Component {
|
|
|
20247
20264
|
}
|
|
20248
20265
|
}
|
|
20249
20266
|
let look2 = math.subVec3(this._look, this._eye, tempVec3$7);
|
|
20250
|
-
const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b$
|
|
20267
|
+
const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b$q), math.normalizeVec3(this._up, tempVec3c$m));
|
|
20251
20268
|
math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
|
|
20252
20269
|
this.up = math.transformPoint3(tempMat, this._up, tempVec3f$2);
|
|
20253
|
-
look2 = math.transformPoint3(tempMat, look2, tempVec3d$
|
|
20270
|
+
look2 = math.transformPoint3(tempMat, look2, tempVec3d$g);
|
|
20254
20271
|
this.look = math.addVec3(look2, this._eye, tempVec3e$8);
|
|
20255
20272
|
}
|
|
20256
20273
|
|
|
@@ -20264,20 +20281,20 @@ class Camera extends Component {
|
|
|
20264
20281
|
const vec = [0, 0, 0];
|
|
20265
20282
|
let v;
|
|
20266
20283
|
if (pan[0] !== 0) {
|
|
20267
|
-
const left = math.cross3Vec3(math.normalizeVec3(eye2, []), math.normalizeVec3(this._up, tempVec3b$
|
|
20284
|
+
const left = math.cross3Vec3(math.normalizeVec3(eye2, []), math.normalizeVec3(this._up, tempVec3b$q));
|
|
20268
20285
|
v = math.mulVec3Scalar(left, pan[0]);
|
|
20269
20286
|
vec[0] += v[0];
|
|
20270
20287
|
vec[1] += v[1];
|
|
20271
20288
|
vec[2] += v[2];
|
|
20272
20289
|
}
|
|
20273
20290
|
if (pan[1] !== 0) {
|
|
20274
|
-
v = math.mulVec3Scalar(math.normalizeVec3(this._up, tempVec3c$
|
|
20291
|
+
v = math.mulVec3Scalar(math.normalizeVec3(this._up, tempVec3c$m), pan[1]);
|
|
20275
20292
|
vec[0] += v[0];
|
|
20276
20293
|
vec[1] += v[1];
|
|
20277
20294
|
vec[2] += v[2];
|
|
20278
20295
|
}
|
|
20279
20296
|
if (pan[2] !== 0) {
|
|
20280
|
-
v = math.mulVec3Scalar(math.normalizeVec3(eye2, tempVec3d$
|
|
20297
|
+
v = math.mulVec3Scalar(math.normalizeVec3(eye2, tempVec3d$g), pan[2]);
|
|
20281
20298
|
vec[0] += v[0];
|
|
20282
20299
|
vec[1] += v[1];
|
|
20283
20300
|
vec[2] += v[2];
|
|
@@ -20293,13 +20310,13 @@ class Camera extends Component {
|
|
|
20293
20310
|
*/
|
|
20294
20311
|
zoom(delta) {
|
|
20295
20312
|
const vec = math.subVec3(this._eye, this._look, tempVec3$7);
|
|
20296
|
-
const lenLook = Math.abs(math.lenVec3(vec, tempVec3b$
|
|
20313
|
+
const lenLook = Math.abs(math.lenVec3(vec, tempVec3b$q));
|
|
20297
20314
|
const newLenLook = Math.abs(lenLook + delta);
|
|
20298
20315
|
if (newLenLook < 0.5) {
|
|
20299
20316
|
return;
|
|
20300
20317
|
}
|
|
20301
|
-
const dir = math.normalizeVec3(vec, tempVec3c$
|
|
20302
|
-
this.eye = math.addVec3(this._look, math.mulVec3Scalar(dir, newLenLook), tempVec3d$
|
|
20318
|
+
const dir = math.normalizeVec3(vec, tempVec3c$m);
|
|
20319
|
+
this.eye = math.addVec3(this._look, math.mulVec3Scalar(dir, newLenLook), tempVec3d$g);
|
|
20303
20320
|
}
|
|
20304
20321
|
|
|
20305
20322
|
/**
|
|
@@ -25962,9 +25979,9 @@ class LinesMaterial extends Material {
|
|
|
25962
25979
|
}
|
|
25963
25980
|
}
|
|
25964
25981
|
|
|
25965
|
-
const tempVec3a$
|
|
25966
|
-
const tempVec3b$
|
|
25967
|
-
const tempMat4a$
|
|
25982
|
+
const tempVec3a$C = math.vec3();
|
|
25983
|
+
const tempVec3b$p = math.vec3();
|
|
25984
|
+
const tempMat4a$g = math.mat4();
|
|
25968
25985
|
|
|
25969
25986
|
/**
|
|
25970
25987
|
* @private
|
|
@@ -26008,7 +26025,7 @@ Frustum.OUTSIDE = 2;
|
|
|
26008
26025
|
/** @private */
|
|
26009
26026
|
function setFrustum(frustum, viewMat, projMat) {
|
|
26010
26027
|
|
|
26011
|
-
const m = math.mulMat4(projMat, viewMat, tempMat4a$
|
|
26028
|
+
const m = math.mulMat4(projMat, viewMat, tempMat4a$g);
|
|
26012
26029
|
|
|
26013
26030
|
const m0 = m[0];
|
|
26014
26031
|
const m1 = m[1];
|
|
@@ -26040,8 +26057,8 @@ function frustumIntersectsAABB3(frustum, aabb) {
|
|
|
26040
26057
|
|
|
26041
26058
|
let ret = Frustum.INSIDE;
|
|
26042
26059
|
|
|
26043
|
-
const min = tempVec3a$
|
|
26044
|
-
const max = tempVec3b$
|
|
26060
|
+
const min = tempVec3a$C;
|
|
26061
|
+
const max = tempVec3b$p;
|
|
26045
26062
|
|
|
26046
26063
|
min[0] = aabb[0];
|
|
26047
26064
|
min[1] = aabb[1];
|
|
@@ -32811,7 +32828,7 @@ function buildFragmentDraw(mesh) {
|
|
|
32811
32828
|
* @author xeolabs / https://github.com/xeolabs
|
|
32812
32829
|
*/
|
|
32813
32830
|
|
|
32814
|
-
const tempVec3a$
|
|
32831
|
+
const tempVec3a$B = math.vec3();
|
|
32815
32832
|
|
|
32816
32833
|
const ids$2 = new Map$1({});
|
|
32817
32834
|
|
|
@@ -32910,7 +32927,7 @@ DrawRenderer.prototype.drawMesh = function (frameCtx, mesh) {
|
|
|
32910
32927
|
gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
|
|
32911
32928
|
if (active) {
|
|
32912
32929
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
32913
|
-
gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$
|
|
32930
|
+
gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$B) : sectionPlane.pos);
|
|
32914
32931
|
gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
|
|
32915
32932
|
}
|
|
32916
32933
|
}
|
|
@@ -34048,7 +34065,7 @@ function buildFragment$5(mesh) {
|
|
|
34048
34065
|
|
|
34049
34066
|
const ids$1 = new Map$1({});
|
|
34050
34067
|
|
|
34051
|
-
const tempVec3a$
|
|
34068
|
+
const tempVec3a$A = math.vec3();
|
|
34052
34069
|
|
|
34053
34070
|
/**
|
|
34054
34071
|
* @private
|
|
@@ -34132,7 +34149,7 @@ EmphasisFillRenderer.prototype.drawMesh = function (frameCtx, mesh, mode) {
|
|
|
34132
34149
|
gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
|
|
34133
34150
|
if (active) {
|
|
34134
34151
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
34135
|
-
gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$
|
|
34152
|
+
gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$A) : sectionPlane.pos);
|
|
34136
34153
|
gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
|
|
34137
34154
|
}
|
|
34138
34155
|
}
|
|
@@ -34468,7 +34485,7 @@ function buildFragment$4(mesh) {
|
|
|
34468
34485
|
|
|
34469
34486
|
const ids = new Map$1({});
|
|
34470
34487
|
|
|
34471
|
-
const tempVec3a$
|
|
34488
|
+
const tempVec3a$z = math.vec3();
|
|
34472
34489
|
|
|
34473
34490
|
/**
|
|
34474
34491
|
* @private
|
|
@@ -34551,7 +34568,7 @@ EmphasisEdgesRenderer.prototype.drawMesh = function (frameCtx, mesh, mode) {
|
|
|
34551
34568
|
gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
|
|
34552
34569
|
if (active) {
|
|
34553
34570
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
34554
|
-
gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$
|
|
34571
|
+
gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$z) : sectionPlane.pos);
|
|
34555
34572
|
gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
|
|
34556
34573
|
}
|
|
34557
34574
|
}
|
|
@@ -34846,7 +34863,7 @@ function buildFragment$3(mesh) {
|
|
|
34846
34863
|
* @author xeolabs / https://github.com/xeolabs
|
|
34847
34864
|
*/
|
|
34848
34865
|
|
|
34849
|
-
const tempVec3a$
|
|
34866
|
+
const tempVec3a$y = math.vec3();
|
|
34850
34867
|
|
|
34851
34868
|
// No ID, because there is exactly one PickMeshRenderer per scene
|
|
34852
34869
|
|
|
@@ -34930,7 +34947,7 @@ PickMeshRenderer.prototype.drawMesh = function (frameCtx, mesh) {
|
|
|
34930
34947
|
gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
|
|
34931
34948
|
if (active) {
|
|
34932
34949
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
34933
|
-
gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$
|
|
34950
|
+
gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$y) : sectionPlane.pos);
|
|
34934
34951
|
gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
|
|
34935
34952
|
}
|
|
34936
34953
|
}
|
|
@@ -35163,7 +35180,7 @@ function buildFragment$2(mesh) {
|
|
|
35163
35180
|
* @author xeolabs / https://github.com/xeolabs
|
|
35164
35181
|
*/
|
|
35165
35182
|
|
|
35166
|
-
const tempVec3a$
|
|
35183
|
+
const tempVec3a$x = math.vec3();
|
|
35167
35184
|
|
|
35168
35185
|
/**
|
|
35169
35186
|
* @private
|
|
@@ -35255,7 +35272,7 @@ PickTriangleRenderer.prototype.drawMesh = function (frameCtx, mesh) {
|
|
|
35255
35272
|
gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
|
|
35256
35273
|
if (active) {
|
|
35257
35274
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
35258
|
-
gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$
|
|
35275
|
+
gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$x) : sectionPlane.pos);
|
|
35259
35276
|
gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
|
|
35260
35277
|
}
|
|
35261
35278
|
}
|
|
@@ -35492,7 +35509,7 @@ function buildFragment$1(mesh) {
|
|
|
35492
35509
|
* @author xeolabs / https://github.com/xeolabs
|
|
35493
35510
|
*/
|
|
35494
35511
|
|
|
35495
|
-
const tempVec3a$
|
|
35512
|
+
const tempVec3a$w = math.vec3();
|
|
35496
35513
|
|
|
35497
35514
|
// No ID, because there is exactly one PickMeshRenderer per scene
|
|
35498
35515
|
|
|
@@ -35600,7 +35617,7 @@ OcclusionRenderer.prototype.drawMesh = function (frameCtx, mesh) {
|
|
|
35600
35617
|
gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
|
|
35601
35618
|
if (active) {
|
|
35602
35619
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
35603
|
-
gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$
|
|
35620
|
+
gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$w) : sectionPlane.pos);
|
|
35604
35621
|
gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
|
|
35605
35622
|
}
|
|
35606
35623
|
}
|
|
@@ -48421,9 +48438,9 @@ class LineSet extends Component {
|
|
|
48421
48438
|
}
|
|
48422
48439
|
|
|
48423
48440
|
const tempVec3$5 = math.vec3();
|
|
48424
|
-
const tempVec3a$
|
|
48425
|
-
const tempVec3b$
|
|
48426
|
-
const tempVec3c$
|
|
48441
|
+
const tempVec3a$v = math.vec3();
|
|
48442
|
+
const tempVec3b$o = math.vec3();
|
|
48443
|
+
const tempVec3c$l = math.vec3();
|
|
48427
48444
|
|
|
48428
48445
|
/**
|
|
48429
48446
|
* {@link Viewer} plugin that saves and loads BCF viewpoints as JSON objects.
|
|
@@ -49102,9 +49119,9 @@ class BCFViewpointsPlugin extends Plugin {
|
|
|
49102
49119
|
bcfViewpoint.bitmaps.forEach(function (e) {
|
|
49103
49120
|
const bitmap_type = e.bitmap_type || "jpg"; // "jpg" | "png"
|
|
49104
49121
|
const bitmap_data = e.bitmap_data; // base64
|
|
49105
|
-
let location = xyzObjectToArray(e.location, tempVec3a$
|
|
49106
|
-
let normal = xyzObjectToArray(e.normal, tempVec3b$
|
|
49107
|
-
let up = xyzObjectToArray(e.up, tempVec3c$
|
|
49122
|
+
let location = xyzObjectToArray(e.location, tempVec3a$v);
|
|
49123
|
+
let normal = xyzObjectToArray(e.normal, tempVec3b$o);
|
|
49124
|
+
let up = xyzObjectToArray(e.up, tempVec3c$l);
|
|
49108
49125
|
let height = e.height || 1;
|
|
49109
49126
|
if (!bitmap_type) {
|
|
49110
49127
|
return;
|
|
@@ -51006,7 +51023,7 @@ class SplineCurve extends Curve {
|
|
|
51006
51023
|
}
|
|
51007
51024
|
}
|
|
51008
51025
|
|
|
51009
|
-
const tempVec3a$
|
|
51026
|
+
const tempVec3a$u = math.vec3();
|
|
51010
51027
|
|
|
51011
51028
|
/**
|
|
51012
51029
|
* @desc Defines a sequence of frames along which a {@link CameraPathAnimation} can animate a {@link Camera}.
|
|
@@ -51138,9 +51155,9 @@ class CameraPath extends Component {
|
|
|
51138
51155
|
t = t / (this._frames[this._frames.length - 1].t - this._frames[0].t);
|
|
51139
51156
|
t = t < 0.0 ? 0.0 : (t > 1.0 ? 1.0 : t);
|
|
51140
51157
|
|
|
51141
|
-
camera.eye = this._eyeCurve.getPoint(t, tempVec3a$
|
|
51142
|
-
camera.look = this._lookCurve.getPoint(t, tempVec3a$
|
|
51143
|
-
camera.up = this._upCurve.getPoint(t, tempVec3a$
|
|
51158
|
+
camera.eye = this._eyeCurve.getPoint(t, tempVec3a$u);
|
|
51159
|
+
camera.look = this._lookCurve.getPoint(t, tempVec3a$u);
|
|
51160
|
+
camera.up = this._upCurve.getPoint(t, tempVec3a$u);
|
|
51144
51161
|
}
|
|
51145
51162
|
|
|
51146
51163
|
/**
|
|
@@ -52179,7 +52196,7 @@ CameraPathAnimation.PLAYING = 2;
|
|
|
52179
52196
|
CameraPathAnimation.PLAYING_TO = 3;
|
|
52180
52197
|
|
|
52181
52198
|
const tempVec3$3 = math.vec3();
|
|
52182
|
-
const tempVec3b$
|
|
52199
|
+
const tempVec3b$n = math.vec3();
|
|
52183
52200
|
math.vec3();
|
|
52184
52201
|
const zeroVec$2 = math.vec3([0, -1, 0]);
|
|
52185
52202
|
const tempQuat = math.vec4([0, 0, 0, 1]);
|
|
@@ -52607,7 +52624,7 @@ class ImagePlane extends Component {
|
|
|
52607
52624
|
const dist = -math.dotVec3(negDir, tempVec3$3);
|
|
52608
52625
|
|
|
52609
52626
|
math.normalizeVec3(negDir);
|
|
52610
|
-
math.mulVec3Scalar(negDir, dist, tempVec3b$
|
|
52627
|
+
math.mulVec3Scalar(negDir, dist, tempVec3b$n);
|
|
52611
52628
|
math.vec3PairToQuaternion(zeroVec$2, dir, tempQuat);
|
|
52612
52629
|
|
|
52613
52630
|
this._node.quaternion = tempQuat;
|
|
@@ -55325,10 +55342,10 @@ const defaultColor$2 = new Float32Array([1, 1, 1, 1]);
|
|
|
55325
55342
|
const edgesDefaultColor = new Float32Array([0, 0, 0, 1]);
|
|
55326
55343
|
|
|
55327
55344
|
const tempVec4 = math.vec4();
|
|
55328
|
-
const tempVec3a$
|
|
55345
|
+
const tempVec3a$t = math.vec3();
|
|
55329
55346
|
math.vec3();
|
|
55330
|
-
const tempVec3c$
|
|
55331
|
-
const tempMat4a$
|
|
55347
|
+
const tempVec3c$k = math.vec3();
|
|
55348
|
+
const tempMat4a$f = math.mat4();
|
|
55332
55349
|
|
|
55333
55350
|
class VBOSceneModelRenderer {
|
|
55334
55351
|
constructor(scene, withSAO = false, {instancing = false, edges = false} = {}) {
|
|
@@ -55422,7 +55439,7 @@ class VBOSceneModelRenderer {
|
|
|
55422
55439
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
55423
55440
|
const origin = layer._state.origin;
|
|
55424
55441
|
if (origin) {
|
|
55425
|
-
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$
|
|
55442
|
+
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$t);
|
|
55426
55443
|
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
|
|
55427
55444
|
} else {
|
|
55428
55445
|
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
|
|
@@ -55773,9 +55790,9 @@ class VBOSceneModelRenderer {
|
|
|
55773
55790
|
const gotOrigin = (origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0);
|
|
55774
55791
|
const gotPosition = (position[0] !== 0 || position[1] !== 0 || position[2] !== 0);
|
|
55775
55792
|
if (gotOrigin || gotPosition) {
|
|
55776
|
-
const rtcOrigin = tempVec3a$
|
|
55793
|
+
const rtcOrigin = tempVec3a$t;
|
|
55777
55794
|
if (gotOrigin) {
|
|
55778
|
-
const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$
|
|
55795
|
+
const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$k);
|
|
55779
55796
|
rtcOrigin[0] = rotatedOrigin[0];
|
|
55780
55797
|
rtcOrigin[1] = rotatedOrigin[1];
|
|
55781
55798
|
rtcOrigin[2] = rotatedOrigin[2];
|
|
@@ -55787,7 +55804,7 @@ class VBOSceneModelRenderer {
|
|
|
55787
55804
|
rtcOrigin[0] += position[0];
|
|
55788
55805
|
rtcOrigin[1] += position[1];
|
|
55789
55806
|
rtcOrigin[2] += position[2];
|
|
55790
|
-
this._matricesUniformBlockBufferData.set(createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$
|
|
55807
|
+
this._matricesUniformBlockBufferData.set(createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$f), offset += mat4Size);
|
|
55791
55808
|
} else {
|
|
55792
55809
|
this._matricesUniformBlockBufferData.set(viewMatrix, offset += mat4Size);
|
|
55793
55810
|
}
|
|
@@ -59250,12 +59267,12 @@ function octDecodeVec2(oct) { // Decode an oct-encoded normal
|
|
|
59250
59267
|
];
|
|
59251
59268
|
}
|
|
59252
59269
|
|
|
59253
|
-
const tempVec3a$
|
|
59254
|
-
const tempVec3b$
|
|
59255
|
-
const tempVec3c$
|
|
59256
|
-
const tempVec3d$
|
|
59270
|
+
const tempVec3a$s = math.vec3();
|
|
59271
|
+
const tempVec3b$m = math.vec3();
|
|
59272
|
+
const tempVec3c$j = math.vec3();
|
|
59273
|
+
const tempVec3d$f = math.vec3();
|
|
59257
59274
|
const tempVec3e$7 = math.vec3();
|
|
59258
|
-
const tempMat4a$
|
|
59275
|
+
const tempMat4a$e = math.mat4();
|
|
59259
59276
|
|
|
59260
59277
|
/**
|
|
59261
59278
|
* @private
|
|
@@ -59300,7 +59317,7 @@ class SnapBatchingDepthBufInitRenderer {
|
|
|
59300
59317
|
const aabb = batchingLayer.aabb;
|
|
59301
59318
|
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
|
|
59302
59319
|
|
|
59303
|
-
const coordinateScaler = tempVec3a$
|
|
59320
|
+
const coordinateScaler = tempVec3a$s;
|
|
59304
59321
|
coordinateScaler[0] = math.safeInv(aabb[3] - aabb[0]) * math.MAX_INT;
|
|
59305
59322
|
coordinateScaler[1] = math.safeInv(aabb[4] - aabb[1]) * math.MAX_INT;
|
|
59306
59323
|
coordinateScaler[2] = math.safeInv(aabb[5] - aabb[2]) * math.MAX_INT;
|
|
@@ -59313,9 +59330,9 @@ class SnapBatchingDepthBufInitRenderer {
|
|
|
59313
59330
|
let rtcCameraEye;
|
|
59314
59331
|
|
|
59315
59332
|
if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
|
|
59316
|
-
const rtcOrigin = tempVec3b$
|
|
59333
|
+
const rtcOrigin = tempVec3b$m;
|
|
59317
59334
|
if (origin) {
|
|
59318
|
-
const rotatedOrigin = tempVec3c$
|
|
59335
|
+
const rotatedOrigin = tempVec3c$j;
|
|
59319
59336
|
math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
|
|
59320
59337
|
rtcOrigin[0] = rotatedOrigin[0];
|
|
59321
59338
|
rtcOrigin[1] = rotatedOrigin[1];
|
|
@@ -59328,8 +59345,8 @@ class SnapBatchingDepthBufInitRenderer {
|
|
|
59328
59345
|
rtcOrigin[0] += position[0];
|
|
59329
59346
|
rtcOrigin[1] += position[1];
|
|
59330
59347
|
rtcOrigin[2] += position[2];
|
|
59331
|
-
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$
|
|
59332
|
-
rtcCameraEye = tempVec3d$
|
|
59348
|
+
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$e);
|
|
59349
|
+
rtcCameraEye = tempVec3d$f;
|
|
59333
59350
|
rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
|
|
59334
59351
|
rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
|
|
59335
59352
|
rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
|
|
@@ -59596,12 +59613,12 @@ class SnapBatchingDepthBufInitRenderer {
|
|
|
59596
59613
|
}
|
|
59597
59614
|
}
|
|
59598
59615
|
|
|
59599
|
-
const tempVec3a$
|
|
59600
|
-
const tempVec3b$
|
|
59601
|
-
const tempVec3c$
|
|
59602
|
-
const tempVec3d$
|
|
59616
|
+
const tempVec3a$r = math.vec3();
|
|
59617
|
+
const tempVec3b$l = math.vec3();
|
|
59618
|
+
const tempVec3c$i = math.vec3();
|
|
59619
|
+
const tempVec3d$e = math.vec3();
|
|
59603
59620
|
const tempVec3e$6 = math.vec3();
|
|
59604
|
-
const tempMat4a$
|
|
59621
|
+
const tempMat4a$d = math.mat4();
|
|
59605
59622
|
|
|
59606
59623
|
/**
|
|
59607
59624
|
* @private
|
|
@@ -59646,7 +59663,7 @@ class SnapBatchingDepthRenderer {
|
|
|
59646
59663
|
const aabb = batchingLayer.aabb;
|
|
59647
59664
|
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
|
|
59648
59665
|
|
|
59649
|
-
const coordinateScaler = tempVec3a$
|
|
59666
|
+
const coordinateScaler = tempVec3a$r;
|
|
59650
59667
|
coordinateScaler[0] = math.safeInv(aabb[3] - aabb[0]) * math.MAX_INT;
|
|
59651
59668
|
coordinateScaler[1] = math.safeInv(aabb[4] - aabb[1]) * math.MAX_INT;
|
|
59652
59669
|
coordinateScaler[2] = math.safeInv(aabb[5] - aabb[2]) * math.MAX_INT;
|
|
@@ -59659,9 +59676,9 @@ class SnapBatchingDepthRenderer {
|
|
|
59659
59676
|
let rtcCameraEye;
|
|
59660
59677
|
|
|
59661
59678
|
if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
|
|
59662
|
-
const rtcOrigin = tempVec3b$
|
|
59679
|
+
const rtcOrigin = tempVec3b$l;
|
|
59663
59680
|
if (origin) {
|
|
59664
|
-
const rotatedOrigin = tempVec3c$
|
|
59681
|
+
const rotatedOrigin = tempVec3c$i;
|
|
59665
59682
|
math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
|
|
59666
59683
|
rtcOrigin[0] = rotatedOrigin[0];
|
|
59667
59684
|
rtcOrigin[1] = rotatedOrigin[1];
|
|
@@ -59674,8 +59691,8 @@ class SnapBatchingDepthRenderer {
|
|
|
59674
59691
|
rtcOrigin[0] += position[0];
|
|
59675
59692
|
rtcOrigin[1] += position[1];
|
|
59676
59693
|
rtcOrigin[2] += position[2];
|
|
59677
|
-
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$
|
|
59678
|
-
rtcCameraEye = tempVec3d$
|
|
59694
|
+
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$d);
|
|
59695
|
+
rtcCameraEye = tempVec3d$e;
|
|
59679
59696
|
rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
|
|
59680
59697
|
rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
|
|
59681
59698
|
rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
|
|
@@ -60029,10 +60046,10 @@ const tempVec4b$b = math.vec4([0, 0, 0, 1]);
|
|
|
60029
60046
|
math.vec4([0, 0, 0, 1]);
|
|
60030
60047
|
math.OBB3();
|
|
60031
60048
|
|
|
60032
|
-
const tempVec3a$
|
|
60033
|
-
const tempVec3b$
|
|
60034
|
-
const tempVec3c$
|
|
60035
|
-
const tempVec3d$
|
|
60049
|
+
const tempVec3a$q = math.vec3();
|
|
60050
|
+
const tempVec3b$k = math.vec3();
|
|
60051
|
+
const tempVec3c$h = math.vec3();
|
|
60052
|
+
const tempVec3d$d = math.vec3();
|
|
60036
60053
|
const tempVec3e$5 = math.vec3();
|
|
60037
60054
|
const tempVec3f$1 = math.vec3();
|
|
60038
60055
|
const tempVec3g$1 = math.vec3();
|
|
@@ -61212,10 +61229,10 @@ class TrianglesBatchingLayer {
|
|
|
61212
61229
|
const origin = state.origin;
|
|
61213
61230
|
const offset = portion.offset;
|
|
61214
61231
|
|
|
61215
|
-
const rtcRayOrigin = tempVec3a$
|
|
61216
|
-
const rtcRayDir = tempVec3b$
|
|
61232
|
+
const rtcRayOrigin = tempVec3a$q;
|
|
61233
|
+
const rtcRayDir = tempVec3b$k;
|
|
61217
61234
|
|
|
61218
|
-
rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$
|
|
61235
|
+
rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$h) : worldRayOrigin); // World -> RTC
|
|
61219
61236
|
rtcRayDir.set(worldRayDir);
|
|
61220
61237
|
|
|
61221
61238
|
if (offset) {
|
|
@@ -61224,7 +61241,7 @@ class TrianglesBatchingLayer {
|
|
|
61224
61241
|
|
|
61225
61242
|
math.transformRay(this.model.worldNormalMatrix, rtcRayOrigin, rtcRayDir, rtcRayOrigin, rtcRayDir); // RTC -> local
|
|
61226
61243
|
|
|
61227
|
-
const a = tempVec3d$
|
|
61244
|
+
const a = tempVec3d$d;
|
|
61228
61245
|
const b = tempVec3e$5;
|
|
61229
61246
|
const c = tempVec3f$1;
|
|
61230
61247
|
|
|
@@ -64374,12 +64391,12 @@ function getInstancingRenderers$1(scene) {
|
|
|
64374
64391
|
return instancingRenderers;
|
|
64375
64392
|
}
|
|
64376
64393
|
|
|
64377
|
-
const tempVec3a$
|
|
64378
|
-
const tempVec3b$
|
|
64379
|
-
const tempVec3c$
|
|
64380
|
-
const tempVec3d$
|
|
64394
|
+
const tempVec3a$p = math.vec3();
|
|
64395
|
+
const tempVec3b$j = math.vec3();
|
|
64396
|
+
const tempVec3c$g = math.vec3();
|
|
64397
|
+
const tempVec3d$c = math.vec3();
|
|
64381
64398
|
const tempVec3e$4 = math.vec3();
|
|
64382
|
-
const tempMat4a$
|
|
64399
|
+
const tempMat4a$c = math.mat4();
|
|
64383
64400
|
|
|
64384
64401
|
/**
|
|
64385
64402
|
* @private
|
|
@@ -64424,7 +64441,7 @@ class SnapInstancingDepthBufInitRenderer {
|
|
|
64424
64441
|
const aabb = instancingLayer.aabb;
|
|
64425
64442
|
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
|
|
64426
64443
|
|
|
64427
|
-
const coordinateScaler = tempVec3a$
|
|
64444
|
+
const coordinateScaler = tempVec3a$p;
|
|
64428
64445
|
coordinateScaler[0] = math.safeInv(aabb[3] - aabb[0]) * math.MAX_INT;
|
|
64429
64446
|
coordinateScaler[1] = math.safeInv(aabb[4] - aabb[1]) * math.MAX_INT;
|
|
64430
64447
|
coordinateScaler[2] = math.safeInv(aabb[5] - aabb[2]) * math.MAX_INT;
|
|
@@ -64436,9 +64453,9 @@ class SnapInstancingDepthBufInitRenderer {
|
|
|
64436
64453
|
let rtcViewMatrix;
|
|
64437
64454
|
let rtcCameraEye;
|
|
64438
64455
|
if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
|
|
64439
|
-
const rtcOrigin = tempVec3b$
|
|
64456
|
+
const rtcOrigin = tempVec3b$j;
|
|
64440
64457
|
if (origin) {
|
|
64441
|
-
const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$
|
|
64458
|
+
const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$g);
|
|
64442
64459
|
rtcOrigin[0] = rotatedOrigin[0];
|
|
64443
64460
|
rtcOrigin[1] = rotatedOrigin[1];
|
|
64444
64461
|
rtcOrigin[2] = rotatedOrigin[2];
|
|
@@ -64450,8 +64467,8 @@ class SnapInstancingDepthBufInitRenderer {
|
|
|
64450
64467
|
rtcOrigin[0] += position[0];
|
|
64451
64468
|
rtcOrigin[1] += position[1];
|
|
64452
64469
|
rtcOrigin[2] += position[2];
|
|
64453
|
-
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$
|
|
64454
|
-
rtcCameraEye = tempVec3d$
|
|
64470
|
+
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$c);
|
|
64471
|
+
rtcCameraEye = tempVec3d$c;
|
|
64455
64472
|
rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
|
|
64456
64473
|
rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
|
|
64457
64474
|
rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
|
|
@@ -64748,12 +64765,12 @@ class SnapInstancingDepthBufInitRenderer {
|
|
|
64748
64765
|
}
|
|
64749
64766
|
}
|
|
64750
64767
|
|
|
64751
|
-
const tempVec3a$
|
|
64752
|
-
const tempVec3b$
|
|
64753
|
-
const tempVec3c$
|
|
64754
|
-
const tempVec3d$
|
|
64768
|
+
const tempVec3a$o = math.vec3();
|
|
64769
|
+
const tempVec3b$i = math.vec3();
|
|
64770
|
+
const tempVec3c$f = math.vec3();
|
|
64771
|
+
const tempVec3d$b = math.vec3();
|
|
64755
64772
|
const tempVec3e$3 = math.vec3();
|
|
64756
|
-
const tempMat4a$
|
|
64773
|
+
const tempMat4a$b = math.mat4();
|
|
64757
64774
|
|
|
64758
64775
|
/**
|
|
64759
64776
|
* @private
|
|
@@ -64798,7 +64815,7 @@ class SnapInstancingDepthRenderer {
|
|
|
64798
64815
|
const aabb = instancingLayer.aabb;
|
|
64799
64816
|
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
|
|
64800
64817
|
|
|
64801
|
-
const coordinateScaler = tempVec3a$
|
|
64818
|
+
const coordinateScaler = tempVec3a$o;
|
|
64802
64819
|
coordinateScaler[0] = math.safeInv(aabb[3] - aabb[0]) * math.MAX_INT;
|
|
64803
64820
|
coordinateScaler[1] = math.safeInv(aabb[4] - aabb[1]) * math.MAX_INT;
|
|
64804
64821
|
coordinateScaler[2] = math.safeInv(aabb[5] - aabb[2]) * math.MAX_INT;
|
|
@@ -64811,9 +64828,9 @@ class SnapInstancingDepthRenderer {
|
|
|
64811
64828
|
let rtcCameraEye;
|
|
64812
64829
|
|
|
64813
64830
|
if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
|
|
64814
|
-
const rtcOrigin = tempVec3b$
|
|
64831
|
+
const rtcOrigin = tempVec3b$i;
|
|
64815
64832
|
if (origin) {
|
|
64816
|
-
const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$
|
|
64833
|
+
const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$f);
|
|
64817
64834
|
rtcOrigin[0] = rotatedOrigin[0];
|
|
64818
64835
|
rtcOrigin[1] = rotatedOrigin[1];
|
|
64819
64836
|
rtcOrigin[2] = rotatedOrigin[2];
|
|
@@ -64825,8 +64842,8 @@ class SnapInstancingDepthRenderer {
|
|
|
64825
64842
|
rtcOrigin[0] += position[0];
|
|
64826
64843
|
rtcOrigin[1] += position[1];
|
|
64827
64844
|
rtcOrigin[2] += position[2];
|
|
64828
|
-
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$
|
|
64829
|
-
rtcCameraEye = tempVec3d$
|
|
64845
|
+
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$b);
|
|
64846
|
+
rtcCameraEye = tempVec3d$b;
|
|
64830
64847
|
rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
|
|
64831
64848
|
rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
|
|
64832
64849
|
rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
|
|
@@ -65189,10 +65206,10 @@ const tempVec4b$a = math.vec4([0, 0, 0, 1]);
|
|
|
65189
65206
|
math.vec4([0, 0, 0, 1]);
|
|
65190
65207
|
const tempVec3fa$2 = new Float32Array(3);
|
|
65191
65208
|
|
|
65192
|
-
const tempVec3a$
|
|
65193
|
-
const tempVec3b$
|
|
65194
|
-
const tempVec3c$
|
|
65195
|
-
const tempVec3d$
|
|
65209
|
+
const tempVec3a$n = math.vec3();
|
|
65210
|
+
const tempVec3b$h = math.vec3();
|
|
65211
|
+
const tempVec3c$e = math.vec3();
|
|
65212
|
+
const tempVec3d$a = math.vec3();
|
|
65196
65213
|
const tempVec3e$2 = math.vec3();
|
|
65197
65214
|
const tempVec3f = math.vec3();
|
|
65198
65215
|
const tempVec3g = math.vec3();
|
|
@@ -66206,10 +66223,10 @@ class TrianglesInstancingLayer {
|
|
|
66206
66223
|
const origin = state.origin;
|
|
66207
66224
|
const offset = portion.offset;
|
|
66208
66225
|
|
|
66209
|
-
const rtcRayOrigin = tempVec3a$
|
|
66210
|
-
const rtcRayDir = tempVec3b$
|
|
66226
|
+
const rtcRayOrigin = tempVec3a$n;
|
|
66227
|
+
const rtcRayDir = tempVec3b$h;
|
|
66211
66228
|
|
|
66212
|
-
rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$
|
|
66229
|
+
rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$e) : worldRayOrigin); // World -> RTC
|
|
66213
66230
|
rtcRayDir.set(worldRayDir);
|
|
66214
66231
|
|
|
66215
66232
|
if (offset) {
|
|
@@ -66220,7 +66237,7 @@ class TrianglesInstancingLayer {
|
|
|
66220
66237
|
|
|
66221
66238
|
math.transformRay(portion.inverseMatrix, rtcRayOrigin, rtcRayDir, rtcRayOrigin, rtcRayDir);
|
|
66222
66239
|
|
|
66223
|
-
const a = tempVec3d$
|
|
66240
|
+
const a = tempVec3d$a;
|
|
66224
66241
|
const b = tempVec3e$2;
|
|
66225
66242
|
const c = tempVec3f;
|
|
66226
66243
|
|
|
@@ -69241,8 +69258,8 @@ class PointsBatchingBuffer {
|
|
|
69241
69258
|
}
|
|
69242
69259
|
}
|
|
69243
69260
|
|
|
69244
|
-
const tempVec3a$
|
|
69245
|
-
const tempVec3b$
|
|
69261
|
+
const tempVec3a$m = math.vec4();
|
|
69262
|
+
const tempVec3b$g = math.vec4();
|
|
69246
69263
|
const tempVec4a$8 = math.vec4([0, 0, 0, 1]);
|
|
69247
69264
|
const tempVec4b$7 = math.vec4([0, 0, 0, 1]);
|
|
69248
69265
|
math.vec4([0, 0, 0, 1]);
|
|
@@ -69391,8 +69408,8 @@ class PointsBatchingLayer {
|
|
|
69391
69408
|
|
|
69392
69409
|
const bounds = geometryCompressionUtils.getPositionsBounds(positionsCompressed);
|
|
69393
69410
|
|
|
69394
|
-
const min = geometryCompressionUtils.decompressPosition(bounds.min, this._state.positionsDecodeMatrix, tempVec3a$
|
|
69395
|
-
const max = geometryCompressionUtils.decompressPosition(bounds.max, this._state.positionsDecodeMatrix, tempVec3b$
|
|
69411
|
+
const min = geometryCompressionUtils.decompressPosition(bounds.min, this._state.positionsDecodeMatrix, tempVec3a$m);
|
|
69412
|
+
const max = geometryCompressionUtils.decompressPosition(bounds.max, this._state.positionsDecodeMatrix, tempVec3b$g);
|
|
69396
69413
|
|
|
69397
69414
|
worldAABB[0] = min[0];
|
|
69398
69415
|
worldAABB[1] = min[1];
|
|
@@ -73357,14 +73374,14 @@ function doCheckResult(buckets, mesh) {
|
|
|
73357
73374
|
}
|
|
73358
73375
|
}
|
|
73359
73376
|
|
|
73360
|
-
const tempVec3a$
|
|
73361
|
-
const tempVec3b$
|
|
73362
|
-
const tempVec3c$
|
|
73363
|
-
const tempVec3d$
|
|
73377
|
+
const tempVec3a$l = math.vec3();
|
|
73378
|
+
const tempVec3b$f = math.vec3();
|
|
73379
|
+
const tempVec3c$d = math.vec3();
|
|
73380
|
+
const tempVec3d$9 = math.vec3();
|
|
73364
73381
|
|
|
73365
73382
|
const tempVec4a$6 = math.vec4();
|
|
73366
73383
|
|
|
73367
|
-
const tempMat4a$
|
|
73384
|
+
const tempMat4a$a = math.mat4();
|
|
73368
73385
|
|
|
73369
73386
|
/**
|
|
73370
73387
|
* @private
|
|
@@ -73425,9 +73442,9 @@ class TrianglesDataTextureColorRenderer {
|
|
|
73425
73442
|
const gotOrigin = (origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0);
|
|
73426
73443
|
const gotPosition = (position[0] !== 0 || position[1] !== 0 || position[2] !== 0);
|
|
73427
73444
|
if (gotOrigin || gotPosition) {
|
|
73428
|
-
const rtcOrigin = tempVec3a$
|
|
73445
|
+
const rtcOrigin = tempVec3a$l;
|
|
73429
73446
|
if (gotOrigin) {
|
|
73430
|
-
const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3b$
|
|
73447
|
+
const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3b$f);
|
|
73431
73448
|
rtcOrigin[0] = rotatedOrigin[0];
|
|
73432
73449
|
rtcOrigin[1] = rotatedOrigin[1];
|
|
73433
73450
|
rtcOrigin[2] = rotatedOrigin[2];
|
|
@@ -73439,8 +73456,8 @@ class TrianglesDataTextureColorRenderer {
|
|
|
73439
73456
|
rtcOrigin[0] += position[0];
|
|
73440
73457
|
rtcOrigin[1] += position[1];
|
|
73441
73458
|
rtcOrigin[2] += position[2];
|
|
73442
|
-
rtcViewMatrix = createRTCViewMat(camera.viewMatrix, rtcOrigin, tempMat4a$
|
|
73443
|
-
rtcCameraEye = tempVec3c$
|
|
73459
|
+
rtcViewMatrix = createRTCViewMat(camera.viewMatrix, rtcOrigin, tempMat4a$a);
|
|
73460
|
+
rtcCameraEye = tempVec3c$d;
|
|
73444
73461
|
rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
|
|
73445
73462
|
rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
|
|
73446
73463
|
rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
|
|
@@ -73473,7 +73490,7 @@ class TrianglesDataTextureColorRenderer {
|
|
|
73473
73490
|
if (active) {
|
|
73474
73491
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
73475
73492
|
if (origin) {
|
|
73476
|
-
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3d$
|
|
73493
|
+
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3d$9);
|
|
73477
73494
|
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
|
|
73478
73495
|
} else {
|
|
73479
73496
|
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
|
|
@@ -73989,11 +74006,11 @@ class TrianglesDataTextureColorRenderer {
|
|
|
73989
74006
|
|
|
73990
74007
|
const defaultColor$1 = new Float32Array([1, 1, 1]);
|
|
73991
74008
|
|
|
73992
|
-
const tempVec3a$
|
|
73993
|
-
const tempVec3b$
|
|
73994
|
-
const tempVec3c$
|
|
73995
|
-
const tempVec3d$
|
|
73996
|
-
const tempMat4a$
|
|
74009
|
+
const tempVec3a$k = math.vec3();
|
|
74010
|
+
const tempVec3b$e = math.vec3();
|
|
74011
|
+
const tempVec3c$c = math.vec3();
|
|
74012
|
+
const tempVec3d$8 = math.vec3();
|
|
74013
|
+
const tempMat4a$9 = math.mat4();
|
|
73997
74014
|
|
|
73998
74015
|
/**
|
|
73999
74016
|
* @private
|
|
@@ -74052,9 +74069,9 @@ class TrianglesDataTextureSilhouetteRenderer {
|
|
|
74052
74069
|
let rtcCameraEye;
|
|
74053
74070
|
|
|
74054
74071
|
if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
|
|
74055
|
-
const rtcOrigin = tempVec3a$
|
|
74072
|
+
const rtcOrigin = tempVec3a$k;
|
|
74056
74073
|
if (origin) {
|
|
74057
|
-
const rotatedOrigin = tempVec3b$
|
|
74074
|
+
const rotatedOrigin = tempVec3b$e;
|
|
74058
74075
|
math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
|
|
74059
74076
|
rtcOrigin[0] = rotatedOrigin[0];
|
|
74060
74077
|
rtcOrigin[1] = rotatedOrigin[1];
|
|
@@ -74067,8 +74084,8 @@ class TrianglesDataTextureSilhouetteRenderer {
|
|
|
74067
74084
|
rtcOrigin[0] += position[0];
|
|
74068
74085
|
rtcOrigin[1] += position[1];
|
|
74069
74086
|
rtcOrigin[2] += position[2];
|
|
74070
|
-
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$
|
|
74071
|
-
rtcCameraEye = tempVec3c$
|
|
74087
|
+
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$9);
|
|
74088
|
+
rtcCameraEye = tempVec3c$c;
|
|
74072
74089
|
rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
|
|
74073
74090
|
rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
|
|
74074
74091
|
rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
|
|
@@ -74121,7 +74138,7 @@ class TrianglesDataTextureSilhouetteRenderer {
|
|
|
74121
74138
|
if (active) {
|
|
74122
74139
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
74123
74140
|
if (origin) {
|
|
74124
|
-
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3d$
|
|
74141
|
+
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3d$8);
|
|
74125
74142
|
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
|
|
74126
74143
|
} else {
|
|
74127
74144
|
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
|
|
@@ -74454,11 +74471,11 @@ class TrianglesDataTextureSilhouetteRenderer {
|
|
|
74454
74471
|
|
|
74455
74472
|
const defaultColor = new Float32Array([0, 0, 0, 1]);
|
|
74456
74473
|
|
|
74457
|
-
const tempVec3a$
|
|
74458
|
-
const tempVec3b$
|
|
74474
|
+
const tempVec3a$j = math.vec3();
|
|
74475
|
+
const tempVec3b$d = math.vec3();
|
|
74459
74476
|
math.vec3();
|
|
74460
|
-
const tempVec3d$
|
|
74461
|
-
const tempMat4a$
|
|
74477
|
+
const tempVec3d$7 = math.vec3();
|
|
74478
|
+
const tempMat4a$8 = math.mat4();
|
|
74462
74479
|
|
|
74463
74480
|
/**
|
|
74464
74481
|
* @private
|
|
@@ -74517,9 +74534,9 @@ class TrianglesDataTextureEdgesRenderer {
|
|
|
74517
74534
|
const gotOrigin = (origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0);
|
|
74518
74535
|
const gotPosition = (position[0] !== 0 || position[1] !== 0 || position[2] !== 0);
|
|
74519
74536
|
if (gotOrigin || gotPosition) {
|
|
74520
|
-
const rtcOrigin = tempVec3a$
|
|
74537
|
+
const rtcOrigin = tempVec3a$j;
|
|
74521
74538
|
if (gotOrigin) {
|
|
74522
|
-
const rotatedOrigin = tempVec3b$
|
|
74539
|
+
const rotatedOrigin = tempVec3b$d;
|
|
74523
74540
|
math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
|
|
74524
74541
|
rtcOrigin[0] = rotatedOrigin[0];
|
|
74525
74542
|
rtcOrigin[1] = rotatedOrigin[1];
|
|
@@ -74532,7 +74549,7 @@ class TrianglesDataTextureEdgesRenderer {
|
|
|
74532
74549
|
rtcOrigin[0] += position[0];
|
|
74533
74550
|
rtcOrigin[1] += position[1];
|
|
74534
74551
|
rtcOrigin[2] += position[2];
|
|
74535
|
-
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$
|
|
74552
|
+
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$8);
|
|
74536
74553
|
} else {
|
|
74537
74554
|
rtcViewMatrix = viewMatrix;
|
|
74538
74555
|
}
|
|
@@ -74577,7 +74594,7 @@ class TrianglesDataTextureEdgesRenderer {
|
|
|
74577
74594
|
if (active) {
|
|
74578
74595
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
74579
74596
|
if (origin) {
|
|
74580
|
-
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3d$
|
|
74597
|
+
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3d$7);
|
|
74581
74598
|
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
|
|
74582
74599
|
} else {
|
|
74583
74600
|
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
|
|
@@ -74878,10 +74895,10 @@ class TrianglesDataTextureEdgesRenderer {
|
|
|
74878
74895
|
}
|
|
74879
74896
|
}
|
|
74880
74897
|
|
|
74881
|
-
const tempVec3a$
|
|
74882
|
-
const tempVec3b$
|
|
74883
|
-
const tempVec3c$
|
|
74884
|
-
const tempMat4a$
|
|
74898
|
+
const tempVec3a$i = math.vec3();
|
|
74899
|
+
const tempVec3b$c = math.vec3();
|
|
74900
|
+
const tempVec3c$b = math.vec3();
|
|
74901
|
+
const tempMat4a$7 = math.mat4();
|
|
74885
74902
|
|
|
74886
74903
|
/**
|
|
74887
74904
|
* @private
|
|
@@ -74939,9 +74956,9 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
74939
74956
|
const gotOrigin = (origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0);
|
|
74940
74957
|
const gotPosition = (position[0] !== 0 || position[1] !== 0 || position[2] !== 0);
|
|
74941
74958
|
if (gotOrigin || gotPosition) {
|
|
74942
|
-
const rtcOrigin = tempVec3a$
|
|
74959
|
+
const rtcOrigin = tempVec3a$i;
|
|
74943
74960
|
if (gotOrigin) {
|
|
74944
|
-
const rotatedOrigin = tempVec3b$
|
|
74961
|
+
const rotatedOrigin = tempVec3b$c;
|
|
74945
74962
|
math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
|
|
74946
74963
|
rtcOrigin[0] = rotatedOrigin[0];
|
|
74947
74964
|
rtcOrigin[1] = rotatedOrigin[1];
|
|
@@ -74954,7 +74971,7 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
74954
74971
|
rtcOrigin[0] += position[0];
|
|
74955
74972
|
rtcOrigin[1] += position[1];
|
|
74956
74973
|
rtcOrigin[2] += position[2];
|
|
74957
|
-
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$
|
|
74974
|
+
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$7);
|
|
74958
74975
|
} else {
|
|
74959
74976
|
rtcViewMatrix = viewMatrix;
|
|
74960
74977
|
}
|
|
@@ -74977,7 +74994,7 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
74977
74994
|
if (active) {
|
|
74978
74995
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
74979
74996
|
if (origin) {
|
|
74980
|
-
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3c$
|
|
74997
|
+
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3c$b);
|
|
74981
74998
|
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
|
|
74982
74999
|
} else {
|
|
74983
75000
|
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
|
|
@@ -75299,10 +75316,10 @@ class TrianglesDataTextureEdgesColorRenderer {
|
|
|
75299
75316
|
}
|
|
75300
75317
|
}
|
|
75301
75318
|
|
|
75302
|
-
const tempVec3a$
|
|
75303
|
-
const tempVec3b$
|
|
75304
|
-
const tempVec3c$
|
|
75305
|
-
const tempMat4a$
|
|
75319
|
+
const tempVec3a$h = math.vec3();
|
|
75320
|
+
const tempVec3b$b = math.vec3();
|
|
75321
|
+
const tempVec3c$a = math.vec3();
|
|
75322
|
+
const tempMat4a$6 = math.mat4();
|
|
75306
75323
|
|
|
75307
75324
|
/**
|
|
75308
75325
|
* @private
|
|
@@ -75355,9 +75372,9 @@ class TrianglesDataTexturePickMeshRenderer {
|
|
|
75355
75372
|
const gotOrigin = (origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0);
|
|
75356
75373
|
const gotPosition = (position[0] !== 0 || position[1] !== 0 || position[2] !== 0);
|
|
75357
75374
|
if (gotOrigin || gotPosition) {
|
|
75358
|
-
const rtcOrigin = tempVec3a$
|
|
75375
|
+
const rtcOrigin = tempVec3a$h;
|
|
75359
75376
|
if (gotOrigin) {
|
|
75360
|
-
const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3b$
|
|
75377
|
+
const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3b$b);
|
|
75361
75378
|
rtcOrigin[0] = rotatedOrigin[0];
|
|
75362
75379
|
rtcOrigin[1] = rotatedOrigin[1];
|
|
75363
75380
|
rtcOrigin[2] = rotatedOrigin[2];
|
|
@@ -75369,8 +75386,8 @@ class TrianglesDataTexturePickMeshRenderer {
|
|
|
75369
75386
|
rtcOrigin[0] += position[0];
|
|
75370
75387
|
rtcOrigin[1] += position[1];
|
|
75371
75388
|
rtcOrigin[2] += position[2];
|
|
75372
|
-
rtcViewMatrix = createRTCViewMat(camera.viewMatrix, rtcOrigin, tempMat4a$
|
|
75373
|
-
rtcCameraEye = tempVec3c$
|
|
75389
|
+
rtcViewMatrix = createRTCViewMat(camera.viewMatrix, rtcOrigin, tempMat4a$6);
|
|
75390
|
+
rtcCameraEye = tempVec3c$a;
|
|
75374
75391
|
rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
|
|
75375
75392
|
rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
|
|
75376
75393
|
rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
|
|
@@ -75400,7 +75417,7 @@ class TrianglesDataTexturePickMeshRenderer {
|
|
|
75400
75417
|
if (active) {
|
|
75401
75418
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
75402
75419
|
if (origin) {
|
|
75403
|
-
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$
|
|
75420
|
+
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$h);
|
|
75404
75421
|
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
|
|
75405
75422
|
} else {
|
|
75406
75423
|
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
|
|
@@ -75732,11 +75749,11 @@ class TrianglesDataTexturePickMeshRenderer {
|
|
|
75732
75749
|
}
|
|
75733
75750
|
}
|
|
75734
75751
|
|
|
75735
|
-
const tempVec3a$
|
|
75736
|
-
const tempVec3b$
|
|
75737
|
-
const tempVec3c$
|
|
75738
|
-
const tempVec3d$
|
|
75739
|
-
const tempMat4a$
|
|
75752
|
+
const tempVec3a$g = math.vec3();
|
|
75753
|
+
const tempVec3b$a = math.vec3();
|
|
75754
|
+
const tempVec3c$9 = math.vec3();
|
|
75755
|
+
const tempVec3d$6 = math.vec3();
|
|
75756
|
+
const tempMat4a$5 = math.mat4();
|
|
75740
75757
|
|
|
75741
75758
|
/**
|
|
75742
75759
|
* @private
|
|
@@ -75787,16 +75804,13 @@ class TrianglesDataTexturePickDepthRenderer {
|
|
|
75787
75804
|
this._uTexturePerObjectIdOffsets
|
|
75788
75805
|
);
|
|
75789
75806
|
|
|
75790
|
-
camera.eye;
|
|
75791
|
-
|
|
75792
|
-
|
|
75793
75807
|
let rtcViewMatrix;
|
|
75794
75808
|
let rtcCameraEye;
|
|
75795
75809
|
|
|
75796
75810
|
if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
|
|
75797
|
-
const rtcOrigin = tempVec3a$
|
|
75811
|
+
const rtcOrigin = tempVec3a$g;
|
|
75798
75812
|
if (origin) {
|
|
75799
|
-
const rotatedOrigin = tempVec3b$
|
|
75813
|
+
const rotatedOrigin = tempVec3b$a;
|
|
75800
75814
|
math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
|
|
75801
75815
|
rtcOrigin[0] = rotatedOrigin[0];
|
|
75802
75816
|
rtcOrigin[1] = rotatedOrigin[1];
|
|
@@ -75809,8 +75823,8 @@ class TrianglesDataTexturePickDepthRenderer {
|
|
|
75809
75823
|
rtcOrigin[0] += position[0];
|
|
75810
75824
|
rtcOrigin[1] += position[1];
|
|
75811
75825
|
rtcOrigin[2] += position[2];
|
|
75812
|
-
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$
|
|
75813
|
-
rtcCameraEye = tempVec3c$
|
|
75826
|
+
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$5);
|
|
75827
|
+
rtcCameraEye = tempVec3c$9;
|
|
75814
75828
|
rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
|
|
75815
75829
|
rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
|
|
75816
75830
|
rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
|
|
@@ -75851,7 +75865,7 @@ class TrianglesDataTexturePickDepthRenderer {
|
|
|
75851
75865
|
if (active) {
|
|
75852
75866
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
75853
75867
|
if (origin) {
|
|
75854
|
-
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3d$
|
|
75868
|
+
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3d$6);
|
|
75855
75869
|
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
|
|
75856
75870
|
} else {
|
|
75857
75871
|
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
|
|
@@ -76182,12 +76196,12 @@ class TrianglesDataTexturePickDepthRenderer {
|
|
|
76182
76196
|
}
|
|
76183
76197
|
}
|
|
76184
76198
|
|
|
76185
|
-
const tempVec3a$
|
|
76186
|
-
const tempVec3b$
|
|
76187
|
-
const tempVec3c$
|
|
76188
|
-
const tempVec3d$
|
|
76199
|
+
const tempVec3a$f = math.vec3();
|
|
76200
|
+
const tempVec3b$9 = math.vec3();
|
|
76201
|
+
const tempVec3c$8 = math.vec3();
|
|
76202
|
+
const tempVec3d$5 = math.vec3();
|
|
76189
76203
|
const tempVec3e$1 = math.vec3();
|
|
76190
|
-
const tempMat4a$
|
|
76204
|
+
const tempMat4a$4 = math.mat4();
|
|
76191
76205
|
|
|
76192
76206
|
/**
|
|
76193
76207
|
* @private
|
|
@@ -76233,7 +76247,7 @@ class TrianglesDataTextureSnapDepthRenderer {
|
|
|
76233
76247
|
const aabb = dataTextureLayer.aabb;
|
|
76234
76248
|
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
|
|
76235
76249
|
|
|
76236
|
-
const coordinateScaler = tempVec3a$
|
|
76250
|
+
const coordinateScaler = tempVec3a$f;
|
|
76237
76251
|
coordinateScaler[0] = math.safeInv(aabb[3] - aabb[0]) * math.MAX_INT;
|
|
76238
76252
|
coordinateScaler[1] = math.safeInv(aabb[4] - aabb[1]) * math.MAX_INT;
|
|
76239
76253
|
coordinateScaler[2] = math.safeInv(aabb[5] - aabb[2]) * math.MAX_INT;
|
|
@@ -76257,9 +76271,9 @@ class TrianglesDataTextureSnapDepthRenderer {
|
|
|
76257
76271
|
const gotOrigin = (origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0);
|
|
76258
76272
|
const gotPosition = (position[0] !== 0 || position[1] !== 0 || position[2] !== 0);
|
|
76259
76273
|
if (gotOrigin || gotPosition) {
|
|
76260
|
-
const rtcOrigin = tempVec3b$
|
|
76274
|
+
const rtcOrigin = tempVec3b$9;
|
|
76261
76275
|
if (gotOrigin) {
|
|
76262
|
-
const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$
|
|
76276
|
+
const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$8);
|
|
76263
76277
|
rtcOrigin[0] = rotatedOrigin[0];
|
|
76264
76278
|
rtcOrigin[1] = rotatedOrigin[1];
|
|
76265
76279
|
rtcOrigin[2] = rotatedOrigin[2];
|
|
@@ -76271,8 +76285,8 @@ class TrianglesDataTextureSnapDepthRenderer {
|
|
|
76271
76285
|
rtcOrigin[0] += position[0];
|
|
76272
76286
|
rtcOrigin[1] += position[1];
|
|
76273
76287
|
rtcOrigin[2] += position[2];
|
|
76274
|
-
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$
|
|
76275
|
-
rtcCameraEye = tempVec3d$
|
|
76288
|
+
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$4);
|
|
76289
|
+
rtcCameraEye = tempVec3d$5;
|
|
76276
76290
|
rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
|
|
76277
76291
|
rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
|
|
76278
76292
|
rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
|
|
@@ -76601,12 +76615,12 @@ class TrianglesDataTextureSnapDepthRenderer {
|
|
|
76601
76615
|
}
|
|
76602
76616
|
}
|
|
76603
76617
|
|
|
76604
|
-
const tempVec3a$
|
|
76605
|
-
const tempVec3b$
|
|
76606
|
-
const tempVec3c$
|
|
76607
|
-
const tempVec3d$
|
|
76618
|
+
const tempVec3a$e = math.vec3();
|
|
76619
|
+
const tempVec3b$8 = math.vec3();
|
|
76620
|
+
const tempVec3c$7 = math.vec3();
|
|
76621
|
+
const tempVec3d$4 = math.vec3();
|
|
76608
76622
|
const tempVec3e = math.vec3();
|
|
76609
|
-
const tempMat4a$
|
|
76623
|
+
const tempMat4a$3 = math.mat4();
|
|
76610
76624
|
/**
|
|
76611
76625
|
* @private
|
|
76612
76626
|
*/
|
|
@@ -76648,7 +76662,7 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
76648
76662
|
const aabb = dataTextureLayer.aabb;
|
|
76649
76663
|
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
|
|
76650
76664
|
|
|
76651
|
-
const coordinateScaler = tempVec3a$
|
|
76665
|
+
const coordinateScaler = tempVec3a$e;
|
|
76652
76666
|
coordinateScaler[0] = math.safeInv(aabb[3] - aabb[0]) * math.MAX_INT;
|
|
76653
76667
|
coordinateScaler[1] = math.safeInv(aabb[4] - aabb[1]) * math.MAX_INT;
|
|
76654
76668
|
coordinateScaler[2] = math.safeInv(aabb[5] - aabb[2]) * math.MAX_INT;
|
|
@@ -76669,9 +76683,9 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
76669
76683
|
const gotOrigin = (origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0);
|
|
76670
76684
|
const gotPosition = (position[0] !== 0 || position[1] !== 0 || position[2] !== 0);
|
|
76671
76685
|
if (gotOrigin || gotPosition) {
|
|
76672
|
-
const rtcOrigin = tempVec3b$
|
|
76686
|
+
const rtcOrigin = tempVec3b$8;
|
|
76673
76687
|
if (gotOrigin) {
|
|
76674
|
-
const rotatedOrigin = tempVec3c$
|
|
76688
|
+
const rotatedOrigin = tempVec3c$7;
|
|
76675
76689
|
math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
|
|
76676
76690
|
rtcOrigin[0] = rotatedOrigin[0];
|
|
76677
76691
|
rtcOrigin[1] = rotatedOrigin[1];
|
|
@@ -76684,8 +76698,8 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
76684
76698
|
rtcOrigin[0] += position[0];
|
|
76685
76699
|
rtcOrigin[1] += position[1];
|
|
76686
76700
|
rtcOrigin[2] += position[2];
|
|
76687
|
-
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$
|
|
76688
|
-
rtcCameraEye = tempVec3d$
|
|
76701
|
+
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$3);
|
|
76702
|
+
rtcCameraEye = tempVec3d$4;
|
|
76689
76703
|
rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
|
|
76690
76704
|
rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
|
|
76691
76705
|
rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
|
|
@@ -77047,7 +77061,7 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
|
|
|
77047
77061
|
}
|
|
77048
77062
|
}
|
|
77049
77063
|
|
|
77050
|
-
const tempVec3a$
|
|
77064
|
+
const tempVec3a$d = math.vec3();
|
|
77051
77065
|
|
|
77052
77066
|
/**
|
|
77053
77067
|
* @private
|
|
@@ -77139,7 +77153,7 @@ class TrianglesDataTexturePickNormalsRenderer {
|
|
|
77139
77153
|
if (active) {
|
|
77140
77154
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
77141
77155
|
if (origin) {
|
|
77142
|
-
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$
|
|
77156
|
+
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$d);
|
|
77143
77157
|
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
|
|
77144
77158
|
} else {
|
|
77145
77159
|
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
|
|
@@ -77474,11 +77488,11 @@ class TrianglesDataTexturePickNormalsRenderer {
|
|
|
77474
77488
|
}
|
|
77475
77489
|
}
|
|
77476
77490
|
|
|
77477
|
-
math.vec3();
|
|
77478
|
-
math.vec3();
|
|
77479
|
-
math.vec3();
|
|
77480
|
-
math.vec3();
|
|
77481
|
-
math.mat4();
|
|
77491
|
+
const tempVec3a$c = math.vec3();
|
|
77492
|
+
const tempVec3b$7 = math.vec3();
|
|
77493
|
+
const tempVec3c$6 = math.vec3();
|
|
77494
|
+
const tempVec3d$3 = math.vec3();
|
|
77495
|
+
const tempMat4a$2 = math.mat4();
|
|
77482
77496
|
|
|
77483
77497
|
/**
|
|
77484
77498
|
* @private
|
|
@@ -77501,30 +77515,142 @@ class TrianglesDataTextureOcclusionRenderer {
|
|
|
77501
77515
|
|
|
77502
77516
|
drawLayer(frameCtx, dataTextureLayer, renderPass) {
|
|
77503
77517
|
|
|
77504
|
-
|
|
77518
|
+
const model = dataTextureLayer.model;
|
|
77519
|
+
const scene = model.scene;
|
|
77520
|
+
const camera = scene.camera;
|
|
77521
|
+
const gl = scene.canvas.gl;
|
|
77522
|
+
const state = dataTextureLayer._state;
|
|
77523
|
+
const textureState = state.textureState;
|
|
77524
|
+
const origin = dataTextureLayer._state.origin;
|
|
77525
|
+
const {position, rotationMatrix, rotationMatrixConjugate} = model;
|
|
77526
|
+
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
|
|
77527
|
+
|
|
77528
|
+
if (!this._program) {
|
|
77529
|
+
this._allocate(dataTextureLayer);
|
|
77530
|
+
if (this.errors) {
|
|
77531
|
+
return;
|
|
77532
|
+
}
|
|
77533
|
+
}
|
|
77534
|
+
|
|
77535
|
+
if (frameCtx.lastProgramId !== this._program.id) {
|
|
77536
|
+
frameCtx.lastProgramId = this._program.id;
|
|
77537
|
+
this._bindProgram();
|
|
77538
|
+
}
|
|
77539
|
+
|
|
77540
|
+
textureState.bindCommonTextures(
|
|
77541
|
+
this._program,
|
|
77542
|
+
this._uTexturePerObjectIdPositionsDecodeMatrix,
|
|
77543
|
+
this._uTexturePerVertexIdCoordinates,
|
|
77544
|
+
this._uTexturePerObjectIdColorsAndFlags,
|
|
77545
|
+
this._uTextureModelMatrices,
|
|
77546
|
+
this._uTexturePerObjectIdOffsets
|
|
77547
|
+
);
|
|
77548
|
+
|
|
77549
|
+
let rtcViewMatrix;
|
|
77550
|
+
let rtcCameraEye;
|
|
77551
|
+
|
|
77552
|
+
if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
|
|
77553
|
+
const rtcOrigin = tempVec3a$c;
|
|
77554
|
+
if (origin) {
|
|
77555
|
+
const rotatedOrigin = tempVec3b$7;
|
|
77556
|
+
math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
|
|
77557
|
+
rtcOrigin[0] = rotatedOrigin[0];
|
|
77558
|
+
rtcOrigin[1] = rotatedOrigin[1];
|
|
77559
|
+
rtcOrigin[2] = rotatedOrigin[2];
|
|
77560
|
+
} else {
|
|
77561
|
+
rtcOrigin[0] = 0;
|
|
77562
|
+
rtcOrigin[1] = 0;
|
|
77563
|
+
rtcOrigin[2] = 0;
|
|
77564
|
+
}
|
|
77565
|
+
rtcOrigin[0] += position[0];
|
|
77566
|
+
rtcOrigin[1] += position[1];
|
|
77567
|
+
rtcOrigin[2] += position[2];
|
|
77568
|
+
rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$2);
|
|
77569
|
+
rtcCameraEye = tempVec3c$6;
|
|
77570
|
+
rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
|
|
77571
|
+
rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
|
|
77572
|
+
rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
|
|
77573
|
+
} else {
|
|
77574
|
+
rtcViewMatrix = viewMatrix;
|
|
77575
|
+
rtcCameraEye = camera.eye;
|
|
77576
|
+
}
|
|
77577
|
+
|
|
77578
|
+
gl.uniform3fv(this._uCameraEyeRtc, rtcCameraEye);
|
|
77579
|
+
gl.uniform1i(this._uRenderPass, renderPass);
|
|
77580
|
+
gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrixConjugate);
|
|
77581
|
+
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
|
|
77582
|
+
|
|
77583
|
+
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
|
|
77584
|
+
|
|
77585
|
+
const numSectionPlanes = scene._sectionPlanesState.sectionPlanes.length;
|
|
77586
|
+
if (numSectionPlanes > 0) {
|
|
77587
|
+
const sectionPlanes = scene._sectionPlanesState.sectionPlanes;
|
|
77588
|
+
const baseIndex = dataTextureLayer.layerIndex * numSectionPlanes;
|
|
77589
|
+
const renderFlags = model.renderFlags;
|
|
77590
|
+
for (let sectionPlaneIndex = 0; sectionPlaneIndex < numSectionPlanes; sectionPlaneIndex++) {
|
|
77591
|
+
const sectionPlaneUniforms = this._uSectionPlanes[sectionPlaneIndex];
|
|
77592
|
+
if (sectionPlaneUniforms) {
|
|
77593
|
+
const active = renderFlags.sectionPlanesActivePerLayer[baseIndex + sectionPlaneIndex];
|
|
77594
|
+
gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
|
|
77595
|
+
if (active) {
|
|
77596
|
+
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
77597
|
+
if (origin) {
|
|
77598
|
+
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3d$3);
|
|
77599
|
+
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
|
|
77600
|
+
} else {
|
|
77601
|
+
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
|
|
77602
|
+
}
|
|
77603
|
+
gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
|
|
77604
|
+
}
|
|
77605
|
+
}
|
|
77606
|
+
}
|
|
77607
|
+
}
|
|
77608
|
+
|
|
77609
|
+
if (state.numIndices8Bits > 0) {
|
|
77610
|
+
textureState.bindTriangleIndicesTextures(
|
|
77611
|
+
this._program,
|
|
77612
|
+
this._uTexturePerPolygonIdPortionIds,
|
|
77613
|
+
this._uTexturePerPolygonIdIndices,
|
|
77614
|
+
8 // 8 bits indices
|
|
77615
|
+
);
|
|
77616
|
+
gl.drawArrays(gl.TRIANGLES, 0, state.numIndices8Bits);
|
|
77617
|
+
}
|
|
77618
|
+
if (state.numIndices16Bits > 0) {
|
|
77619
|
+
textureState.bindTriangleIndicesTextures(
|
|
77620
|
+
this._program,
|
|
77621
|
+
this._uTexturePerPolygonIdPortionIds,
|
|
77622
|
+
this._uTexturePerPolygonIdIndices,
|
|
77623
|
+
16 // 16 bits indices
|
|
77624
|
+
);
|
|
77625
|
+
gl.drawArrays(gl.TRIANGLES, 0, state.numIndices16Bits);
|
|
77626
|
+
}
|
|
77627
|
+
if (state.numIndices32Bits > 0) {
|
|
77628
|
+
textureState.bindTriangleIndicesTextures(
|
|
77629
|
+
this._program,
|
|
77630
|
+
this._uTexturePerPolygonIdPortionIds,
|
|
77631
|
+
this._uTexturePerPolygonIdIndices,
|
|
77632
|
+
32 // 32 bits indices
|
|
77633
|
+
);
|
|
77634
|
+
gl.drawArrays(gl.TRIANGLES, 0, state.numIndices32Bits);
|
|
77635
|
+
}
|
|
77636
|
+
frameCtx.drawElements++;
|
|
77505
77637
|
}
|
|
77506
77638
|
|
|
77507
77639
|
_allocate() {
|
|
77508
|
-
|
|
77509
77640
|
const scene = this._scene;
|
|
77510
77641
|
const gl = scene.canvas.gl;
|
|
77511
|
-
|
|
77512
77642
|
this._program = new Program(gl, this._buildShader());
|
|
77513
|
-
|
|
77514
77643
|
if (this._program.errors) {
|
|
77515
77644
|
this.errors = this._program.errors;
|
|
77516
77645
|
return;
|
|
77517
77646
|
}
|
|
77518
|
-
|
|
77519
77647
|
const program = this._program;
|
|
77520
|
-
|
|
77521
77648
|
this._uRenderPass = program.getLocation("renderPass");
|
|
77522
|
-
this.
|
|
77523
|
-
this._uWorldMatrix = program.getLocation("
|
|
77649
|
+
this._uPickInvisible = program.getLocation("pickInvisible");
|
|
77650
|
+
this._uWorldMatrix = program.getLocation("sceneModelWorldMatrix");
|
|
77524
77651
|
this._uViewMatrix = program.getLocation("viewMatrix");
|
|
77525
77652
|
this._uProjMatrix = program.getLocation("projMatrix");
|
|
77526
77653
|
this._uSectionPlanes = [];
|
|
77527
|
-
|
|
77528
77654
|
for (let i = 0, len = scene._sectionPlanesState.sectionPlanes.length; i < len; i++) {
|
|
77529
77655
|
this._uSectionPlanes.push({
|
|
77530
77656
|
active: program.getLocation("sectionPlaneActive" + i),
|
|
@@ -77532,32 +77658,30 @@ class TrianglesDataTextureOcclusionRenderer {
|
|
|
77532
77658
|
dir: program.getLocation("sectionPlaneDir" + i)
|
|
77533
77659
|
});
|
|
77534
77660
|
}
|
|
77535
|
-
|
|
77536
|
-
this.
|
|
77537
|
-
this._aOffset = program.getAttribute("offset");
|
|
77538
|
-
this._aColor = program.getAttribute("color");
|
|
77539
|
-
this._aFlags = program.getAttribute("flags");
|
|
77540
|
-
this._aFlags2 = program.getAttribute("flags2");
|
|
77541
|
-
|
|
77661
|
+
this._uPickZNear = program.getLocation("pickZNear");
|
|
77662
|
+
this._uPickZFar = program.getLocation("pickZFar");
|
|
77542
77663
|
if (scene.logarithmicDepthBufferEnabled) {
|
|
77543
77664
|
this._uLogDepthBufFC = program.getLocation("logDepthBufFC");
|
|
77544
77665
|
}
|
|
77666
|
+
this._uTexturePerObjectIdPositionsDecodeMatrix = "uTexturePerObjectIdPositionsDecodeMatrix";
|
|
77667
|
+
this._uTexturePerObjectIdColorsAndFlags = "uTexturePerObjectIdColorsAndFlags";
|
|
77668
|
+
this._uTexturePerVertexIdCoordinates = "uTexturePerVertexIdCoordinates";
|
|
77669
|
+
this._uTexturePerPolygonIdNormals = "uTexturePerPolygonIdNormals";
|
|
77670
|
+
this._uTexturePerPolygonIdIndices = "uTexturePerPolygonIdIndices";
|
|
77671
|
+
this._uTexturePerPolygonIdPortionIds = "uTexturePerPolygonIdPortionIds";
|
|
77672
|
+
this._uTextureCameraMatrices = "uTextureCameraMatrices";
|
|
77673
|
+
this._uTextureModelMatrices = "uTextureModelMatrices";
|
|
77674
|
+
this._uTexturePerObjectIdOffsets = "uTexturePerObjectIdOffsets";
|
|
77675
|
+
this._uCameraEyeRtc = program.getLocation("uCameraEyeRtc");
|
|
77545
77676
|
}
|
|
77546
77677
|
|
|
77547
77678
|
_bindProgram() {
|
|
77548
77679
|
|
|
77549
77680
|
const scene = this._scene;
|
|
77550
|
-
|
|
77551
|
-
|
|
77681
|
+
scene.canvas.gl;
|
|
77682
|
+
scene.camera.project;
|
|
77552
77683
|
|
|
77553
77684
|
this._program.bind();
|
|
77554
|
-
|
|
77555
|
-
gl.uniformMatrix4fv(this._uProjMatrix, false, project.matrix);
|
|
77556
|
-
|
|
77557
|
-
if (scene.logarithmicDepthBufferEnabled) {
|
|
77558
|
-
const logDepthBufFC = 2.0 / (Math.log(project.far + 1.0) / Math.LN2);
|
|
77559
|
-
gl.uniform1f(this._uLogDepthBufFC, logDepthBufFC);
|
|
77560
|
-
}
|
|
77561
77685
|
}
|
|
77562
77686
|
|
|
77563
77687
|
_buildShader() {
|
|
@@ -77573,35 +77697,64 @@ class TrianglesDataTextureOcclusionRenderer {
|
|
|
77573
77697
|
const src = [];
|
|
77574
77698
|
src.push("#version 300 es");
|
|
77575
77699
|
src.push("// TrianglesDataTextureColorRenderer vertex shader");
|
|
77700
|
+
|
|
77701
|
+
src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");
|
|
77702
|
+
src.push("precision highp float;");
|
|
77703
|
+
src.push("precision highp int;");
|
|
77704
|
+
src.push("precision highp usampler2D;");
|
|
77705
|
+
src.push("precision highp isampler2D;");
|
|
77706
|
+
src.push("precision highp sampler2D;");
|
|
77707
|
+
src.push("#else");
|
|
77708
|
+
src.push("precision mediump float;");
|
|
77709
|
+
src.push("precision mediump int;");
|
|
77710
|
+
src.push("precision mediump usampler2D;");
|
|
77711
|
+
src.push("precision mediump isampler2D;");
|
|
77712
|
+
src.push("precision mediump sampler2D;");
|
|
77713
|
+
src.push("#endif");
|
|
77714
|
+
|
|
77576
77715
|
src.push("uniform int renderPass;");
|
|
77577
|
-
|
|
77716
|
+
|
|
77578
77717
|
if (scene.entityOffsetsEnabled) {
|
|
77579
|
-
src.push("
|
|
77718
|
+
src.push("in vec3 offset;");
|
|
77580
77719
|
}
|
|
77581
|
-
src.push("attribute vec4 color;");
|
|
77582
|
-
src.push("attribute vec4 flags;");
|
|
77583
|
-
src.push("attribute vec4 flags2;");
|
|
77584
77720
|
|
|
77585
|
-
src.push("uniform mat4
|
|
77721
|
+
src.push("uniform mat4 sceneModelWorldMatrix;");
|
|
77586
77722
|
src.push("uniform mat4 viewMatrix;");
|
|
77587
77723
|
src.push("uniform mat4 projMatrix;");
|
|
77588
|
-
|
|
77589
|
-
|
|
77590
|
-
|
|
77591
|
-
|
|
77592
|
-
|
|
77593
|
-
|
|
77594
|
-
|
|
77595
|
-
|
|
77596
|
-
|
|
77597
|
-
|
|
77598
|
-
|
|
77724
|
+
|
|
77725
|
+
src.push("uniform highp sampler2D uTexturePerObjectIdPositionsDecodeMatrix;");
|
|
77726
|
+
src.push("uniform lowp usampler2D uTexturePerObjectIdColorsAndFlags;");
|
|
77727
|
+
src.push("uniform highp sampler2D uTexturePerObjectIdOffsets;");
|
|
77728
|
+
src.push("uniform mediump usampler2D uTexturePerVertexIdCoordinates;");
|
|
77729
|
+
src.push("uniform highp usampler2D uTexturePerPolygonIdIndices;");
|
|
77730
|
+
src.push("uniform mediump usampler2D uTexturePerPolygonIdPortionIds;");
|
|
77731
|
+
src.push("uniform highp sampler2D uTextureModelMatrices;");
|
|
77732
|
+
src.push("uniform vec3 uCameraEyeRtc;");
|
|
77733
|
+
|
|
77734
|
+
src.push("vec3 positions[3];");
|
|
77735
|
+
src.push("bool isPerspectiveMatrix(mat4 m) {");
|
|
77736
|
+
src.push(" return (m[2][3] == - 1.0);");
|
|
77737
|
+
src.push("}");
|
|
77599
77738
|
if (clipping) {
|
|
77600
77739
|
src.push("out vec4 vWorldPosition;");
|
|
77601
77740
|
src.push("out vec4 vFlags2;");
|
|
77602
77741
|
}
|
|
77603
77742
|
src.push("void main(void) {");
|
|
77604
77743
|
|
|
77744
|
+
// constants
|
|
77745
|
+
src.push("int polygonIndex = gl_VertexID / 3;");
|
|
77746
|
+
|
|
77747
|
+
// get packed object-id
|
|
77748
|
+
src.push("int h_packed_object_id_index = (polygonIndex >> 3) & 4095;");
|
|
77749
|
+
src.push("int v_packed_object_id_index = (polygonIndex >> 3) >> 12;");
|
|
77750
|
+
|
|
77751
|
+
src.push("int objectIndex = int(texelFetch(uTexturePerPolygonIdPortionIds, ivec2(h_packed_object_id_index, v_packed_object_id_index), 0).r);");
|
|
77752
|
+
src.push("ivec2 objectIndexCoords = ivec2(objectIndex % 512, objectIndex / 512);");
|
|
77753
|
+
|
|
77754
|
+
// get flags & flags2
|
|
77755
|
+
src.push("uvec4 flags = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+2, objectIndexCoords.y), 0);");
|
|
77756
|
+
src.push("uvec4 flags2 = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+3, objectIndexCoords.y), 0);");
|
|
77757
|
+
|
|
77605
77758
|
// flags.x = NOT_RENDERED | COLOR_OPAQUE | COLOR_TRANSPARENT
|
|
77606
77759
|
// renderPass = COLOR_OPAQUE
|
|
77607
77760
|
// Only opaque objects can be occluders
|
|
@@ -77610,20 +77763,75 @@ class TrianglesDataTextureOcclusionRenderer {
|
|
|
77610
77763
|
src.push(" gl_Position = vec4(0.0, 0.0, 0.0, 0.0);"); // Cull vertex
|
|
77611
77764
|
|
|
77612
77765
|
src.push(" } else {");
|
|
77613
|
-
|
|
77614
|
-
|
|
77615
|
-
src.push(" worldPosition.xyz = worldPosition.xyz + offset;");
|
|
77616
|
-
}
|
|
77766
|
+
// model matrices
|
|
77767
|
+
src.push ("mat4 worldMatrix = sceneModelWorldMatrix * mat4 (texelFetch (uTextureModelMatrices, ivec2(0, 0), 0), texelFetch (uTextureModelMatrices, ivec2(1, 0), 0), texelFetch (uTextureModelMatrices, ivec2(2, 0), 0), texelFetch (uTextureModelMatrices, ivec2(3, 0), 0));");
|
|
77617
77768
|
|
|
77618
|
-
|
|
77769
|
+
// get vertex base
|
|
77770
|
+
src.push("ivec4 packedVertexBase = ivec4(texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+4, objectIndexCoords.y), 0));");
|
|
77771
|
+
|
|
77772
|
+
src.push("ivec4 packedIndexBaseOffset = ivec4(texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+5, objectIndexCoords.y), 0));");
|
|
77773
|
+
|
|
77774
|
+
src.push("int indexBaseOffset = (packedIndexBaseOffset.r << 24) + (packedIndexBaseOffset.g << 16) + (packedIndexBaseOffset.b << 8) + packedIndexBaseOffset.a;");
|
|
77775
|
+
|
|
77776
|
+
src.push("int h_index = (polygonIndex - indexBaseOffset) & 4095;");
|
|
77777
|
+
src.push("int v_index = (polygonIndex - indexBaseOffset) >> 12;");
|
|
77778
|
+
|
|
77779
|
+
src.push("ivec3 vertexIndices = ivec3(texelFetch(uTexturePerPolygonIdIndices, ivec2(h_index, v_index), 0));");
|
|
77780
|
+
src.push("ivec3 uniqueVertexIndexes = vertexIndices + (packedVertexBase.r << 24) + (packedVertexBase.g << 16) + (packedVertexBase.b << 8) + packedVertexBase.a;");
|
|
77781
|
+
|
|
77782
|
+
src.push("ivec3 indexPositionH = uniqueVertexIndexes & 4095;");
|
|
77783
|
+
src.push("ivec3 indexPositionV = uniqueVertexIndexes >> 12;");
|
|
77784
|
+
|
|
77785
|
+
src.push("mat4 positionsDecodeMatrix = mat4 (texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*4+0, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*4+1, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*4+2, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*4+3, objectIndexCoords.y), 0));");
|
|
77786
|
+
|
|
77787
|
+
src.push("uint solid = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+7, objectIndexCoords.y), 0).r;");
|
|
77788
|
+
|
|
77789
|
+
// get position
|
|
77790
|
+
src.push("positions[0] = vec3(texelFetch(uTexturePerVertexIdCoordinates, ivec2(indexPositionH.r, indexPositionV.r), 0));");
|
|
77791
|
+
src.push("positions[1] = vec3(texelFetch(uTexturePerVertexIdCoordinates, ivec2(indexPositionH.g, indexPositionV.g), 0));");
|
|
77792
|
+
src.push("positions[2] = vec3(texelFetch(uTexturePerVertexIdCoordinates, ivec2(indexPositionH.b, indexPositionV.b), 0));");
|
|
77793
|
+
|
|
77794
|
+
// get color
|
|
77795
|
+
src.push("uvec4 color = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+0, objectIndexCoords.y), 0);");
|
|
77796
|
+
|
|
77797
|
+
src.push(`if (color.a == 0u) {`);
|
|
77798
|
+
src.push(" gl_Position = vec4(3.0, 3.0, 3.0, 1.0);"); // Cull vertex
|
|
77799
|
+
src.push(" return;");
|
|
77800
|
+
src.push("};");
|
|
77801
|
+
|
|
77802
|
+
src.push("vec3 normal = normalize(cross(positions[2] - positions[0], positions[1] - positions[0]));");
|
|
77803
|
+
src.push("vec3 position;");
|
|
77804
|
+
src.push("position = positions[gl_VertexID % 3];");
|
|
77805
|
+
|
|
77806
|
+
// when the geometry is not solid, if needed, flip the triangle winding
|
|
77807
|
+
src.push("if (solid != 1u) {");
|
|
77808
|
+
src.push(" if (isPerspectiveMatrix(projMatrix)) {");
|
|
77809
|
+
src.push(" vec3 uCameraEyeRtcInQuantizedSpace = (inverse(worldMatrix * positionsDecodeMatrix) * vec4(uCameraEyeRtc, 1)).xyz;");
|
|
77810
|
+
src.push(" if (dot(position.xyz - uCameraEyeRtcInQuantizedSpace, normal) < 0.0) {");
|
|
77811
|
+
src.push(" position = positions[2 - (gl_VertexID % 3)];");
|
|
77812
|
+
src.push(" }");
|
|
77813
|
+
src.push(" } else {");
|
|
77814
|
+
src.push(" vec3 viewNormal = -normalize((transpose(inverse(viewMatrix*positionsDecodeMatrix)) * vec4(normal,1)).xyz);");
|
|
77815
|
+
src.push(" if (viewNormal.z < 0.0) {");
|
|
77816
|
+
src.push(" position = positions[2 - (gl_VertexID % 3)];");
|
|
77817
|
+
src.push(" }");
|
|
77818
|
+
src.push(" }");
|
|
77819
|
+
src.push("}");
|
|
77820
|
+
|
|
77821
|
+
src.push("vec4 worldPosition = worldMatrix * (positionsDecodeMatrix * vec4(position, 1.0)); ");
|
|
77822
|
+
|
|
77823
|
+
// get XYZ offset
|
|
77824
|
+
src.push("vec4 offset = vec4(texelFetch (uTexturePerObjectIdOffsets, objectIndexCoords, 0).rgb, 0.0);");
|
|
77825
|
+
src.push("worldPosition.xyz = worldPosition.xyz + offset.xyz;");
|
|
77826
|
+
src.push("vec4 viewPosition = viewMatrix * worldPosition; ");
|
|
77619
77827
|
if (clipping) {
|
|
77620
77828
|
src.push(" vWorldPosition = worldPosition;");
|
|
77621
77829
|
src.push(" vFlags2 = flags2;");
|
|
77622
77830
|
}
|
|
77623
77831
|
src.push("vec4 clipPos = projMatrix * viewPosition;");
|
|
77624
|
-
if (
|
|
77625
|
-
src.push("
|
|
77626
|
-
src.push("
|
|
77832
|
+
if (clipping) {
|
|
77833
|
+
src.push("vWorldPosition = worldPosition;");
|
|
77834
|
+
src.push("vFlags2 = flags2.r;");
|
|
77627
77835
|
}
|
|
77628
77836
|
src.push("gl_Position = clipPos;");
|
|
77629
77837
|
src.push(" }");
|
|
@@ -77645,11 +77853,6 @@ class TrianglesDataTextureOcclusionRenderer {
|
|
|
77645
77853
|
src.push("precision mediump float;");
|
|
77646
77854
|
src.push("precision mediump int;");
|
|
77647
77855
|
src.push("#endif");
|
|
77648
|
-
if (scene.logarithmicDepthBufferEnabled) {
|
|
77649
|
-
src.push("in float isPerspective;");
|
|
77650
|
-
src.push("uniform float logDepthBufFC;");
|
|
77651
|
-
src.push("in float vFragDepth;");
|
|
77652
|
-
}
|
|
77653
77856
|
if (clipping) {
|
|
77654
77857
|
src.push("in vec4 vWorldPosition;");
|
|
77655
77858
|
src.push("in vec4 vFlags2;");
|
|
@@ -77659,6 +77862,7 @@ class TrianglesDataTextureOcclusionRenderer {
|
|
|
77659
77862
|
src.push("uniform vec3 sectionPlaneDir" + i + ";");
|
|
77660
77863
|
}
|
|
77661
77864
|
}
|
|
77865
|
+
src.push("out vec4 outColor;");
|
|
77662
77866
|
src.push("void main(void) {");
|
|
77663
77867
|
if (clipping) {
|
|
77664
77868
|
src.push(" bool clippable = (float(vFlags2.x) > 0.0);");
|
|
@@ -77672,10 +77876,7 @@ class TrianglesDataTextureOcclusionRenderer {
|
|
|
77672
77876
|
src.push(" if (dist > 0.0) { discard; }");
|
|
77673
77877
|
src.push(" }");
|
|
77674
77878
|
}
|
|
77675
|
-
|
|
77676
|
-
src.push(" gl_FragDepthEXT = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
77677
|
-
}
|
|
77678
|
-
src.push(" gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0); "); // Occluders are blue
|
|
77879
|
+
src.push(" outColor = vec4(0.0, 0.0, 1.0, 1.0); "); // Occluders are blue
|
|
77679
77880
|
src.push("}");
|
|
77680
77881
|
return src;
|
|
77681
77882
|
}
|
|
@@ -86146,7 +86347,7 @@ class PickController {
|
|
|
86146
86347
|
this.snapPickResult = snapPickResult;
|
|
86147
86348
|
this.snappedOrPicked = true;
|
|
86148
86349
|
this._needFireEvents = true;
|
|
86149
|
-
}else {
|
|
86350
|
+
} else {
|
|
86150
86351
|
this.schedulePickSurface = true; // Fallback
|
|
86151
86352
|
this.snapPickResult = null;
|
|
86152
86353
|
}
|
|
@@ -86200,7 +86401,7 @@ class PickController {
|
|
|
86200
86401
|
this.pickedSurface = true;
|
|
86201
86402
|
}
|
|
86202
86403
|
this._needFireEvents = true;
|
|
86203
|
-
}else
|
|
86404
|
+
} else if (this.scheduleSnapOrPick) {
|
|
86204
86405
|
this.hoveredSnappedOrSurfaceOff = true;
|
|
86205
86406
|
this._needFireEvents = true;
|
|
86206
86407
|
}
|
|
@@ -86240,6 +86441,11 @@ class PickController {
|
|
|
86240
86441
|
const pickResult = new PickResult();
|
|
86241
86442
|
pickResult.worldPos = this.snapPickResult.snappedWorldPos;
|
|
86242
86443
|
pickResult.canvasPos = this.snapPickResult.snappedCanvasPos;
|
|
86444
|
+
if (this._configs.snapMode === "vertex") {
|
|
86445
|
+
pickResult.snappedToVertex = true;
|
|
86446
|
+
} else {
|
|
86447
|
+
pickResult.snappedToEdge = true;
|
|
86448
|
+
}
|
|
86243
86449
|
this._cameraControl.fire("hoverSnapOrSurface", pickResult, true);
|
|
86244
86450
|
this.snapPickResult = null;
|
|
86245
86451
|
} else {
|
|
@@ -90354,7 +90560,7 @@ class MetaModel {
|
|
|
90354
90560
|
* @property metaObjects
|
|
90355
90561
|
* @type {MetaObject[]}
|
|
90356
90562
|
*/
|
|
90357
|
-
this.metaObjects=[];
|
|
90563
|
+
this.metaObjects = [];
|
|
90358
90564
|
|
|
90359
90565
|
/**
|
|
90360
90566
|
* Connectivity graph.
|
|
@@ -90375,7 +90581,7 @@ class MetaModel {
|
|
|
90375
90581
|
* Load metamodel data into this MetaModel.
|
|
90376
90582
|
* @param metaModelData
|
|
90377
90583
|
*/
|
|
90378
|
-
loadData(metaModelData, options={}) {
|
|
90584
|
+
loadData(metaModelData, options = {}) {
|
|
90379
90585
|
|
|
90380
90586
|
if (this.finalized) {
|
|
90381
90587
|
throw "MetaScene already finalized - can't add more data";
|
|
@@ -90491,13 +90697,26 @@ class MetaModel {
|
|
|
90491
90697
|
this.metaScene.fire("metaModelCreated", this.id);
|
|
90492
90698
|
}
|
|
90493
90699
|
|
|
90700
|
+
/**
|
|
90701
|
+
* Gets this MetaModel as JSON.
|
|
90702
|
+
* @returns {{schema: (String|string|*), createdAt: (String|string|*), metaObjects: *[], author: (String|string|*), id: (String|Number|string|number|*), creatingApplication: (String|string|*), projectId: (String|Number|string|number|*), propertySets: *[]}}
|
|
90703
|
+
*/
|
|
90494
90704
|
getJSON() {
|
|
90495
|
-
|
|
90496
|
-
|
|
90497
|
-
|
|
90498
|
-
|
|
90705
|
+
const json = {
|
|
90706
|
+
id: this.id,
|
|
90707
|
+
projectId: this.projectId,
|
|
90708
|
+
author: this.author,
|
|
90709
|
+
createdAt: this.createdAt,
|
|
90710
|
+
schema: this.schema,
|
|
90711
|
+
creatingApplication: this.creatingApplication,
|
|
90712
|
+
metaObjects: [],
|
|
90713
|
+
propertySets: []
|
|
90714
|
+
};
|
|
90715
|
+
for (let i = 0, len = this.metaObjects.length; i < len; i++) {
|
|
90716
|
+
const metaObject = this.metaObjects[i];
|
|
90499
90717
|
const metaObjectCfg = {
|
|
90500
90718
|
id: metaObject.id,
|
|
90719
|
+
originalSystemId: metaObject.originalSystemId,
|
|
90501
90720
|
extId: metaObject.extId,
|
|
90502
90721
|
type: metaObject.type,
|
|
90503
90722
|
name: metaObject.name
|
|
@@ -90505,23 +90724,38 @@ class MetaModel {
|
|
|
90505
90724
|
if (metaObject.parent) {
|
|
90506
90725
|
metaObjectCfg.parent = metaObject.parent.id;
|
|
90507
90726
|
}
|
|
90508
|
-
|
|
90509
|
-
|
|
90510
|
-
|
|
90511
|
-
|
|
90512
|
-
|
|
90513
|
-
|
|
90727
|
+
if (metaObject.attributes) {
|
|
90728
|
+
metaObjectCfg.attributes = metaObject.attributes;
|
|
90729
|
+
}
|
|
90730
|
+
if (metaObject.propertySetIds) {
|
|
90731
|
+
metaObjectCfg.propertySetIds = metaObject.propertySetIds;
|
|
90732
|
+
}
|
|
90733
|
+
json.metaObjects.push(metaObjectCfg);
|
|
90734
|
+
}
|
|
90735
|
+
for (let i = 0, len = this.propertySets.length; i < len; i++) {
|
|
90736
|
+
const propertySet = this.propertySets[i];
|
|
90737
|
+
const propertySetCfg = {
|
|
90738
|
+
id: propertySet.id,
|
|
90739
|
+
originalSystemId: propertySet.originalSystemId,
|
|
90740
|
+
extId: propertySet.extId,
|
|
90741
|
+
type: propertySet.type,
|
|
90742
|
+
name: propertySet.name,
|
|
90743
|
+
propertyies: []
|
|
90744
|
+
};
|
|
90745
|
+
for (let j = 0, lenj = propertySet.properties.length; j < lenj; j++) {
|
|
90746
|
+
const property = propertySet.properties[j];
|
|
90747
|
+
const propertyCfg = {
|
|
90748
|
+
id: property.id,
|
|
90749
|
+
description: property.description,
|
|
90750
|
+
type: property.type,
|
|
90751
|
+
name: property.name,
|
|
90752
|
+
value: property.value,
|
|
90753
|
+
valueType: property.valueType
|
|
90754
|
+
};
|
|
90755
|
+
propertySetCfg.properties.push(propertyCfg);
|
|
90514
90756
|
}
|
|
90757
|
+
json.propertySets.push(propertySetCfg);
|
|
90515
90758
|
}
|
|
90516
|
-
|
|
90517
|
-
visit(this.rootMetaObject);
|
|
90518
|
-
|
|
90519
|
-
const json = {
|
|
90520
|
-
id: this.id,
|
|
90521
|
-
projectId: this.projectId,
|
|
90522
|
-
revisionId: this.revisionId,
|
|
90523
|
-
metaObjects: metaObjects
|
|
90524
|
-
};
|
|
90525
90759
|
return json;
|
|
90526
90760
|
}
|
|
90527
90761
|
|
|
@@ -99468,8 +99702,15 @@ class DistanceMeasurementsControl extends Component {
|
|
|
99468
99702
|
this.markerDiv.style.marginLeft = `${event.canvasPos[0] - 5}px`;
|
|
99469
99703
|
this.markerDiv.style.marginTop = `${event.canvasPos[1] - 5}px`;
|
|
99470
99704
|
this.markerDiv.style.background = "pink";
|
|
99471
|
-
|
|
99472
|
-
|
|
99705
|
+
if (event.snappedToVertex || event.snappedToEdge) {
|
|
99706
|
+
this.markerDiv.style.background = "greenyellow";
|
|
99707
|
+
this.markerDiv.style.border ="2px solid green";
|
|
99708
|
+
} else {
|
|
99709
|
+
this.markerDiv.style.background = "pink";
|
|
99710
|
+
this.markerDiv.style.border = "2px solid red";
|
|
99711
|
+
}
|
|
99712
|
+
|
|
99713
|
+
} else {
|
|
99473
99714
|
this.markerDiv.style.marginLeft = `-10000px`;
|
|
99474
99715
|
this.markerDiv.style.marginTop = `-10000px`;
|
|
99475
99716
|
}
|
|
@@ -99482,6 +99723,8 @@ class DistanceMeasurementsControl extends Component {
|
|
|
99482
99723
|
this._currentDistanceMeasurementByMouse.zAxisVisible = this._currentDistanceMeasurementByMouseInittouchState.zAxisVisible && this.plugin.defaultZAxisVisible;
|
|
99483
99724
|
this._currentDistanceMeasurementByMouse.targetVisible = this._currentDistanceMeasurementByMouseInittouchState.targetVisible;
|
|
99484
99725
|
this._currentDistanceMeasurementByMouse.target.worldPos = mouseWorldPos;
|
|
99726
|
+
this.markerDiv.style.marginLeft = `-10000px`;
|
|
99727
|
+
this.markerDiv.style.marginTop = `-10000px`;
|
|
99485
99728
|
}
|
|
99486
99729
|
});
|
|
99487
99730
|
|
|
@@ -188568,6 +188811,181 @@ const LASLoader = {
|
|
|
188568
188811
|
options: DEFAULT_LAS_OPTIONS
|
|
188569
188812
|
};
|
|
188570
188813
|
|
|
188814
|
+
//import * as epsgCheck from 'epsg-index/all.json';
|
|
188815
|
+
|
|
188816
|
+
const headerBlockItems = [
|
|
188817
|
+
{item: 'FileSignature', format: 'char', size: 4},
|
|
188818
|
+
{item: 'FileSoureceID', format: 'uShort', size: 2},
|
|
188819
|
+
{item: 'GlobalEncoding', format: 'uShort', size: 2},
|
|
188820
|
+
{item: 'ProjectID1', format: 'notUsed', size: 4},
|
|
188821
|
+
{item: 'ProjectID2', format: 'notUsed', size: 2},
|
|
188822
|
+
{item: 'ProjectID3', format: 'notUsed', size: 2},
|
|
188823
|
+
{item: 'ProjectID4', format: 'notUsed', size: 8},
|
|
188824
|
+
{item: 'VersionMajor', format: 'uChar', size: 1},
|
|
188825
|
+
{item: 'VersionMinor', format: 'uChar', size: 1},
|
|
188826
|
+
{item: 'SystemIdentifier', format: 'char', size: 32},
|
|
188827
|
+
{item: 'GeneratingSoftware', format: 'char', size: 32},
|
|
188828
|
+
{item: 'CreationDay', format: 'uShort', size: 2},
|
|
188829
|
+
{item: 'CreationYear', format: 'uShort', size: 2},
|
|
188830
|
+
{item: 'HeaderSize', format: 'uShort', size: 2},
|
|
188831
|
+
{item: 'OffsetToPointData', format: 'uLong', size: 4},
|
|
188832
|
+
{item: 'NumberOfVariableLengthRecords', format: 'uLong', size: 4},
|
|
188833
|
+
{item: 'PointDataFormatID', format: 'uChar', size: 1},
|
|
188834
|
+
{item: 'PointDataRecordLength', format: 'uShort', size: 2},
|
|
188835
|
+
{item: 'NumberOfPoints', format: 'uLong', size: 4},
|
|
188836
|
+
{item: 'NumberOfPointByReturn', format: 'uLong', size: 20},
|
|
188837
|
+
{item: 'ScaleFactorX', format: 'double', size: 8},
|
|
188838
|
+
{item: 'ScaleFactorY', format: 'double', size: 8},
|
|
188839
|
+
{item: 'ScaleFactorZ', format: 'double', size: 8},
|
|
188840
|
+
{item: 'OffsetX', format: 'double', size: 8},
|
|
188841
|
+
{item: 'OffsetY', format: 'double', size: 8},
|
|
188842
|
+
{item: 'OffsetZ', format: 'double', size: 8},
|
|
188843
|
+
{item: 'MaxX', format: 'double', size: 8},
|
|
188844
|
+
{item: 'MinX', format: 'double', size: 8},
|
|
188845
|
+
{item: 'MaxY', format: 'double', size: 8},
|
|
188846
|
+
{item: 'MinY', format: 'double', size: 8},
|
|
188847
|
+
{item: 'MaxZ', format: 'double', size: 8},
|
|
188848
|
+
{item: 'MinZ', format: 'double', size: 8},
|
|
188849
|
+
];
|
|
188850
|
+
|
|
188851
|
+
const variableLengthRecord = [
|
|
188852
|
+
{item: 'Reserved', format: 'uShort', size: 2},
|
|
188853
|
+
{item: 'UserId', format: 'char', size: 16},
|
|
188854
|
+
{item: 'RecordId', format: 'uShort', size: 2},
|
|
188855
|
+
{item: 'RecordLengthAfterHeader', format: 'uShort', size: 2},
|
|
188856
|
+
{item: 'Description', format: 'char', size: 32},
|
|
188857
|
+
];
|
|
188858
|
+
|
|
188859
|
+
/**
|
|
188860
|
+
* @private
|
|
188861
|
+
* @param arrayBuffer
|
|
188862
|
+
* @returns {{}}
|
|
188863
|
+
*/
|
|
188864
|
+
const loadLASHeader = (arrayBuffer) => {
|
|
188865
|
+
|
|
188866
|
+
let currentByte = 0;
|
|
188867
|
+
let numOfVarLenRecords = 0;
|
|
188868
|
+
let projectionStart = 0;
|
|
188869
|
+
|
|
188870
|
+
const dataView = new DataView(arrayBuffer);
|
|
188871
|
+
const buffer = new Uint8Array(6000);
|
|
188872
|
+
|
|
188873
|
+
const getGeoKeys = (geoRecord) => {
|
|
188874
|
+
if (geoRecord === undefined) {
|
|
188875
|
+
return undefined;
|
|
188876
|
+
}
|
|
188877
|
+
const projectionEnd = projectionStart + geoRecord["RecordLengthAfterHeader"];
|
|
188878
|
+
const geoTag = buffer.slice(projectionStart, projectionEnd);
|
|
188879
|
+
const arrayBuffer = bufferFlipper(geoTag);
|
|
188880
|
+
const dataView = new DataView(arrayBuffer);
|
|
188881
|
+
let byteCount = 6;
|
|
188882
|
+
let numberOfKeys = Number(dataView.getUint16(byteCount, true));
|
|
188883
|
+
const geoKeys = [];
|
|
188884
|
+
while (numberOfKeys--) {
|
|
188885
|
+
const keyTmp = {};
|
|
188886
|
+
keyTmp.key = dataView.getUint16(byteCount += 2, true);
|
|
188887
|
+
keyTmp.tiffTagLocation = dataView.getUint16(byteCount += 2, true);
|
|
188888
|
+
keyTmp.count = dataView.getUint16(byteCount += 2, true);
|
|
188889
|
+
keyTmp.valueOffset = dataView.getUint16(byteCount += 2, true);
|
|
188890
|
+
geoKeys.push(keyTmp);
|
|
188891
|
+
}
|
|
188892
|
+
const projRecord = geoKeys.find(x => x.key === 3072);
|
|
188893
|
+
if (projRecord && projRecord.hasOwnProperty('valueOffset')) {
|
|
188894
|
+
const epsg = projRecord.valueOffset;
|
|
188895
|
+
{
|
|
188896
|
+
return epsg;
|
|
188897
|
+
}
|
|
188898
|
+
}
|
|
188899
|
+
return undefined;
|
|
188900
|
+
};
|
|
188901
|
+
|
|
188902
|
+
const getValue = ({item, format, size}) => {
|
|
188903
|
+
let str, array;
|
|
188904
|
+
switch (format) {
|
|
188905
|
+
case 'char':
|
|
188906
|
+
array = new Uint8Array(arrayBuffer, currentByte, size);
|
|
188907
|
+
currentByte += size;
|
|
188908
|
+
str = uint8arrayToString(array);
|
|
188909
|
+
return [item, str];
|
|
188910
|
+
case 'uShort':
|
|
188911
|
+
str = dataView.getUint16(currentByte, true);
|
|
188912
|
+
currentByte += size;
|
|
188913
|
+
return [item, str];
|
|
188914
|
+
case 'uLong':
|
|
188915
|
+
str = dataView.getUint32(currentByte, true);
|
|
188916
|
+
if (item === 'NumberOfVariableLengthRecords') {
|
|
188917
|
+
numOfVarLenRecords = str;
|
|
188918
|
+
}
|
|
188919
|
+
currentByte += size;
|
|
188920
|
+
return [item, str];
|
|
188921
|
+
case 'uChar':
|
|
188922
|
+
str = dataView.getUint8(currentByte);
|
|
188923
|
+
currentByte += size;
|
|
188924
|
+
return [item, str];
|
|
188925
|
+
case 'double':
|
|
188926
|
+
str = dataView.getFloat64(currentByte, true);
|
|
188927
|
+
currentByte += size;
|
|
188928
|
+
return [item, str];
|
|
188929
|
+
default:
|
|
188930
|
+
currentByte += size;
|
|
188931
|
+
}
|
|
188932
|
+
};
|
|
188933
|
+
|
|
188934
|
+
const getValues = () => {
|
|
188935
|
+
const publicHeaderBlock = {};
|
|
188936
|
+
headerBlockItems.forEach((obj) => {
|
|
188937
|
+
const myObj = getValue({...obj});
|
|
188938
|
+
if (myObj !== undefined) {
|
|
188939
|
+
if (myObj[0] === 'FileSignature' && myObj[1] !== 'LASF') {
|
|
188940
|
+
throw new Error('Ivalid FileSignature. Is this a LAS/LAZ file');
|
|
188941
|
+
}
|
|
188942
|
+
publicHeaderBlock[myObj[0]] = myObj[1];
|
|
188943
|
+
}
|
|
188944
|
+
});
|
|
188945
|
+
const variableRecords = [];
|
|
188946
|
+
let variableLengthRecords = numOfVarLenRecords;
|
|
188947
|
+
while (variableLengthRecords--) {
|
|
188948
|
+
const variableObj = {};
|
|
188949
|
+
variableLengthRecord.forEach((obj) => {
|
|
188950
|
+
const myObj = getValue({...obj});
|
|
188951
|
+
variableObj[myObj[0]] = myObj[1];
|
|
188952
|
+
if (myObj[0] === 'UserId' && myObj[1] === 'LASF_Projection') {
|
|
188953
|
+
projectionStart = currentByte - 18 + 54;
|
|
188954
|
+
}
|
|
188955
|
+
});
|
|
188956
|
+
variableRecords.push(variableObj);
|
|
188957
|
+
}
|
|
188958
|
+
const geoRecord = variableRecords.find(x => x.UserId === 'LASF_Projection');
|
|
188959
|
+
const epsg = getGeoKeys(geoRecord);
|
|
188960
|
+
if (epsg) {
|
|
188961
|
+
publicHeaderBlock['epsg'] = epsg;
|
|
188962
|
+
}
|
|
188963
|
+
return publicHeaderBlock;
|
|
188964
|
+
};
|
|
188965
|
+
|
|
188966
|
+
return getValues();
|
|
188967
|
+
};
|
|
188968
|
+
|
|
188969
|
+
const bufferFlipper = (buf) => {
|
|
188970
|
+
let ab = new ArrayBuffer(buf.length);
|
|
188971
|
+
let view = new Uint8Array(ab);
|
|
188972
|
+
for (let i = 0; i < buf.length; ++i) {
|
|
188973
|
+
view[i] = buf[i];
|
|
188974
|
+
}
|
|
188975
|
+
return ab;
|
|
188976
|
+
};
|
|
188977
|
+
|
|
188978
|
+
const uint8arrayToString = (array) => {
|
|
188979
|
+
let str = '';
|
|
188980
|
+
array.forEach((item) => {
|
|
188981
|
+
let c = String.fromCharCode(item);
|
|
188982
|
+
if (c !== '\u0000') {
|
|
188983
|
+
str += c;
|
|
188984
|
+
}
|
|
188985
|
+
});
|
|
188986
|
+
return str.trim();
|
|
188987
|
+
};
|
|
188988
|
+
|
|
188571
188989
|
/**
|
|
188572
188990
|
* {@link Viewer} plugin that loads lidar point cloud geometry from LAS files.
|
|
188573
188991
|
*
|
|
@@ -188961,6 +189379,9 @@ class LASLoaderPlugin extends Plugin {
|
|
|
188961
189379
|
stats.numVertices = 0;
|
|
188962
189380
|
|
|
188963
189381
|
try {
|
|
189382
|
+
|
|
189383
|
+
const lasHeader = loadLASHeader(arrayBuffer);
|
|
189384
|
+
|
|
188964
189385
|
parse$3(arrayBuffer, LASLoader, options).then((parsedData) => {
|
|
188965
189386
|
|
|
188966
189387
|
const attributes = parsedData.attributes;
|
|
@@ -189035,16 +189456,20 @@ class LASLoaderPlugin extends Plugin {
|
|
|
189035
189456
|
createdAt: "",
|
|
189036
189457
|
schema: "",
|
|
189037
189458
|
creatingApplication: "",
|
|
189038
|
-
metaObjects: [
|
|
189039
|
-
|
|
189040
|
-
|
|
189041
|
-
|
|
189042
|
-
|
|
189043
|
-
|
|
189044
|
-
|
|
189045
|
-
|
|
189046
|
-
|
|
189047
|
-
|
|
189459
|
+
metaObjects: [
|
|
189460
|
+
{
|
|
189461
|
+
id: rootMetaObjectId,
|
|
189462
|
+
name: "Model",
|
|
189463
|
+
type: "Model"
|
|
189464
|
+
},
|
|
189465
|
+
{
|
|
189466
|
+
id: pointsObjectId,
|
|
189467
|
+
name: "PointCloud (LAS)",
|
|
189468
|
+
type: "PointCloud",
|
|
189469
|
+
parent: rootMetaObjectId,
|
|
189470
|
+
attributes: lasHeader || {}
|
|
189471
|
+
}
|
|
189472
|
+
],
|
|
189048
189473
|
propertySets: []
|
|
189049
189474
|
};
|
|
189050
189475
|
const metaModelId = sceneModel.id;
|