@xeokit/xeokit-sdk 2.5.2-beta-2 → 2.5.2-beta-3
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 +97 -51
- package/dist/xeokit-sdk.es.js +97 -51
- package/dist/xeokit-sdk.es5.js +83 -72
- package/dist/xeokit-sdk.min.cjs.js +1 -1
- package/dist/xeokit-sdk.min.es.js +5 -5
- package/dist/xeokit-sdk.min.es5.js +3 -3
- package/package.json +1 -1
- package/src/extras/MarqueePicker/MarqueePickerMouseControl.js +1 -1
- package/src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js +2 -2
- package/src/viewer/Configs.js +1 -2
- package/src/viewer/scene/LineSet/LineSet.js +1 -1
- package/src/viewer/scene/model/SceneModel.js +2 -2
- package/src/viewer/scene/model/SceneModelEntity.js +10 -8
- package/src/viewer/scene/model/SceneModelTransform.js +1 -1
- package/src/viewer/scene/model/dtx/lines/DTXLinesLayer.js +1 -1
- package/src/viewer/scene/model/dtx/triangles/DTXTrianglesLayer.js +2 -2
- package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesSnapInitRenderer.js +5 -2
- package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLineSnapInitRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesColorRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesRenderers.js +2 -2
- package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesSilhouetteRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesSnapInitRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOBatchingLinesSnapRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/lines/renderers/VBOSceneModelLineBatchingRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/points/VBOBatchingPointsRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsColorRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsOcclusionRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsPickDepthRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsPickMeshRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsRenderers.js +2 -2
- package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsShadowRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsSilhouetteRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsSnapInitRenderer.js +5 -5
- package/src/viewer/scene/model/vbo/batching/points/renderers/VBOBatchingPointsSnapRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/triangles/VBOBatchingTrianglesBuffer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/triangles/renderers/VBOBatchingTrianglesColorRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/triangles/renderers/VBOBatchingTrianglesDepthRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/triangles/renderers/VBOBatchingTrianglesEdgesColorRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/triangles/renderers/VBOBatchingTrianglesFlatColorRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/batching/triangles/renderers/VBOBatchingTrianglesRenderers.js +2 -2
- package/src/viewer/scene/model/vbo/batching/triangles/renderers/VBOSceneModelTriangleBatchingEdgesRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/lines/renderers/VBOInstancingLinesColorRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/lines/renderers/VBOInstancingLinesRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsDepthRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsPickDepthRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsRenderers.js +2 -2
- package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsShadowRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsSilhouetteRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingPointsSnapInitRenderer.js +5 -4
- package/src/viewer/scene/model/vbo/instancing/points/renderers/VBOInstancingTrianglesRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/VBOInstancingTrianglesColorTextureRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/VBOInstancingTrianglesDepthRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/VBOInstancingTrianglesEdgesColorRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/VBOInstancingTrianglesEdgesRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/VBOInstancingTrianglesFlatColorRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/VBOInstancingTrianglesFlatNormalsRenderer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/VBOInstancingTrianglesRenderers.js +2 -2
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/VBOSceneModelTriangleInstancingEdgesRenderer.js +1 -1
- package/src/viewer/scene/scene/Scene.js +46 -6
package/dist/xeokit-sdk.es5.js
CHANGED
|
@@ -2522,7 +2522,7 @@ if(lastOpacityQuantized===opacityQuantized){return;}}else{opacityQuantized=255.0
|
|
|
2522
2522
|
* Default value is ````[0,0,0]````.
|
|
2523
2523
|
*
|
|
2524
2524
|
* @type {Number[]}
|
|
2525
|
-
*/,set:function set(offset){if(offset){this._offset[0]=offset[0];this._offset[1]=offset[1];this._offset[2]=offset[2];}else{this._offset[0]=0;this._offset[1]=0;this._offset[2]=0;}for(var _i39=0,len=this.meshes.length;_i39<len;_i39++){this.meshes[_i39]._setOffset(this._offset);}this._aabbDirty=true;this.model._aabbDirty=true;this.scene._aabbDirty=true;this.scene._objectOffsetUpdated(this,offset);this.model.glRedraw();}},{key:"saoEnabled",get:function get(){return this.model.saoEnabled;}},{key:"getEachVertex",value:function getEachVertex(callback){for(var _i40=0,len=this.meshes.length;_i40<len;_i40++){this.meshes[_i40].getEachVertex(callback);}}},{key:"_getFlag",value:function _getFlag(flag){return!!(this._flags&flag);}},{key:"_finalize",value:function _finalize(){var scene=this.model.scene;if(this._isObject){if(this.visible){scene._objectVisibilityUpdated(this);}if(this.highlighted){scene._objectHighlightedUpdated(this);}if(this.xrayed){scene._objectXRayedUpdated(this);}if(this.selected){scene._objectSelectedUpdated(this);}}for(var _i41=0,len=this.meshes.length;_i41<len;_i41++){this.meshes[_i41]._finalize(this._flags);}}},{key:"_finalize2",value:function _finalize2(){for(var _i42=0,len=this.meshes.length;_i42<len;_i42++){this.meshes[_i42]._finalize2();}}},{key:"_destroy",value:function _destroy(){var scene=this.model.scene;if(this._isObject){scene._deregisterObject(this);if(this.visible){scene.
|
|
2525
|
+
*/,set:function set(offset){if(offset){this._offset[0]=offset[0];this._offset[1]=offset[1];this._offset[2]=offset[2];}else{this._offset[0]=0;this._offset[1]=0;this._offset[2]=0;}for(var _i39=0,len=this.meshes.length;_i39<len;_i39++){this.meshes[_i39]._setOffset(this._offset);}this._aabbDirty=true;this.model._aabbDirty=true;this.scene._aabbDirty=true;this.scene._objectOffsetUpdated(this,offset);this.model.glRedraw();}},{key:"saoEnabled",get:function get(){return this.model.saoEnabled;}},{key:"getEachVertex",value:function getEachVertex(callback){for(var _i40=0,len=this.meshes.length;_i40<len;_i40++){this.meshes[_i40].getEachVertex(callback);}}},{key:"_getFlag",value:function _getFlag(flag){return!!(this._flags&flag);}},{key:"_finalize",value:function _finalize(){var scene=this.model.scene;if(this._isObject){if(this.visible){scene._objectVisibilityUpdated(this);}if(this.highlighted){scene._objectHighlightedUpdated(this);}if(this.xrayed){scene._objectXRayedUpdated(this);}if(this.selected){scene._objectSelectedUpdated(this);}}for(var _i41=0,len=this.meshes.length;_i41<len;_i41++){this.meshes[_i41]._finalize(this._flags);}}},{key:"_finalize2",value:function _finalize2(){for(var _i42=0,len=this.meshes.length;_i42<len;_i42++){this.meshes[_i42]._finalize2();}}},{key:"_destroy",value:function _destroy(){var scene=this.model.scene;if(this._isObject){scene._deregisterObject(this);if(this.visible){scene._deRegisterVisibleObject(this);}if(this.xrayed){scene._deRegisterXRayedObject(this);}if(this.selected){scene._deRegisterSelectedObject(this);}if(this.highlighted){scene._deRegisterHighlightedObject(this);}if(this._colorizeUpdated){this.scene._deRegisterColorizedObject(this);}if(this._opacityUpdated){this.scene._deRegisterOpacityObject(this);}if(this._offset&&(this._offset[0]!==0||this._offset[1]!==0||this._offset[2]!==0)){this.scene._deRegisterOffsetObject(this);}}for(var _i43=0,len=this.meshes.length;_i43<len;_i43++){this.meshes[_i43]._destroy();}scene._aabbDirty=true;}}]);return SceneModelEntity;}();var tempVec4a$9=math.vec4();var tempVec4b$6=math.vec4();/**
|
|
2526
2526
|
* @desc Tracks the World, View and Canvas coordinates, and visibility, of a position within a {@link Scene}.
|
|
2527
2527
|
*
|
|
2528
2528
|
* ## Position
|
|
@@ -9008,12 +9008,19 @@ var types=this.types[type];if(types){delete types[id];if(utils.isEmptyObject(typ
|
|
|
9008
9008
|
this.fire("modelUnloaded",modelId);}},{key:"_registerObject",value:function _registerObject(entity){this.objects[entity.id]=entity;this._numObjects++;this._objectIds=null;// Lazy regenerate
|
|
9009
9009
|
}},{key:"_deregisterObject",value:function _deregisterObject(entity){delete this.objects[entity.id];this._numObjects--;this._objectIds=null;// Lazy regenerate
|
|
9010
9010
|
}},{key:"_objectVisibilityUpdated",value:function _objectVisibilityUpdated(entity){var notify=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;if(entity.visible){this.visibleObjects[entity.id]=entity;this._numVisibleObjects++;}else{delete this.visibleObjects[entity.id];this._numVisibleObjects--;}this._visibleObjectIds=null;// Lazy regenerate
|
|
9011
|
-
if(notify){this.fire("objectVisibility",entity,true);}}},{key:"
|
|
9012
|
-
|
|
9013
|
-
if(notify){this.fire("
|
|
9014
|
-
|
|
9011
|
+
if(notify){this.fire("objectVisibility",entity,true);}}},{key:"_deRegisterVisibleObject",value:function _deRegisterVisibleObject(entity){delete this.visibleObjects[entity.id];this._numVisibleObjects--;this._visibleObjectIds=null;// Lazy regenerate
|
|
9012
|
+
}},{key:"_objectXRayedUpdated",value:function _objectXRayedUpdated(entity){var notify=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;if(entity.xrayed){this.xrayedObjects[entity.id]=entity;this._numXRayedObjects++;}else{delete this.xrayedObjects[entity.id];this._numXRayedObjects--;}this._xrayedObjectIds=null;// Lazy regenerate
|
|
9013
|
+
if(notify){this.fire("objectXRayed",entity,true);}}},{key:"_deRegisterXRayedObject",value:function _deRegisterXRayedObject(entity){delete this.xrayedObjects[entity.id];this._numXRayedObjects--;this._xrayedObjectIds=null;// Lazy regenerate
|
|
9014
|
+
}},{key:"_objectHighlightedUpdated",value:function _objectHighlightedUpdated(entity){if(entity.highlighted){this.highlightedObjects[entity.id]=entity;this._numHighlightedObjects++;}else{delete this.highlightedObjects[entity.id];this._numHighlightedObjects--;}this._highlightedObjectIds=null;// Lazy regenerate
|
|
9015
|
+
}},{key:"_deRegisterHighlightedObject",value:function _deRegisterHighlightedObject(entity){delete this.highlightedObjects[entity.id];this._numHighlightedObjects--;this._highlightedObjectIds=null;// Lazy regenerate
|
|
9016
|
+
}},{key:"_objectSelectedUpdated",value:function _objectSelectedUpdated(entity){var notify=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;if(entity.selected){this.selectedObjects[entity.id]=entity;this._numSelectedObjects++;}else{delete this.selectedObjects[entity.id];this._numSelectedObjects--;}this._selectedObjectIds=null;// Lazy regenerate
|
|
9017
|
+
if(notify){this.fire("objectSelected",entity,true);}}},{key:"_deRegisterSelectedObject",value:function _deRegisterSelectedObject(entity){delete this.selectedObjects[entity.id];this._numSelectedObjects--;this._selectedObjectIds=null;// Lazy regenerate
|
|
9018
|
+
}},{key:"_objectColorizeUpdated",value:function _objectColorizeUpdated(entity,colorized){if(colorized){this.colorizedObjects[entity.id]=entity;this._numColorizedObjects++;}else{delete this.colorizedObjects[entity.id];this._numColorizedObjects--;}this._colorizedObjectIds=null;// Lazy regenerate
|
|
9019
|
+
}},{key:"_deRegisterColorizedObject",value:function _deRegisterColorizedObject(entity){delete this.colorizedObjects[entity.id];this._numColorizedObjects--;this._colorizedObjectIds=null;// Lazy regenerate
|
|
9015
9020
|
}},{key:"_objectOpacityUpdated",value:function _objectOpacityUpdated(entity,opacityUpdated){if(opacityUpdated){this.opacityObjects[entity.id]=entity;this._numOpacityObjects++;}else{delete this.opacityObjects[entity.id];this._numOpacityObjects--;}this._opacityObjectIds=null;// Lazy regenerate
|
|
9021
|
+
}},{key:"_deRegisterOpacityObject",value:function _deRegisterOpacityObject(entity){delete this.opacityObjects[entity.id];this._numOpacityObjects--;this._opacityObjectIds=null;// Lazy regenerate
|
|
9016
9022
|
}},{key:"_objectOffsetUpdated",value:function _objectOffsetUpdated(entity,offset){if(!offset||offset[0]===0&&offset[1]===0&&offset[2]===0){this.offsetObjects[entity.id]=entity;this._numOffsetObjects++;}else{delete this.offsetObjects[entity.id];this._numOffsetObjects--;}this._offsetObjectIds=null;// Lazy regenerate
|
|
9023
|
+
}},{key:"_deRegisterOffsetObject",value:function _deRegisterOffsetObject(entity){delete this.offsetObjects[entity.id];this._numOffsetObjects--;this._offsetObjectIds=null;// Lazy regenerate
|
|
9017
9024
|
}},{key:"_webglContextLost",value:function _webglContextLost(){// this.loading++;
|
|
9018
9025
|
this.canvas.spinner.processes++;for(var id in this.components){if(this.components.hasOwnProperty(id)){var component=this.components[id];if(component._webglContextLost){component._webglContextLost();}}}this._renderer.webglContextLost();}},{key:"_webglContextRestored",value:function _webglContextRestored(){var gl=this.canvas.gl;for(var id in this.components){if(this.components.hasOwnProperty(id)){var component=this.components[id];if(component._webglContextRestored){component._webglContextRestored(gl);}}}this._renderer.webglContextRestored(gl);//this.loading--;
|
|
9019
9026
|
this.canvas.spinner.processes--;}/**
|
|
@@ -14759,7 +14766,10 @@ gl.uniform1f(this._uLogDepthBufFC,logDepthBufFC);}this.setSectionPlanesStateUnif
|
|
|
14759
14766
|
gl.drawArrays(gl.POINTS,0,state.positionsBuf.numItems);}},{key:"_allocate",value:function _allocate(){_get(_getPrototypeOf(VBOBatchingPointsSnapInitRenderer.prototype),"_allocate",this).call(this);var program=this._program;{this._uLogDepthBufFC=program.getLocation("logDepthBufFC");}this._uCameraEyeRtc=program.getLocation("uCameraEyeRtc");this.uVectorA=program.getLocation("snapVectorA");this.uInverseVectorAB=program.getLocation("snapInvVectorAB");this._uLayerNumber=program.getLocation("layerNumber");this._uCoordinateScaler=program.getLocation("coordinateScaler");}},{key:"_bindProgram",value:function _bindProgram(){this._program.bind();}},{key:"_buildVertexShader",value:function _buildVertexShader(){var scene=this._scene;var clipping=scene._sectionPlanesState.getNumAllocatedSectionPlanes()>0;var src=[];src.push('#version 300 es');src.push("// VBOBatchingPointsSnapInitRenderer vertex shader");src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");src.push("precision highp float;");src.push("precision highp int;");src.push("precision highp usampler2D;");src.push("precision highp isampler2D;");src.push("precision highp sampler2D;");src.push("#else");src.push("precision mediump float;");src.push("precision mediump int;");src.push("precision mediump usampler2D;");src.push("precision mediump isampler2D;");src.push("precision mediump sampler2D;");src.push("#endif");src.push("uniform int renderPass;");src.push("in vec4 pickColor;");src.push("in vec3 position;");if(scene.entityOffsetsEnabled){src.push("in vec3 offset;");}src.push("in float flags;");src.push("uniform bool pickInvisible;");this._addMatricesUniformBlockLines(src);src.push("uniform vec3 uCameraEyeRtc;");src.push("uniform vec2 snapVectorA;");src.push("uniform vec2 snapInvVectorAB;");{src.push("uniform float logDepthBufFC;");src.push("out float vFragDepth;");src.push("out float isPerspective;");}src.push("bool isPerspectiveMatrix(mat4 m) {");src.push(" return (m[2][3] == - 1.0);");src.push("}");src.push("vec2 remapClipPos(vec2 clipPos) {");src.push(" float x = (clipPos.x - snapVectorA.x) * snapInvVectorAB.x;");src.push(" float y = (clipPos.y - snapVectorA.y) * snapInvVectorAB.y;");src.push(" return vec2(x, y);");src.push("}");src.push("flat out vec4 vPickColor;");src.push("out vec4 vWorldPosition;");if(clipping){src.push("out float vFlags;");}src.push("out highp vec3 relativeToOriginPosition;");src.push("void main(void) {");// pickFlag = NOT_RENDERED | PICK
|
|
14760
14767
|
// renderPass = PICK
|
|
14761
14768
|
src.push("int pickFlag = int(flags) >> 12 & 0xF;");src.push("if (pickFlag != renderPass) {");src.push(" gl_Position = vec4(0.0, 0.0, 0.0, 0.0);");// Cull vertex
|
|
14762
|
-
src.push(" } else {");src.push(" vec4 worldPosition = worldMatrix * (positionsDecodeMatrix * vec4(position, 1.0)); ");if(scene.entityOffsetsEnabled){src.push(" worldPosition.xyz = worldPosition.xyz + offset;");}src.push(" relativeToOriginPosition = worldPosition.xyz;");src.push(" vec4 viewPosition = viewMatrix * worldPosition; ");src.push(" vWorldPosition = worldPosition;");if(clipping){src.push(" vFlags = flags;");}src.push("vPickColor = pickColor;");src.push("vec4 clipPos = projMatrix * viewPosition;");src.push("float tmp = clipPos.w;");src.push("clipPos.xyzw /= tmp;");src.push("clipPos.xy = remapClipPos(clipPos.xy);");src.push("clipPos.xyzw *= tmp;");{src.push("vFragDepth = 1.0 + clipPos.w;");src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");}src.push("gl_Position = clipPos;");src.push(" }");src.push("}");return src;}},{key:"_buildFragmentShader",value:function _buildFragmentShader(){var scene=this._scene;var sectionPlanesState=scene._sectionPlanesState;var clipping=sectionPlanesState.getNumAllocatedSectionPlanes()>0;var src=[];src.push('#version 300 es');src.push("// VBOBatchingPointsSnapInitRenderer fragment shader");src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");src.push("precision highp float;");src.push("precision highp int;");src.push("#else");src.push("precision mediump float;");src.push("precision mediump int;");src.push("#endif");{src.push("in float isPerspective;");src.push("uniform float logDepthBufFC;");src.push("in float vFragDepth;");}src.push("uniform int layerNumber;");src.push("uniform vec3 coordinateScaler;");src.push("in vec4 vWorldPosition;");src.push("flat in vec4 vPickColor;");if(clipping){src.push("in float vFlags;");for(var _i274=0;_i274<sectionPlanesState.getNumAllocatedSectionPlanes();_i274++){src.push("uniform bool sectionPlaneActive"+_i274+";");src.push("uniform vec3 sectionPlanePos"+_i274+";");src.push("uniform vec3 sectionPlaneDir"+_i274+";");}}src.push("in highp vec3 relativeToOriginPosition;");src.push("layout(location = 0) out highp ivec4 outCoords;");src.push("layout(location = 1) out highp ivec4 outNormal;");src.push("layout(location = 2) out lowp uvec4 outPickColor;");src.push("void main(void) {");if(clipping){src.push(" bool clippable = (int(vFlags) >> 16 & 0xF) == 1;");src.push(" if (clippable) {");src.push(" float dist = 0.0;");for(var i=0;i<sectionPlanesState.getNumAllocatedSectionPlanes();i++){src.push(" if (sectionPlaneActive"+i+") {");src.push(" dist += clamp(dot(-sectionPlaneDir"+i+".xyz, vWorldPosition.xyz - sectionPlanePos"+i+".xyz), 0.0, 1000.0);");src.push(" }");}src.push(" if (dist > 0.0) { discard; }");src.push(" }");}{src.push(" float dx = dFdx(vFragDepth);");src.push(" float dy = dFdy(vFragDepth);");src.push(" float diff = sqrt(dx*dx+dy*dy);");src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth + diff ) * logDepthBufFC * 0.5;");}src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, -layerNumber);")
|
|
14769
|
+
src.push(" } else {");src.push(" vec4 worldPosition = worldMatrix * (positionsDecodeMatrix * vec4(position, 1.0)); ");if(scene.entityOffsetsEnabled){src.push(" worldPosition.xyz = worldPosition.xyz + offset;");}src.push(" relativeToOriginPosition = worldPosition.xyz;");src.push(" vec4 viewPosition = viewMatrix * worldPosition; ");src.push(" vWorldPosition = worldPosition;");if(clipping){src.push(" vFlags = flags;");}src.push("vPickColor = pickColor;");src.push("vec4 clipPos = projMatrix * viewPosition;");src.push("float tmp = clipPos.w;");src.push("clipPos.xyzw /= tmp;");src.push("clipPos.xy = remapClipPos(clipPos.xy);");src.push("clipPos.xyzw *= tmp;");{src.push("vFragDepth = 1.0 + clipPos.w;");src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");}src.push("gl_Position = clipPos;");src.push(" }");src.push("}");return src;}},{key:"_buildFragmentShader",value:function _buildFragmentShader(){var scene=this._scene;var sectionPlanesState=scene._sectionPlanesState;var clipping=sectionPlanesState.getNumAllocatedSectionPlanes()>0;var src=[];src.push('#version 300 es');src.push("// VBOBatchingPointsSnapInitRenderer fragment shader");src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");src.push("precision highp float;");src.push("precision highp int;");src.push("#else");src.push("precision mediump float;");src.push("precision mediump int;");src.push("#endif");{src.push("in float isPerspective;");src.push("uniform float logDepthBufFC;");src.push("in float vFragDepth;");}src.push("uniform int layerNumber;");src.push("uniform vec3 coordinateScaler;");src.push("in vec4 vWorldPosition;");src.push("flat in vec4 vPickColor;");if(clipping){src.push("in float vFlags;");for(var _i274=0;_i274<sectionPlanesState.getNumAllocatedSectionPlanes();_i274++){src.push("uniform bool sectionPlaneActive"+_i274+";");src.push("uniform vec3 sectionPlanePos"+_i274+";");src.push("uniform vec3 sectionPlaneDir"+_i274+";");}}src.push("in highp vec3 relativeToOriginPosition;");src.push("layout(location = 0) out highp ivec4 outCoords;");src.push("layout(location = 1) out highp ivec4 outNormal;");src.push("layout(location = 2) out lowp uvec4 outPickColor;");src.push("void main(void) {");if(clipping){src.push(" bool clippable = (int(vFlags) >> 16 & 0xF) == 1;");src.push(" if (clippable) {");src.push(" float dist = 0.0;");for(var i=0;i<sectionPlanesState.getNumAllocatedSectionPlanes();i++){src.push(" if (sectionPlaneActive"+i+") {");src.push(" dist += clamp(dot(-sectionPlaneDir"+i+".xyz, vWorldPosition.xyz - sectionPlanePos"+i+".xyz), 0.0, 1000.0);");src.push(" }");}src.push(" if (dist > 0.0) { discard; }");src.push(" }");}{src.push(" float dx = dFdx(vFragDepth);");src.push(" float dy = dFdy(vFragDepth);");src.push(" float diff = sqrt(dx*dx+dy*dy);");src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth + diff ) * logDepthBufFC * 0.5;");}src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, -layerNumber);");// src.push("vec3 xTangent = dFdx( vWorldPosition.xyz );");
|
|
14770
|
+
// src.push("vec3 yTangent = dFdy( vWorldPosition.xyz );");
|
|
14771
|
+
// src.push("vec3 worldNormal = normalize( cross( xTangent, yTangent ) );");
|
|
14772
|
+
src.push("outNormal = ivec4(1.0, 1.0, 1.0, 1.0);");src.push("outPickColor = uvec4(vPickColor);");src.push("}");return src;}},{key:"webglContextRestored",value:function webglContextRestored(){this._program=null;}},{key:"destroy",value:function destroy(){if(this._program){this._program.destroy();}this._program=null;}}]);return VBOBatchingPointsSnapInitRenderer;}(VBORenderer);var tempVec3a$q=math.vec3();var tempVec3b$m=math.vec3();var tempVec3c$h=math.vec3();var tempVec3d$3=math.vec3();var tempMat4a$h=math.mat4();/**
|
|
14763
14773
|
* @private
|
|
14764
14774
|
*/var VBOBatchingPointsSnapRenderer=/*#__PURE__*/function(_VBORenderer15){_inherits(VBOBatchingPointsSnapRenderer,_VBORenderer15);var _super100=_createSuper(VBOBatchingPointsSnapRenderer);function VBOBatchingPointsSnapRenderer(){_classCallCheck(this,VBOBatchingPointsSnapRenderer);return _super100.apply(this,arguments);}_createClass(VBOBatchingPointsSnapRenderer,[{key:"_getHash",value:function _getHash(){return this._scene._sectionPlanesState.getHash()+this._scene.pointsMaterial.hash;}},{key:"drawLayer",value:function drawLayer(frameCtx,batchingLayer,renderPass){if(!this._program){this._allocate();if(this.errors){return;}}if(frameCtx.lastProgramId!==this._program.id){frameCtx.lastProgramId=this._program.id;this._bindProgram();}var model=batchingLayer.model;var scene=model.scene;var camera=scene.camera;var gl=scene.canvas.gl;var state=batchingLayer._state;var origin=batchingLayer._state.origin;var position=model.position,rotationMatrix=model.rotationMatrix,rotationMatrixConjugate=model.rotationMatrixConjugate;var aabb=batchingLayer.aabb;// Per-layer AABB for best RTC accuracy
|
|
14765
14775
|
var viewMatrix=frameCtx.pickViewMatrix||camera.viewMatrix;if(this._vaoCache.has(batchingLayer)){gl.bindVertexArray(this._vaoCache.get(batchingLayer));}else{this._vaoCache.set(batchingLayer,this._makeVAO(state));}var coordinateScaler=tempVec3a$q;coordinateScaler[0]=math.safeInv(aabb[3]-aabb[0])*math.MAX_INT;coordinateScaler[1]=math.safeInv(aabb[4]-aabb[1])*math.MAX_INT;coordinateScaler[2]=math.safeInv(aabb[5]-aabb[2])*math.MAX_INT;frameCtx.snapPickCoordinateScale[0]=math.safeInv(coordinateScaler[0]);frameCtx.snapPickCoordinateScale[1]=math.safeInv(coordinateScaler[1]);frameCtx.snapPickCoordinateScale[2]=math.safeInv(coordinateScaler[2]);var rtcViewMatrix;var rtcCameraEye;if(origin||position[0]!==0||position[1]!==0||position[2]!==0){var rtcOrigin=tempVec3b$m;if(origin){var rotatedOrigin=tempVec3c$h;math.transformPoint3(rotationMatrix,origin,rotatedOrigin);rtcOrigin[0]=rotatedOrigin[0];rtcOrigin[1]=rotatedOrigin[1];rtcOrigin[2]=rotatedOrigin[2];}else{rtcOrigin[0]=0;rtcOrigin[1]=0;rtcOrigin[2]=0;}rtcOrigin[0]+=position[0];rtcOrigin[1]+=position[1];rtcOrigin[2]+=position[2];rtcViewMatrix=createRTCViewMat(viewMatrix,rtcOrigin,tempMat4a$h);rtcCameraEye=tempVec3d$3;rtcCameraEye[0]=camera.eye[0]-rtcOrigin[0];rtcCameraEye[1]=camera.eye[1]-rtcOrigin[1];rtcCameraEye[2]=camera.eye[2]-rtcOrigin[2];frameCtx.snapPickOrigin[0]=rtcOrigin[0];frameCtx.snapPickOrigin[1]=rtcOrigin[1];frameCtx.snapPickOrigin[2]=rtcOrigin[2];}else{rtcViewMatrix=viewMatrix;rtcCameraEye=camera.eye;frameCtx.snapPickOrigin[0]=0;frameCtx.snapPickOrigin[1]=0;frameCtx.snapPickOrigin[2]=0;}gl.uniform3fv(this._uCameraEyeRtc,rtcCameraEye);gl.uniform2fv(this.uVectorA,frameCtx.snapVectorA);gl.uniform2fv(this.uInverseVectorAB,frameCtx.snapInvVectorAB);gl.uniform1i(this._uLayerNumber,frameCtx.snapPickLayerNumber);gl.uniform3fv(this._uCoordinateScaler,coordinateScaler);gl.uniform1i(this._uRenderPass,renderPass);gl.uniform1i(this._uPickInvisible,frameCtx.pickInvisible);var offset=0;var mat4Size=4*4;this._matricesUniformBlockBufferData.set(rotationMatrixConjugate,0);this._matricesUniformBlockBufferData.set(rtcViewMatrix,offset+=mat4Size);this._matricesUniformBlockBufferData.set(camera.projMatrix,offset+=mat4Size);this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix,offset+=mat4Size);gl.bindBuffer(gl.UNIFORM_BUFFER,this._matricesUniformBlockBuffer);gl.bufferData(gl.UNIFORM_BUFFER,this._matricesUniformBlockBufferData,gl.DYNAMIC_DRAW);gl.bindBufferBase(gl.UNIFORM_BUFFER,this._matricesUniformBlockBufferBindingPoint,this._matricesUniformBlockBuffer);{var logDepthBufFC=2.0/(Math.log(frameCtx.pickZFar+1.0)/Math.LN2);// TODO: Far from pick project matrix?
|
|
@@ -14888,11 +14898,10 @@ gl.vertexAttribDivisor(this._aModelMatrixCol0.location,0);gl.vertexAttribDivisor
|
|
|
14888
14898
|
src.push("in vec4 modelMatrixCol1;");src.push("in vec4 modelMatrixCol2;");src.push("uniform bool pickInvisible;");this._addMatricesUniformBlockLines(src);src.push("uniform vec2 snapVectorA;");src.push("uniform vec2 snapInvVectorAB;");{src.push("uniform float logDepthBufFC;");src.push("out float vFragDepth;");src.push("bool isPerspectiveMatrix(mat4 m) {");src.push(" return (m[2][3] == - 1.0);");src.push("}");src.push("out float isPerspective;");}src.push("vec2 remapClipPos(vec2 clipPos) {");src.push(" float x = (clipPos.x - snapVectorA.x) * snapInvVectorAB.x;");src.push(" float y = (clipPos.y - snapVectorA.y) * snapInvVectorAB.y;");src.push(" return vec2(x, y);");src.push("}");src.push("flat out vec4 vPickColor;");src.push("out vec4 vWorldPosition;");if(clipping){src.push("out float vFlags;");}src.push("out highp vec3 relativeToOriginPosition;");src.push("void main(void) {");// pickFlag = NOT_RENDERED | PICK
|
|
14889
14899
|
// renderPass = PICK
|
|
14890
14900
|
src.push("int pickFlag = int(flags) >> 12 & 0xF;");src.push("if (pickFlag != renderPass) {");src.push(" gl_Position = vec4(0.0, 0.0, 0.0, 0.0);");// Cull vertex
|
|
14891
|
-
src.push("} else {");src.push(" vec4 worldPosition = positionsDecodeMatrix * vec4(position, 1.0); ");src.push(" worldPosition = worldMatrix * vec4(dot(worldPosition, modelMatrixCol0), dot(worldPosition, modelMatrixCol1), dot(worldPosition, modelMatrixCol2), 1.0);");if(scene.entityOffsetsEnabled){src.push(" worldPosition.xyz = worldPosition.xyz + offset;");}src.push("relativeToOriginPosition = worldPosition.xyz;");src.push(" vec4 viewPosition = viewMatrix * worldPosition; ");src.push(" vWorldPosition = worldPosition;");if(clipping){src.push(" vFlags = flags;");}src.push("vPickColor = pickColor;");src.push("vec4 clipPos = projMatrix * viewPosition;");src.push("float tmp = clipPos.w;");src.push("clipPos.xyzw /= tmp;");src.push("clipPos.xy = remapClipPos(clipPos.xy);");src.push("clipPos.xyzw *= tmp;");{src.push("vFragDepth = 1.0 + clipPos.w;");src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");}src.push("gl_Position = clipPos;");src.push("}");src.push("}");return src;}},{key:"_buildFragmentShader",value:function _buildFragmentShader(){var scene=this._scene;var sectionPlanesState=scene._sectionPlanesState;var clipping=sectionPlanesState.getNumAllocatedSectionPlanes()>0;var src=[];src.push('#version 300 es');src.push("// Points instancing pick depth fragment shader");src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");src.push("precision highp float;");src.push("precision highp int;");src.push("#else");src.push("precision mediump float;");src.push("precision mediump int;");src.push("#endif");{src.push("in float isPerspective;");src.push("uniform float logDepthBufFC;");src.push("in float vFragDepth;");}src.push("uniform int layerNumber;");src.push("uniform vec3 coordinateScaler;");src.push("in vec4 vWorldPosition;");src.push("flat in vec4 vPickColor;");if(clipping){src.push("in float vFlags;");for(var _i299=0;_i299<sectionPlanesState.getNumAllocatedSectionPlanes();_i299++){src.push("uniform bool sectionPlaneActive"+_i299+";");src.push("uniform vec3 sectionPlanePos"+_i299+";");src.push("uniform vec3 sectionPlaneDir"+_i299+";");}}src.push("in highp vec3 relativeToOriginPosition;");src.push("layout(location = 0) out highp ivec4 outCoords;")
|
|
14892
|
-
//
|
|
14893
|
-
//
|
|
14894
|
-
|
|
14895
|
-
src.push("layout(location = 2) out lowp uvec4 outPickColor;");src.push("void main(void) {");if(clipping){src.push(" bool clippable = (int(vFlags) >> 16 & 0xF) == 1;");src.push(" if (clippable) {");src.push(" float dist = 0.0;");for(var _i300=0;_i300<sectionPlanesState.getNumAllocatedSectionPlanes();_i300++){src.push("if (sectionPlaneActive"+_i300+") {");src.push(" dist += clamp(dot(-sectionPlaneDir"+_i300+".xyz, vWorldPosition.xyz - sectionPlanePos"+_i300+".xyz), 0.0, 1000.0);");src.push("}");}src.push("if (dist > 0.0) { discard; }");src.push("}");}{src.push(" float dx = dFdx(vFragDepth);");src.push(" float dy = dFdy(vFragDepth);");src.push(" float diff = sqrt(dx*dx+dy*dy);");src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth + diff ) * logDepthBufFC * 0.5;");}src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, -layerNumber);");src.push("outPickColor = uvec4(vPickColor);");src.push("}");return src;}},{key:"webglContextRestored",value:function webglContextRestored(){this._program=null;}},{key:"destroy",value:function destroy(){if(this._program){this._program.destroy();}this._program=null;}}]);return VBOInstancingPointsSnapInitRenderer;}(VBORenderer);var tempVec3a$o=math.vec3();var tempVec3b$k=math.vec3();var tempVec3c$f=math.vec3();math.vec3();var tempMat4a$f=math.mat4();/**
|
|
14901
|
+
src.push("} else {");src.push(" vec4 worldPosition = positionsDecodeMatrix * vec4(position, 1.0); ");src.push(" worldPosition = worldMatrix * vec4(dot(worldPosition, modelMatrixCol0), dot(worldPosition, modelMatrixCol1), dot(worldPosition, modelMatrixCol2), 1.0);");if(scene.entityOffsetsEnabled){src.push(" worldPosition.xyz = worldPosition.xyz + offset;");}src.push("relativeToOriginPosition = worldPosition.xyz;");src.push(" vec4 viewPosition = viewMatrix * worldPosition; ");src.push(" vWorldPosition = worldPosition;");if(clipping){src.push(" vFlags = flags;");}src.push("vPickColor = pickColor;");src.push("vec4 clipPos = projMatrix * viewPosition;");src.push("float tmp = clipPos.w;");src.push("clipPos.xyzw /= tmp;");src.push("clipPos.xy = remapClipPos(clipPos.xy);");src.push("clipPos.xyzw *= tmp;");{src.push("vFragDepth = 1.0 + clipPos.w;");src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");}src.push("gl_Position = clipPos;");src.push("}");src.push("}");return src;}},{key:"_buildFragmentShader",value:function _buildFragmentShader(){var scene=this._scene;var sectionPlanesState=scene._sectionPlanesState;var clipping=sectionPlanesState.getNumAllocatedSectionPlanes()>0;var src=[];src.push('#version 300 es');src.push("// Points instancing pick depth fragment shader");src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");src.push("precision highp float;");src.push("precision highp int;");src.push("#else");src.push("precision mediump float;");src.push("precision mediump int;");src.push("#endif");{src.push("in float isPerspective;");src.push("uniform float logDepthBufFC;");src.push("in float vFragDepth;");}src.push("uniform int layerNumber;");src.push("uniform vec3 coordinateScaler;");src.push("in vec4 vWorldPosition;");src.push("flat in vec4 vPickColor;");if(clipping){src.push("in float vFlags;");for(var _i299=0;_i299<sectionPlanesState.getNumAllocatedSectionPlanes();_i299++){src.push("uniform bool sectionPlaneActive"+_i299+";");src.push("uniform vec3 sectionPlanePos"+_i299+";");src.push("uniform vec3 sectionPlaneDir"+_i299+";");}}src.push("in highp vec3 relativeToOriginPosition;");src.push("layout(location = 0) out highp ivec4 outCoords;");src.push("layout(location = 1) out highp ivec4 outNormal;");src.push("layout(location = 2) out lowp uvec4 outPickColor;");src.push("void main(void) {");if(clipping){src.push(" bool clippable = (int(vFlags) >> 16 & 0xF) == 1;");src.push(" if (clippable) {");src.push(" float dist = 0.0;");for(var _i300=0;_i300<sectionPlanesState.getNumAllocatedSectionPlanes();_i300++){src.push("if (sectionPlaneActive"+_i300+") {");src.push(" dist += clamp(dot(-sectionPlaneDir"+_i300+".xyz, vWorldPosition.xyz - sectionPlanePos"+_i300+".xyz), 0.0, 1000.0);");src.push("}");}src.push("if (dist > 0.0) { discard; }");src.push("}");}{src.push(" float dx = dFdx(vFragDepth);");src.push(" float dy = dFdy(vFragDepth);");src.push(" float diff = sqrt(dx*dx+dy*dy);");src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth + diff ) * logDepthBufFC * 0.5;");}src.push("outCoords = ivec4(relativeToOriginPosition.xyz*coordinateScaler.xyz, -layerNumber);");// src.push("vec3 xTangent = dFdx( vWorldPosition.xyz );");
|
|
14902
|
+
// src.push("vec3 yTangent = dFdy( vWorldPosition.xyz );");
|
|
14903
|
+
// src.push("vec3 worldNormal = normalize( cross( xTangent, yTangent ) );");
|
|
14904
|
+
src.push("outNormal = ivec4(1.0, 1.0, 1.0, 1.0);");src.push("outPickColor = uvec4(vPickColor);");src.push("}");return src;}},{key:"webglContextRestored",value:function webglContextRestored(){this._program=null;}},{key:"destroy",value:function destroy(){if(this._program){this._program.destroy();}this._program=null;}}]);return VBOInstancingPointsSnapInitRenderer;}(VBORenderer);var tempVec3a$o=math.vec3();var tempVec3b$k=math.vec3();var tempVec3c$f=math.vec3();math.vec3();var tempMat4a$f=math.mat4();/**
|
|
14896
14905
|
* @private
|
|
14897
14906
|
*/var VBOInstancingPointsSnapRenderer=/*#__PURE__*/function(_VBORenderer18){_inherits(VBOInstancingPointsSnapRenderer,_VBORenderer18);var _super110=_createSuper(VBOInstancingPointsSnapRenderer);function VBOInstancingPointsSnapRenderer(scene){_classCallCheck(this,VBOInstancingPointsSnapRenderer);return _super110.call(this,scene,false,{instancing:true});}_createClass(VBOInstancingPointsSnapRenderer,[{key:"drawLayer",value:function drawLayer(frameCtx,instancingLayer,renderPass){if(!this._program){this._allocate(instancingLayer);if(this.errors){return;}}if(frameCtx.lastProgramId!==this._program.id){frameCtx.lastProgramId=this._program.id;this._bindProgram();}var model=instancingLayer.model;var scene=model.scene;var camera=scene.camera;var gl=scene.canvas.gl;var state=instancingLayer._state;var origin=instancingLayer._state.origin;var position=model.position,rotationMatrix=model.rotationMatrix,rotationMatrixConjugate=model.rotationMatrixConjugate;var aabb=instancingLayer.aabb;// Per-layer AABB for best RTC accuracy
|
|
14898
14907
|
var viewMatrix=frameCtx.pickViewMatrix||camera.viewMatrix;if(this._vaoCache.has(instancingLayer)){gl.bindVertexArray(this._vaoCache.get(instancingLayer));}else{this._vaoCache.set(instancingLayer,this._makeVAO(state));}var coordinateScaler=tempVec3a$o;coordinateScaler[0]=math.safeInv(aabb[3]-aabb[0])*math.MAX_INT;coordinateScaler[1]=math.safeInv(aabb[4]-aabb[1])*math.MAX_INT;coordinateScaler[2]=math.safeInv(aabb[5]-aabb[2])*math.MAX_INT;frameCtx.snapPickCoordinateScale[0]=math.safeInv(coordinateScaler[0]);frameCtx.snapPickCoordinateScale[1]=math.safeInv(coordinateScaler[1]);frameCtx.snapPickCoordinateScale[2]=math.safeInv(coordinateScaler[2]);var rtcViewMatrix;if(origin||position[0]!==0||position[1]!==0||position[2]!==0){var rtcOrigin=tempVec3b$k;if(origin){var rotatedOrigin=math.transformPoint3(rotationMatrix,origin,tempVec3c$f);rtcOrigin[0]=rotatedOrigin[0];rtcOrigin[1]=rotatedOrigin[1];rtcOrigin[2]=rotatedOrigin[2];}else{rtcOrigin[0]=0;rtcOrigin[1]=0;rtcOrigin[2]=0;}rtcOrigin[0]+=position[0];rtcOrigin[1]+=position[1];rtcOrigin[2]+=position[2];rtcViewMatrix=createRTCViewMat(viewMatrix,rtcOrigin,tempMat4a$f);frameCtx.snapPickOrigin[0]=rtcOrigin[0];frameCtx.snapPickOrigin[1]=rtcOrigin[1];frameCtx.snapPickOrigin[2]=rtcOrigin[2];}else{rtcViewMatrix=viewMatrix;frameCtx.snapPickOrigin[0]=0;frameCtx.snapPickOrigin[1]=0;frameCtx.snapPickOrigin[2]=0;}gl.uniform2fv(this.uVectorA,frameCtx.snapVectorA);gl.uniform2fv(this.uInverseVectorAB,frameCtx.snapInvVectorAB);gl.uniform1i(this._uLayerNumber,frameCtx.snapPickLayerNumber);gl.uniform3fv(this._uCoordinateScaler,coordinateScaler);gl.uniform1i(this._uRenderPass,renderPass);gl.uniform1i(this._uPickInvisible,frameCtx.pickInvisible);var offset=0;var mat4Size=4*4;this._matricesUniformBlockBufferData.set(rotationMatrixConjugate,0);this._matricesUniformBlockBufferData.set(rtcViewMatrix,offset+=mat4Size);this._matricesUniformBlockBufferData.set(camera.projMatrix,offset+=mat4Size);this._matricesUniformBlockBufferData.set(state.positionsDecodeMatrix,offset+=mat4Size);gl.bindBuffer(gl.UNIFORM_BUFFER,this._matricesUniformBlockBuffer);gl.bufferData(gl.UNIFORM_BUFFER,this._matricesUniformBlockBufferData,gl.DYNAMIC_DRAW);gl.bindBufferBase(gl.UNIFORM_BUFFER,this._matricesUniformBlockBufferBindingPoint,this._matricesUniformBlockBuffer);{var logDepthBufFC=2.0/(Math.log(frameCtx.pickZFar+1.0)/Math.LN2);// TODO: Far from pick project matrix
|
|
@@ -15419,7 +15428,7 @@ src.push(" }");src.push("}");return src;}},{key:"_buildFragmentShader",value:fu
|
|
|
15419
15428
|
var viewMatrix=frameCtx.pickViewMatrix||camera.viewMatrix;var coordinateScaler=tempVec3a$f;coordinateScaler[0]=math.safeInv(aabb[3]-aabb[0])*math.MAX_INT;coordinateScaler[1]=math.safeInv(aabb[4]-aabb[1])*math.MAX_INT;coordinateScaler[2]=math.safeInv(aabb[5]-aabb[2])*math.MAX_INT;frameCtx.snapPickCoordinateScale[0]=math.safeInv(coordinateScaler[0]);frameCtx.snapPickCoordinateScale[1]=math.safeInv(coordinateScaler[1]);frameCtx.snapPickCoordinateScale[2]=math.safeInv(coordinateScaler[2]);textureState.bindCommonTextures(this._program,this.uTexturePerObjectPositionsDecodeMatrix,this._uTexturePerVertexIdCoordinates,this.uTexturePerObjectColorsAndFlags,this._uTexturePerObjectMatrix);var rtcViewMatrix;var rtcCameraEye;var gotOrigin=origin[0]!==0||origin[1]!==0||origin[2]!==0;var gotPosition=position[0]!==0||position[1]!==0||position[2]!==0;if(gotOrigin||gotPosition){var rtcOrigin=tempVec3b$b;if(gotOrigin){var rotatedOrigin=tempVec3c$9;math.transformPoint3(rotationMatrix,origin,rotatedOrigin);rtcOrigin[0]=rotatedOrigin[0];rtcOrigin[1]=rotatedOrigin[1];rtcOrigin[2]=rotatedOrigin[2];}else{rtcOrigin[0]=0;rtcOrigin[1]=0;rtcOrigin[2]=0;}rtcOrigin[0]+=position[0];rtcOrigin[1]+=position[1];rtcOrigin[2]+=position[2];rtcViewMatrix=createRTCViewMat(viewMatrix,rtcOrigin,tempMat4a$5);rtcCameraEye=tempVec3d$1;rtcCameraEye[0]=camera.eye[0]-rtcOrigin[0];rtcCameraEye[1]=camera.eye[1]-rtcOrigin[1];rtcCameraEye[2]=camera.eye[2]-rtcOrigin[2];frameCtx.snapPickOrigin[0]=rtcOrigin[0];frameCtx.snapPickOrigin[1]=rtcOrigin[1];frameCtx.snapPickOrigin[2]=rtcOrigin[2];}else{rtcViewMatrix=viewMatrix;rtcCameraEye=camera.eye;frameCtx.snapPickOrigin[0]=0;frameCtx.snapPickOrigin[1]=0;frameCtx.snapPickOrigin[2]=0;}gl.uniform3fv(this._uCameraEyeRtc,rtcCameraEye);gl.uniform2fv(this._uVectorA,frameCtx.snapVectorA);gl.uniform2fv(this._uInverseVectorAB,frameCtx.snapInvVectorAB);gl.uniform1i(this._uLayerNumber,frameCtx.snapPickLayerNumber);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._uViewMatrix,false,rtcViewMatrix);gl.uniformMatrix4fv(this._uProjMatrix,false,camera.projMatrix);{var logDepthBufFC=2.0/(Math.log(frameCtx.pickZFar+1.0)/Math.LN2);gl.uniform1f(this._uLogDepthBufFC,logDepthBufFC);}var numAllocatedSectionPlanes=scene._sectionPlanesState.getNumAllocatedSectionPlanes();var numSectionPlanes=scene._sectionPlanesState.sectionPlanes.length;if(numAllocatedSectionPlanes>0){var sectionPlanes=scene._sectionPlanesState.sectionPlanes;var baseIndex=dataTextureLayer.layerIndex*numSectionPlanes;var renderFlags=model.renderFlags;for(var sectionPlaneIndex=0;sectionPlaneIndex<numAllocatedSectionPlanes;sectionPlaneIndex++){var sectionPlaneUniforms=this._uSectionPlanes[sectionPlaneIndex];if(sectionPlaneUniforms){if(sectionPlaneIndex<numSectionPlanes){var active=renderFlags.sectionPlanesActivePerLayer[baseIndex+sectionPlaneIndex];gl.uniform1i(sectionPlaneUniforms.active,active?1:0);if(active){var sectionPlane=sectionPlanes[sectionPlaneIndex];if(origin){var rtcSectionPlanePos=getPlaneRTCPos(sectionPlane.dist,sectionPlane.dir,origin,tempVec3a$f);gl.uniform3fv(sectionPlaneUniforms.pos,rtcSectionPlanePos);}else{gl.uniform3fv(sectionPlaneUniforms.pos,sectionPlane.pos);}gl.uniform3fv(sectionPlaneUniforms.dir,sectionPlane.dir);}}else{gl.uniform1i(sectionPlaneUniforms.active,0);}}}}if(state.numIndices8Bits>0){textureState.bindTriangleIndicesTextures(this._program,this._uTexturePerPolygonIdPortionIds,this._uTexturePerPolygonIdIndices,8// 8 bits indices
|
|
15420
15429
|
);gl.drawArrays(gl.TRIANGLES,0,state.numIndices8Bits);}if(state.numIndices16Bits>0){textureState.bindTriangleIndicesTextures(this._program,this._uTexturePerPolygonIdPortionIds,this._uTexturePerPolygonIdIndices,16// 16 bits indices
|
|
15421
15430
|
);gl.drawArrays(gl.TRIANGLES,0,state.numIndices16Bits);}if(state.numIndices32Bits>0){textureState.bindTriangleIndicesTextures(this._program,this._uTexturePerPolygonIdPortionIds,this._uTexturePerPolygonIdIndices,32// 32 bits indices
|
|
15422
|
-
);gl.drawArrays(gl.TRIANGLES,0,state.numIndices32Bits);}frameCtx.drawElements++;}},{key:"_allocate",value:function _allocate(){var scene=this._scene;var gl=scene.canvas.gl;this._program=new Program(gl,this._buildShader());if(this._program.errors){this.errors=this._program.errors;return;}var program=this._program;this._uRenderPass=program.getLocation("renderPass");this._uPickInvisible=program.getLocation("pickInvisible");this._uSceneWorldModelMatrix=program.getLocation("sceneModelMatrix");this._uViewMatrix=program.getLocation("viewMatrix");this._uProjMatrix=program.getLocation("projMatrix");this._uSectionPlanes=[];for(var _i341=0,len=scene._sectionPlanesState.getNumAllocatedSectionPlanes();_i341<len;_i341++){this._uSectionPlanes.push({active:program.getLocation("sectionPlaneActive"+_i341),pos:program.getLocation("sectionPlanePos"+_i341),dir:program.getLocation("sectionPlaneDir"+_i341)});}{this._uLogDepthBufFC=program.getLocation("logDepthBufFC");}this.uTexturePerObjectPositionsDecodeMatrix="uObjectPerObjectPositionsDecodeMatrix";this.uTexturePerObjectColorsAndFlags="uObjectPerObjectColorsAndFlags";this._uTexturePerVertexIdCoordinates="uTexturePerVertexIdCoordinates";this._uTexturePerPolygonIdIndices="uTexturePerPolygonIdIndices";this._uTexturePerPolygonIdPortionIds="uTexturePerPolygonIdPortionIds";this._uTexturePerObjectMatrix="uTexturePerObjectMatrix";this._uCameraEyeRtc=program.getLocation("uCameraEyeRtc");this._uVectorA=program.getLocation("uVectorAB");this._uInverseVectorAB=program.getLocation("uInverseVectorAB");this._uLayerNumber=program.getLocation("uLayerNumber");this._uCoordinateScaler=program.getLocation("uCoordinateScaler");}},{key:"_bindProgram",value:function _bindProgram(){this._program.bind();}},{key:"_buildShader",value:function _buildShader(){return{vertex:this._buildVertexShader(),fragment:this._buildFragmentShader()};}},{key:"_buildVertexShader",value:function _buildVertexShader(){var scene=this._scene;var clipping=scene._sectionPlanesState.getNumAllocatedSectionPlanes()>0;var src=[];src.push("#version 300 es");src.push("//
|
|
15431
|
+
);gl.drawArrays(gl.TRIANGLES,0,state.numIndices32Bits);}frameCtx.drawElements++;}},{key:"_allocate",value:function _allocate(){var scene=this._scene;var gl=scene.canvas.gl;this._program=new Program(gl,this._buildShader());if(this._program.errors){this.errors=this._program.errors;return;}var program=this._program;this._uRenderPass=program.getLocation("renderPass");this._uPickInvisible=program.getLocation("pickInvisible");this._uSceneWorldModelMatrix=program.getLocation("sceneModelMatrix");this._uViewMatrix=program.getLocation("viewMatrix");this._uProjMatrix=program.getLocation("projMatrix");this._uSectionPlanes=[];for(var _i341=0,len=scene._sectionPlanesState.getNumAllocatedSectionPlanes();_i341<len;_i341++){this._uSectionPlanes.push({active:program.getLocation("sectionPlaneActive"+_i341),pos:program.getLocation("sectionPlanePos"+_i341),dir:program.getLocation("sectionPlaneDir"+_i341)});}{this._uLogDepthBufFC=program.getLocation("logDepthBufFC");}this.uTexturePerObjectPositionsDecodeMatrix="uObjectPerObjectPositionsDecodeMatrix";this.uTexturePerObjectColorsAndFlags="uObjectPerObjectColorsAndFlags";this._uTexturePerVertexIdCoordinates="uTexturePerVertexIdCoordinates";this._uTexturePerPolygonIdIndices="uTexturePerPolygonIdIndices";this._uTexturePerPolygonIdPortionIds="uTexturePerPolygonIdPortionIds";this._uTexturePerObjectMatrix="uTexturePerObjectMatrix";this._uCameraEyeRtc=program.getLocation("uCameraEyeRtc");this._uVectorA=program.getLocation("uVectorAB");this._uInverseVectorAB=program.getLocation("uInverseVectorAB");this._uLayerNumber=program.getLocation("uLayerNumber");this._uCoordinateScaler=program.getLocation("uCoordinateScaler");}},{key:"_bindProgram",value:function _bindProgram(){this._program.bind();}},{key:"_buildShader",value:function _buildShader(){return{vertex:this._buildVertexShader(),fragment:this._buildFragmentShader()};}},{key:"_buildVertexShader",value:function _buildVertexShader(){var scene=this._scene;var clipping=scene._sectionPlanesState.getNumAllocatedSectionPlanes()>0;var src=[];src.push("#version 300 es");src.push("// DTXTrianglesSnapInitRenderer vertex shader");src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");src.push("precision highp float;");src.push("precision highp int;");src.push("precision highp usampler2D;");src.push("precision highp isampler2D;");src.push("precision highp sampler2D;");src.push("#else");src.push("precision mediump float;");src.push("precision mediump int;");src.push("precision mediump usampler2D;");src.push("precision mediump isampler2D;");src.push("precision mediump sampler2D;");src.push("#endif");src.push("uniform int renderPass;");if(scene.entityOffsetsEnabled){src.push("in vec3 offset;");}src.push("uniform mat4 sceneModelMatrix;");src.push("uniform mat4 viewMatrix;");src.push("uniform mat4 projMatrix;");src.push("uniform highp sampler2D uObjectPerObjectPositionsDecodeMatrix;");src.push("uniform highp sampler2D uTexturePerObjectMatrix;");src.push("uniform lowp usampler2D uObjectPerObjectColorsAndFlags;");src.push("uniform mediump usampler2D uTexturePerVertexIdCoordinates;");src.push("uniform highp usampler2D uTexturePerPolygonIdIndices;");src.push("uniform mediump usampler2D uTexturePerPolygonIdPortionIds;");src.push("uniform vec3 uCameraEyeRtc;");src.push("uniform vec2 uVectorAB;");src.push("uniform vec2 uInverseVectorAB;");src.push("vec3 positions[3];");{src.push("uniform float logDepthBufFC;");src.push("out float vFragDepth;");src.push("out float isPerspective;");}src.push("bool isPerspectiveMatrix(mat4 m) {");src.push(" return (m[2][3] == - 1.0);");src.push("}");src.push("vec2 remapClipPos(vec2 clipPos) {");src.push(" float x = (clipPos.x - uVectorAB.x) * uInverseVectorAB.x;");src.push(" float y = (clipPos.y - uVectorAB.y) * uInverseVectorAB.y;");src.push(" return vec2(x, y);");src.push("}");src.push("flat out vec4 vPickColor;");src.push("out vec4 vWorldPosition;");if(clipping){src.push("flat out uint vFlags2;");}src.push("out highp vec3 relativeToOriginPosition;");src.push("void main(void) {");// constants
|
|
15423
15432
|
src.push("int polygonIndex = gl_VertexID / 3;");// get packed object-id
|
|
15424
15433
|
src.push("int h_packed_object_id_index = (polygonIndex >> 3) & 4095;");src.push("int v_packed_object_id_index = (polygonIndex >> 3) >> 12;");src.push("int objectIndex = int(texelFetch(uTexturePerPolygonIdPortionIds, ivec2(h_packed_object_id_index, v_packed_object_id_index), 0).r);");src.push("ivec2 objectIndexCoords = ivec2(objectIndex % 512, objectIndex / 512);");// get flags & flags2
|
|
15425
15434
|
src.push("uvec4 flags = texelFetch (uObjectPerObjectColorsAndFlags, ivec2(objectIndexCoords.x*8+2, objectIndexCoords.y), 0);");src.push("uvec4 flags2 = texelFetch (uObjectPerObjectColorsAndFlags, ivec2(objectIndexCoords.x*8+3, objectIndexCoords.y), 0);");src.push("{");// get color
|
|
@@ -15428,7 +15437,9 @@ src.push(" return;");src.push("};");// get vertex base
|
|
|
15428
15437
|
src.push("ivec4 packedVertexBase = ivec4(texelFetch (uObjectPerObjectColorsAndFlags, ivec2(objectIndexCoords.x*8+4, objectIndexCoords.y), 0));");src.push("ivec4 packedIndexBaseOffset = ivec4(texelFetch (uObjectPerObjectColorsAndFlags, ivec2(objectIndexCoords.x*8+5, objectIndexCoords.y), 0));");src.push("int indexBaseOffset = (packedIndexBaseOffset.r << 24) + (packedIndexBaseOffset.g << 16) + (packedIndexBaseOffset.b << 8) + packedIndexBaseOffset.a;");src.push("int h_index = (polygonIndex - indexBaseOffset) & 4095;");src.push("int v_index = (polygonIndex - indexBaseOffset) >> 12;");src.push("ivec3 vertexIndices = ivec3(texelFetch(uTexturePerPolygonIdIndices, ivec2(h_index, v_index), 0));");src.push("ivec3 uniqueVertexIndexes = vertexIndices + (packedVertexBase.r << 24) + (packedVertexBase.g << 16) + (packedVertexBase.b << 8) + packedVertexBase.a;");src.push("ivec3 indexPositionH = uniqueVertexIndexes & 4095;");src.push("ivec3 indexPositionV = uniqueVertexIndexes >> 12;");src.push("mat4 objectInstanceMatrix = mat4 (texelFetch (uTexturePerObjectMatrix, ivec2(objectIndexCoords.x*4+0, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectMatrix, ivec2(objectIndexCoords.x*4+1, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectMatrix, ivec2(objectIndexCoords.x*4+2, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectMatrix, ivec2(objectIndexCoords.x*4+3, objectIndexCoords.y), 0));");src.push("mat4 objectDecodeAndInstanceMatrix = objectInstanceMatrix * mat4 (texelFetch (uObjectPerObjectPositionsDecodeMatrix, ivec2(objectIndexCoords.x*4+0, objectIndexCoords.y), 0), texelFetch (uObjectPerObjectPositionsDecodeMatrix, ivec2(objectIndexCoords.x*4+1, objectIndexCoords.y), 0), texelFetch (uObjectPerObjectPositionsDecodeMatrix, ivec2(objectIndexCoords.x*4+2, objectIndexCoords.y), 0), texelFetch (uObjectPerObjectPositionsDecodeMatrix, ivec2(objectIndexCoords.x*4+3, objectIndexCoords.y), 0));");src.push("uint solid = texelFetch (uObjectPerObjectColorsAndFlags, ivec2(objectIndexCoords.x*8+7, objectIndexCoords.y), 0).r;");// get position
|
|
15429
15438
|
src.push("positions[0] = vec3(texelFetch(uTexturePerVertexIdCoordinates, ivec2(indexPositionH.r, indexPositionV.r), 0));");src.push("positions[1] = vec3(texelFetch(uTexturePerVertexIdCoordinates, ivec2(indexPositionH.g, indexPositionV.g), 0));");src.push("positions[2] = vec3(texelFetch(uTexturePerVertexIdCoordinates, ivec2(indexPositionH.b, indexPositionV.b), 0));");// get normal
|
|
15430
15439
|
src.push("vec3 normal = normalize(cross(positions[2] - positions[0], positions[1] - positions[0]));");src.push("vec3 position;");src.push("position = positions[gl_VertexID % 3];");src.push("vec3 viewNormal = -normalize((transpose(inverse(viewMatrix*objectDecodeAndInstanceMatrix)) * vec4(normal,1)).xyz);");// when the geometry is not solid, if needed, flip the triangle winding
|
|
15431
|
-
src.push("if (solid != 1u) {");src.push(" if (isPerspectiveMatrix(projMatrix)) {");src.push(" vec3 uCameraEyeRtcInQuantizedSpace = (inverse(sceneModelMatrix * objectDecodeAndInstanceMatrix) * vec4(uCameraEyeRtc, 1)).xyz;");src.push(" if (dot(position.xyz - uCameraEyeRtcInQuantizedSpace, normal) < 0.0) {");src.push(" position = positions[2 - (gl_VertexID % 3)];");src.push(" viewNormal = -viewNormal;");src.push(" }");src.push(" } else {");src.push(" if (viewNormal.z < 0.0) {");src.push(" position = positions[2 - (gl_VertexID % 3)];");src.push(" viewNormal = -viewNormal;");src.push(" }");src.push(" }");src.push("}");src.push("vec4 worldPosition = sceneModelMatrix * (objectDecodeAndInstanceMatrix * vec4(position, 1.0)); ");src.push("relativeToOriginPosition = worldPosition.xyz;");src.push("vec4 viewPosition = viewMatrix * worldPosition; ");src.push("vWorldPosition = worldPosition;");if(clipping){src.push("vFlags2 = flags2.r;");}src.push("vPickColor = vec4(texelFetch (uObjectPerObjectColorsAndFlags, ivec2(objectIndexCoords.x*8+1, objectIndexCoords.y), 0));")
|
|
15440
|
+
src.push("if (solid != 1u) {");src.push(" if (isPerspectiveMatrix(projMatrix)) {");src.push(" vec3 uCameraEyeRtcInQuantizedSpace = (inverse(sceneModelMatrix * objectDecodeAndInstanceMatrix) * vec4(uCameraEyeRtc, 1)).xyz;");src.push(" if (dot(position.xyz - uCameraEyeRtcInQuantizedSpace, normal) < 0.0) {");src.push(" position = positions[2 - (gl_VertexID % 3)];");src.push(" viewNormal = -viewNormal;");src.push(" }");src.push(" } else {");src.push(" if (viewNormal.z < 0.0) {");src.push(" position = positions[2 - (gl_VertexID % 3)];");src.push(" viewNormal = -viewNormal;");src.push(" }");src.push(" }");src.push("}");src.push("vec4 worldPosition = sceneModelMatrix * (objectDecodeAndInstanceMatrix * vec4(position, 1.0)); ");src.push("relativeToOriginPosition = worldPosition.xyz;");src.push("vec4 viewPosition = viewMatrix * worldPosition; ");src.push("vWorldPosition = worldPosition;");if(clipping){src.push("vFlags2 = flags2.r;");}src.push("vPickColor = vec4(texelFetch (uObjectPerObjectColorsAndFlags, ivec2(objectIndexCoords.x*8+1, objectIndexCoords.y), 0));");// TODO: Normalized color? See here:
|
|
15441
|
+
//src.push("vPickColor = vec4(texelFetch (uObjectPerObjectColorsAndFlags, ivec2(objectIndexCoords.x*8+1, objectIndexCoords.y), 0)) /255.0;");
|
|
15442
|
+
src.push("vec4 clipPos = projMatrix * viewPosition;");src.push("float tmp = clipPos.w;");src.push("clipPos.xyzw /= tmp;");src.push("clipPos.xy = remapClipPos(clipPos.xy);");src.push("clipPos.xyzw *= tmp;");{src.push("vFragDepth = 1.0 + clipPos.w;");src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");}src.push("gl_Position = clipPos;");src.push(" }");src.push("}");return src;}},{key:"_buildFragmentShader",value:function _buildFragmentShader(){var scene=this._scene;var clipping=scene._sectionPlanesState.getNumAllocatedSectionPlanes()>0;var src=[];src.push('#version 300 es');src.push("// DTXTrianglesSnapInitRenderer fragment shader");src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");src.push("precision highp float;");src.push("precision highp int;");src.push("#else");src.push("precision mediump float;");src.push("precision mediump int;");src.push("#endif");{src.push("in float isPerspective;");src.push("uniform float logDepthBufFC;");src.push("in float vFragDepth;");}src.push("uniform int uLayerNumber;");src.push("uniform vec3 uCoordinateScaler;");src.push("in vec4 vWorldPosition;");src.push("flat in vec4 vPickColor;");if(clipping){src.push("flat in uint vFlags2;");for(var _i342=0,len=scene._sectionPlanesState.getNumAllocatedSectionPlanes();_i342<len;_i342++){src.push("uniform bool sectionPlaneActive"+_i342+";");src.push("uniform vec3 sectionPlanePos"+_i342+";");src.push("uniform vec3 sectionPlaneDir"+_i342+";");}}src.push("in highp vec3 relativeToOriginPosition;");src.push("layout(location = 0) out highp ivec4 outCoords;");src.push("layout(location = 1) out highp ivec4 outNormal;");src.push("layout(location = 2) out lowp uvec4 outPickColor;");src.push("void main(void) {");if(clipping){src.push(" bool clippable = vFlags2 > 0u;");src.push(" if (clippable) {");src.push(" float dist = 0.0;");for(var i=0;i<scene._sectionPlanesState.getNumAllocatedSectionPlanes();i++){src.push(" if (sectionPlaneActive"+i+") {");src.push(" dist += clamp(dot(-sectionPlaneDir"+i+".xyz, vWorldPosition.xyz - sectionPlanePos"+i+".xyz), 0.0, 1000.0);");src.push(" }");}src.push(" if (dist > 0.0) { discard; }");src.push(" }");}{src.push(" float dx = dFdx(vFragDepth);");src.push(" float dy = dFdy(vFragDepth);");src.push(" float diff = sqrt(dx*dx+dy*dy);");src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth + diff ) * logDepthBufFC * 0.5;");}src.push("outCoords = ivec4(relativeToOriginPosition.xyz * uCoordinateScaler.xyz, - uLayerNumber);");src.push("vec3 xTangent = dFdx( vWorldPosition.xyz );");src.push("vec3 yTangent = dFdy( vWorldPosition.xyz );");src.push("vec3 worldNormal = normalize( cross( xTangent, yTangent ) );");src.push("outNormal = ivec4(worldNormal * float(".concat(math.MAX_INT,"), 1.0);"));src.push("outPickColor = uvec4(vPickColor);");src.push("}");return src;}},{key:"webglContextRestored",value:function webglContextRestored(){this._program=null;}},{key:"destroy",value:function destroy(){if(this._program){this._program.destroy();}this._program=null;}}]);return DTXTrianglesSnapInitRenderer;}();var tempVec3a$e=math.vec3();var tempVec3b$a=math.vec3();var tempVec3c$8=math.vec3();math.vec3();var tempMat4a$4=math.mat4();/**
|
|
15432
15443
|
* @private
|
|
15433
15444
|
*/var DTXTrianglesOcclusionRenderer=/*#__PURE__*/function(){function DTXTrianglesOcclusionRenderer(scene){_classCallCheck(this,DTXTrianglesOcclusionRenderer);this._scene=scene;this._hash=this._getHash();this._allocate();}_createClass(DTXTrianglesOcclusionRenderer,[{key:"getValid",value:function getValid(){return this._hash===this._getHash();}},{key:"_getHash",value:function _getHash(){return this._scene._sectionPlanesState.getHash();}},{key:"drawLayer",value:function drawLayer(frameCtx,dataTextureLayer,renderPass){var model=dataTextureLayer.model;var scene=model.scene;var camera=scene.camera;var gl=scene.canvas.gl;var state=dataTextureLayer._state;var textureState=state.textureState;var origin=dataTextureLayer._state.origin;var position=model.position,rotationMatrix=model.rotationMatrix,rotationMatrixConjugate=model.rotationMatrixConjugate;var viewMatrix=frameCtx.pickViewMatrix||camera.viewMatrix;if(!this._program){this._allocate(dataTextureLayer);if(this.errors){return;}}if(frameCtx.lastProgramId!==this._program.id){frameCtx.lastProgramId=this._program.id;this._bindProgram();}textureState.bindCommonTextures(this._program,this.uTexturePerObjectPositionsDecodeMatrix,this._uTexturePerVertexIdCoordinates,this.uTexturePerObjectColorsAndFlags,this._uTexturePerObjectMatrix);var rtcViewMatrix;var rtcCameraEye;if(origin||position[0]!==0||position[1]!==0||position[2]!==0){var rtcOrigin=tempVec3a$e;if(origin){var rotatedOrigin=tempVec3b$a;math.transformPoint3(rotationMatrix,origin,rotatedOrigin);rtcOrigin[0]=rotatedOrigin[0];rtcOrigin[1]=rotatedOrigin[1];rtcOrigin[2]=rotatedOrigin[2];}else{rtcOrigin[0]=0;rtcOrigin[1]=0;rtcOrigin[2]=0;}rtcOrigin[0]+=position[0];rtcOrigin[1]+=position[1];rtcOrigin[2]+=position[2];rtcViewMatrix=createRTCViewMat(viewMatrix,rtcOrigin,tempMat4a$4);rtcCameraEye=tempVec3c$8;rtcCameraEye[0]=camera.eye[0]-rtcOrigin[0];rtcCameraEye[1]=camera.eye[1]-rtcOrigin[1];rtcCameraEye[2]=camera.eye[2]-rtcOrigin[2];}else{rtcViewMatrix=viewMatrix;rtcCameraEye=camera.eye;}gl.uniform3fv(this._uCameraEyeRtc,rtcCameraEye);gl.uniform1i(this._uRenderPass,renderPass);gl.uniformMatrix4fv(this._uWorldMatrix,false,rotationMatrixConjugate);gl.uniformMatrix4fv(this._uViewMatrix,false,rtcViewMatrix);gl.uniformMatrix4fv(this._uProjMatrix,false,camera.projMatrix);var numAllocatedSectionPlanes=scene._sectionPlanesState.getNumAllocatedSectionPlanes();var numSectionPlanes=scene._sectionPlanesState.sectionPlanes.length;if(numAllocatedSectionPlanes>0){var sectionPlanes=scene._sectionPlanesState.sectionPlanes;var baseIndex=dataTextureLayer.layerIndex*numSectionPlanes;var renderFlags=model.renderFlags;for(var sectionPlaneIndex=0;sectionPlaneIndex<numAllocatedSectionPlanes;sectionPlaneIndex++){var sectionPlaneUniforms=this._uSectionPlanes[sectionPlaneIndex];if(sectionPlaneUniforms){if(sectionPlaneIndex<numSectionPlanes){var active=renderFlags.sectionPlanesActivePerLayer[baseIndex+sectionPlaneIndex];gl.uniform1i(sectionPlaneUniforms.active,active?1:0);if(active){var sectionPlane=sectionPlanes[sectionPlaneIndex];if(origin){var rtcSectionPlanePos=getPlaneRTCPos(sectionPlane.dist,sectionPlane.dir,origin,tempVec3a$e);gl.uniform3fv(sectionPlaneUniforms.pos,rtcSectionPlanePos);}else{gl.uniform3fv(sectionPlaneUniforms.pos,sectionPlane.pos);}gl.uniform3fv(sectionPlaneUniforms.dir,sectionPlane.dir);}}else{gl.uniform1i(sectionPlaneUniforms.active,0);}}}}if(state.numIndices8Bits>0){textureState.bindTriangleIndicesTextures(this._program,this._uTexturePerPolygonIdPortionIds,this._uTexturePerPolygonIdIndices,8// 8 bits indices
|
|
15434
15445
|
);gl.drawArrays(gl.TRIANGLES,0,state.numIndices8Bits);}if(state.numIndices16Bits>0){textureState.bindTriangleIndicesTextures(this._program,this._uTexturePerPolygonIdPortionIds,this._uTexturePerPolygonIdIndices,16// 16 bits indices
|
|
@@ -18197,22 +18208,6 @@ this._geometries={};this._dtxBuckets={};this._textures={};this._textureSets={};t
|
|
|
18197
18208
|
*/function createDTXBuckets(geometry,enableVertexWelding,enableIndexBucketing){var uniquePositionsCompressed,uniqueIndices,uniqueEdgeIndices;if(enableVertexWelding||enableIndexBucketing){// Expensive - careful!
|
|
18198
18209
|
var _uniquifyPositions=uniquifyPositions({positionsCompressed:geometry.positionsCompressed,indices:geometry.indices,edgeIndices:geometry.edgeIndices});var _uniquifyPositions2=_slicedToArray(_uniquifyPositions,3);uniquePositionsCompressed=_uniquifyPositions2[0];uniqueIndices=_uniquifyPositions2[1];uniqueEdgeIndices=_uniquifyPositions2[2];}else{uniquePositionsCompressed=geometry.positionsCompressed;uniqueIndices=geometry.indices;uniqueEdgeIndices=geometry.edgeIndices;}var buckets;if(enableIndexBucketing){var numUniquePositions=uniquePositionsCompressed.length/3;buckets=rebucketPositions({positionsCompressed:uniquePositionsCompressed,indices:uniqueIndices,edgeIndices:uniqueEdgeIndices},numUniquePositions>1<<16?16:8// true
|
|
18199
18210
|
);}else{buckets=[{positionsCompressed:uniquePositionsCompressed,indices:uniqueIndices,edgeIndices:uniqueEdgeIndices}];}return buckets;}/**
|
|
18200
|
-
* @desc A high-performance model representation for efficient rendering and low memory usage.
|
|
18201
|
-
*
|
|
18202
|
-
* * PerformanceModel was replaced with {@link SceneModel} in ````xeokit-sdk v2.4````.
|
|
18203
|
-
* * PerformanceModel currently extends {@link SceneModel}, in order to maintain backward-compatibility until we remove PerformanceModel.
|
|
18204
|
-
* * See {@link SceneModel} for API details.
|
|
18205
|
-
*
|
|
18206
|
-
* @deprecated
|
|
18207
|
-
* @implements {Drawable}
|
|
18208
|
-
* @implements {Entity}
|
|
18209
|
-
* @extends {SceneModel}
|
|
18210
|
-
*/var PerformanceModel=/*#__PURE__*/function(_SceneModel){_inherits(PerformanceModel,_SceneModel);var _super113=_createSuper(PerformanceModel);/**
|
|
18211
|
-
* See {@link VBOSceneModel} for details.
|
|
18212
|
-
*
|
|
18213
|
-
* @param owner
|
|
18214
|
-
* @param cfg
|
|
18215
|
-
*/function PerformanceModel(owner){var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,PerformanceModel);return _super113.call(this,owner,cfg);}return _createClass(PerformanceModel);}(SceneModel);/**
|
|
18216
18211
|
* A set of 3D line segments.
|
|
18217
18212
|
*
|
|
18218
18213
|
* * Creates a set of 3D line segments.
|
|
@@ -18263,7 +18258,7 @@ var _uniquifyPositions=uniquifyPositions({positionsCompressed:geometry.positions
|
|
|
18263
18258
|
* indices: geometryArrays.indices
|
|
18264
18259
|
* });
|
|
18265
18260
|
* ````
|
|
18266
|
-
*/var LineSet=/*#__PURE__*/function(_Component28){_inherits(LineSet,_Component28);var
|
|
18261
|
+
*/var LineSet=/*#__PURE__*/function(_Component28){_inherits(LineSet,_Component28);var _super113=_createSuper(LineSet);/**
|
|
18267
18262
|
* Creates a new LineSet.
|
|
18268
18263
|
*
|
|
18269
18264
|
* Registers the LineSet in {@link Scene#lineSets}; causes Scene to fire a "lineSetCreated" event.
|
|
@@ -18277,7 +18272,7 @@ var _uniquifyPositions=uniquifyPositions({positionsCompressed:geometry.positions
|
|
|
18277
18272
|
* @param {Number[]} [cfg.color=[0,0,0]] The color of this ````LineSet````. This is both emissive and diffuse.
|
|
18278
18273
|
* @param {Boolean} [cfg.visible=true] Indicates whether or not this ````LineSet```` is visible.
|
|
18279
18274
|
* @param {Number} [cfg.opacity=1.0] ````LineSet````'s initial opacity factor.
|
|
18280
|
-
*/function LineSet(owner){var _this76;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,LineSet);_this76=
|
|
18275
|
+
*/function LineSet(owner){var _this76;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,LineSet);_this76=_super113.call(this,owner,cfg);_this76._positions=cfg.positions||[];if(cfg.indices){_this76._indices=cfg.indices;}else{_this76._indices=[];for(var _i446=0,len=_this76._positions.length/3-1;_i446<len;_i446+=2){_this76._indices.push(_i446);_this76._indices.push(_i446+1);}}_this76._sceneModel=new SceneModel(_assertThisInitialized(_this76),{isModel:false// Don't register in Scene.models
|
|
18281
18276
|
});_this76._sceneModel.createMesh({id:"linesMesh",primitive:"lines",positions:_this76._positions,indices:_this76._indices});_this76._sceneModel.createEntity({meshIds:["linesMesh"],visible:cfg.visible,clippable:cfg.clippable,collidable:cfg.collidable});_this76._sceneModel.finalize();_this76.scene._lineSetCreated(_assertThisInitialized(_this76));return _this76;}/**
|
|
18282
18277
|
* Sets if this ````LineSet```` is visible.
|
|
18283
18278
|
*
|
|
@@ -18599,14 +18594,14 @@ this.scene._lineSetDestroyed(this);}}]);return LineSet;}(Component);var tempVec3
|
|
|
18599
18594
|
* target viewer.
|
|
18600
18595
|
*
|
|
18601
18596
|
* @class BCFViewpointsPlugin
|
|
18602
|
-
*/var BCFViewpointsPlugin=/*#__PURE__*/function(_Plugin4){_inherits(BCFViewpointsPlugin,_Plugin4);var
|
|
18597
|
+
*/var BCFViewpointsPlugin=/*#__PURE__*/function(_Plugin4){_inherits(BCFViewpointsPlugin,_Plugin4);var _super114=_createSuper(BCFViewpointsPlugin);/**
|
|
18603
18598
|
* @constructor
|
|
18604
18599
|
* @param {Viewer} viewer The Viewer.
|
|
18605
18600
|
* @param {Object} cfg Plugin configuration.
|
|
18606
18601
|
* @param {String} [cfg.id="BCFViewpoints"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
|
|
18607
18602
|
* @param {String} [cfg.originatingSystem] Identifies the originating system for BCF records.
|
|
18608
18603
|
* @param {String} [cfg.authoringTool] Identifies the authoring tool for BCF records.
|
|
18609
|
-
*/function BCFViewpointsPlugin(viewer){var _this77;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,BCFViewpointsPlugin);_this77=
|
|
18604
|
+
*/function BCFViewpointsPlugin(viewer){var _this77;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,BCFViewpointsPlugin);_this77=_super114.call(this,"BCFViewpoints",viewer,cfg);/**
|
|
18610
18605
|
* Identifies the originating system to include in BCF viewpoints saved by this plugin.
|
|
18611
18606
|
* @property originatingSystem
|
|
18612
18607
|
* @type {string}
|
|
@@ -18673,9 +18668,9 @@ origin:eye,direction:look});look=hit?hit.worldPos:math.addVec3(eye,look,tempVec3
|
|
|
18673
18668
|
* @desc Measures the distance between two 3D points.
|
|
18674
18669
|
*
|
|
18675
18670
|
* See {@link DistanceMeasurementsPlugin} for more info.
|
|
18676
|
-
*/var DistanceMeasurement=/*#__PURE__*/function(_Component29){_inherits(DistanceMeasurement,_Component29);var
|
|
18671
|
+
*/var DistanceMeasurement=/*#__PURE__*/function(_Component29){_inherits(DistanceMeasurement,_Component29);var _super115=_createSuper(DistanceMeasurement);/**
|
|
18677
18672
|
* @private
|
|
18678
|
-
*/function DistanceMeasurement(plugin){var _this80;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,DistanceMeasurement);_this80=
|
|
18673
|
+
*/function DistanceMeasurement(plugin){var _this80;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,DistanceMeasurement);_this80=_super115.call(this,plugin.viewer.scene,cfg);/**
|
|
18679
18674
|
* The {@link DistanceMeasurementsPlugin} that owns this DistanceMeasurement.
|
|
18680
18675
|
* @type {DistanceMeasurementsPlugin}
|
|
18681
18676
|
*/_this80.plugin=plugin;_this80._container=cfg.container;if(!_this80._container){throw"config missing: container";}_this80._eventSubs={};var scene=_this80.plugin.viewer.scene;_this80._originMarker=new Marker(scene,cfg.origin);_this80._targetMarker=new Marker(scene,cfg.target);_this80._originWorld=math.vec3();_this80._targetWorld=math.vec3();_this80._wp=new Float64Array(24);_this80._vp=new Float64Array(24);_this80._pp=new Float64Array(24);_this80._cp=new Float64Array(8);_this80._xAxisLabelCulled=false;_this80._yAxisLabelCulled=false;_this80._zAxisLabelCulled=false;_this80._color=cfg.color||_this80.plugin.defaultColor;var onMouseOver=cfg.onMouseOver?function(event){cfg.onMouseOver(event,_assertThisInitialized(_this80));_this80.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent('mouseover',event));}:null;var onMouseLeave=cfg.onMouseLeave?function(event){cfg.onMouseLeave(event,_assertThisInitialized(_this80));_this80.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent('mouseleave',event));}:null;var onMouseDown=function onMouseDown(event){_this80.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent('mousedown',event));};var onMouseUp=function onMouseUp(event){_this80.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent('mouseup',event));};var onMouseMove=function onMouseMove(event){_this80.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent('mousemove',event));};var onContextMenu=cfg.onContextMenu?function(event){cfg.onContextMenu(event,_assertThisInitialized(_this80));}:null;var onMouseWheel=function onMouseWheel(event){_this80.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent('wheel',event));};_this80._originDot=new Dot(_this80._container,{fillColor:_this80._color,zIndex:plugin.zIndex!==undefined?plugin.zIndex+2:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onMouseDown:onMouseDown,onMouseUp:onMouseUp,onMouseMove:onMouseMove,onContextMenu:onContextMenu});_this80._targetDot=new Dot(_this80._container,{fillColor:_this80._color,zIndex:plugin.zIndex!==undefined?plugin.zIndex+2:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onMouseDown:onMouseDown,onMouseUp:onMouseUp,onMouseMove:onMouseMove,onContextMenu:onContextMenu});_this80._lengthWire=new Wire(_this80._container,{color:_this80._color,thickness:2,thicknessClickable:6,zIndex:plugin.zIndex!==undefined?plugin.zIndex+1:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onMouseDown:onMouseDown,onMouseUp:onMouseUp,onMouseMove:onMouseMove,onContextMenu:onContextMenu});_this80._xAxisWire=new Wire(_this80._container,{color:"#FF0000",thickness:1,thicknessClickable:6,zIndex:plugin.zIndex!==undefined?plugin.zIndex+1:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onMouseDown:onMouseDown,onMouseUp:onMouseUp,onMouseMove:onMouseMove,onContextMenu:onContextMenu});_this80._yAxisWire=new Wire(_this80._container,{color:"green",thickness:1,thicknessClickable:6,zIndex:plugin.zIndex!==undefined?plugin.zIndex+1:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onMouseDown:onMouseDown,onMouseUp:onMouseUp,onMouseMove:onMouseMove,onContextMenu:onContextMenu});_this80._zAxisWire=new Wire(_this80._container,{color:"blue",thickness:1,thicknessClickable:6,zIndex:plugin.zIndex!==undefined?plugin.zIndex+1:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onMouseDown:onMouseDown,onMouseUp:onMouseUp,onMouseMove:onMouseMove,onContextMenu:onContextMenu});_this80._lengthLabel=new Label(_this80._container,{fillColor:_this80._color,prefix:"",text:"",zIndex:plugin.zIndex!==undefined?plugin.zIndex+4:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onMouseDown:onMouseDown,onMouseUp:onMouseUp,onMouseMove:onMouseMove,onContextMenu:onContextMenu});_this80._xAxisLabel=new Label(_this80._container,{fillColor:"red",prefix:"X",text:"",zIndex:plugin.zIndex!==undefined?plugin.zIndex+3:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onMouseDown:onMouseDown,onMouseUp:onMouseUp,onMouseMove:onMouseMove,onContextMenu:onContextMenu});_this80._yAxisLabel=new Label(_this80._container,{fillColor:"green",prefix:"Y",text:"",zIndex:plugin.zIndex!==undefined?plugin.zIndex+3:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onMouseDown:onMouseDown,onMouseUp:onMouseUp,onMouseMove:onMouseMove,onContextMenu:onContextMenu});_this80._zAxisLabel=new Label(_this80._container,{fillColor:"blue",prefix:"Z",text:"",zIndex:plugin.zIndex!==undefined?plugin.zIndex+3:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onMouseDown:onMouseDown,onMouseUp:onMouseUp,onMouseMove:onMouseMove,onContextMenu:onContextMenu});_this80._wpDirty=false;_this80._vpDirty=false;_this80._cpDirty=false;_this80._sectionPlanesDirty=true;_this80._visible=false;_this80._originVisible=false;_this80._targetVisible=false;_this80._wireVisible=false;_this80._axisVisible=false;_this80._xAxisVisible=false;_this80._yAxisVisible=false;_this80._zAxisVisible=false;_this80._axisEnabled=true;_this80._labelsVisible=false;_this80._clickable=false;_this80._originMarker.on("worldPos",function(value){_this80._originWorld.set(value||[0,0,0]);_this80._wpDirty=true;_this80._needUpdate(0);// No lag
|
|
@@ -18828,7 +18823,7 @@ this._originDot.setVisible(this._visible&&this._originVisible);this._targetDot.s
|
|
|
18828
18823
|
*
|
|
18829
18824
|
* @interface
|
|
18830
18825
|
* @abstract
|
|
18831
|
-
*/var DistanceMeasurementsControl=/*#__PURE__*/function(_Component30){_inherits(DistanceMeasurementsControl,_Component30);var
|
|
18826
|
+
*/var DistanceMeasurementsControl=/*#__PURE__*/function(_Component30){_inherits(DistanceMeasurementsControl,_Component30);var _super116=_createSuper(DistanceMeasurementsControl);function DistanceMeasurementsControl(){_classCallCheck(this,DistanceMeasurementsControl);return _super116.apply(this,arguments);}_createClass(DistanceMeasurementsControl,[{key:"active",get:/**
|
|
18832
18827
|
* Gets if this DistanceMeasurementsControl is currently active, where it is responding to input.
|
|
18833
18828
|
*
|
|
18834
18829
|
* @returns {boolean} True if this DistanceMeasurementsControl is active.
|
|
@@ -18908,14 +18903,14 @@ this._originDot.setVisible(this._visible&&this._originVisible);this._targetDot.s
|
|
|
18908
18903
|
*
|
|
18909
18904
|
* distanceMeasurementsControl.activate();
|
|
18910
18905
|
* ````
|
|
18911
|
-
*/var DistanceMeasurementsMouseControl=/*#__PURE__*/function(_DistanceMeasurements){_inherits(DistanceMeasurementsMouseControl,_DistanceMeasurements);var
|
|
18906
|
+
*/var DistanceMeasurementsMouseControl=/*#__PURE__*/function(_DistanceMeasurements){_inherits(DistanceMeasurementsMouseControl,_DistanceMeasurements);var _super117=_createSuper(DistanceMeasurementsMouseControl);/**
|
|
18912
18907
|
* Creates a DistanceMeasurementsMouseControl bound to the given DistanceMeasurementsPlugin.
|
|
18913
18908
|
*
|
|
18914
18909
|
* @param {DistanceMeasurementsPlugin} distanceMeasurementsPlugin The AngleMeasurementsPlugin to control.
|
|
18915
18910
|
* @param [cfg] Configuration
|
|
18916
18911
|
* @param {PointerLens} [cfg.pointerLens] A PointerLens to use to provide a magnified view of the cursor when snapping is enabled.
|
|
18917
18912
|
* @param {boolean} [cfg.snapping=true] Whether to initially enable snap-to-vertex and snap-to-edge for this DistanceMeasurementsMouseControl.
|
|
18918
|
-
*/function DistanceMeasurementsMouseControl(distanceMeasurementsPlugin){var _this81;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,DistanceMeasurementsMouseControl);_this81=
|
|
18913
|
+
*/function DistanceMeasurementsMouseControl(distanceMeasurementsPlugin){var _this81;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,DistanceMeasurementsMouseControl);_this81=_super117.call(this,distanceMeasurementsPlugin.viewer.scene);_this81.pointerLens=cfg.pointerLens;_this81._active=false;_this81._currentDistanceMeasurement=null;_this81._currentDistanceMeasurementInitState={wireVisible:null,axisVisible:null,xAxisVisible:null,yaxisVisible:null,zAxisVisible:null,targetVisible:null};_this81._initMarkerDiv();_this81._onCameraControlHoverSnapOrSurface=null;_this81._onCameraControlHoverSnapOrSurfaceOff=null;_this81._onMouseDown=null;_this81._onMouseUp=null;_this81._onCanvasTouchStart=null;_this81._onCanvasTouchEnd=null;_this81._snapping=cfg.snapping!==false;_this81._mouseState=MOUSE_FIRST_CLICK_EXPECTED;_this81._attachPlugin(distanceMeasurementsPlugin,cfg);return _this81;}_createClass(DistanceMeasurementsMouseControl,[{key:"_initMarkerDiv",value:function _initMarkerDiv(){var markerDiv=document.createElement('div');markerDiv.setAttribute('id','myMarkerDiv');var canvas=this.scene.canvas.canvas;canvas.parentNode.insertBefore(markerDiv,canvas);markerDiv.style.background="black";markerDiv.style.border="2px solid blue";markerDiv.style.borderRadius="10px";markerDiv.style.width="5px";markerDiv.style.height="5px";markerDiv.style.margin="-200px -200px";markerDiv.style.zIndex="100";markerDiv.style.position="absolute";markerDiv.style.pointerEvents="none";this._markerDiv=markerDiv;}},{key:"_destroyMarkerDiv",value:function _destroyMarkerDiv(){if(this._markerDiv){var element=document.getElementById('myMarkerDiv');element.parentNode.removeChild(element);this._markerDiv=null;}}},{key:"_attachPlugin",value:function _attachPlugin(distanceMeasurementsPlugin){var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};/**
|
|
18919
18914
|
* The {@link DistanceMeasurementsPlugin} that owns this DistanceMeasurementsMouseControl.
|
|
18920
18915
|
* @type {DistanceMeasurementsPlugin}
|
|
18921
18916
|
*/this.distanceMeasurementsPlugin=distanceMeasurementsPlugin;/**
|
|
@@ -19176,7 +19171,7 @@ this._originDot.setVisible(this._visible&&this._originVisible);this._targetDot.s
|
|
|
19176
19171
|
* });
|
|
19177
19172
|
* });
|
|
19178
19173
|
* ````
|
|
19179
|
-
*/var DistanceMeasurementsPlugin=/*#__PURE__*/function(_Plugin5){_inherits(DistanceMeasurementsPlugin,_Plugin5);var
|
|
19174
|
+
*/var DistanceMeasurementsPlugin=/*#__PURE__*/function(_Plugin5){_inherits(DistanceMeasurementsPlugin,_Plugin5);var _super118=_createSuper(DistanceMeasurementsPlugin);/**
|
|
19180
19175
|
* @constructor
|
|
19181
19176
|
* @param {Viewer} viewer The Viewer.
|
|
19182
19177
|
* @param {Object} [cfg] Plugin configuration.
|
|
@@ -19195,7 +19190,7 @@ this._originDot.setVisible(this._visible&&this._originVisible);this._targetDot.s
|
|
|
19195
19190
|
* @param {string} [cfg.defaultColor=#00BBFF] The default color of the length dots, wire and label.
|
|
19196
19191
|
* @param {number} [cfg.zIndex] If set, the wires, dots and labels will have this zIndex (+1 for dots and +2 for labels).
|
|
19197
19192
|
* @param {PointerCircle} [cfg.pointerLens] A PointerLens to help the user position the pointer. This can be shared with other plugins.
|
|
19198
|
-
*/function DistanceMeasurementsPlugin(viewer){var _this83;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,DistanceMeasurementsPlugin);_this83=
|
|
19193
|
+
*/function DistanceMeasurementsPlugin(viewer){var _this83;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,DistanceMeasurementsPlugin);_this83=_super118.call(this,"DistanceMeasurements",viewer);_this83._pointerLens=cfg.pointerLens;_this83._container=cfg.container||document.body;_this83._defaultControl=null;_this83._measurements={};_this83.labelMinAxisLength=cfg.labelMinAxisLength;_this83.defaultVisible=cfg.defaultVisible!==false;_this83.defaultOriginVisible=cfg.defaultOriginVisible!==false;_this83.defaultTargetVisible=cfg.defaultTargetVisible!==false;_this83.defaultWireVisible=cfg.defaultWireVisible!==false;_this83.defaultLabelsVisible=cfg.defaultLabelsVisible!==false;_this83.defaultAxisVisible=cfg.defaultAxisVisible!==false;_this83.defaultXAxisVisible=cfg.defaultXAxisVisible!==false;_this83.defaultYAxisVisible=cfg.defaultYAxisVisible!==false;_this83.defaultZAxisVisible=cfg.defaultZAxisVisible!==false;_this83.defaultColor=cfg.defaultColor!==undefined?cfg.defaultColor:"#00BBFF";_this83.zIndex=cfg.zIndex||10000;_this83._onMouseOver=function(event,measurement){_this83.fire("mouseOver",{plugin:_assertThisInitialized(_this83),distanceMeasurement:measurement,measurement:measurement,event:event});};_this83._onMouseLeave=function(event,measurement){_this83.fire("mouseLeave",{plugin:_assertThisInitialized(_this83),distanceMeasurement:measurement,measurement:measurement,event:event});};_this83._onContextMenu=function(event,measurement){_this83.fire("contextMenu",{plugin:_assertThisInitialized(_this83),distanceMeasurement:measurement,measurement:measurement,event:event});};return _this83;}/**
|
|
19199
19194
|
* Gets the plugin's HTML container element, if any.
|
|
19200
19195
|
* @returns {*|HTMLElement|HTMLElement}
|
|
19201
19196
|
*/_createClass(DistanceMeasurementsPlugin,[{key:"getContainerElement",value:function getContainerElement(){return this._container;}/**
|
|
@@ -19358,7 +19353,7 @@ this._originDot.setVisible(this._visible&&this._originVisible);this._targetDot.s
|
|
|
19358
19353
|
* ````
|
|
19359
19354
|
*
|
|
19360
19355
|
* @class FastNavPlugin
|
|
19361
|
-
*/var FastNavPlugin=/*#__PURE__*/function(_Plugin6){_inherits(FastNavPlugin,_Plugin6);var
|
|
19356
|
+
*/var FastNavPlugin=/*#__PURE__*/function(_Plugin6){_inherits(FastNavPlugin,_Plugin6);var _super119=_createSuper(FastNavPlugin);/**
|
|
19362
19357
|
* @constructor
|
|
19363
19358
|
* @param {Viewer} viewer The Viewer.
|
|
19364
19359
|
* @param {Object} cfg FastNavPlugin configuration.
|
|
@@ -19372,7 +19367,7 @@ this._originDot.setVisible(this._visible&&this._originVisible);this._targetDot.s
|
|
|
19372
19367
|
* @param {Number} [cfg.scaleCanvasResolutionFactor=0.6] The factor by which we downscale the canvas resolution whenever we interact with the Viewer.
|
|
19373
19368
|
* @param {Boolean} [cfg.delayBeforeRestore=true] Whether to temporarily have a delay before restoring normal rendering after we stop interacting with the Viewer.
|
|
19374
19369
|
* @param {Number} [cfg.delayBeforeRestoreSeconds=0.5] Delay in seconds before restoring normal rendering after we stop interacting with the Viewer.
|
|
19375
|
-
*/function FastNavPlugin(viewer){var _this85;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,FastNavPlugin);_this85=
|
|
19370
|
+
*/function FastNavPlugin(viewer){var _this85;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,FastNavPlugin);_this85=_super119.call(this,"FastNav",viewer);_this85._hideColorTexture=cfg.hideColorTexture!==false;_this85._hidePBR=cfg.hidePBR!==false;_this85._hideSAO=cfg.hideSAO!==false;_this85._hideEdges=cfg.hideEdges!==false;_this85._hideTransparentObjects=!!cfg.hideTransparentObjects;_this85._scaleCanvasResolution=!!cfg.scaleCanvasResolution;_this85._scaleCanvasResolutionFactor=cfg.scaleCanvasResolutionFactor||0.6;_this85._delayBeforeRestore=cfg.delayBeforeRestore!==false;_this85._delayBeforeRestoreSeconds=cfg.delayBeforeRestoreSeconds||0.5;var timer=_this85._delayBeforeRestoreSeconds*1000;var fastMode=false;var switchToLowQuality=function switchToLowQuality(){timer=_this85._delayBeforeRestoreSeconds*1000;if(!fastMode){viewer.scene._renderer.setColorTextureEnabled(!_this85._hideColorTexture);viewer.scene._renderer.setPBREnabled(!_this85._hidePBR);viewer.scene._renderer.setSAOEnabled(!_this85._hideSAO);viewer.scene._renderer.setTransparentEnabled(!_this85._hideTransparentObjects);viewer.scene._renderer.setEdgesEnabled(!_this85._hideEdges);if(_this85._scaleCanvasResolution){viewer.scene.canvas.resolutionScale=_this85._scaleCanvasResolutionFactor;}else{viewer.scene.canvas.resolutionScale=1;}fastMode=true;}};var switchToHighQuality=function switchToHighQuality(){viewer.scene.canvas.resolutionScale=1;viewer.scene._renderer.setEdgesEnabled(true);viewer.scene._renderer.setColorTextureEnabled(true);viewer.scene._renderer.setPBREnabled(true);viewer.scene._renderer.setSAOEnabled(true);viewer.scene._renderer.setTransparentEnabled(true);fastMode=false;};_this85._onCanvasBoundary=viewer.scene.canvas.on("boundary",switchToLowQuality);_this85._onCameraMatrix=viewer.scene.camera.on("matrix",switchToLowQuality);_this85._onSceneTick=viewer.scene.on("tick",function(tickEvent){if(!fastMode){return;}timer-=tickEvent.deltaTime;if(!_this85._delayBeforeRestore||timer<=0){switchToHighQuality();}});var down=false;_this85._onSceneMouseDown=viewer.scene.input.on("mousedown",function(){down=true;});_this85._onSceneMouseUp=viewer.scene.input.on("mouseup",function(){down=false;});_this85._onSceneMouseMove=viewer.scene.input.on("mousemove",function(){if(!down){return;}switchToLowQuality();});return _this85;}/**
|
|
19376
19371
|
* Gets whether to temporarily hide color textures whenever we interact with the Viewer.
|
|
19377
19372
|
*
|
|
19378
19373
|
* Default is ````true````.
|
|
@@ -19821,14 +19816,14 @@ subs[subId]={callback:callback};this._eventSubEvents[subId]=event;var value=this
|
|
|
19821
19816
|
*/},{key:"off",value:function off(subId){if(subId===undefined||subId===null){return;}if(!this._eventSubEvents){return;}var event=this._eventSubEvents[subId];if(event){delete this._eventSubEvents[subId];var subs=this._eventSubs[event];if(subs){delete subs[subId];}this._eventSubIDMap.removeItem(subId);// Release subId
|
|
19822
19817
|
}}}]);return LocaleService;}();function resolvePath$1(key,json){if(json[key]){return json[key];}var parts=key.split(".");var obj=json;for(var _i453=0,len=parts.length;obj&&_i453<len;_i453++){var part=parts[_i453];obj=obj[part];}return obj;}function vsprintf(msg){var args=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];return msg.replace(/\{\{|\}\}|\{(\d+)\}/g,function(m,n){if(m==="{{"){return"{";}if(m==="}}"){return"}";}return args[n];});}/**
|
|
19823
19818
|
* @desc Abstract base class for curve classes.
|
|
19824
|
-
*/var Curve=/*#__PURE__*/function(_Component31){_inherits(Curve,_Component31);var
|
|
19819
|
+
*/var Curve=/*#__PURE__*/function(_Component31){_inherits(Curve,_Component31);var _super120=_createSuper(Curve);/**
|
|
19825
19820
|
* @constructor
|
|
19826
19821
|
* @param {Component} [owner] Owner component. When destroyed, the owner will destroy this Curve as well.
|
|
19827
19822
|
* @param {*} [cfg] Configs
|
|
19828
19823
|
* @param {String} [cfg.id] Optional ID, unique among all components in the parent {@link Curve}, generated automatically when omitted.
|
|
19829
19824
|
* @param {Object} [cfg] Configs for this Curve.
|
|
19830
19825
|
* @param {Number} [cfg.t=0] Current position on this Curve, in range between ````0..1````.
|
|
19831
|
-
*/function Curve(owner){var _this86;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Curve);_this86=
|
|
19826
|
+
*/function Curve(owner){var _this86;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Curve);_this86=_super120.call(this,owner,cfg);_this86.t=cfg.t;return _this86;}/**
|
|
19832
19827
|
* Sets the progress along this Curve.
|
|
19833
19828
|
*
|
|
19834
19829
|
* Automatically clamps to range ````[0..1]````.
|
|
@@ -19875,7 +19870,7 @@ comparison=arcLengths[i]-targetArcLength;if(comparison<0){low=i+1;}else if(compa
|
|
|
19875
19870
|
* <img style="border:1px solid; background: white;" src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/72/Quadratic_spline_six_segments.svg/200px-Quadratic_spline_six_segments.svg.png"/><br>
|
|
19876
19871
|
*
|
|
19877
19872
|
* * <a href="https://en.wikipedia.org/wiki/Spline_(mathematics)">Spline Curve from Wikipedia</a>*
|
|
19878
|
-
*/var SplineCurve=/*#__PURE__*/function(_Curve){_inherits(SplineCurve,_Curve);var
|
|
19873
|
+
*/var SplineCurve=/*#__PURE__*/function(_Curve){_inherits(SplineCurve,_Curve);var _super121=_createSuper(SplineCurve);/**
|
|
19879
19874
|
* @constructor
|
|
19880
19875
|
* @param {Component} [owner] Owner component. When destroyed, the owner will destroy this SplineCurve as well.
|
|
19881
19876
|
* @param {*} [cfg] Configs
|
|
@@ -19883,7 +19878,7 @@ comparison=arcLengths[i]-targetArcLength;if(comparison<0){low=i+1;}else if(compa
|
|
|
19883
19878
|
* @param {Array} [cfg.points=[]] Control points on this SplineCurve.
|
|
19884
19879
|
* @param {Number} [cfg.t=0] Current position on this SplineCurve, in range between 0..1.
|
|
19885
19880
|
* @param {Number} [cfg.t=0] Current position on this CubicBezierCurve, in range between 0..1.
|
|
19886
|
-
*/function SplineCurve(owner){var _this87;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,SplineCurve);_this87=
|
|
19881
|
+
*/function SplineCurve(owner){var _this87;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,SplineCurve);_this87=_super121.call(this,owner,cfg);_this87.points=cfg.points;_this87.t=cfg.t;return _this87;}/**
|
|
19887
19882
|
* Sets the control points on this SplineCurve.
|
|
19888
19883
|
*
|
|
19889
19884
|
* Default value is ````[]````.
|
|
@@ -19924,13 +19919,13 @@ comparison=arcLengths[i]-targetArcLength;if(comparison<0){low=i+1;}else if(compa
|
|
|
19924
19919
|
* @desc Defines a sequence of frames along which a {@link CameraPathAnimation} can animate a {@link Camera}.
|
|
19925
19920
|
*
|
|
19926
19921
|
* See {@link CameraPathAnimation} for usage.
|
|
19927
|
-
*/var CameraPath=/*#__PURE__*/function(_Component32){_inherits(CameraPath,_Component32);var
|
|
19922
|
+
*/var CameraPath=/*#__PURE__*/function(_Component32){_inherits(CameraPath,_Component32);var _super122=_createSuper(CameraPath);/**
|
|
19928
19923
|
* @constructor
|
|
19929
19924
|
* @param {Component} [owner] Owner component. When destroyed, the owner will destroy this CameraPath as well.
|
|
19930
19925
|
* @param [cfg] {*} Configuration
|
|
19931
19926
|
* @param {String} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
|
|
19932
19927
|
* @param {{t:Number, eye:Object, look:Object, up: Object}[]} [cfg.frames] Initial sequence of frames.
|
|
19933
|
-
*/function CameraPath(owner){var _this88;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,CameraPath);_this88=
|
|
19928
|
+
*/function CameraPath(owner){var _this88;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,CameraPath);_this88=_super122.call(this,owner,cfg);_this88._frames=[];_this88._eyeCurve=new SplineCurve(_assertThisInitialized(_this88));_this88._lookCurve=new SplineCurve(_assertThisInitialized(_this88));_this88._upCurve=new SplineCurve(_assertThisInitialized(_this88));if(cfg.frames){_this88.addFrames(cfg.frames);_this88.smoothFrameTimes(1);}return _this88;}/**
|
|
19934
19929
|
* Gets the camera frames in this CameraPath.
|
|
19935
19930
|
*
|
|
19936
19931
|
* @returns {{t:Number, eye:Object, look:Object, up: Object}[]} The frames on this CameraPath.
|
|
@@ -20072,10 +20067,10 @@ comparison=arcLengths[i]-targetArcLength;if(comparison<0){low=i+1;}else if(compa
|
|
|
20072
20067
|
* // Done
|
|
20073
20068
|
* });
|
|
20074
20069
|
* ````
|
|
20075
|
-
*/var CameraFlightAnimation=/*#__PURE__*/function(_Component33){_inherits(CameraFlightAnimation,_Component33);var
|
|
20070
|
+
*/var CameraFlightAnimation=/*#__PURE__*/function(_Component33){_inherits(CameraFlightAnimation,_Component33);var _super123=_createSuper(CameraFlightAnimation);/**
|
|
20076
20071
|
@constructor
|
|
20077
20072
|
@private
|
|
20078
|
-
*/function CameraFlightAnimation(owner){var _this89;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,CameraFlightAnimation);_this89=
|
|
20073
|
+
*/function CameraFlightAnimation(owner){var _this89;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,CameraFlightAnimation);_this89=_super123.call(this,owner,cfg);_this89._look1=math.vec3();_this89._eye1=math.vec3();_this89._up1=math.vec3();_this89._look2=math.vec3();_this89._eye2=math.vec3();_this89._up2=math.vec3();_this89._orthoScale1=1;_this89._orthoScale2=1;_this89._flying=false;_this89._flyEyeLookUp=false;_this89._flyingEye=false;_this89._flyingLook=false;_this89._callback=null;_this89._callbackScope=null;_this89._time1=null;_this89._time2=null;_this89.easing=cfg.easing!==false;_this89.duration=cfg.duration;_this89.fit=cfg.fit;_this89.fitFOV=cfg.fitFOV;_this89.trail=cfg.trail;return _this89;}/**
|
|
20079
20074
|
* Flies the {@link Camera} to a target.
|
|
20080
20075
|
*
|
|
20081
20076
|
* * When the target is a boundary, the {@link Camera} will fly towards the target and stop when the target fills most of the canvas.
|
|
@@ -20264,13 +20259,13 @@ t/=d;return-c*t*(t-2)+b;}},{key:"_easeInCubic",value:function _easeInCubic(t,b,c
|
|
|
20264
20259
|
* }, 2000);
|
|
20265
20260
|
* });
|
|
20266
20261
|
* ````
|
|
20267
|
-
*/var CameraPathAnimation=/*#__PURE__*/function(_Component34){_inherits(CameraPathAnimation,_Component34);var
|
|
20262
|
+
*/var CameraPathAnimation=/*#__PURE__*/function(_Component34){_inherits(CameraPathAnimation,_Component34);var _super124=_createSuper(CameraPathAnimation);/**
|
|
20268
20263
|
* @constructor
|
|
20269
20264
|
* @param {Component} [owner] Owner component. When destroyed, the owner will destroy this CameraPathAnimation as well.
|
|
20270
20265
|
* @param {*} [cfg] Configuration
|
|
20271
20266
|
* @param {String} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
|
|
20272
20267
|
* @param {CameraPath} [cfg.eyeCurve] A {@link CameraPath} that defines the path of a {@link Camera}.
|
|
20273
|
-
*/function CameraPathAnimation(owner){var _this90;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,CameraPathAnimation);_this90=
|
|
20268
|
+
*/function CameraPathAnimation(owner){var _this90;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,CameraPathAnimation);_this90=_super124.call(this,owner,cfg);_this90._cameraFlightAnimation=new CameraFlightAnimation(_assertThisInitialized(_this90));_this90._t=0;_this90.state=CameraPathAnimation.SCRUBBING;_this90._playingFromT=0;_this90._playingToT=0;_this90._playingRate=cfg.playingRate||1.0;_this90._playingDir=1.0;_this90._lastTime=null;_this90.cameraPath=cfg.cameraPath;_this90._tick=_this90.scene.on("tick",_this90._updateT,_assertThisInitialized(_this90));return _this90;}_createClass(CameraPathAnimation,[{key:"type",get:/**
|
|
20274
20269
|
* Returns "CameraPathAnimation".
|
|
20275
20270
|
*
|
|
20276
20271
|
* @private
|
|
@@ -20432,7 +20427,7 @@ t/=d;return-c*t*(t-2)+b;}},{key:"_easeInCubic",value:function _easeInCubic(t,b,c
|
|
|
20432
20427
|
* pickable: false // Don't allow ImagePlane to be picked
|
|
20433
20428
|
* });
|
|
20434
20429
|
* ````
|
|
20435
|
-
*/var ImagePlane=/*#__PURE__*/function(_Component35){_inherits(ImagePlane,_Component35);var
|
|
20430
|
+
*/var ImagePlane=/*#__PURE__*/function(_Component35){_inherits(ImagePlane,_Component35);var _super125=_createSuper(ImagePlane);/**
|
|
20436
20431
|
* @constructor
|
|
20437
20432
|
* @param {Component} [owner] Owner component. When destroyed, the owner will destroy this ````ImagePlane```` as well.
|
|
20438
20433
|
* @param {*} [cfg] ````ImagePlane```` configuration
|
|
@@ -20451,7 +20446,7 @@ t/=d;return-c*t*(t-2)+b;}},{key:"_easeInCubic",value:function _easeInCubic(t,b,c
|
|
|
20451
20446
|
* @param {Number} [cfg.opacity=1.0] ````ImagePlane````'s initial opacity factor, multiplies by the rendered fragment alpha.
|
|
20452
20447
|
* @param {String} [cfg.src] URL of image. Accepted file types are PNG and JPEG.
|
|
20453
20448
|
* @param {HTMLImageElement} [cfg.image] An ````HTMLImageElement```` to source the image from. Overrides ````src````.
|
|
20454
|
-
*/function ImagePlane(owner){var _this91;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,ImagePlane);_this91=
|
|
20449
|
+
*/function ImagePlane(owner){var _this91;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,ImagePlane);_this91=_super125.call(this,owner,cfg);_this91._src=null;_this91._image=null;_this91._pos=math.vec3();_this91._origin=math.vec3();_this91._rtcPos=math.vec3();_this91._dir=math.vec3();_this91._size=1.0;_this91._imageSize=math.vec2();_this91._texture=new Texture(_assertThisInitialized(_this91));_this91._plane=new Mesh(_assertThisInitialized(_this91),{geometry:new ReadableGeometry(_assertThisInitialized(_this91),buildPlaneGeometry({center:[0,0,0],xSize:1,zSize:1,xSegments:10,zSegments:10})),material:new PhongMaterial(_assertThisInitialized(_this91),{diffuse:[0,0,0],ambient:[0,0,0],specular:[0,0,0],diffuseMap:_this91._texture,emissiveMap:_this91._texture,backfaces:true}),clippable:cfg.clippable});_this91._grid=new Mesh(_assertThisInitialized(_this91),{geometry:new ReadableGeometry(_assertThisInitialized(_this91),buildGridGeometry({size:1,divisions:10})),material:new PhongMaterial(_assertThisInitialized(_this91),{diffuse:[0.0,0.0,0.0],ambient:[0.0,0.0,0.0],emissive:[0.2,0.8,0.2]}),position:[0,0.001,0.0],clippable:cfg.clippable});_this91._node=new Node$2(_assertThisInitialized(_this91),{rotation:[0,0,0],position:[0,0,0],scale:[1,1,1],clippable:false,children:[_this91._plane,_this91._grid]});_this91._gridVisible=false;_this91.visible=true;_this91.gridVisible=cfg.gridVisible;_this91.position=cfg.position;_this91.rotation=cfg.rotation;_this91.dir=cfg.dir;_this91.size=cfg.size;_this91.collidable=cfg.collidable;_this91.clippable=cfg.clippable;_this91.pickable=cfg.pickable;_this91.opacity=cfg.opacity;if(cfg.image){_this91.image=cfg.image;}else{_this91.src=cfg.src;}return _this91;}/**
|
|
20455
20450
|
* Sets if this ````ImagePlane```` is visible or not.
|
|
20456
20451
|
*
|
|
20457
20452
|
* Default value is ````true````.
|
|
@@ -20693,7 +20688,7 @@ t/=d;return-c*t*(t-2)+b;}},{key:"_easeInCubic",value:function _easeInCubic(t,b,c
|
|
|
20693
20688
|
* position: [0, -2.1, 0]
|
|
20694
20689
|
* });
|
|
20695
20690
|
* ````
|
|
20696
|
-
*/var PointLight=/*#__PURE__*/function(_Light3){_inherits(PointLight,_Light3);var
|
|
20691
|
+
*/var PointLight=/*#__PURE__*/function(_Light3){_inherits(PointLight,_Light3);var _super126=_createSuper(PointLight);/**
|
|
20697
20692
|
* @param {Component} owner Owner component. When destroyed, the owner will destroy this PointLight as well.
|
|
20698
20693
|
* @param {*} [cfg] The PointLight configuration
|
|
20699
20694
|
* @param {String} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
|
|
@@ -20705,7 +20700,7 @@ t/=d;return-c*t*(t-2)+b;}},{key:"_easeInCubic",value:function _easeInCubic(t,b,c
|
|
|
20705
20700
|
* @param {Number} [cfg.quadraticAttenuation=0]Quadratic attenuation factor.
|
|
20706
20701
|
* @param {String} [cfg.space="view"]The coordinate system this PointLight is defined in - "view" or "world".
|
|
20707
20702
|
* @param {Boolean} [cfg.castsShadow=false] Flag which indicates if this PointLight casts a castsShadow.
|
|
20708
|
-
*/function PointLight(owner){var _this93;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,PointLight);_this93=
|
|
20703
|
+
*/function PointLight(owner){var _this93;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,PointLight);_this93=_super126.call(this,owner,cfg);var self=_assertThisInitialized(_this93);_this93._shadowRenderBuf=null;_this93._shadowViewMatrix=null;_this93._shadowProjMatrix=null;_this93._shadowViewMatrixDirty=true;_this93._shadowProjMatrixDirty=true;var camera=_this93.scene.camera;var canvas=_this93.scene.canvas;_this93._onCameraViewMatrix=camera.on("viewMatrix",function(){_this93._shadowViewMatrixDirty=true;});_this93._onCameraProjMatrix=camera.on("projMatrix",function(){_this93._shadowProjMatrixDirty=true;});_this93._onCanvasBoundary=canvas.on("boundary",function(){_this93._shadowProjMatrixDirty=true;});_this93._state=new RenderState({type:"point",pos:math.vec3([1.0,1.0,1.0]),color:math.vec3([0.7,0.7,0.8]),intensity:1.0,attenuation:[0.0,0.0,0.0],space:cfg.space||"view",castsShadow:false,getShadowViewMatrix:function getShadowViewMatrix(){if(self._shadowViewMatrixDirty){if(!self._shadowViewMatrix){self._shadowViewMatrix=math.identityMat4();}var eye=self._state.pos;var look=camera.look;var up=camera.up;math.lookAtMat4v(eye,look,up,self._shadowViewMatrix);self._shadowViewMatrixDirty=false;}return self._shadowViewMatrix;},getShadowProjMatrix:function getShadowProjMatrix(){if(self._shadowProjMatrixDirty){// TODO: Set when canvas resizes
|
|
20709
20704
|
if(!self._shadowProjMatrix){self._shadowProjMatrix=math.identityMat4();}var _canvas4=self.scene.canvas.canvas;math.perspectiveMat4(70*(Math.PI/180.0),_canvas4.clientWidth/_canvas4.clientHeight,0.1,500.0,self._shadowProjMatrix);self._shadowProjMatrixDirty=false;}return self._shadowProjMatrix;},getShadowRenderBuf:function getShadowRenderBuf(){if(!self._shadowRenderBuf){self._shadowRenderBuf=new RenderBuffer(self.scene.canvas.canvas,self.scene.canvas.gl,{size:[1024,1024]});// Super old mobile devices have a limit of 1024x1024 textures
|
|
20710
20705
|
}return self._shadowRenderBuf;}});_this93.pos=cfg.pos;_this93.color=cfg.color;_this93.intensity=cfg.intensity;_this93.constantAttenuation=cfg.constantAttenuation;_this93.linearAttenuation=cfg.linearAttenuation;_this93.quadraticAttenuation=cfg.quadraticAttenuation;_this93.castsShadow=cfg.castsShadow;_this93.scene._lightCreated(_assertThisInitialized(_this93));return _this93;}/**
|
|
20711
20706
|
* Sets the position of this PointLight.
|
|
@@ -20801,7 +20796,7 @@ if(!self._shadowProjMatrix){self._shadowProjMatrix=math.identityMat4();}var _can
|
|
|
20801
20796
|
* Destroys this PointLight.
|
|
20802
20797
|
*/,set:function set(castsShadow){castsShadow=!!castsShadow;if(this._state.castsShadow===castsShadow){return;}this._state.castsShadow=castsShadow;this._shadowViewMatrixDirty=true;this.glRedraw();}},{key:"destroy",value:function destroy(){var camera=this.scene.camera;var canvas=this.scene.canvas;camera.off(this._onCameraViewMatrix);camera.off(this._onCameraProjMatrix);canvas.off(this._onCanvasBoundary);_get(_getPrototypeOf(PointLight.prototype),"destroy",this).call(this);this._state.destroy();if(this._shadowRenderBuf){this._shadowRenderBuf.destroy();}this.scene._lightDestroyed(this);this.glRedraw();}}]);return PointLight;}(Light);function ensureImageSizePowerOfTwo(image){if(!isPowerOfTwo(image.width)||!isPowerOfTwo(image.height)){var _canvas5=document.createElement("canvas");_canvas5.width=nextHighestPowerOfTwo(image.width);_canvas5.height=nextHighestPowerOfTwo(image.height);var ctx=_canvas5.getContext("2d");ctx.drawImage(image,0,0,image.width,image.height,0,0,_canvas5.width,_canvas5.height);image=_canvas5;}return image;}function isPowerOfTwo(x){return(x&x-1)===0;}function nextHighestPowerOfTwo(x){--x;for(var _i457=1;_i457<32;_i457<<=1){x=x|x>>_i457;}return x+1;}/**
|
|
20803
20798
|
* @desc A cube texture map.
|
|
20804
|
-
*/var CubeTexture=/*#__PURE__*/function(_Component36){_inherits(CubeTexture,_Component36);var
|
|
20799
|
+
*/var CubeTexture=/*#__PURE__*/function(_Component36){_inherits(CubeTexture,_Component36);var _super127=_createSuper(CubeTexture);/**
|
|
20805
20800
|
* @constructor
|
|
20806
20801
|
* @param {Component} owner Owner component. When destroyed, the owner will destroy this component as well.
|
|
20807
20802
|
* @param {*} [cfg] Configs
|
|
@@ -20809,7 +20804,7 @@ if(!self._shadowProjMatrix){self._shadowProjMatrix=math.identityMat4();}var _can
|
|
|
20809
20804
|
* @param {String[]} [cfg.src=null] Paths to six image files to load into this CubeTexture.
|
|
20810
20805
|
* @param {Boolean} [cfg.flipY=false] Flips this CubeTexture's source data along its vertical axis when true.
|
|
20811
20806
|
* @param {Number} [cfg.encoding=LinearEncoding] Encoding format. Supported values are {@link LinearEncoding} and {@link sRGBEncoding}.
|
|
20812
|
-
*/function CubeTexture(owner){var _this94;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,CubeTexture);_this94=
|
|
20807
|
+
*/function CubeTexture(owner){var _this94;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,CubeTexture);_this94=_super127.call(this,owner,cfg);var gl=_this94.scene.canvas.gl;_this94._state=new RenderState({texture:new Texture2D({gl:gl,target:gl.TEXTURE_CUBE_MAP}),flipY:_this94._checkFlipY(cfg.minFilter),encoding:_this94._checkEncoding(cfg.encoding),minFilter:LinearMipmapLinearFilter,magFilter:LinearFilter,wrapS:ClampToEdgeWrapping,wrapT:ClampToEdgeWrapping,mipmaps:true});_this94._src=cfg.src;_this94._images=[];_this94._loadSrc(cfg.src);stats.memory.textures++;return _this94;}_createClass(CubeTexture,[{key:"type",get:/**
|
|
20813
20808
|
@private
|
|
20814
20809
|
*/function get(){return"CubeTexture";}},{key:"_checkFlipY",value:function _checkFlipY(value){return!!value;}},{key:"_checkEncoding",value:function _checkEncoding(value){value=value||LinearEncoding;if(value!==LinearEncoding&&value!==sRGBEncoding){this.error("Unsupported value for 'encoding' - supported values are LinearEncoding and sRGBEncoding. Defaulting to LinearEncoding.");value=LinearEncoding;}return value;}},{key:"_webglContextRestored",value:function _webglContextRestored(){this.scene.canvas.gl;this._state.texture=null;// if (this._images.length > 0) {
|
|
20815
20810
|
// this._state.texture = new xeokit.renderer.Texture2D(gl, gl.TEXTURE_CUBE_MAP);
|
|
@@ -20862,14 +20857,14 @@ if(this._src){this._loadSrc(this._src);}}},{key:"_loadSrc",value:function _loadS
|
|
|
20862
20857
|
* })
|
|
20863
20858
|
* });
|
|
20864
20859
|
* ````
|
|
20865
|
-
*/var ReflectionMap=/*#__PURE__*/function(_CubeTexture){_inherits(ReflectionMap,_CubeTexture);var
|
|
20860
|
+
*/var ReflectionMap=/*#__PURE__*/function(_CubeTexture){_inherits(ReflectionMap,_CubeTexture);var _super128=_createSuper(ReflectionMap);/**
|
|
20866
20861
|
* @param {Component} owner Owner component. When destroyed, the owner will destroy this component as well.
|
|
20867
20862
|
* @param {*} [cfg] Configs
|
|
20868
20863
|
* @param {String} [cfg.id] Optional ID for this ReflectionMap, unique among all components in the parent scene, generated automatically when omitted.
|
|
20869
20864
|
* @param {String[]} [cfg.src=null] Paths to six image files to load into this ReflectionMap.
|
|
20870
20865
|
* @param {Boolean} [cfg.flipY=false] Flips this ReflectionMap's source data along its vertical axis when true.
|
|
20871
20866
|
* @param {Number} [cfg.encoding=LinearEncoding] Encoding format. Supported values are {@link LinearEncoding} and {@link sRGBEncoding}.
|
|
20872
|
-
*/function ReflectionMap(owner){var _this95;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,ReflectionMap);_this95=
|
|
20867
|
+
*/function ReflectionMap(owner){var _this95;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,ReflectionMap);_this95=_super128.call(this,owner,cfg);_this95.scene._lightsState.addReflectionMap(_this95._state);_this95.scene._reflectionMapCreated(_assertThisInitialized(_this95));return _this95;}/**
|
|
20873
20868
|
* Destroys this ReflectionMap.
|
|
20874
20869
|
*/_createClass(ReflectionMap,[{key:"type",get:/**
|
|
20875
20870
|
@private
|
|
@@ -20916,7 +20911,7 @@ if(this._src){this._loadSrc(this._src);}}},{key:"_loadSrc",value:function _loadS
|
|
|
20916
20911
|
* })
|
|
20917
20912
|
* });
|
|
20918
20913
|
* ````
|
|
20919
|
-
*/var LightMap=/*#__PURE__*/function(_CubeTexture2){_inherits(LightMap,_CubeTexture2);var
|
|
20914
|
+
*/var LightMap=/*#__PURE__*/function(_CubeTexture2){_inherits(LightMap,_CubeTexture2);var _super129=_createSuper(LightMap);/**
|
|
20920
20915
|
* @constructor
|
|
20921
20916
|
* @param {Component} owner Owner component. When destroyed, the owner will destroy this component as well.
|
|
20922
20917
|
* @param {*} [cfg] Configs
|
|
@@ -20925,7 +20920,7 @@ if(this._src){this._loadSrc(this._src);}}},{key:"_loadSrc",value:function _loadS
|
|
|
20925
20920
|
* @param {String[]} [cfg.src=null] Paths to six image files to load into this LightMap.
|
|
20926
20921
|
* @param {Boolean} [cfg.flipY=false] Flips this LightMap's source data along its vertical axis when true.
|
|
20927
20922
|
* @param {Number} [cfg.encoding=LinearEncoding] Encoding format. Supported values are {@link LinearEncoding} and {@link sRGBEncoding}.
|
|
20928
|
-
*/function LightMap(owner){var _this96;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,LightMap);_this96=
|
|
20923
|
+
*/function LightMap(owner){var _this96;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,LightMap);_this96=_super129.call(this,owner,cfg);_this96.scene._lightMapCreated(_assertThisInitialized(_this96));return _this96;}_createClass(LightMap,[{key:"type",get:/**
|
|
20929
20924
|
@private
|
|
20930
20925
|
*/function get(){return"LightMap";}},{key:"destroy",value:function destroy(){_get(_getPrototypeOf(LightMap.prototype),"destroy",this).call(this);this.scene._lightMapDestroyed(this);}}]);return LightMap;}(CubeTexture);/**
|
|
20931
20926
|
* A {@link Marker} with a billboarded and textured quad attached to it.
|
|
@@ -20966,7 +20961,7 @@ if(this._src){this._loadSrc(this._src);}}},{key:"_loadSrc",value:function _loadS
|
|
|
20966
20961
|
* occludable: false
|
|
20967
20962
|
* });
|
|
20968
20963
|
*````
|
|
20969
|
-
*/var SpriteMarker=/*#__PURE__*/function(_Marker2){_inherits(SpriteMarker,_Marker2);var
|
|
20964
|
+
*/var SpriteMarker=/*#__PURE__*/function(_Marker2){_inherits(SpriteMarker,_Marker2);var _super130=_createSuper(SpriteMarker);/**
|
|
20970
20965
|
* @constructor
|
|
20971
20966
|
* @param {Component} owner Owner component. When destroyed, the owner will destroy this SpriteMarker as well.
|
|
20972
20967
|
* @param {*} [cfg] Configs
|
|
@@ -20978,7 +20973,7 @@ if(this._src){this._loadSrc(this._src);}}},{key:"_loadSrc",value:function _loadS
|
|
|
20978
20973
|
* @param {HTMLImageElement} [cfg.image=null] HTML Image object to load into this SpriteMarker. See the {@link SpriteMarker#image} property for more info.
|
|
20979
20974
|
* @param {Boolean} [cfg.flipY=false] Flips this SpriteMarker's texture image along its vertical axis when true.
|
|
20980
20975
|
* @param {String} [cfg.encoding="linear"] Texture encoding format. See the {@link Texture#encoding} property for more info.
|
|
20981
|
-
*/function SpriteMarker(owner){var _this97;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,SpriteMarker);_this97=
|
|
20976
|
+
*/function SpriteMarker(owner){var _this97;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,SpriteMarker);_this97=_super130.call(this,owner,{entity:cfg.entity,occludable:cfg.occludable,worldPos:cfg.worldPos});_this97._occluded=false;_this97._visible=true;_this97._src=null;_this97._image=null;_this97._pos=math.vec3();_this97._origin=math.vec3();_this97._rtcPos=math.vec3();_this97._dir=math.vec3();_this97._size=1.0;_this97._imageSize=math.vec2();_this97._texture=new Texture(_assertThisInitialized(_this97),{src:cfg.src});_this97._geometry=new ReadableGeometry(_assertThisInitialized(_this97),{primitive:"triangles",positions:[3,3,0,-3,3,0,-3,-3,0,3,-3,0],normals:[-1,0,0,-1,0,0,-1,0,0,-1,0,0],uv:[1,-1,0,-1,0,0,1,0],indices:[0,1,2,0,2,3]// Ensure these will be front-faces
|
|
20982
20977
|
});_this97._mesh=new Mesh(_assertThisInitialized(_this97),{geometry:_this97._geometry,material:new PhongMaterial(_assertThisInitialized(_this97),{ambient:[0.9,0.3,0.9],shininess:30,diffuseMap:_this97._texture,backfaces:true}),scale:[1,1,1],// Note: by design, scale does not work with billboard
|
|
20983
20978
|
position:cfg.worldPos,rotation:[90,0,0],billboard:"spherical",occluder:false// Don't occlude SpriteMarkers or Annotations
|
|
20984
20979
|
});_this97.visible=true;_this97.collidable=cfg.collidable;_this97.clippable=cfg.clippable;_this97.pickable=cfg.pickable;_this97.opacity=cfg.opacity;_this97.size=cfg.size;if(cfg.image){_this97.image=cfg.image;}else{_this97.src=cfg.src;}return _this97;}_createClass(SpriteMarker,[{key:"_setVisible",value:function _setVisible(visible){// Called by VisibilityTester and this._entity.on("destroyed"..)
|
|
@@ -21343,7 +21338,7 @@ this._occluded=!visible;this._mesh.visible=this._visible&&!this._occluded;_get(_
|
|
|
21343
21338
|
* <img style="border:1px solid;" src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/db/B%C3%A9zier_3_big.gif/240px-B%C3%A9zier_3_big.gif"/>
|
|
21344
21339
|
* <br>
|
|
21345
21340
|
* [Cubic Bezier Curve from WikiPedia](https://en.wikipedia.org/wiki/B%C3%A9zier_curve)
|
|
21346
|
-
*/var CubicBezierCurve=/*#__PURE__*/function(_Curve2){_inherits(CubicBezierCurve,_Curve2);var
|
|
21341
|
+
*/var CubicBezierCurve=/*#__PURE__*/function(_Curve2){_inherits(CubicBezierCurve,_Curve2);var _super131=_createSuper(CubicBezierCurve);/**
|
|
21347
21342
|
* @constructor
|
|
21348
21343
|
* @param {Component} [owner] Owner component. When destroyed, the owner will destroy this CubicBezierCurve as well.
|
|
21349
21344
|
* @param {*} [cfg] Configs
|
|
@@ -21353,7 +21348,7 @@ this._occluded=!visible;this._mesh.visible=this._visible&&!this._occluded;_get(_
|
|
|
21353
21348
|
* @param {Number[]} [cfg.v2=[0,0,0]] The middle control point.
|
|
21354
21349
|
* @param {Number[]} [cfg.v3=[0,0,0]] The ending point.
|
|
21355
21350
|
* @param {Number} [cfg.t=0] Current position on this CubicBezierCurve, in range between 0..1.
|
|
21356
|
-
*/function CubicBezierCurve(owner){var _this99;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,CubicBezierCurve);_this99=
|
|
21351
|
+
*/function CubicBezierCurve(owner){var _this99;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,CubicBezierCurve);_this99=_super131.call(this,owner,cfg);_this99.v0=cfg.v0;_this99.v1=cfg.v1;_this99.v2=cfg.v2;_this99.v3=cfg.v3;_this99.t=cfg.t;return _this99;}/**
|
|
21357
21352
|
* Sets the starting point on this CubicBezierCurve.
|
|
21358
21353
|
*
|
|
21359
21354
|
* Default value is ````[0.0, 0.0, 0.0]````
|
|
@@ -21435,14 +21430,14 @@ this._occluded=!visible;this._mesh.visible=this._visible&&!this._occluded;_get(_
|
|
|
21435
21430
|
* * A Path can be constructed from these {@link Curve} subtypes: {@link SplineCurve}, {@link CubicBezierCurve} and {@link QuadraticBezierCurve}.
|
|
21436
21431
|
* * You can sample a {@link Path#point} and a {@link Curve#tangent} vector on a Path for any given value of {@link Path#t} in the range ````[0..1]````.
|
|
21437
21432
|
* * When you set {@link Path#t} on a Path, its {@link Path#point} and {@link Curve#tangent} properties will update accordingly.
|
|
21438
|
-
*/var Path=/*#__PURE__*/function(_Curve3){_inherits(Path,_Curve3);var
|
|
21433
|
+
*/var Path=/*#__PURE__*/function(_Curve3){_inherits(Path,_Curve3);var _super132=_createSuper(Path);/**
|
|
21439
21434
|
* @constructor
|
|
21440
21435
|
* @param {Component} [owner] Owner component. When destroyed, the owner will destroy this SectionPlane as well.
|
|
21441
21436
|
* @param {*} [cfg] Path configuration
|
|
21442
21437
|
* @param {String} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
|
|
21443
21438
|
* @param {String []} [cfg.paths=[]] IDs or instances of {{#crossLink "path"}}{{/crossLink}} subtypes to add to this Path.
|
|
21444
21439
|
* @param {Number} [cfg.t=0] Current position on this Path, in range between 0..1.
|
|
21445
|
-
*/function Path(owner){var _this100;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Path);_this100=
|
|
21440
|
+
*/function Path(owner){var _this100;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Path);_this100=_super132.call(this,owner,cfg);_this100._cachedLengths=[];_this100._dirty=true;_this100._curves=[];// Array of child Curve components
|
|
21446
21441
|
_this100._t=0;_this100._dirtySubs=[];// Subscriptions to "dirty" events from child Curve components
|
|
21447
21442
|
_this100._destroyedSubs=[];// Subscriptions to "destroyed" events from child Curve components
|
|
21448
21443
|
_this100.curves=cfg.curves||[];// Add initial curves
|
|
@@ -21503,7 +21498,7 @@ var id=curve;curve=this.scene.components[id];if(!curve){this.error("Component no
|
|
|
21503
21498
|
* <img style="border:1px solid;" src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/B%C3%A9zier_2_big.gif/240px-B%C3%A9zier_2_big.gif"/>
|
|
21504
21499
|
* <br>
|
|
21505
21500
|
* *[Quadratic Bezier Curve from WikiPedia](https://en.wikipedia.org/wiki/B%C3%A9zier_curve)*
|
|
21506
|
-
*/var QuadraticBezierCurve=/*#__PURE__*/function(_Curve4){_inherits(QuadraticBezierCurve,_Curve4);var
|
|
21501
|
+
*/var QuadraticBezierCurve=/*#__PURE__*/function(_Curve4){_inherits(QuadraticBezierCurve,_Curve4);var _super133=_createSuper(QuadraticBezierCurve);/**
|
|
21507
21502
|
* @constructor
|
|
21508
21503
|
* @param {Component} owner Owner component. When destroyed, the owner will destroy this MetallicMaterial as well.
|
|
21509
21504
|
* @param {*} [cfg] Configuration
|
|
@@ -21512,7 +21507,7 @@ var id=curve;curve=this.scene.components[id];if(!curve){this.error("Component no
|
|
|
21512
21507
|
* @param {Number[]} [cfg.v1=[0,0,0]] The middle control point.
|
|
21513
21508
|
* @param {Number[]} [cfg.v2=[0,0,0]] The end point.
|
|
21514
21509
|
* @param {Number[]} [cfg.t=0] Current position on this QuadraticBezierCurve, in range between ````0..1````.
|
|
21515
|
-
*/function QuadraticBezierCurve(owner){var _this101;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,QuadraticBezierCurve);_this101=
|
|
21510
|
+
*/function QuadraticBezierCurve(owner){var _this101;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,QuadraticBezierCurve);_this101=_super133.call(this,owner,cfg);_this101.v0=cfg.v0;_this101.v1=cfg.v1;_this101.v2=cfg.v2;_this101.t=cfg.t;return _this101;}/**
|
|
21516
21511
|
* Sets the starting point on this QuadraticBezierCurve.
|
|
21517
21512
|
*
|
|
21518
21513
|
* Default value is ````[0.0, 0.0, 0.0]````.
|
|
@@ -21573,6 +21568,22 @@ var id=curve;curve=this.scene.components[id];if(!curve){this.error("Component no
|
|
|
21573
21568
|
* @param {Number} t Position to get point at.
|
|
21574
21569
|
* @returns {Number[]} The point.
|
|
21575
21570
|
*/},{key:"getPoint",value:function getPoint(t){var vector=math.vec3();vector[0]=math.b2(t,this._v0[0],this._v1[0],this._v2[0]);vector[1]=math.b2(t,this._v0[1],this._v1[1],this._v2[1]);vector[2]=math.b2(t,this._v0[2],this._v1[2],this._v2[2]);return vector;}},{key:"getJSON",value:function getJSON(){return{v0:this._v0,v1:this._v1,v2:this._v2,t:this._t};}}]);return QuadraticBezierCurve;}(Curve);/**
|
|
21571
|
+
* @desc A high-performance model representation for efficient rendering and low memory usage.
|
|
21572
|
+
*
|
|
21573
|
+
* * PerformanceModel was replaced with {@link SceneModel} in ````xeokit-sdk v2.4````.
|
|
21574
|
+
* * PerformanceModel currently extends {@link SceneModel}, in order to maintain backward-compatibility until we remove PerformanceModel.
|
|
21575
|
+
* * See {@link SceneModel} for API details.
|
|
21576
|
+
*
|
|
21577
|
+
* @deprecated
|
|
21578
|
+
* @implements {Drawable}
|
|
21579
|
+
* @implements {Entity}
|
|
21580
|
+
* @extends {SceneModel}
|
|
21581
|
+
*/var PerformanceModel=/*#__PURE__*/function(_SceneModel){_inherits(PerformanceModel,_SceneModel);var _super134=_createSuper(PerformanceModel);/**
|
|
21582
|
+
* See {@link VBOSceneModel} for details.
|
|
21583
|
+
*
|
|
21584
|
+
* @param owner
|
|
21585
|
+
* @param cfg
|
|
21586
|
+
*/function PerformanceModel(owner){var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,PerformanceModel);return _super134.call(this,owner,cfg);}return _createClass(PerformanceModel);}(SceneModel);/**
|
|
21576
21587
|
* @desc A Skybox.
|
|
21577
21588
|
*/var Skybox=/*#__PURE__*/function(_Component37){_inherits(Skybox,_Component37);var _super135=_createSuper(Skybox);/**
|
|
21578
21589
|
* @constructor
|
|
@@ -24922,9 +24933,9 @@ for(var _id5 in this._controls){if(this._controls.hasOwnProperty(_id5)){this._co
|
|
|
24922
24933
|
*/this.height=height;});var tempVec3a$2=math.vec3();var tempMat4=math.mat4();var EMPTY_IMAGE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==";/**
|
|
24923
24934
|
* @desc A {@link Viewer} plugin that provides methods for visualizing IfcBuildingStoreys.
|
|
24924
24935
|
*
|
|
24925
|
-
* <a href="https://xeokit.github.io/xeokit-sdk/examples/#
|
|
24936
|
+
* <a href="https://xeokit.github.io/xeokit-sdk/examples/navigation/#StoreyViewsPlugin_recipe3"><img src="http://xeokit.io/img/docs/StoreyViewsPlugin/minimap.gif"></a>
|
|
24926
24937
|
*
|
|
24927
|
-
* [[Run this example](https://xeokit.github.io/xeokit-sdk/examples/#
|
|
24938
|
+
* [[Run this example](https://xeokit.github.io/xeokit-sdk/examples/navigation/#StoreyViewsPlugin_recipe3)]
|
|
24928
24939
|
*
|
|
24929
24940
|
* ## Overview
|
|
24930
24941
|
*
|