diff --git a/dist/xeokit-bim-viewer.es.js b/dist/xeokit-bim-viewer.es.js
index b52c117e..7baba35e 100644
--- a/dist/xeokit-bim-viewer.es.js
+++ b/dist/xeokit-bim-viewer.es.js
@@ -503,6 +503,7 @@ class ContextMenu {
this._updateItemsTitles();
this._updateItemsEnabledStatus();
this._showMenu(this._rootMenu.id, pageX, pageY);
+ this._updateSubMenuInfo();
this._shown = true;
this.fire("shown", {});
}
@@ -678,9 +679,8 @@ class ContextMenu {
if (itemSubMenu) {
html.push(
- '
');
if (!((groupIdx === groupLen - 1) || (j < lenj - 1))) {
html.push(
@@ -912,6 +912,29 @@ class ContextMenu {
}
}
+ _updateSubMenuInfo() {
+ if (!this._context) return;
+ let itemElement, itemRect, subMenuElement, initialStyles, showOnLeft, subMenuWidth;
+ this._itemList.forEach((item) => {
+ if (item.subMenu) {
+ itemElement = item.itemElement;
+ itemRect = itemElement.getBoundingClientRect();
+ subMenuElement = item.subMenu.menuElement;
+ initialStyles = {
+ visibility: subMenuElement.style.visibility,
+ display: subMenuElement.style.display,
+ };
+ subMenuElement.style.display = "block";
+ subMenuElement.style.visibility = "hidden";
+ subMenuWidth = item.subMenu.menuElement.getBoundingClientRect().width;
+ subMenuElement.style.visibility = initialStyles.visibility;
+ subMenuElement.style.display = initialStyles.display;
+ showOnLeft = ((itemRect.right + subMenuWidth) > window.innerWidth);
+ itemElement.setAttribute("data-submenuposition", showOnLeft ? "left" : "right");
+ }
+ });
+ }
+
_showMenu(menuId, pageX, pageY) { // Shows the given menu, at the specified page coordinates
const menu = this._menuMap[menuId];
if (!menu) {
@@ -979,7 +1002,7 @@ const tempVec3a$N = new FloatArrayType(3);
const tempMat1 = new FloatArrayType(16);
const tempMat2 = new FloatArrayType(16);
-const tempVec4$1 = new FloatArrayType(4);
+const tempVec4$2 = new FloatArrayType(4);
/**
@@ -4168,7 +4191,7 @@ const math = {
},
quaternionToAngleAxis(q, angleAxis = math.vec4()) {
- q = math.normalizeQuaternion(q, tempVec4$1);
+ q = math.normalizeQuaternion(q, tempVec4$2);
const q3 = q[3];
const angle = 2 * Math.acos(q3);
const s = Math.sqrt(1 - q3 * q3);
@@ -9002,6 +9025,7 @@ class Dot {
}
const tempVec3a$L = math.vec3();
+const tempVec4$1 = math.vec4();
/**
* Given a view matrix and a relative-to-center (RTC) coordinate origin, returns a view matrix
@@ -9115,7 +9139,10 @@ function worldToRTCPositions(worldPositions, rtcPositions, rtcCenter, cellSize =
* @param rtcPlanePos
* @returns {*}
*/
-function getPlaneRTCPos(dist, dir, rtcCenter, rtcPlanePos) {
+function getPlaneRTCPos(dist, dir, rtcOrigin, rtcPlanePos, originMatrix) {
+ const rtcCenter = (originMatrix
+ ? (tempVec4$1.set(rtcOrigin, 0), tempVec4$1[3] = 1, math.mulMat4v4(originMatrix, tempVec4$1, tempVec4$1))
+ : rtcOrigin);
const rtcCenterToPlaneDist = math.dotVec3(dir, rtcCenter) + dist;
const dirNormalized = math.normalizeVec3(dir, tempVec3a$L);
math.mulVec3Scalar(dirNormalized, -rtcCenterToPlaneDist, rtcPlanePos);
@@ -11803,9 +11830,6 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
const mouseHoverCanvasPos = math.vec2();
this._currentAngleMeasurement = null;
- const getTop = el => el.offsetTop + (el.offsetParent && (el.offsetParent !== canvas.parentNode) && getTop(el.offsetParent));
- const getLeft = el => el.offsetLeft + (el.offsetParent && (el.offsetParent !== canvas.parentNode) && getLeft(el.offsetParent));
-
const pagePos = math.vec2();
const hoverOn = event => {
@@ -11840,8 +11864,10 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
this.markerDiv.style.left = `${pagePos[0] - 5}px`;
this.markerDiv.style.top = `${pagePos[1] - 5}px`;
} else {
- this.markerDiv.style.left = `${getLeft(canvas) + canvasPos[0] - 5}px`;
- this.markerDiv.style.top = `${getTop(canvas) + canvasPos[1] - 5}px`;
+ const markerPos = math.vec2(canvasPos);
+ transformToNode(canvas, this.markerDiv.parentNode, markerPos);
+ this.markerDiv.style.left = `${markerPos[0] - 5}px`;
+ this.markerDiv.style.top = `${markerPos[1] - 5}px`;
}
break;
case MOUSE_FINDING_CORNER:
@@ -19201,15 +19227,11 @@ class Input extends Component {
this.mouseCanvasPos[1] = event.y;
} else {
let element = event.target;
- let totalOffsetLeft = 0;
- let totalOffsetTop = 0;
- while (element.offsetParent) {
- totalOffsetLeft += element.offsetLeft;
- totalOffsetTop += element.offsetTop;
- element = element.offsetParent;
- }
- this.mouseCanvasPos[0] = event.pageX - totalOffsetLeft;
- this.mouseCanvasPos[1] = event.pageY - totalOffsetTop;
+
+ const rect = element.getBoundingClientRect();
+
+ this.mouseCanvasPos[0] = event.clientX - rect.left;
+ this.mouseCanvasPos[1] = event.clientY - rect.top;
}
}
@@ -43114,6 +43136,16 @@ class SceneModelMesh {
*/
set aabb(aabb) { // Called by SceneModel
this._aabbLocal = aabb;
+ if (this.origin) {
+ this._aabbLocal = aabb.slice(0);
+ const origin = this.origin;
+ this._aabbLocal[0] += origin[0];
+ this._aabbLocal[1] += origin[1];
+ this._aabbLocal[2] += origin[2];
+ this._aabbLocal[3] += origin[0];
+ this._aabbLocal[4] += origin[1];
+ this._aabbLocal[5] += origin[2];
+ }
}
/**
@@ -43130,15 +43162,6 @@ class SceneModelMesh {
math.transformOBB3(this.model.worldMatrix, tempOBB3$1, tempOBB3b);
math.OBB3ToAABB3(tempOBB3b, this._aabbWorld);
}
- if (this.origin) {
- const origin = this.origin;
- this._aabbWorld[0] += origin[0];
- this._aabbWorld[1] += origin[1];
- this._aabbWorld[2] += origin[2];
- this._aabbWorld[3] += origin[0];
- this._aabbWorld[4] += origin[1];
- this._aabbWorld[5] += origin[2];
- }
this._aabbWorldDirty = false;
}
return this._aabbWorld;
@@ -43374,7 +43397,7 @@ class VBORenderer {
const sectionPlane = sectionPlanes[sectionPlaneIndex];
const origin = layer._state.origin;
if (origin) {
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$C);
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$C, model.matrix);
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
} else {
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -43681,7 +43704,7 @@ class VBORenderer {
const {camera} = model.scene;
const {viewNormalMatrix, project} = camera;
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
- const {position, rotationMatrix, rotationMatrixConjugate, worldNormalMatrix} = model;
+ const {position, rotationMatrix, worldNormalMatrix} = model;
if (!this._program) {
this._allocate();
@@ -43704,7 +43727,7 @@ class VBORenderer {
let offset = 0;
const mat4Size = 4 * 4;
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
const gotOrigin = (origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0);
const gotPosition = (position[0] !== 0 || position[1] !== 0 || position[2] !== 0);
@@ -46690,7 +46713,7 @@ class TrianglesSnapInitRenderer$1 extends VBORenderer {
const gl = scene.canvas.gl;
const state = batchingLayer._state;
const origin = batchingLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const aabb = batchingLayer.aabb; // Per-layer AABB for best RTC accuracy
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
@@ -46755,7 +46778,7 @@ class TrianglesSnapInitRenderer$1 extends VBORenderer {
let offset = 0;
const mat4Size = 4 * 4;
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -46999,7 +47022,7 @@ class TrianglesSnapRenderer$1 extends VBORenderer{
const gl = scene.canvas.gl;
const state = batchingLayer._state;
const origin = batchingLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const aabb = batchingLayer.aabb; // Per-layer AABB for best RTC accuracy
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
@@ -47064,7 +47087,7 @@ class TrianglesSnapRenderer$1 extends VBORenderer{
let offset = 0;
const mat4Size = 4 * 4;
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -48759,12 +48782,15 @@ class VBOBatchingTrianglesLayer {
return;
}
const positions = portion.quantizedPositions;
- const origin = state.origin;
- const offsetX = origin[0] ;
- const offsetY = origin[1] ;
- const offsetZ = origin[2] ;
- const worldPos = tempVec4a$9;
const sceneModelMatrix = this.model.matrix;
+ const origin = math.vec4();
+ origin.set(state.origin, 0);
+ origin[3] = 1;
+ math.mulMat4v4(sceneModelMatrix, origin, origin);
+ const offsetX = origin[0];
+ const offsetY = origin[1];
+ const offsetZ = origin[2];
+ const worldPos = tempVec4a$9;
const positionsDecodeMatrix = state.positionsDecodeMatrix;
for (let i = 0, len = positions.length; i < len; i += 3) {
worldPos[0] = positions[i];
@@ -48772,7 +48798,8 @@ class VBOBatchingTrianglesLayer {
worldPos[2] = positions[i + 2];
worldPos[3] = 1.0;
math.decompressPosition(worldPos, positionsDecodeMatrix);
- math.transformPoint4(sceneModelMatrix, worldPos);
+ worldPos[3] = 1;
+ math.mulMat4v4(sceneModelMatrix, worldPos, worldPos);
worldPos[0] += offsetX;
worldPos[1] += offsetY;
worldPos[2] += offsetZ;
@@ -52117,7 +52144,7 @@ class TrianglesSnapInitRenderer extends VBORenderer {
const camera = scene.camera;
const state = instancingLayer._state;
const origin = instancingLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const aabb = instancingLayer.aabb; // Per-layer AABB for best RTC accuracy
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
@@ -52180,7 +52207,7 @@ class TrianglesSnapInitRenderer extends VBORenderer {
let offset = 0;
const mat4Size = 4 * 4;
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -52453,7 +52480,7 @@ class TrianglesSnapRenderer extends VBORenderer {
const gl = scene.canvas.gl;
const state = instancingLayer._state;
const origin = instancingLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const aabb = instancingLayer.aabb; // Per-layer AABB for best RTC accuracy
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
@@ -52517,7 +52544,7 @@ class TrianglesSnapRenderer extends VBORenderer {
let offset = 0;
const mat4Size = 4 * 4;
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -53496,6 +53523,7 @@ class VBOInstancingTrianglesLayer {
&& !!textureSet
&& !!textureSet.colorTexture;
+
if (!this.model.scene.readableGeometryEnabled) {
this._state.geometry = null;
}
@@ -53826,21 +53854,25 @@ class VBOInstancingTrianglesLayer {
return;
}
const positions = geometry.positionsCompressed;
- const origin = state.origin;
+ const sceneModelMatrix = this.model.matrix;
+ const origin = math.vec4();
+ origin.set(state.origin, 0);
+ origin[3] = 1;
+ math.mulMat4v4(sceneModelMatrix, origin, origin);
const offsetX = origin[0];
const offsetY = origin[1];
const offsetZ = origin[2];
const worldPos = tempVec4a$8;
const portionMatrix = portion.matrix;
- const sceneModelMatrix = this.model.matrix;
const positionsDecodeMatrix = state.positionsDecodeMatrix;
for (let i = 0, len = positions.length; i < len; i += 3) {
worldPos[0] = positions[i];
worldPos[1] = positions[i + 1];
worldPos[2] = positions[i + 2];
math.decompressPosition(worldPos, positionsDecodeMatrix);
- math.transformPoint3(portionMatrix, worldPos);
- math.transformPoint3(sceneModelMatrix, worldPos);
+ math.transformPoint3(portionMatrix, worldPos, worldPos);
+ worldPos[3] = 1;
+ math.mulMat4v4(sceneModelMatrix, worldPos, worldPos);
worldPos[0] += offsetX;
worldPos[1] += offsetY;
worldPos[2] += offsetZ;
@@ -54632,7 +54664,7 @@ class VBOBatchingLinesSnapInitRenderer extends VBORenderer {
const gl = scene.canvas.gl;
const state = batchingLayer._state;
const origin = batchingLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const aabb = batchingLayer.aabb; // Per-layer AABB for best RTC accuracy
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
@@ -54697,7 +54729,7 @@ class VBOBatchingLinesSnapInitRenderer extends VBORenderer {
let offset = 0;
const mat4Size = 4 * 4;
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -54941,7 +54973,7 @@ class VBOBatchingLinesSnapRenderer extends VBORenderer{
const gl = scene.canvas.gl;
const state = batchingLayer._state;
const origin = batchingLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const aabb = batchingLayer.aabb; // Per-layer AABB for best RTC accuracy
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
@@ -55006,7 +55038,7 @@ class VBOBatchingLinesSnapRenderer extends VBORenderer{
let offset = 0;
const mat4Size = 4 * 4;
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -56352,7 +56384,7 @@ class VBOInstancingLinesSnapInitRenderer extends VBORenderer {
const camera = scene.camera;
const state = instancingLayer._state;
const origin = instancingLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const aabb = instancingLayer.aabb; // Per-layer AABB for best RTC accuracy
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
@@ -56408,7 +56440,7 @@ class VBOInstancingLinesSnapInitRenderer extends VBORenderer {
let offset = 0;
const mat4Size = 4 * 4;
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -56677,7 +56709,7 @@ class VBOInstancingLinesSnapRenderer extends VBORenderer {
const gl = scene.canvas.gl;
const state = instancingLayer._state;
const origin = instancingLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const aabb = instancingLayer.aabb; // Per-layer AABB for best RTC accuracy
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
@@ -56734,7 +56766,7 @@ class VBOInstancingLinesSnapRenderer extends VBORenderer {
let offset = 0;
const mat4Size = 4 * 4;
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -58585,7 +58617,7 @@ class VBOBatchingPointsSnapInitRenderer extends VBORenderer {
const gl = scene.canvas.gl;
const state = batchingLayer._state;
const origin = batchingLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const aabb = batchingLayer.aabb; // Per-layer AABB for best RTC accuracy
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
@@ -58646,11 +58678,12 @@ class VBOBatchingPointsSnapInitRenderer extends VBORenderer {
gl.uniform3fv(this._uCoordinateScaler, coordinateScaler);
gl.uniform1i(this._uRenderPass, renderPass);
gl.uniform1i(this._uPickInvisible, frameCtx.pickInvisible);
+ gl.uniform1f(this._uPointSize, 1.0);
let offset = 0;
const mat4Size = 4 * 4;
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -58689,6 +58722,7 @@ class VBOBatchingPointsSnapInitRenderer extends VBORenderer {
this.uInverseVectorAB = program.getLocation("snapInvVectorAB");
this._uLayerNumber = program.getLocation("layerNumber");
this._uCoordinateScaler = program.getLocation("coordinateScaler");
+ this._uPointSize = program.getLocation("pointSize");
}
_bindProgram() {
@@ -58729,6 +58763,7 @@ class VBOBatchingPointsSnapInitRenderer extends VBORenderer {
src.push("uniform vec3 uCameraEyeRtc;");
src.push("uniform vec2 snapVectorA;");
src.push("uniform vec2 snapInvVectorAB;");
+ src.push("uniform float pointSize;");
{
src.push("uniform float logDepthBufFC;");
src.push("out float vFragDepth;");
@@ -58776,6 +58811,7 @@ class VBOBatchingPointsSnapInitRenderer extends VBORenderer {
src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
}
src.push("gl_Position = clipPos;");
+ src.push("gl_PointSize = pointSize;");
src.push(" }");
src.push("}");
return src;
@@ -58892,7 +58928,7 @@ class VBOBatchingPointsSnapRenderer extends VBORenderer{
const gl = scene.canvas.gl;
const state = batchingLayer._state;
const origin = batchingLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const aabb = batchingLayer.aabb; // Per-layer AABB for best RTC accuracy
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
@@ -58957,7 +58993,7 @@ class VBOBatchingPointsSnapRenderer extends VBORenderer{
let offset = 0;
const mat4Size = 4 * 4;
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -59330,7 +59366,7 @@ class VBOBatchingPointsLayer {
this._renderers = getRenderers$3(cfg.model.scene);
- const maxGeometryBatchSize = Math.min(5000000, cfg.maxGeometryBatchSize || window.Infinity);
+ const maxGeometryBatchSize = cfg.maxGeometryBatchSize || 5000000;
const attribute = function() {
const portions = [ ];
@@ -59446,7 +59482,7 @@ class VBOBatchingPointsLayer {
if (this._finalized) {
throw "Already finalized";
}
- return (this._buffer.vertsIndex + (lenPositions / 3)) < this._buffer.maxVerts;
+ return (this._buffer.vertsIndex + (lenPositions / 3)) <= this._buffer.maxVerts;
}
/**
@@ -61095,7 +61131,7 @@ class VBOInstancingPointsSnapInitRenderer extends VBORenderer {
const camera = scene.camera;
const state = instancingLayer._state;
const origin = instancingLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const aabb = instancingLayer.aabb; // Per-layer AABB for best RTC accuracy
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
@@ -61151,7 +61187,7 @@ class VBOInstancingPointsSnapInitRenderer extends VBORenderer {
let offset = 0;
const mat4Size = 4 * 4;
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -61419,7 +61455,7 @@ class VBOInstancingPointsSnapRenderer extends VBORenderer {
const gl = scene.canvas.gl;
const state = instancingLayer._state;
const origin = instancingLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const aabb = instancingLayer.aabb; // Per-layer AABB for best RTC accuracy
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
@@ -61476,7 +61512,7 @@ class VBOInstancingPointsSnapRenderer extends VBORenderer {
let offset = 0;
const mat4Size = 4 * 4;
- this._matricesUniformBlockBufferData.set(rotationMatrixConjugate, 0);
+ this._matricesUniformBlockBufferData.set(rotationMatrix, 0);
this._matricesUniformBlockBufferData.set(rtcViewMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(camera.projMatrix, offset += mat4Size);
this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix, offset += mat4Size);
@@ -62613,7 +62649,7 @@ class DTXLinesColorRenderer {
const state = dataTextureLayer._state;
const textureState = state.textureState;
const origin = dataTextureLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const viewMatrix = camera.viewMatrix;
if (!this._program) {
@@ -62660,7 +62696,7 @@ class DTXLinesColorRenderer {
rtcViewMatrix = viewMatrix;
}
- gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrixConjugate);
+ gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrix);
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
gl.uniform1i(this._uRenderPass, renderPass);
@@ -62685,7 +62721,7 @@ class DTXLinesColorRenderer {
if (active) {
const sectionPlane = sectionPlanes[sectionPlaneIndex];
if (origin) {
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$n);
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$n, model.matrix);
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
} else {
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -64520,7 +64556,7 @@ class DTXTrianglesColorRenderer {
const state = dataTextureLayer._state;
const textureState = state.textureState;
const origin = dataTextureLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
if (!this._program) {
this._allocate();
@@ -64572,7 +64608,7 @@ class DTXTrianglesColorRenderer {
rtcCameraEye = camera.eye;
}
- gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrixConjugate);
+ gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrix);
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
gl.uniform3fv(this._uCameraEyeRtc, rtcCameraEye);
@@ -64598,7 +64634,7 @@ class DTXTrianglesColorRenderer {
if (active) {
const sectionPlane = sectionPlanes[sectionPlaneIndex];
if (origin) {
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$m);
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$m, model.matrix);
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
} else {
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -65133,7 +65169,7 @@ class DTXTrianglesSilhouetteRenderer {
const state = dataTextureLayer._state;
const textureState = state.textureState;
const origin = dataTextureLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const viewMatrix = camera.viewMatrix;
if (!this._program) {
@@ -65188,7 +65224,7 @@ class DTXTrianglesSilhouetteRenderer {
gl.uniform3fv(this._uCameraEyeRtc, rtcCameraEye);
gl.uniform1i(this._uRenderPass, renderPass);
- gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrixConjugate);
+ gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrix);
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
@@ -65232,7 +65268,7 @@ class DTXTrianglesSilhouetteRenderer {
if (active) {
const sectionPlane = sectionPlanes[sectionPlaneIndex];
if (origin) {
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$l);
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$l, model.matrix);
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
} else {
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -65593,7 +65629,7 @@ class DTXTrianglesEdgesRenderer {
const state = dataTextureLayer._state;
const textureState = state.textureState;
const origin = dataTextureLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const viewMatrix = camera.viewMatrix;
if (!this._program) {
@@ -65641,7 +65677,7 @@ class DTXTrianglesEdgesRenderer {
}
gl.uniform1i(this._uRenderPass, renderPass);
- gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrixConjugate);
+ gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrix);
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
@@ -65682,7 +65718,7 @@ class DTXTrianglesEdgesRenderer {
if (active) {
const sectionPlane = sectionPlanes[sectionPlaneIndex];
if (origin) {
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$k);
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$k, model.matrix);
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
} else {
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -66007,7 +66043,7 @@ class DTXTrianglesEdgesColorRenderer {
const state = dataTextureLayer._state;
const textureState = state.textureState;
const origin = dataTextureLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const viewMatrix = camera.viewMatrix;
if (!this._program) {
@@ -66055,7 +66091,7 @@ class DTXTrianglesEdgesColorRenderer {
}
gl.uniform1i(this._uRenderPass, renderPass);
- gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrixConjugate);
+ gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrix);
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
@@ -66074,7 +66110,7 @@ class DTXTrianglesEdgesColorRenderer {
if (active) {
const sectionPlane = sectionPlanes[sectionPlaneIndex];
if (origin) {
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$j);
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$j, model.matrix);
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
} else {
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -66427,7 +66463,7 @@ class DTXTrianglesPickMeshRenderer {
const state = dataTextureLayer._state;
const textureState = state.textureState;
const origin = dataTextureLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
const projMatrix = frameCtx.pickProjMatrix || camera.projMatrix;
@@ -66471,7 +66507,7 @@ class DTXTrianglesPickMeshRenderer {
}
gl.uniform2fv(this._uPickClipPos, frameCtx.pickClipPos);
gl.uniform2f(this._uDrawingBufferSize, gl.drawingBufferWidth, gl.drawingBufferHeight);
- gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrixConjugate);
+ gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrix);
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
gl.uniformMatrix4fv(this._uProjMatrix, false, projMatrix);
gl.uniform3fv(this._uCameraEyeRtc, rtcCameraEye);
@@ -66495,7 +66531,7 @@ class DTXTrianglesPickMeshRenderer {
if (active) {
const sectionPlane = sectionPlanes[sectionPlaneIndex];
if (origin) {
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$i);
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$i, model.matrix);
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
} else {
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -66853,7 +66889,7 @@ class DTXTrianglesPickDepthRenderer {
const state = dataTextureLayer._state;
const textureState = state.textureState;
const origin = dataTextureLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
const projMatrix = frameCtx.pickProjMatrix || camera.projMatrix;
@@ -66919,7 +66955,7 @@ class DTXTrianglesPickDepthRenderer {
gl.uniform2f(this._uDrawingBufferSize, gl.drawingBufferWidth, gl.drawingBufferHeight);
gl.uniform1f(this._uPickZNear, frameCtx.pickZNear);
gl.uniform1f(this._uPickZFar, frameCtx.pickZFar);
- gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrixConjugate);
+ gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrix);
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
gl.uniformMatrix4fv(this._uProjMatrix, false, projMatrix);
if (scene.logarithmicDepthBufferEnabled) {
@@ -66942,7 +66978,7 @@ class DTXTrianglesPickDepthRenderer {
if (active) {
const sectionPlane = sectionPlanes[sectionPlaneIndex];
if (origin) {
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$h);
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$h, model.matrix);
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
} else {
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -67328,7 +67364,7 @@ class DTXTrianglesSnapRenderer {
const state = dataTextureLayer._state;
const textureState = state.textureState;
const origin = dataTextureLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const aabb = dataTextureLayer.aabb; // Per-layer AABB for best RTC accuracy
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
@@ -67392,7 +67428,7 @@ class DTXTrianglesSnapRenderer {
gl.uniform3fv(this._uCoordinateScaler, coordinateScaler);
gl.uniform1i(this._uRenderPass, renderPass);
gl.uniform1i(this._uPickInvisible, frameCtx.pickInvisible);
- gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrixConjugate);
+ gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrix);
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
{
@@ -67414,7 +67450,7 @@ class DTXTrianglesSnapRenderer {
if (active) {
const sectionPlane = sectionPlanes[sectionPlaneIndex];
if (origin) {
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$g);
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$g, model.matrix);
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
} else {
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -67754,7 +67790,7 @@ class DTXTrianglesSnapInitRenderer {
const state = dataTextureLayer._state;
const textureState = state.textureState;
const origin = dataTextureLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const aabb = dataTextureLayer.aabb; // Per-layer AABB for best RTC accuracy
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
@@ -67817,7 +67853,7 @@ class DTXTrianglesSnapInitRenderer {
gl.uniform3fv(this._uCoordinateScaler, coordinateScaler);
gl.uniform1i(this._uRenderPass, renderPass);
gl.uniform1i(this._uPickInvisible, frameCtx.pickInvisible);
- gl.uniformMatrix4fv(this._uSceneWorldModelMatrix, false, rotationMatrixConjugate);
+ gl.uniformMatrix4fv(this._uSceneWorldModelMatrix, false, rotationMatrix);
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
{
@@ -67839,7 +67875,7 @@ class DTXTrianglesSnapInitRenderer {
if (active) {
const sectionPlane = sectionPlanes[sectionPlaneIndex];
if (origin) {
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$f);
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$f, model.matrix);
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
} else {
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -68214,7 +68250,7 @@ class DTXTrianglesOcclusionRenderer {
const state = dataTextureLayer._state;
const textureState = state.textureState;
const origin = dataTextureLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
if (!this._program) {
@@ -68268,7 +68304,7 @@ class DTXTrianglesOcclusionRenderer {
gl.uniform3fv(this._uCameraEyeRtc, rtcCameraEye);
gl.uniform1i(this._uRenderPass, renderPass);
- gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrixConjugate);
+ gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrix);
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
@@ -68288,7 +68324,7 @@ class DTXTrianglesOcclusionRenderer {
if (active) {
const sectionPlane = sectionPlanes[sectionPlaneIndex];
if (origin) {
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$e);
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$e, model.matrix);
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
} else {
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -68613,7 +68649,7 @@ class DTXTrianglesDepthRenderer {
const state = dataTextureLayer._state;
const textureState = state.textureState;
const origin = dataTextureLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
if (!this._program) {
this._allocate();
@@ -68665,7 +68701,7 @@ class DTXTrianglesDepthRenderer {
rtcCameraEye = camera.eye;
}
- gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrixConjugate);
+ gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrix);
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
gl.uniform3fv(this._uCameraEyeRtc, rtcCameraEye);
@@ -68691,7 +68727,7 @@ class DTXTrianglesDepthRenderer {
if (active) {
const sectionPlane = sectionPlanes[sectionPlaneIndex];
if (origin) {
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$d);
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$d, model.matrix);
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
} else {
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -69072,7 +69108,7 @@ class DTXTrianglesNormalsRenderer {
const gl = scene.canvas.gl;
const state = dataTextureLayer._state;
const origin = dataTextureLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
const viewMatrix = camera.viewMatrix;
if (!this._program) {
@@ -69120,7 +69156,7 @@ class DTXTrianglesNormalsRenderer {
gl.uniform1i(this._uRenderPass, renderPass);
- gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrixConjugate);
+ gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrix);
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
@@ -69142,7 +69178,7 @@ class DTXTrianglesNormalsRenderer {
if (active) {
const sectionPlane = sectionPlanes[sectionPlaneIndex];
if (origin) {
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$c);
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$c, model.matrix);
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
} else {
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -69419,7 +69455,7 @@ class DTXTrianglesPickNormalsFlatRenderer {
const state = dataTextureLayer._state;
const textureState = state.textureState;
const origin = dataTextureLayer._state.origin;
- const {position, rotationMatrix, rotationMatrixConjugate} = model;
+ const {position, rotationMatrix} = model;
if (!this._program) {
this._allocate();
@@ -69477,7 +69513,7 @@ class DTXTrianglesPickNormalsFlatRenderer {
}
gl.uniform2fv(this._uPickClipPos, frameCtx.pickClipPos);
gl.uniform2f(this._uDrawingBufferSize, gl.drawingBufferWidth, gl.drawingBufferHeight);
- gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrixConjugate);
+ gl.uniformMatrix4fv(this._uSceneModelMatrix, false, rotationMatrix);
gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
gl.uniformMatrix4fv(this._uProjMatrix, false, projMatrix);
gl.uniform3fv(this._uCameraEyeRtc, rtcCameraEye);
@@ -69501,7 +69537,7 @@ class DTXTrianglesPickNormalsFlatRenderer {
if (active) {
const sectionPlane = sectionPlanes[sectionPlaneIndex];
if (origin) {
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$b);
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$b, model.matrix);
gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
} else {
gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -71811,14 +71847,14 @@ class DTXTrianglesLayer {
// object colors
textureState.texturePerObjectColorsAndFlags._textureData.set(tempUint8Array4, subPortionId * 32);
if (this._deferredSetFlagsActive) {
- console.info("_subPortionSetColor defer");
+ //console.info("_subPortionSetColor defer");
this._deferredSetFlagsDirty = true;
return;
}
if (++this._numUpdatesInFrame >= MAX_OBJECT_UPDATES_IN_FRAME_WITHOUT_BATCHED_UPDATE) {
this._beginDeferredFlags(); // Subsequent flags updates now deferred
}
- console.info("_subPortionSetColor write through");
+ //console.info("_subPortionSetColor write through");
gl.bindTexture(gl.TEXTURE_2D, textureState.texturePerObjectColorsAndFlags._texture);
gl.texSubImage2D(
gl.TEXTURE_2D,
@@ -72111,8 +72147,8 @@ class DTXTrianglesLayer {
worldPos[2] = positions[i + 2];
worldPos[3] = 1.0;
math.decompressPosition(worldPos, positionsDecodeMatrix);
- math.transformPoint4(this.model.worldMatrix, worldPos);
- math.transformPoint4(this.model.worldMatrix, worldPos);
+ math.transformPoint4(this.model.worldMatrix, worldPos, worldPos);
+ math.transformPoint4(this.model.worldMatrix, worldPos, worldPos);
worldPos[0] += offsetX;
worldPos[1] += offsetY;
worldPos[2] += offsetZ;
@@ -75893,13 +75929,7 @@ class SceneModel extends Component {
*/
set matrix(value) {
this._matrix.set(value || DEFAULT_MATRIX);
-
- math.quaternionToRotationMat4(this._quaternion, this._worldRotationMatrix);
- math.conjugateQuaternion(this._quaternion, this._conjugateQuaternion);
- math.quaternionToRotationMat4(this._quaternion, this._worldRotationMatrixConjugate);
- this._matrix.set(this._worldRotationMatrix);
- math.translateMat4v(this._position, this._matrix);
-
+ math.decomposeMat4(this._matrix, this._position, this._quaternion, this._scale);
this._matrixDirty = false;
this._setWorldMatrixDirty();
this._sceneModelDirty();
@@ -75914,9 +75944,7 @@ class SceneModel extends Component {
* @type {Number[]}
*/
get matrix() {
- if (this._matrixDirty) {
- this._rebuildMatrices();
- }
+ this._rebuildMatrices();
return this._matrix;
}
@@ -75926,9 +75954,7 @@ class SceneModel extends Component {
* @type {Number[]}
*/
get rotationMatrix() {
- if (this._matrixDirty) {
- this._rebuildMatrices();
- }
+ this._rebuildMatrices();
return this._worldRotationMatrix;
}
@@ -75936,10 +75962,13 @@ class SceneModel extends Component {
if (this._matrixDirty) {
math.quaternionToRotationMat4(this._quaternion, this._worldRotationMatrix);
math.conjugateQuaternion(this._quaternion, this._conjugateQuaternion);
- math.quaternionToRotationMat4(this._quaternion, this._worldRotationMatrixConjugate);
+ math.quaternionToRotationMat4(this._conjugateQuaternion, this._worldRotationMatrixConjugate);
+ math.scaleMat4v(this._scale, this._worldRotationMatrix);
+ math.scaleMat4v(this._scale, this._worldRotationMatrixConjugate);
this._matrix.set(this._worldRotationMatrix);
math.translateMat4v(this._position, this._matrix);
this._matrixDirty = false;
+ this._viewMatrixDirty = true;
}
}
@@ -75951,9 +75980,7 @@ class SceneModel extends Component {
* @type {Number[]}
*/
get rotationMatrixConjugate() {
- if (this._matrixDirty) {
- this._rebuildMatrices();
- }
+ this._rebuildMatrices();
return this._worldRotationMatrixConjugate;
}
@@ -75997,6 +76024,16 @@ class SceneModel extends Component {
return this._worldNormalMatrix;
}
+ _rebuildViewMatrices() {
+ this._rebuildMatrices();
+ if (this._viewMatrixDirty) {
+ math.mulMat4(this.scene.camera.viewMatrix, this._matrix, this._viewMatrix);
+ math.inverseMat4(this._viewMatrix, this._viewNormalMatrix);
+ math.transposeMat4(this._viewNormalMatrix);
+ this._viewMatrixDirty = false;
+ }
+ }
+
/**
* Called by private renderers in ./lib, returns the view matrix with which to
* render this SceneModel. The view matrix is the concatenation of the
@@ -76008,16 +76045,7 @@ class SceneModel extends Component {
if (!this._viewMatrix) {
return this.scene.camera.viewMatrix;
}
- if (this._matrixDirty) {
- this._rebuildMatrices();
- this._viewMatrixDirty = true;
- }
- if (this._viewMatrixDirty) {
- math.mulMat4(this.scene.camera.viewMatrix, this._matrix, this._viewMatrix);
- math.inverseMat4(this._viewMatrix, this._viewNormalMatrix);
- math.transposeMat4(this._viewNormalMatrix);
- this._viewMatrixDirty = false;
- }
+ this._rebuildViewMatrices();
return this._viewMatrix;
}
@@ -76030,18 +76058,7 @@ class SceneModel extends Component {
if (!this._viewNormalMatrix) {
return this.scene.camera.viewNormalMatrix;
}
- if (this._matrixDirty) {
- this._rebuildMatrices();
- this._viewMatrixDirty = true;
- }
- if (this._viewMatrixDirty) {
- math.mulMat4(this.scene.camera.viewMatrix, this._matrix, this._viewMatrix);
- math.inverseMat4(this._viewMatrix, this._viewNormalMatrix);
- math.transposeMat4(this._viewNormalMatrix);
- this._viewMatrixDirty = false;
- }
- math.inverseMat4(this._viewMatrix, this._viewNormalMatrix);
- math.transposeMat4(this._viewNormalMatrix);
+ this._rebuildViewMatrices();
return this._viewNormalMatrix;
}
@@ -77460,6 +77477,7 @@ class SceneModel extends Component {
cfg.meshMatrix = cfg.transform.worldMatrix;
}
mesh.portionId = mesh.layer.createPortion(mesh, cfg);
+ mesh.numPrimitives = cfg.numPrimitives;
this._meshes[cfg.id] = mesh;
this._unusedMeshes[cfg.id] = mesh;
this._meshList.push(mesh);
@@ -77823,7 +77841,7 @@ class SceneModel extends Component {
flags = flags | ENTITY_FLAGS.SELECTED;
}
cfg.flags = flags;
- this._createEntity(cfg);
+ return this._createEntity(cfg);
}
_createEntity(cfg) {
@@ -77854,6 +77872,7 @@ class SceneModel extends Component {
this._entities[cfg.id] = entity;
this._entitiesToFinalize.push(entity);
this.numEntities++;
+ return entity;
}
/**
@@ -81008,9 +81027,6 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
this._mouseState = MOUSE_FIRST_CLICK_EXPECTED;
- const getTop = el => el.offsetTop + (el.offsetParent && (el.offsetParent !== canvas.parentNode) && getTop(el.offsetParent));
- const getLeft = el => el.offsetLeft + (el.offsetParent && (el.offsetParent !== canvas.parentNode) && getLeft(el.offsetParent));
-
const pagePos = math.vec2();
const hoverOn = event => {
@@ -81025,8 +81041,10 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
this._markerDiv.style.left = `${pagePos[0] - 5}px`;
this._markerDiv.style.top = `${pagePos[1] - 5}px`;
} else {
- this._markerDiv.style.left = `${getLeft(canvas) + canvasPos[0] - 5}px`;
- this._markerDiv.style.top = `${getTop(canvas) + canvasPos[1] - 5}px`;
+ const markerPos = math.vec2(canvasPos);
+ transformToNode(canvas, this._markerDiv.parentNode, markerPos);
+ this._markerDiv.style.left = `${markerPos[0] - 5}px`;
+ this._markerDiv.style.top = `${markerPos[1] - 5}px`;
}
this._markerDiv.style.background = "pink";
@@ -88858,9 +88876,9 @@ class MetaModel {
* The {@link MetaObject}s in this MetaModel, each mapped to its ID.
*
* @property metaObjects
- * @type {MetaObject[]}
+ * @type {{String:MetaObject}}
*/
- this.metaObjects = [];
+ this.metaObjects = {};
/**
* Connectivity graph.
@@ -88959,7 +88977,7 @@ class MetaModel {
this.metaScene.metaObjects[id] = metaObject;
metaObject.metaModels = [];
}
- this.metaObjects.push(metaObject);
+ this.metaObjects[id] =metaObject;
if (!metaObjectData.parent) {
this.rootMetaObjects.push(metaObject);
metaScene.rootMetaObjects[id] = metaObject;
@@ -89036,8 +89054,8 @@ class MetaModel {
for (let modelId in metaScene.metaModels) {
const metaModel = metaScene.metaModels[modelId];
- for (let i = 0, len = metaModel.metaObjects.length; i < len; i++) {
- const metaObject = metaModel.metaObjects[i];
+ for (let objectId in metaModel.metaObjects) {
+ const metaObject = metaModel.metaObjects[objectId];
metaObject.metaModels.push(metaModel);
}
}
@@ -89083,8 +89101,9 @@ class MetaModel {
metaObjects: [],
propertySets: []
};
- for (let i = 0, len = this.metaObjects.length; i < len; i++) {
- const metaObject = this.metaObjects[i];
+ const metaObjectsList = Object.values(this.metaObjects);
+ for (let i = 0, len = metaObjectsList.length; i < len; i++) {
+ const metaObject = metaObjectsList[i];
const metaObjectCfg = {
id: metaObject.id,
originalSystemId: metaObject.originalSystemId,
@@ -97823,10 +97842,18 @@ class Viewer {
for (let i = 0, len = pluginContainerElements.length; i < len; i++) {
const containerElement = pluginContainerElements[i];
+ //only calculate the scale for first plugin
+ //for all others keep the scale 1 otherwise it will keep multiplying the scale with the base scale of canvas
+ //resulting in increase/decreased size for the the canvas that is being overlapped
+ const scale = i == 0 ? snapshotCanvas.width / containerElement.clientWidth : 1;
+ const off = math.vec2([ 0, 0 ]);
+ transformToNode(canvas, containerElement, off);
await html2canvas(containerElement, {
canvas: snapshotCanvas,
backgroundColor: null,
- scale: snapshotCanvas.width / containerElement.clientWidth
+ x: off[0],
+ y: off[1],
+ scale
});
}
if (!params.includeGizmos) {
@@ -103060,6 +103087,9 @@ class RenderService {
}
if (indeterminate !== checkbox.indeterminate) {
checkbox.indeterminate = indeterminate;
+ if (indeterminate) {
+ checkbox.checked = false;
+ }
}
}
}
@@ -104071,7 +104101,7 @@ class TreeViewPlugin extends Plugin {
buildingNode = {
nodeId: `${this._id}-${objectId}`,
objectId: objectId,
- title: (metaObject.metaModels.length === 0) ? "na" : this._rootNames[metaObject.metaModels[0].id] || ((metaObjectName && metaObjectName !== "" && metaObjectName !== "Undefined" && metaObjectName !== "Default") ? metaObjectName : metaObjectType),
+ title: (metaObject.metaModels.length === 0) ? metaObjectName : this._rootNames[metaObject.metaModels[0].id] || ((metaObjectName && metaObjectName !== "" && metaObjectName !== "Undefined" && metaObjectName !== "Default") ? metaObjectName : metaObjectType),
type: metaObjectType,
parent: null,
numEntities: 0,
@@ -104174,7 +104204,7 @@ class TreeViewPlugin extends Plugin {
rootNode = {
nodeId: `${this._id}-${objectId}`,
objectId: objectId,
- title: metaObject.metaModels.length === 0 ? "na" : this._rootNames[metaObject.metaModels[0].id] || ((metaObjectName && metaObjectName !== "" && metaObjectName !== "Undefined" && metaObjectName !== "Default") ? metaObjectName : metaObjectType),
+ title: metaObject.metaModels.length === 0 ? metaObjectName : this._rootNames[metaObject.metaModels[0].id] || ((metaObjectName && metaObjectName !== "" && metaObjectName !== "Undefined" && metaObjectName !== "Default") ? metaObjectName : metaObjectType),
type: metaObjectType,
parent: null,
numEntities: 0,
@@ -104255,7 +104285,7 @@ class TreeViewPlugin extends Plugin {
const node = {
nodeId: `${this._id}-${objectId}`,
objectId: objectId,
- title: (!parent) ? metaObject.metaModels.length === 0 ? "na" : (this._rootNames[metaObject.metaModels[0].id] || metaObjectName) : (metaObjectName && metaObjectName !== "" && metaObjectName !== "Undefined" && metaObjectName !== "Default") ? metaObjectName : metaObjectType,
+ title: (!parent) ? metaObject.metaModels.length === 0 ? metaObjectName : (this._rootNames[metaObject.metaModels[0].id] || metaObjectName) : (metaObjectName && metaObjectName !== "" && metaObjectName !== "Undefined" && metaObjectName !== "Default") ? metaObjectName : metaObjectType,
type: metaObjectType,
parent: parent,
numEntities: 0,
@@ -104291,8 +104321,8 @@ class TreeViewPlugin extends Plugin {
if (!children || children.length === 0) {
return;
}
- if (this._hierarchy === "storeys" && node.type === "IfcBuilding") {
- // Assumes that children of an IfcBuilding will always be IfcBuildingStoreys
+ const firstChild = children[0];
+ if ((this._hierarchy === "storeys" || this._hierarchy === "containment") && firstChild.type === "IfcBuildingStorey") {
children.sort(this._getSpatialSortFunc());
} else {
children.sort(this._alphaSortFunc);
@@ -104303,36 +104333,30 @@ class TreeViewPlugin extends Plugin {
}
}
- _getSpatialSortFunc() { // Creates cached sort func with Viewer in scope
+ _getSpatialSortFunc() {
const viewer = this.viewer;
const scene = viewer.scene;
const camera = scene.camera;
- const metaScene = viewer.metaScene;
- return this._spatialSortFunc || (this._spatialSortFunc = (node1, node2) => {
- if (!node1.aabb || !node2.aabb) {
- // Sorting on lowest point of the AABB is likely more more robust when objects could overlap storeys
- if (!node1.aabb) {
- node1.aabb = scene.getAABB(metaScene.getObjectIDsInSubtree(node1.objectId));
- }
- if (!node2.aabb) {
- node2.aabb = scene.getAABB(metaScene.getObjectIDsInSubtree(node2.objectId));
- }
- }
- let idx = 0;
- if (camera.xUp) {
- idx = 0;
- } else if (camera.yUp) {
- idx = 1;
+ return this._spatialSortFunc || (this._spatialSortFunc = (storey1, storey2) => {
+ if (camera.xUp) ; else if (camera.yUp) ; else ;
+ const metaScene = this.viewer.metaScene;
+ const storey1MetaObject = metaScene.metaObjects[storey1.objectId];
+ const storey2MetaObject = metaScene.metaObjects[storey2.objectId];
+
+ if (storey1MetaObject && (storey1MetaObject.attributes && storey1MetaObject.attributes.elevation !== undefined) &&
+ storey2MetaObject && (storey2MetaObject.attributes && storey2MetaObject.attributes.elevation !== undefined)) {
+ const elevation1 = storey1MetaObject.attributes.elevation;
+ const elevation2 = storey2MetaObject.attributes.elevation;
+ if (elevation1 > elevation2) {
+ return -1;
+ }
+ if (elevation1 < elevation2) {
+ return 1;
+ }
+ return 0;
} else {
- idx = 2;
- }
- if (node1.aabb[idx] > node2.aabb[idx]) {
- return -1;
- }
- if (node1.aabb[idx] < node2.aabb[idx]) {
- return 1;
+ return 0;
}
- return 0;
});
}
@@ -109648,10 +109672,8 @@ class XKTLoaderPlugin extends Plugin {
delete params.id;
}
- if (!params.src && !params.xkt && !params.manifestSrc && !params.manifest) {
- this.error("load() param expected: src, xkt, manifestSrc or manifestData");
- return sceneModel; // Return new empty model
- }
+ if (!params.src && !params.xkt && !params.manifestSrc && !params.manifest)
+ throw new Error("XKTLoaderPlugin: load() param expected: src, xkt, manifestSrc or manifestData");
const options = {};
const includeTypes = params.includeTypes || this._includeTypes;
@@ -109750,9 +109772,9 @@ class XKTLoaderPlugin extends Plugin {
globalizeObjectIds: options.globalizeObjectIds
});
if (params.src) {
- this._loadModel(params.src, params, options, sceneModel, null, manifestCtx, finish, error);
+ this._loadModel(params.src, options, sceneModel, null, manifestCtx, finish, error);
} else {
- this._parseModel(params.xkt, params, options, sceneModel, null, manifestCtx);
+ this._parseModel(params.xkt, options, sceneModel, null, manifestCtx);
finish();
}
}, (errMsg) => {
@@ -109766,9 +109788,9 @@ class XKTLoaderPlugin extends Plugin {
globalizeObjectIds: options.globalizeObjectIds
});
if (params.src) {
- this._loadModel(params.src, params, options, sceneModel, null, manifestCtx, finish, error);
+ this._loadModel(params.src, options, sceneModel, null, manifestCtx, finish, error);
} else {
- this._parseModel(params.xkt, params, options, sceneModel, null, manifestCtx);
+ this._parseModel(params.xkt, options, sceneModel, null, manifestCtx);
finish();
}
}
@@ -109777,9 +109799,9 @@ class XKTLoaderPlugin extends Plugin {
} else {
if (params.src) {
- this._loadModel(params.src, params, options, sceneModel, metaModel, manifestCtx, finish, error);
+ this._loadModel(params.src, options, sceneModel, metaModel, manifestCtx, finish, error);
} else if (params.xkt) {
- this._parseModel(params.xkt, params, options, sceneModel, metaModel, manifestCtx);
+ this._parseModel(params.xkt, options, sceneModel, metaModel, manifestCtx);
finish();
} else if (params.manifestSrc || params.manifest) {
const baseDir = params.manifestSrc ? getBaseDirectory(params.manifestSrc) : "";
@@ -109813,7 +109835,7 @@ class XKTLoaderPlugin extends Plugin {
done();
} else {
this._dataSource.getXKT(`${baseDir}${xktFiles[i]}`, (arrayBuffer) => {
- this._parseModel(arrayBuffer, params, options, sceneModel, null /* Ignore metamodel in XKT */, manifestCtx);
+ this._parseModel(arrayBuffer, options, sceneModel, null /* Ignore metamodel in XKT */, manifestCtx);
sceneModel.preFinalize();
i++;
this.scheduleTask(loadNext, 200);
@@ -109831,7 +109853,7 @@ class XKTLoaderPlugin extends Plugin {
done();
} else {
this._dataSource.getXKT(`${baseDir}${xktFiles[i]}`, (arrayBuffer) => {
- this._parseModel(arrayBuffer, params, options, sceneModel, metaModel, manifestCtx);
+ this._parseModel(arrayBuffer, options, sceneModel, metaModel, manifestCtx);
sceneModel.preFinalize();
i++;
this.scheduleTask(loadNext, 200);
@@ -109881,15 +109903,15 @@ class XKTLoaderPlugin extends Plugin {
return sceneModel;
}
- _loadModel(src, params, options, sceneModel, metaModel, manifestCtx, done, error) {
- this._dataSource.getXKT(params.src, (arrayBuffer) => {
- this._parseModel(arrayBuffer, params, options, sceneModel, metaModel, manifestCtx);
+ _loadModel(src, options, sceneModel, metaModel, manifestCtx, done, error) {
+ this._dataSource.getXKT(src, (arrayBuffer) => {
+ this._parseModel(arrayBuffer, options, sceneModel, metaModel, manifestCtx);
sceneModel.preFinalize();
done();
}, error);
}
- async _parseModel(arrayBuffer, params, options, sceneModel, metaModel, manifestCtx) {
+ async _parseModel(arrayBuffer, options, sceneModel, metaModel, manifestCtx) {
if (sceneModel.destroyed) {
return;
}
diff --git a/dist/xeokit-bim-viewer.min.es.js b/dist/xeokit-bim-viewer.min.es.js
index 440951c3..38b57f91 100644
--- a/dist/xeokit-bim-viewer.min.es.js
+++ b/dist/xeokit-bim-viewer.min.es.js
@@ -1,4 +1,4 @@
-class e{constructor(e,t){this.items=e||[],this._lastUniqueId=(t||0)+1}addItem(){let e;if(2===arguments.length){const t=arguments[0];if(e=arguments[1],this.items[t])throw"ID clash: '"+t+"'";return this.items[t]=e,t}for(e=arguments[0]||{};;){const t=this._lastUniqueId++;if(!this.items[t])return this.items[t]=e,t}}removeItem(e){const t=this.items[e];return delete this.items[e],t}}const t=new e;class i{constructor(e){this.id=e,this.parentItem=null,this.groups=[],this.menuElement=null,this.shown=!1,this.mouseOver=0}}class s{constructor(){this.items=[]}}class r{constructor(e,t,i,s,r){this.id=e,this.getTitle=t,this.doAction=i,this.getEnabled=s,this.getShown=r,this.itemElement=null,this.subMenu=null,this.enabled=!0}}class o{constructor(e={}){this._id=t.addItem(),this._context=null,this._enabled=!1,this._itemsCfg=[],this._rootMenu=null,this._menuList=[],this._menuMap={},this._itemList=[],this._itemMap={},this._shown=!1,this._nextId=0,this._eventSubs={},!1!==e.hideOnMouseDown&&(document.addEventListener("mousedown",(e=>{e.target.classList.contains("xeokit-context-menu-item")||this.hide()})),document.addEventListener("touchstart",this._canvasTouchStartHandler=e=>{e.target.classList.contains("xeokit-context-menu-item")||this.hide()})),e.items&&(this.items=e.items),this._hideOnAction=!1!==e.hideOnAction,this.context=e.context,this.enabled=!1!==e.enabled,this.hide()}on(e,t){let i=this._eventSubs[e];i||(i=[],this._eventSubs[e]=i),i.push(t)}fire(e,t){const i=this._eventSubs[e];if(i)for(let e=0,s=i.length;e{const o=this._getNextId(),n=new i(o);for(let i=0,o=e.length;i0,A=this._getNextId(),h=i.getTitle||(()=>i.title||""),c=i.doAction||i.callback||(()=>{}),u=i.getEnabled||(()=>!0),d=i.getShown||(()=>!0),p=new r(A,h,c,u,d);if(p.parentMenu=n,a.items.push(p),l){const e=t(s);p.subMenu=e,e.parentItem=p}this._itemList.push(p),this._itemMap[p.id]=p}}return this._menuList.push(n),this._menuMap[n.id]=n,n};this._rootMenu=t(e)}_getNextId(){return"ContextMenu_"+this._id+"_"+this._nextId++}_createUI(){const e=t=>{this._createMenuUI(t);const i=t.groups;for(let t=0,s=i.length;t