@xeokit/xeokit-sdk 2.6.65 → 2.6.66
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 +155 -68
- package/dist/xeokit-sdk.es.js +155 -68
- package/dist/xeokit-sdk.es5.js +82 -58
- package/dist/xeokit-sdk.min.cjs.js +5 -5
- package/dist/xeokit-sdk.min.es.js +5 -5
- package/dist/xeokit-sdk.min.es5.js +4 -4
- package/package.json +1 -1
- package/src/extras/PointerCircle/PointerCircle.js +1 -1
- package/src/plugins/SectionPlanesPlugin/Control.js +11 -12
- package/src/viewer/scene/model/SceneModel.js +1 -0
- package/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesColorRenderer.js +4 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesColorRenderer.js +4 -1
- package/src/viewer/scene/sectionPlane/SectionPlane.js +79 -1
- package/src/viewer/scene/webgl/Renderer.js +9 -3
- package/types/extras/PointerCircle/PointerCircle.d.ts +50 -0
- package/types/extras/PointerCircle/index.d.ts +1 -0
- package/types/plugins/index.d.ts +1 -0
- package/types/plugins/lib/ui/index.d.ts +12 -0
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -1311,7 +1311,7 @@ class PointerLens {
|
|
|
1311
1311
|
let doublePrecision = true;
|
|
1312
1312
|
let FloatArrayType = doublePrecision ? Float64Array : Float32Array;
|
|
1313
1313
|
|
|
1314
|
-
const tempVec3a$
|
|
1314
|
+
const tempVec3a$O = new FloatArrayType(3);
|
|
1315
1315
|
|
|
1316
1316
|
const tempMat1 = new FloatArrayType(16);
|
|
1317
1317
|
const tempMat2 = new FloatArrayType(16);
|
|
@@ -6681,10 +6681,10 @@ math.buildEdgeIndices = (function () {
|
|
|
6681
6681
|
*/
|
|
6682
6682
|
math.planeClipsPositions3 = function (pos, dir, positions, numElementsPerPosition = 3) {
|
|
6683
6683
|
for (let i = 0, len = positions.length; i < len; i += numElementsPerPosition) {
|
|
6684
|
-
tempVec3a$
|
|
6685
|
-
tempVec3a$
|
|
6686
|
-
tempVec3a$
|
|
6687
|
-
let dotProduct = tempVec3a$
|
|
6684
|
+
tempVec3a$O[0] = positions[i + 0] - pos[0];
|
|
6685
|
+
tempVec3a$O[1] = positions[i + 1] - pos[1];
|
|
6686
|
+
tempVec3a$O[2] = positions[i + 2] - pos[2];
|
|
6687
|
+
let dotProduct = tempVec3a$O[0] * dir[0] + tempVec3a$O[1] * dir[1] + tempVec3a$O[2] * dir[2];
|
|
6688
6688
|
if (dotProduct < 0) {
|
|
6689
6689
|
return true;
|
|
6690
6690
|
}
|
|
@@ -8564,8 +8564,8 @@ class Component {
|
|
|
8564
8564
|
}
|
|
8565
8565
|
}
|
|
8566
8566
|
|
|
8567
|
-
const tempVec3a$
|
|
8568
|
-
const tempVec3b$
|
|
8567
|
+
const tempVec3a$N = math.vec3();
|
|
8568
|
+
const tempVec3b$B = math.vec3();
|
|
8569
8569
|
const tempMat4a$s = math.mat4();
|
|
8570
8570
|
|
|
8571
8571
|
/**
|
|
@@ -8642,8 +8642,8 @@ function frustumIntersectsAABB3(frustum, aabb) {
|
|
|
8642
8642
|
|
|
8643
8643
|
let ret = Frustum$1.INSIDE;
|
|
8644
8644
|
|
|
8645
|
-
const min = tempVec3a$
|
|
8646
|
-
const max = tempVec3b$
|
|
8645
|
+
const min = tempVec3a$N;
|
|
8646
|
+
const max = tempVec3b$B;
|
|
8647
8647
|
|
|
8648
8648
|
min[0] = aabb[0];
|
|
8649
8649
|
min[1] = aabb[1];
|
|
@@ -9278,7 +9278,7 @@ class PointerCircle {
|
|
|
9278
9278
|
}
|
|
9279
9279
|
|
|
9280
9280
|
/**
|
|
9281
|
-
* Stop the
|
|
9281
|
+
* Stop the shrinking circle and hide it.
|
|
9282
9282
|
*/
|
|
9283
9283
|
stop() {
|
|
9284
9284
|
if (this._destroyed) {
|
|
@@ -10262,7 +10262,7 @@ class Wire {
|
|
|
10262
10262
|
}
|
|
10263
10263
|
}
|
|
10264
10264
|
|
|
10265
|
-
const tempVec3a$
|
|
10265
|
+
const tempVec3a$M = math.vec3();
|
|
10266
10266
|
const tempVec4$1 = math.vec4();
|
|
10267
10267
|
|
|
10268
10268
|
/**
|
|
@@ -10343,7 +10343,7 @@ function worldToRTCPos(worldPos, rtcCenter, rtcPos) {
|
|
|
10343
10343
|
*/
|
|
10344
10344
|
function worldToRTCPositions(worldPositions, rtcPositions, rtcCenter, cellSize = 1000) {
|
|
10345
10345
|
|
|
10346
|
-
const center = math.getPositionsCenter(worldPositions, tempVec3a$
|
|
10346
|
+
const center = math.getPositionsCenter(worldPositions, tempVec3a$M);
|
|
10347
10347
|
|
|
10348
10348
|
const rtcCenterX = Math.round(center[0] / cellSize) * cellSize;
|
|
10349
10349
|
const rtcCenterY = Math.round(center[1] / cellSize) * cellSize;
|
|
@@ -10397,7 +10397,7 @@ function getPlaneRTCPos(dist, dir, rtcOrigin, rtcPlanePos, originMatrix) {
|
|
|
10397
10397
|
? (tempVec4$1.set(rtcOrigin, 0), tempVec4$1[3] = 1, math.mulMat4v4(originMatrix, tempVec4$1, tempVec4$1))
|
|
10398
10398
|
: rtcOrigin);
|
|
10399
10399
|
const rtcCenterToPlaneDist = math.dotVec3(dir, rtcCenter) + dist;
|
|
10400
|
-
const dirNormalized = math.normalizeVec3(dir, tempVec3a$
|
|
10400
|
+
const dirNormalized = math.normalizeVec3(dir, tempVec3a$M);
|
|
10401
10401
|
math.mulVec3Scalar(dirNormalized, -rtcCenterToPlaneDist, rtcPlanePos);
|
|
10402
10402
|
return rtcPlanePos;
|
|
10403
10403
|
}
|
|
@@ -11185,7 +11185,7 @@ class SceneModelEntity {
|
|
|
11185
11185
|
}
|
|
11186
11186
|
}
|
|
11187
11187
|
|
|
11188
|
-
const tempVec4a$
|
|
11188
|
+
const tempVec4a$c = math.vec4();
|
|
11189
11189
|
const tempVec4b$7 = math.vec4();
|
|
11190
11190
|
|
|
11191
11191
|
|
|
@@ -11345,9 +11345,9 @@ class Marker extends Component {
|
|
|
11345
11345
|
this.fire("viewPos", this._viewPos);
|
|
11346
11346
|
}
|
|
11347
11347
|
if (this._canvasPosDirty) {
|
|
11348
|
-
tempVec4a$
|
|
11349
|
-
tempVec4a$
|
|
11350
|
-
math.transformPoint4(this.scene.camera.projMatrix, tempVec4a$
|
|
11348
|
+
tempVec4a$c.set(this._viewPos);
|
|
11349
|
+
tempVec4a$c[3] = 1.0;
|
|
11350
|
+
math.transformPoint4(this.scene.camera.projMatrix, tempVec4a$c, tempVec4b$7);
|
|
11351
11351
|
const aabb = this.scene.canvas.boundary;
|
|
11352
11352
|
this._canvasPos[0] = Math.floor((1 + tempVec4b$7[0] / tempVec4b$7[3]) * aabb[2] / 2);
|
|
11353
11353
|
this._canvasPos[1] = Math.floor((1 - tempVec4b$7[1] / tempVec4b$7[3]) * aabb[3] / 2);
|
|
@@ -14742,8 +14742,8 @@ class AngleMeasurementEditTouchControl extends AngleMeasurementEditControl {
|
|
|
14742
14742
|
}
|
|
14743
14743
|
}
|
|
14744
14744
|
|
|
14745
|
-
const tempVec3a$
|
|
14746
|
-
const tempVec3b$
|
|
14745
|
+
const tempVec3a$L = math.vec3();
|
|
14746
|
+
const tempVec3b$A = math.vec3();
|
|
14747
14747
|
const tempVec3c$v = math.vec3();
|
|
14748
14748
|
|
|
14749
14749
|
/**
|
|
@@ -14992,9 +14992,9 @@ class Annotation extends Marker {
|
|
|
14992
14992
|
if (!pickResult.worldPos || !pickResult.worldNormal) {
|
|
14993
14993
|
this.error("Param 'pickResult' does not have both worldPos and worldNormal");
|
|
14994
14994
|
} else {
|
|
14995
|
-
const normalizedWorldNormal = math.normalizeVec3(pickResult.worldNormal, tempVec3a$
|
|
14995
|
+
const normalizedWorldNormal = math.normalizeVec3(pickResult.worldNormal, tempVec3a$L);
|
|
14996
14996
|
const offset = (this.plugin && this.plugin.surfaceOffset) || 0;
|
|
14997
|
-
const offsetVec = math.mulVec3Scalar(normalizedWorldNormal, offset, tempVec3b$
|
|
14997
|
+
const offsetVec = math.mulVec3Scalar(normalizedWorldNormal, offset, tempVec3b$A);
|
|
14998
14998
|
const offsetWorldPos = math.addVec3(pickResult.worldPos, offsetVec, tempVec3c$v);
|
|
14999
14999
|
this.entity = pickResult.entity;
|
|
15000
15000
|
this.worldPos = offsetWorldPos;
|
|
@@ -17864,7 +17864,7 @@ class OcclusionLayer {
|
|
|
17864
17864
|
const MARKER_COLOR = math.vec3([1.0, 0.0, 0.0]);
|
|
17865
17865
|
const POINT_SIZE = 20;
|
|
17866
17866
|
|
|
17867
|
-
const tempVec3a$
|
|
17867
|
+
const tempVec3a$K = math.vec3();
|
|
17868
17868
|
|
|
17869
17869
|
/**
|
|
17870
17870
|
* Manages occlusion testing. Private member of a Renderer.
|
|
@@ -18203,7 +18203,7 @@ class OcclusionTester {
|
|
|
18203
18203
|
gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
|
|
18204
18204
|
if (active) {
|
|
18205
18205
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
18206
|
-
gl.uniform3fv(sectionPlaneUniforms.pos, getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$
|
|
18206
|
+
gl.uniform3fv(sectionPlaneUniforms.pos, getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$K));
|
|
18207
18207
|
gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
|
|
18208
18208
|
}
|
|
18209
18209
|
}
|
|
@@ -20303,6 +20303,9 @@ const Renderer$1 = function (scene, options) {
|
|
|
20303
20303
|
pickProjMatrix = scene.camera.projMatrix;
|
|
20304
20304
|
projection = scene.camera.projection;
|
|
20305
20305
|
|
|
20306
|
+
nearAndFar[0] = scene.camera.project.near;
|
|
20307
|
+
nearAndFar[1] = scene.camera.project.far;
|
|
20308
|
+
|
|
20306
20309
|
pickResult.canvasPos = params.canvasPos;
|
|
20307
20310
|
|
|
20308
20311
|
} else {
|
|
@@ -20316,6 +20319,9 @@ const Renderer$1 = function (scene, options) {
|
|
|
20316
20319
|
pickProjMatrix = scene.camera.projMatrix;
|
|
20317
20320
|
projection = scene.camera.projection;
|
|
20318
20321
|
|
|
20322
|
+
nearAndFar[0] = scene.camera.project.near;
|
|
20323
|
+
nearAndFar[1] = scene.camera.project.far;
|
|
20324
|
+
|
|
20319
20325
|
} else {
|
|
20320
20326
|
|
|
20321
20327
|
worldRayOrigin.set(params.origin || [0, 0, 0]);
|
|
@@ -20335,6 +20341,9 @@ const Renderer$1 = function (scene, options) {
|
|
|
20335
20341
|
pickProjMatrix = scene.camera.ortho.matrix;
|
|
20336
20342
|
projection = "ortho";
|
|
20337
20343
|
|
|
20344
|
+
nearAndFar[0] = scene.camera.ortho.near;
|
|
20345
|
+
nearAndFar[1] = scene.camera.ortho.far;
|
|
20346
|
+
|
|
20338
20347
|
pickResult.origin = worldRayOrigin;
|
|
20339
20348
|
pickResult.direction = worldRayDir;
|
|
20340
20349
|
}
|
|
@@ -20389,9 +20398,6 @@ const Renderer$1 = function (scene, options) {
|
|
|
20389
20398
|
|
|
20390
20399
|
if (pickable.canPickWorldPos && pickable.canPickWorldPos()) {
|
|
20391
20400
|
|
|
20392
|
-
nearAndFar[0] = scene.camera.project.near;
|
|
20393
|
-
nearAndFar[1] = scene.camera.project.far;
|
|
20394
|
-
|
|
20395
20401
|
gpuPickWorldPos(pickBuffer, pickable, canvasPos, pickViewMatrix, pickProjMatrix, nearAndFar, pickResult);
|
|
20396
20402
|
|
|
20397
20403
|
if (params.pickSurfaceNormal !== false) {
|
|
@@ -23809,12 +23815,12 @@ class CustomProjection extends Component {
|
|
|
23809
23815
|
}
|
|
23810
23816
|
|
|
23811
23817
|
const tempVec3$6 = math.vec3();
|
|
23812
|
-
const tempVec3b$
|
|
23818
|
+
const tempVec3b$z = math.vec3();
|
|
23813
23819
|
const tempVec3c$u = math.vec3();
|
|
23814
23820
|
const tempVec3d$d = math.vec3();
|
|
23815
23821
|
const tempVec3e$2 = math.vec3();
|
|
23816
23822
|
const tempVec3f$2 = math.vec3();
|
|
23817
|
-
const tempVec4a$
|
|
23823
|
+
const tempVec4a$b = math.vec4();
|
|
23818
23824
|
const tempVec4b$6 = math.vec4();
|
|
23819
23825
|
const tempVec4c$2 = math.vec4();
|
|
23820
23826
|
const tempMat = math.mat4();
|
|
@@ -24122,7 +24128,7 @@ class Camera extends Component {
|
|
|
24122
24128
|
orbitYaw(angleInc) {
|
|
24123
24129
|
let lookEyeVec = math.subVec3(this._eye, this._look, tempVec3$6);
|
|
24124
24130
|
math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
|
|
24125
|
-
lookEyeVec = math.transformPoint3(tempMat, lookEyeVec, tempVec3b$
|
|
24131
|
+
lookEyeVec = math.transformPoint3(tempMat, lookEyeVec, tempVec3b$z);
|
|
24126
24132
|
this.eye = math.addVec3(this._look, lookEyeVec, tempVec3c$u); // Set eye position as 'look' plus 'eye' vector
|
|
24127
24133
|
this.up = math.transformPoint3(tempMat, this._up, tempVec3d$d); // Rotate 'up' vector
|
|
24128
24134
|
}
|
|
@@ -24140,7 +24146,7 @@ class Camera extends Component {
|
|
|
24140
24146
|
}
|
|
24141
24147
|
}
|
|
24142
24148
|
let eye2 = math.subVec3(this._eye, this._look, tempVec3$6);
|
|
24143
|
-
const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b$
|
|
24149
|
+
const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b$z), math.normalizeVec3(this._up, tempVec3c$u));
|
|
24144
24150
|
math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
|
|
24145
24151
|
eye2 = math.transformPoint3(tempMat, eye2, tempVec3d$d);
|
|
24146
24152
|
this.up = math.transformPoint3(tempMat, this._up, tempVec3e$2);
|
|
@@ -24155,7 +24161,7 @@ class Camera extends Component {
|
|
|
24155
24161
|
yaw(angleInc) {
|
|
24156
24162
|
let look2 = math.subVec3(this._look, this._eye, tempVec3$6);
|
|
24157
24163
|
math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
|
|
24158
|
-
look2 = math.transformPoint3(tempMat, look2, tempVec3b$
|
|
24164
|
+
look2 = math.transformPoint3(tempMat, look2, tempVec3b$z);
|
|
24159
24165
|
this.look = math.addVec3(look2, this._eye, tempVec3c$u);
|
|
24160
24166
|
if (this._gimbalLock) {
|
|
24161
24167
|
this.up = math.transformPoint3(tempMat, this._up, tempVec3d$d);
|
|
@@ -24175,7 +24181,7 @@ class Camera extends Component {
|
|
|
24175
24181
|
}
|
|
24176
24182
|
}
|
|
24177
24183
|
let look2 = math.subVec3(this._look, this._eye, tempVec3$6);
|
|
24178
|
-
const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b$
|
|
24184
|
+
const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b$z), math.normalizeVec3(this._up, tempVec3c$u));
|
|
24179
24185
|
math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
|
|
24180
24186
|
this.up = math.transformPoint3(tempMat, this._up, tempVec3f$2);
|
|
24181
24187
|
look2 = math.transformPoint3(tempMat, look2, tempVec3d$d);
|
|
@@ -24192,7 +24198,7 @@ class Camera extends Component {
|
|
|
24192
24198
|
const vec = [0, 0, 0];
|
|
24193
24199
|
let v;
|
|
24194
24200
|
if (pan[0] !== 0) {
|
|
24195
|
-
const left = math.cross3Vec3(math.normalizeVec3(eye2, []), math.normalizeVec3(this._up, tempVec3b$
|
|
24201
|
+
const left = math.cross3Vec3(math.normalizeVec3(eye2, []), math.normalizeVec3(this._up, tempVec3b$z));
|
|
24196
24202
|
v = math.mulVec3Scalar(left, pan[0]);
|
|
24197
24203
|
vec[0] += v[0];
|
|
24198
24204
|
vec[1] += v[1];
|
|
@@ -24221,7 +24227,7 @@ class Camera extends Component {
|
|
|
24221
24227
|
*/
|
|
24222
24228
|
zoom(delta) {
|
|
24223
24229
|
const vec = math.subVec3(this._eye, this._look, tempVec3$6);
|
|
24224
|
-
const lenLook = Math.abs(math.lenVec3(vec, tempVec3b$
|
|
24230
|
+
const lenLook = Math.abs(math.lenVec3(vec, tempVec3b$z));
|
|
24225
24231
|
const newLenLook = Math.abs(lenLook + delta);
|
|
24226
24232
|
if (newLenLook < 0.5) {
|
|
24227
24233
|
return;
|
|
@@ -24680,7 +24686,7 @@ class Camera extends Component {
|
|
|
24680
24686
|
* @returns {[number, number]} the canvas position
|
|
24681
24687
|
*/
|
|
24682
24688
|
projectWorldPos(worldPos) {
|
|
24683
|
-
const _worldPos = tempVec4a$
|
|
24689
|
+
const _worldPos = tempVec4a$b;
|
|
24684
24690
|
const viewPos = tempVec4b$6;
|
|
24685
24691
|
const screenPos = tempVec4c$2;
|
|
24686
24692
|
_worldPos[0] = worldPos[0];
|
|
@@ -34765,7 +34771,7 @@ function buildFragmentDraw(mesh) {
|
|
|
34765
34771
|
* @author xeolabs / https://github.com/xeolabs
|
|
34766
34772
|
*/
|
|
34767
34773
|
|
|
34768
|
-
const tempVec3a$
|
|
34774
|
+
const tempVec3a$J = math.vec3();
|
|
34769
34775
|
|
|
34770
34776
|
const ids$2 = new Map$1({});
|
|
34771
34777
|
|
|
@@ -34867,7 +34873,7 @@ DrawRenderer.prototype.drawMesh = function (frameCtx, mesh) {
|
|
|
34867
34873
|
if (active) {
|
|
34868
34874
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
34869
34875
|
if (origin) {
|
|
34870
|
-
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$
|
|
34876
|
+
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$J);
|
|
34871
34877
|
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
|
|
34872
34878
|
} else {
|
|
34873
34879
|
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
|
|
@@ -36013,7 +36019,7 @@ function buildFragment$5(mesh) {
|
|
|
36013
36019
|
|
|
36014
36020
|
const ids$1 = new Map$1({});
|
|
36015
36021
|
|
|
36016
|
-
const tempVec3a$
|
|
36022
|
+
const tempVec3a$I = math.vec3();
|
|
36017
36023
|
|
|
36018
36024
|
/**
|
|
36019
36025
|
* @private
|
|
@@ -36100,7 +36106,7 @@ EmphasisFillRenderer.prototype.drawMesh = function (frameCtx, mesh, mode) {
|
|
|
36100
36106
|
if (active) {
|
|
36101
36107
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
36102
36108
|
if (origin) {
|
|
36103
|
-
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$
|
|
36109
|
+
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$I);
|
|
36104
36110
|
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
|
|
36105
36111
|
} else {
|
|
36106
36112
|
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
|
|
@@ -36444,7 +36450,7 @@ function buildFragment$4(mesh) {
|
|
|
36444
36450
|
|
|
36445
36451
|
const ids = new Map$1({});
|
|
36446
36452
|
|
|
36447
|
-
const tempVec3a$
|
|
36453
|
+
const tempVec3a$H = math.vec3();
|
|
36448
36454
|
|
|
36449
36455
|
/**
|
|
36450
36456
|
* @private
|
|
@@ -36530,7 +36536,7 @@ EmphasisEdgesRenderer.prototype.drawMesh = function (frameCtx, mesh, mode) {
|
|
|
36530
36536
|
if (active) {
|
|
36531
36537
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
36532
36538
|
if (origin) {
|
|
36533
|
-
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$
|
|
36539
|
+
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$H);
|
|
36534
36540
|
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
|
|
36535
36541
|
} else {
|
|
36536
36542
|
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
|
|
@@ -36843,7 +36849,7 @@ function buildFragment$3(mesh) {
|
|
|
36843
36849
|
* @author xeolabs / https://github.com/xeolabs
|
|
36844
36850
|
*/
|
|
36845
36851
|
|
|
36846
|
-
const tempVec3a$
|
|
36852
|
+
const tempVec3a$G = math.vec3();
|
|
36847
36853
|
|
|
36848
36854
|
// No ID, because there is exactly one PickMeshRenderer per scene
|
|
36849
36855
|
|
|
@@ -36930,7 +36936,7 @@ PickMeshRenderer.prototype.drawMesh = function (frameCtx, mesh) {
|
|
|
36930
36936
|
if (active) {
|
|
36931
36937
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
36932
36938
|
if (origin) {
|
|
36933
|
-
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$
|
|
36939
|
+
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$G);
|
|
36934
36940
|
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
|
|
36935
36941
|
} else {
|
|
36936
36942
|
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
|
|
@@ -37182,7 +37188,7 @@ function buildFragment$2(mesh) {
|
|
|
37182
37188
|
* @author xeolabs / https://github.com/xeolabs
|
|
37183
37189
|
*/
|
|
37184
37190
|
|
|
37185
|
-
const tempVec3a$
|
|
37191
|
+
const tempVec3a$F = math.vec3();
|
|
37186
37192
|
|
|
37187
37193
|
/**
|
|
37188
37194
|
* @private
|
|
@@ -37277,7 +37283,7 @@ PickTriangleRenderer.prototype.drawMesh = function (frameCtx, mesh) {
|
|
|
37277
37283
|
if (active) {
|
|
37278
37284
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
37279
37285
|
if (origin) {
|
|
37280
|
-
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$
|
|
37286
|
+
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$F);
|
|
37281
37287
|
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
|
|
37282
37288
|
} else {
|
|
37283
37289
|
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
|
|
@@ -37526,7 +37532,7 @@ function buildFragment$1(mesh) {
|
|
|
37526
37532
|
* @author xeolabs / https://github.com/xeolabs
|
|
37527
37533
|
*/
|
|
37528
37534
|
|
|
37529
|
-
const tempVec3a$
|
|
37535
|
+
const tempVec3a$E = math.vec3();
|
|
37530
37536
|
|
|
37531
37537
|
// No ID, because there is exactly one PickMeshRenderer per scene
|
|
37532
37538
|
|
|
@@ -37641,7 +37647,7 @@ OcclusionRenderer.prototype.drawMesh = function (frameCtx, mesh) {
|
|
|
37641
37647
|
if (active) {
|
|
37642
37648
|
const sectionPlane = sectionPlanes[sectionPlaneIndex];
|
|
37643
37649
|
if (origin) {
|
|
37644
|
-
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$
|
|
37650
|
+
const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$E);
|
|
37645
37651
|
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
|
|
37646
37652
|
} else {
|
|
37647
37653
|
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
|
|
@@ -42886,7 +42892,12 @@ class AxisGizmoPlugin extends Plugin {
|
|
|
42886
42892
|
}
|
|
42887
42893
|
}
|
|
42888
42894
|
|
|
42889
|
-
math.vec3();
|
|
42895
|
+
const tempVec3a$D = math.vec3();
|
|
42896
|
+
const tempVec3b$y = math.vec3();
|
|
42897
|
+
const tempVec4a$a = math.vec4();
|
|
42898
|
+
const front = math.vec3([0, 0, -1]);
|
|
42899
|
+
const back = math.vec3([0, 0, 1]);
|
|
42900
|
+
const up = math.vec3([0, 1, 0]);
|
|
42890
42901
|
|
|
42891
42902
|
/**
|
|
42892
42903
|
* @desc An arbitrarily-aligned World-space clipping plane.
|
|
@@ -42958,6 +42969,8 @@ class SectionPlane extends Component {
|
|
|
42958
42969
|
this._state = new RenderState({
|
|
42959
42970
|
active: true,
|
|
42960
42971
|
pos: math.vec3(),
|
|
42972
|
+
quaternion: math.vec4(),
|
|
42973
|
+
roll: 0,
|
|
42961
42974
|
dir: math.vec3(),
|
|
42962
42975
|
dist: 0
|
|
42963
42976
|
});
|
|
@@ -43019,6 +43032,59 @@ class SectionPlane extends Component {
|
|
|
43019
43032
|
return this._state.pos;
|
|
43020
43033
|
}
|
|
43021
43034
|
|
|
43035
|
+
/**
|
|
43036
|
+
* Sets the quaternion of this SectionPlane's plane.
|
|
43037
|
+
*
|
|
43038
|
+
* Default value is ````[0, -1, 0, 0]````.
|
|
43039
|
+
*
|
|
43040
|
+
* @param {Number[]} value New quaternion.
|
|
43041
|
+
*/
|
|
43042
|
+
set quaternion(value) {
|
|
43043
|
+
this._state.quaternion.set(value || [0, 0, 0, -1]);
|
|
43044
|
+
math.vec3ApplyQuaternion(this._state.quaternion, back, this._state.dir);
|
|
43045
|
+
const quatUp = math.vec3ApplyQuaternion(this._state.quaternion, up, tempVec3a$D);
|
|
43046
|
+
const dirOnlyQ = math.vec3PairToQuaternion(back, this._state.dir, tempVec4a$a);
|
|
43047
|
+
const dirOnlyUp = math.vec3ApplyQuaternion(dirOnlyQ, up, tempVec3b$y);
|
|
43048
|
+
const angle = Math.acos(Math.min(1, math.dotVec3(quatUp, dirOnlyUp)));
|
|
43049
|
+
const sign = Math.sign(math.dotVec3(this._state.dir, math.cross3Vec3(quatUp, dirOnlyUp, tempVec3b$y)));
|
|
43050
|
+
this._state.roll = sign * angle;
|
|
43051
|
+
this._onDirUpdated();
|
|
43052
|
+
}
|
|
43053
|
+
|
|
43054
|
+
/**
|
|
43055
|
+
* Gets the quaternion of this SectionPlane's plane.
|
|
43056
|
+
*
|
|
43057
|
+
* Default value is ````[0, -1, 0, 0]````.
|
|
43058
|
+
*
|
|
43059
|
+
* @returns {Number[]} value Current quaternion.
|
|
43060
|
+
*/
|
|
43061
|
+
get quaternion() {
|
|
43062
|
+
return this._state.quaternion;
|
|
43063
|
+
}
|
|
43064
|
+
|
|
43065
|
+
/**
|
|
43066
|
+
* Sets the roll of this SectionPlane's plane.
|
|
43067
|
+
*
|
|
43068
|
+
* Default value is ````0````.
|
|
43069
|
+
*
|
|
43070
|
+
* @param {Number[]} value New roll.
|
|
43071
|
+
*/
|
|
43072
|
+
set roll(value) {
|
|
43073
|
+
this._state.roll = value || 0;
|
|
43074
|
+
this._onDirRollUpdated();
|
|
43075
|
+
}
|
|
43076
|
+
|
|
43077
|
+
/**
|
|
43078
|
+
* Gets the roll of this SectionPlane's plane.
|
|
43079
|
+
*
|
|
43080
|
+
* Default value is ````0````.
|
|
43081
|
+
*
|
|
43082
|
+
* @returns {Number[]} value Current roll.
|
|
43083
|
+
*/
|
|
43084
|
+
get roll() {
|
|
43085
|
+
return this._state.roll;
|
|
43086
|
+
}
|
|
43087
|
+
|
|
43022
43088
|
/**
|
|
43023
43089
|
* Sets the direction of this SectionPlane's plane.
|
|
43024
43090
|
*
|
|
@@ -43027,7 +43093,25 @@ class SectionPlane extends Component {
|
|
|
43027
43093
|
* @param {Number[]} value New direction.
|
|
43028
43094
|
*/
|
|
43029
43095
|
set dir(value) {
|
|
43030
|
-
this._state.dir.set(value ||
|
|
43096
|
+
this._state.dir.set(value || front);
|
|
43097
|
+
this._onDirRollUpdated();
|
|
43098
|
+
}
|
|
43099
|
+
|
|
43100
|
+
_onDirRollUpdated() {
|
|
43101
|
+
math.vec3PairToQuaternion(back, this._state.dir, this._state.quaternion);
|
|
43102
|
+
|
|
43103
|
+
tempVec4a$a[0] = 0;
|
|
43104
|
+
tempVec4a$a[1] = 0;
|
|
43105
|
+
tempVec4a$a[2] = -1;
|
|
43106
|
+
tempVec4a$a[3] = this._state.roll;
|
|
43107
|
+
math.angleAxisToQuaternion(tempVec4a$a, tempVec4a$a);
|
|
43108
|
+
|
|
43109
|
+
math.mulQuaternions(this._state.quaternion, tempVec4a$a, this._state.quaternion);
|
|
43110
|
+
|
|
43111
|
+
this._onDirUpdated();
|
|
43112
|
+
}
|
|
43113
|
+
|
|
43114
|
+
_onDirUpdated() {
|
|
43031
43115
|
this._state.dist = (-math.dotVec3(this._state.pos, this._state.dir));
|
|
43032
43116
|
this.glRedraw();
|
|
43033
43117
|
this.fire("dir", this._state.dir);
|
|
@@ -52684,7 +52768,10 @@ class TrianglesColorRenderer$1 extends TrianglesBatchingRenderer {
|
|
|
52684
52768
|
}
|
|
52685
52769
|
|
|
52686
52770
|
if (scene.logarithmicDepthBufferEnabled) {
|
|
52687
|
-
src.push("
|
|
52771
|
+
src.push(" float dx = dFdx(vFragDepth);");
|
|
52772
|
+
src.push(" float dy = dFdy(vFragDepth);");
|
|
52773
|
+
src.push(" float diff = sqrt(dx*dx+dy*dy);");
|
|
52774
|
+
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth + diff ) * logDepthBufFC * 0.5;");
|
|
52688
52775
|
}
|
|
52689
52776
|
|
|
52690
52777
|
if (this._withSAO) {
|
|
@@ -58035,7 +58122,10 @@ class TrianglesColorRenderer extends TrianglesInstancingRenderer {
|
|
|
58035
58122
|
}
|
|
58036
58123
|
|
|
58037
58124
|
if (scene.logarithmicDepthBufferEnabled) {
|
|
58038
|
-
src.push("
|
|
58125
|
+
src.push(" float dx = dFdx(vFragDepth);");
|
|
58126
|
+
src.push(" float dy = dFdy(vFragDepth);");
|
|
58127
|
+
src.push(" float diff = sqrt(dx*dx+dy*dy);");
|
|
58128
|
+
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth + diff ) * logDepthBufFC * 0.5;");
|
|
58039
58129
|
}
|
|
58040
58130
|
|
|
58041
58131
|
// Doing SAO blend in the main solid fill draw shader just so that edge lines can be drawn over the top
|
|
@@ -84480,6 +84570,7 @@ class SceneModel extends Component {
|
|
|
84480
84570
|
set matrix(value) {
|
|
84481
84571
|
this._matrix.set(value || DEFAULT_MATRIX);
|
|
84482
84572
|
math.decomposeMat4(this._matrix, this._position, this._quaternion, this._scale);
|
|
84573
|
+
math.quaternionToEuler(this._quaternion, "XYZ", this._rotation);
|
|
84483
84574
|
this._matrixDirty = false;
|
|
84484
84575
|
this._setWorldMatrixDirty();
|
|
84485
84576
|
this._sceneModelDirty();
|
|
@@ -93255,7 +93346,7 @@ CameraPathAnimation.PLAYING_TO = 3;
|
|
|
93255
93346
|
const tempVec3$3 = math.vec3();
|
|
93256
93347
|
const tempVec3b$5 = math.vec3();
|
|
93257
93348
|
math.vec3();
|
|
93258
|
-
const zeroVec$
|
|
93349
|
+
const zeroVec$1 = math.vec3([0, -1, 0]);
|
|
93259
93350
|
const tempQuat = math.vec4([0, 0, 0, 1]);
|
|
93260
93351
|
|
|
93261
93352
|
/**
|
|
@@ -93682,7 +93773,7 @@ class ImagePlane extends Component {
|
|
|
93682
93773
|
|
|
93683
93774
|
math.normalizeVec3(negDir);
|
|
93684
93775
|
math.mulVec3Scalar(negDir, dist, tempVec3b$5);
|
|
93685
|
-
math.vec3PairToQuaternion(zeroVec$
|
|
93776
|
+
math.vec3PairToQuaternion(zeroVec$1, dir, tempQuat);
|
|
93686
93777
|
|
|
93687
93778
|
this._node.quaternion = tempQuat;
|
|
93688
93779
|
}
|
|
@@ -120721,9 +120812,6 @@ class OBJLoaderPlugin extends Plugin {
|
|
|
120721
120812
|
}
|
|
120722
120813
|
}
|
|
120723
120814
|
|
|
120724
|
-
const zeroVec$1 = new Float64Array([0, 0, 1]);
|
|
120725
|
-
const quat$1 = new Float64Array(4);
|
|
120726
|
-
|
|
120727
120815
|
/**
|
|
120728
120816
|
* Controls a {@link SectionPlane} with mouse and touch input.
|
|
120729
120817
|
*
|
|
@@ -120841,15 +120929,13 @@ class Control {
|
|
|
120841
120929
|
});
|
|
120842
120930
|
|
|
120843
120931
|
const handlers = { };
|
|
120844
|
-
const addAxis = (rgb,
|
|
120932
|
+
const addAxis = (rgb, hoopRot) => {
|
|
120933
|
+
math.mulVec3Scalar(rgb, -1, math.vec3());
|
|
120845
120934
|
const material = colorMaterial(rgb);
|
|
120846
120935
|
|
|
120847
|
-
const
|
|
120848
|
-
|
|
120849
|
-
const hoopMatrix = math.mulMat4(hoopRotation, rotateToHorizontal, math.identityMat4());
|
|
120850
|
-
|
|
120936
|
+
const hoopMatrix = math.quaternionToRotationMat4(hoopRot, math.identityMat4());
|
|
120937
|
+
math.mulMat4(math.rotationMat4v(Math.PI, [0,1,0], math.mat4()), hoopMatrix, hoopMatrix);
|
|
120851
120938
|
const scale = math.scaleMat4v([0.6, 0.6, 0.6], math.identityMat4());
|
|
120852
|
-
|
|
120853
120939
|
const scaledArrowMatrix = (t, matR) => {
|
|
120854
120940
|
const matT = math.translateMat4v(t, math.identityMat4());
|
|
120855
120941
|
const ret = math.identityMat4();
|
|
@@ -120918,7 +121004,8 @@ class Control {
|
|
|
120918
121004
|
}), NO_STATE_INHERIT);
|
|
120919
121005
|
|
|
120920
121006
|
|
|
120921
|
-
const axisRotation = math.quaternionToRotationMat4(math.vec3PairToQuaternion([ 0, 1, 0 ],
|
|
121007
|
+
const axisRotation = math.quaternionToRotationMat4(math.vec3PairToQuaternion([ 0, 1, 0 ], rgb), math.identityMat4());
|
|
121008
|
+
math.mulMat4(math.rotationMat4v(Math.PI, [0,1,0], math.mat4()), axisRotation, axisRotation);
|
|
120922
121009
|
|
|
120923
121010
|
const translatedAxisMatrix = (yOffset) => math.mulMat4(axisRotation, math.translateMat4c(0, yOffset, 0, math.identityMat4()), math.identityMat4());
|
|
120924
121011
|
const arrowMatrix = translatedAxisMatrix(arrowLength + .1);
|
|
@@ -121047,7 +121134,7 @@ class Control {
|
|
|
121047
121134
|
rootNode.rotate(rgb, (rotation - lastRotation) * 180 / Math.PI);
|
|
121048
121135
|
if (this._sectionPlane) {
|
|
121049
121136
|
ignoreNextSectionPlaneDirUpdate = true;
|
|
121050
|
-
this._sectionPlane.
|
|
121137
|
+
this._sectionPlane.quaternion = rootNode.quaternion;
|
|
121051
121138
|
}
|
|
121052
121139
|
lastRotation = rotation;
|
|
121053
121140
|
};
|
|
@@ -121161,9 +121248,9 @@ class Control {
|
|
|
121161
121248
|
//
|
|
121162
121249
|
//----------------------------------------------------------------------------------------------------------
|
|
121163
121250
|
|
|
121164
|
-
addAxis([1,0,0], [
|
|
121165
|
-
addAxis([0,1,0], [
|
|
121166
|
-
addAxis([0,0,1],
|
|
121251
|
+
addAxis([1,0,0], math.vec3PairToQuaternion([1,0,0], [0,0,1])),
|
|
121252
|
+
addAxis([0,1,0], math.eulerToQuaternion([90,0,0], "XYZ")),
|
|
121253
|
+
addAxis([0,0,1], math.identityQuaternion())
|
|
121167
121254
|
];
|
|
121168
121255
|
|
|
121169
121256
|
const cleanups = [ ];
|
|
@@ -121301,7 +121388,7 @@ class Control {
|
|
|
121301
121388
|
this.id = sectionPlane.id;
|
|
121302
121389
|
this._sectionPlane = sectionPlane;
|
|
121303
121390
|
const setPosFromSectionPlane = () => setPos(sectionPlane.pos);
|
|
121304
|
-
const setDirFromSectionPlane = () => rootNode.quaternion =
|
|
121391
|
+
const setDirFromSectionPlane = () => rootNode.quaternion = sectionPlane.quaternion;
|
|
121305
121392
|
setPosFromSectionPlane();
|
|
121306
121393
|
setDirFromSectionPlane();
|
|
121307
121394
|
const onSectionPlanePos = sectionPlane.on("pos", setPosFromSectionPlane);
|