@xeokit/xeokit-sdk 2.4.0-alpha-6 → 2.4.0-alpha-7

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.
@@ -1907,9 +1907,9 @@ this._attached={};this._attachments=null;this._subIdMap=null;this._subIdEvents=n
1907
1907
  * @type {{PICKABLE: number, CLIPPABLE: number, BACKFACES: number, VISIBLE: number, SELECTED: number, OUTLINED: number, CULLED: number, RECEIVE_SHADOW: number, COLLIDABLE: number, XRAYED: number, CAST_SHADOW: number, EDGES: number, HIGHLIGHTED: number}}
1908
1908
  */var ENTITY_FLAGS$1={VISIBLE:1,CULLED:1<<2,PICKABLE:1<<3,CLIPPABLE:1<<4,COLLIDABLE:1<<5,CAST_SHADOW:1<<6,RECEIVE_SHADOW:1<<7,XRAYED:1<<8,HIGHLIGHTED:1<<9,SELECTED:1<<10,EDGES:1<<11,BACKFACES:1<<12,TRANSPARENT:1<<13};var tempFloatRGB$1=new Float32Array([0,0,0]);var tempIntRGB$1=new Uint16Array([0,0,0]);/**
1909
1909
  * @private
1910
- */var VBOSceneModelNode$1=/*#__PURE__*/function(){/**
1910
+ */var VBOSceneModelNode=/*#__PURE__*/function(){/**
1911
1911
  * @private
1912
- */function VBOSceneModelNode$1(model,isObject,id,meshes,flags,aabb){_classCallCheck(this,VBOSceneModelNode$1);this._isObject=isObject;/**
1912
+ */function VBOSceneModelNode(model,isObject,id,meshes,flags,aabb){_classCallCheck(this,VBOSceneModelNode);this._isObject=isObject;/**
1913
1913
  * The {@link Scene} that contains this VBOSceneModelNode.
1914
1914
  *
1915
1915
  * @property scene
@@ -1942,7 +1942,7 @@ var _mesh=this.meshes[i];_mesh.parent=this;this._numTriangles+=_mesh.numTriangle
1942
1942
  /**
1943
1943
  * Returns true to indicate that VBOSceneModelNode is an {@link Entity}.
1944
1944
  * @type {Boolean}
1945
- */_createClass(VBOSceneModelNode$1,[{key:"isEntity",get:function get(){return true;}/**
1945
+ */_createClass(VBOSceneModelNode,[{key:"isEntity",get:function get(){return true;}/**
1946
1946
  * Always returns ````false```` because a VBOSceneModelNode can never represent a model.
1947
1947
  *
1948
1948
  * @type {Boolean}
@@ -2159,7 +2159,7 @@ return false;}/**
2159
2159
  * @type {Boolean}
2160
2160
  * @abstract
2161
2161
  */},{key:"saoEnabled",get:function get(){return this.model.saoEnabled;}},{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 _i32=0,len=this.meshes.length;_i32<len;_i32++){this.meshes[_i32]._finalize(this._flags);}}},{key:"_finalize2",value:function _finalize2(){for(var _i33=0,len=this.meshes.length;_i33<len;_i33++){this.meshes[_i33]._finalize2();}}},{key:"_destroy",value:function _destroy(){// Called by VBOSceneModel
2162
- var scene=this.model.scene;if(this._isObject){scene._deregisterObject(this);if(this.visible){scene._objectVisibilityUpdated(this,false);}if(this.xrayed){scene._objectXRayedUpdated(this);}if(this.selected){scene._objectSelectedUpdated(this);}if(this.highlighted){scene._objectHighlightedUpdated(this);}if(this._opacityUpdated){this.scene._objectColorizeUpdated(this,false);}if(this._opacityUpdated){this.scene._objectOpacityUpdated(this,false);}this.scene._objectOffsetUpdated(this,false);}for(var _i34=0,len=this.meshes.length;_i34<len;_i34++){this.meshes[_i34]._destroy();}scene._aabbDirty=true;}}]);return VBOSceneModelNode$1;}();var tempVec3a$1h=math.vec3();/**
2162
+ var scene=this.model.scene;if(this._isObject){scene._deregisterObject(this);if(this.visible){scene._objectVisibilityUpdated(this,false);}if(this.xrayed){scene._objectXRayedUpdated(this);}if(this.selected){scene._objectSelectedUpdated(this);}if(this.highlighted){scene._objectHighlightedUpdated(this);}if(this._opacityUpdated){this.scene._objectColorizeUpdated(this,false);}if(this._opacityUpdated){this.scene._objectOpacityUpdated(this,false);}this.scene._objectOffsetUpdated(this,false);}for(var _i34=0,len=this.meshes.length;_i34<len;_i34++){this.meshes[_i34]._destroy();}scene._aabbDirty=true;}}]);return VBOSceneModelNode;}();var tempVec3a$1h=math.vec3();/**
2163
2163
  * Given a view matrix and a relative-to-center (RTC) coordinate origin, returns a view matrix
2164
2164
  * to transform RTC coordinates to View-space.
2165
2165
  *
@@ -2338,7 +2338,7 @@ if(this._visible===visible);this._visible=visible;this.fire("visible",this._visi
2338
2338
  * can adjust that frequency via property {@link Scene#ticksPerOcclusionTest}.
2339
2339
  *
2340
2340
  * @type {Boolean}
2341
- */,set:function set(entity){var _this6=this;if(this._entity){if(this._entity===entity){return;}if(this._onEntityDestroyed!==null){this._entity.off(this._onEntityDestroyed);this._onEntityDestroyed=null;}if(this._onEntityModelDestroyed!==null){this._entity.model.off(this._onEntityModelDestroyed);this._onEntityModelDestroyed=null;}}this._entity=entity;if(this._entity){if(this._entity instanceof VBOSceneModelNode$1){this._onEntityModelDestroyed=this._entity.model.on("destroyed",function(){// VBOSceneModelNode does not fire events, and cannot exist beyond its VBOSceneModel
2341
+ */,set:function set(entity){var _this6=this;if(this._entity){if(this._entity===entity){return;}if(this._onEntityDestroyed!==null){this._entity.off(this._onEntityDestroyed);this._onEntityDestroyed=null;}if(this._onEntityModelDestroyed!==null){this._entity.model.off(this._onEntityModelDestroyed);this._onEntityModelDestroyed=null;}}this._entity=entity;if(this._entity){if(this._entity instanceof VBOSceneModelNode){this._onEntityModelDestroyed=this._entity.model.on("destroyed",function(){// VBOSceneModelNode does not fire events, and cannot exist beyond its VBOSceneModel
2342
2342
  _this6._entity=null;// Marker now may become visible, if it was synched to invisible Entity
2343
2343
  _this6._onEntityModelDestroyed=null;});}else{this._onEntityDestroyed=this._entity.on("destroyed",function(){_this6._entity=null;_this6._onEntityDestroyed=null;});}}this.fire("entity",this._entity,true/* forget */);}},{key:"occludable",get:/**
2344
2344
  * Gets whether occlusion testing is performed for this Marker.
@@ -2403,8 +2403,8 @@ _this6._onEntityModelDestroyed=null;});}else{this._onEntityDestroyed=this._entit
2403
2403
  * @final
2404
2404
  */},{key:"visible",get:function get(){return!!this._visible;}/**
2405
2405
  * Destroys this Marker.
2406
- */},{key:"destroy",value:function destroy(){this.fire("destroyed",true);this.scene.camera.off(this._onCameraViewMatrix);this.scene.camera.off(this._onCameraProjMatrix);if(this._entity){if(this._onEntityDestroyed!==null){this._entity.off(this._onEntityDestroyed);}if(this._onEntityModelDestroyed!==null){this._entity.model.off(this._onEntityModelDestroyed);}}this._renderer.removeMarker(this);_get(_getPrototypeOf(Marker.prototype),"destroy",this).call(this);}}]);return Marker;}(Component);/** @private */var Wire=/*#__PURE__*/function(){function Wire(parentElement){var _this7=this;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Wire);this._color=cfg.color||"black";this._highlightClass="viewer-ruler-wire-highlighted";this._wire=document.createElement('div');this._wire.className+=this._wire.className?' viewer-ruler-wire':'viewer-ruler-wire';this._wireClickable=document.createElement('div');this._wireClickable.className+=this._wireClickable.className?' viewer-ruler-wire-clickable':'viewer-ruler-wire-clickable';this._thickness=cfg.thickness||1.0;this._thicknessClickable=cfg.thicknessClickable||6.0;var wire=this._wire;var wireStyle=wire.style;wireStyle.border="solid "+this._thickness+"px "+this._color;wireStyle.position="absolute";wireStyle["z-index"]=cfg.zIndex===undefined?"2000001":cfg.zIndex;wireStyle.width=0+"px";wireStyle.height=0+"px";wireStyle.visibility="visible";wireStyle.top=0+"px";wireStyle.left=0+"px";wireStyle['-webkit-transform-origin']="0 0";wireStyle['-moz-transform-origin']="0 0";wireStyle['-ms-transform-origin']="0 0";wireStyle['-o-transform-origin']="0 0";wireStyle['transform-origin']="0 0";wireStyle['-webkit-transform']='rotate(0deg)';wireStyle['-moz-transform']='rotate(0deg)';wireStyle['-ms-transform']='rotate(0deg)';wireStyle['-o-transform']='rotate(0deg)';wireStyle['transform']='rotate(0deg)';wireStyle["opacity"]=1.0;if(cfg.onContextMenu);parentElement.appendChild(wire);var wireClickable=this._wireClickable;var wireClickableStyle=wireClickable.style;wireClickableStyle.border="solid "+this._thicknessClickable+"px "+this._color;wireClickableStyle.position="absolute";wireClickableStyle["z-index"]=cfg.zIndex===undefined?"2000002":cfg.zIndex+1;wireClickableStyle.width=0+"px";wireClickableStyle.height=0+"px";wireClickableStyle.visibility="visible";wireClickableStyle.top=0+"px";wireClickableStyle.left=0+"px";// wireClickableStyle["pointer-events"] = "none";
2407
- wireClickableStyle['-webkit-transform-origin']="0 0";wireClickableStyle['-moz-transform-origin']="0 0";wireClickableStyle['-ms-transform-origin']="0 0";wireClickableStyle['-o-transform-origin']="0 0";wireClickableStyle['transform-origin']="0 0";wireClickableStyle['-webkit-transform']='rotate(0deg)';wireClickableStyle['-moz-transform']='rotate(0deg)';wireClickableStyle['-ms-transform']='rotate(0deg)';wireClickableStyle['-o-transform']='rotate(0deg)';wireClickableStyle['transform']='rotate(0deg)';wireClickableStyle["opacity"]=0.0;wireClickableStyle["pointer-events"]="all";if(cfg.onContextMenu);parentElement.appendChild(wireClickable);if(cfg.onMouseOver){wireClickable.addEventListener('mouseover',function(event){cfg.onMouseOver(event,_this7);});}if(cfg.onMouseLeave){wireClickable.addEventListener('mouseleave',function(event){cfg.onMouseLeave(event,_this7);});}if(cfg.onContextMenu){wireClickable.addEventListener('contextmenu',function(event){cfg.onContextMenu(event,_this7);event.preventDefault();});}this._x1=0;this._y1=0;this._x2=0;this._y2=0;this._update();}_createClass(Wire,[{key:"_visible",get:function get(){return this._wire.style.visibility==="visible";}},{key:"_update",value:function _update(){var length=Math.abs(Math.sqrt((this._x1-this._x2)*(this._x1-this._x2)+(this._y1-this._y2)*(this._y1-this._y2)));var angle=Math.atan2(this._y2-this._y1,this._x2-this._x1)*180.0/Math.PI;var wireStyle=this._wire.style;wireStyle["width"]=Math.round(length)+'px';wireStyle["left"]=Math.round(this._x1)+'px';wireStyle["top"]=Math.round(this._y1)+'px';wireStyle['-webkit-transform']='rotate('+angle+'deg)';wireStyle['-moz-transform']='rotate('+angle+'deg)';wireStyle['-ms-transform']='rotate('+angle+'deg)';wireStyle['-o-transform']='rotate('+angle+'deg)';wireStyle['transform']='rotate('+angle+'deg)';var wireClickableStyle=this._wireClickable.style;wireClickableStyle["width"]=Math.round(length)+'px';wireClickableStyle["left"]=Math.round(this._x1)+'px';wireClickableStyle["top"]=Math.round(this._y1)+'px';wireClickableStyle['-webkit-transform']='rotate('+angle+'deg)';wireClickableStyle['-moz-transform']='rotate('+angle+'deg)';wireClickableStyle['-ms-transform']='rotate('+angle+'deg)';wireClickableStyle['-o-transform']='rotate('+angle+'deg)';wireClickableStyle['transform']='rotate('+angle+'deg)';}},{key:"setStartAndEnd",value:function setStartAndEnd(x1,y1,x2,y2){this._x1=x1;this._y1=y1;this._x2=x2;this._y2=y2;this._update();}},{key:"setColor",value:function setColor(color){this._color=color||"black";this._wire.style.border="solid "+this._thickness+"px "+this._color;}},{key:"setOpacity",value:function setOpacity(opacity){this._wire.style.opacity=opacity;}},{key:"setVisible",value:function setVisible(visible){visible=!!visible;if(this._visible===visible){return;}this._wire.style.visibility=visible?"visible":"hidden";}},{key:"setClickable",value:function setClickable(clickable){this._wireClickable.style["pointer-events"]=!!clickable?"all":"none";}},{key:"setHighlighted",value:function setHighlighted(highlighted){if(this._highlighted===highlighted){return;}this._highlighted=!!highlighted;if(this._highlighted){this._wire.classList.add(this._highlightClass);}else{this._wire.classList.remove(this._highlightClass);}}},{key:"destroy",value:function destroy(visible){this._wire.parentElement.removeChild(this._wire);this._wireClickable.parentElement.removeChild(this._wireClickable);}}]);return Wire;}();/** @private */var Dot=/*#__PURE__*/function(){function Dot(parentElement){var _this8=this;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Dot);this._highlightClass="viewer-ruler-dot-highlighted";this._x=0;this._y=0;this._visible=true;this._dot=document.createElement('div');this._dot.className+=this._dot.className?' viewer-ruler-dot':'viewer-ruler-dot';this._dotClickable=document.createElement('div');this._dotClickable.className+=this._dotClickable.className?' viewer-ruler-dot-clickable':'viewer-ruler-dot-clickable';var dot=this._dot;var dotStyle=dot.style;dotStyle["border-radius"]=25+"px";dotStyle.border="solid 2px white";dotStyle.background="lightgreen";dotStyle.position="absolute";dotStyle["z-index"]=cfg.zIndex===undefined?"40000005":cfg.zIndex;dotStyle.width=8+"px";dotStyle.height=8+"px";dotStyle.visibility=cfg.visible!==false?"visible":"hidden";dotStyle.top=0+"px";dotStyle.left=0+"px";dotStyle["box-shadow"]="0 2px 5px 0 #182A3D;";dotStyle["opacity"]=1.0;dotStyle["pointer-events"]="all";if(cfg.onContextMenu);parentElement.appendChild(dot);var dotClickable=this._dotClickable;var dotClickableStyle=dotClickable.style;dotClickableStyle["border-radius"]=35+"px";dotClickableStyle.border="solid 10px white";dotClickableStyle.position="absolute";dotClickableStyle["z-index"]=cfg.zIndex===undefined?"40000007":cfg.zIndex+1;dotClickableStyle.width=8+"px";dotClickableStyle.height=8+"px";dotClickableStyle.visibility="visible";dotClickableStyle.top=0+"px";dotClickableStyle.left=0+"px";dotClickableStyle["opacity"]=0.0;dotClickableStyle["pointer-events"]="none";if(cfg.onContextMenu);parentElement.appendChild(dotClickable);if(cfg.onMouseOver){dotClickable.addEventListener('mouseover',function(event){cfg.onMouseOver(event,_this8);});}if(cfg.onMouseLeave){dotClickable.addEventListener('mouseleave',function(event){cfg.onMouseLeave(event,_this8);});}if(cfg.onContextMenu){dotClickable.addEventListener('contextmenu',function(event){cfg.onContextMenu(event,_this8);event.preventDefault();});}this.setPos(cfg.x||0,cfg.y||0);this.setFillColor(cfg.fillColor);this.setBorderColor(cfg.borderColor);}_createClass(Dot,[{key:"setPos",value:function setPos(x,y){this._x=x;this._y=y;var dotStyle=this._dot.style;dotStyle["left"]=Math.round(x)-4+'px';dotStyle["top"]=Math.round(y)-4+'px';var dotClickableStyle=this._dotClickable.style;dotClickableStyle["left"]=Math.round(x)-9+'px';dotClickableStyle["top"]=Math.round(y)-9+'px';}},{key:"setFillColor",value:function setFillColor(color){this._dot.style.background=color||"lightgreen";}},{key:"setBorderColor",value:function setBorderColor(color){this._dot.style.border="solid 2px"+(color||"black");}},{key:"setOpacity",value:function setOpacity(opacity){this._dot.style.opacity=opacity;}},{key:"setVisible",value:function setVisible(visible){if(this._visible===visible){return;}this._visible=!!visible;this._dot.style.visibility=this._visible?"visible":"hidden";}},{key:"setClickable",value:function setClickable(clickable){this._dotClickable.style["pointer-events"]=!!clickable?"all":"none";this._dot.style["pointer-events"]=!!clickable?"all":"none";}},{key:"setHighlighted",value:function setHighlighted(highlighted){if(this._highlighted===highlighted){return;}this._highlighted=!!highlighted;if(this._highlighted){this._dot.classList.add(this._highlightClass);}else{this._dot.classList.remove(this._highlightClass);}}},{key:"destroy",value:function destroy(){this.setVisible(false);this._dot.parentElement.removeChild(this._dot);this._dotClickable.parentElement.removeChild(this._dotClickable);}}]);return Dot;}();/** @private */var Label=/*#__PURE__*/function(){function Label(parentElement){var _this9=this;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Label);this._highlightClass="viewer-ruler-label-highlighted";this._prefix=cfg.prefix||"";this._x=0;this._y=0;this._visible=true;this._culled=false;this._label=document.createElement('div');this._label.className+=this._label.className?' viewer-ruler-label':'viewer-ruler-label';var label=this._label;var style=label.style;style["border-radius"]=5+"px";style.color="white";style.padding="4px";style.border="solid 1px";style.background="lightgreen";style.position="absolute";style["z-index"]=cfg.zIndex===undefined?"5000005":cfg.zIndex;style.width="auto";style.height="auto";style.visibility="visible";style.top=0+"px";style.left=0+"px";style["pointer-events"]="all";style["opacity"]=1.0;if(cfg.onContextMenu);label.innerText="";parentElement.appendChild(label);this.setPos(cfg.x||0,cfg.y||0);this.setFillColor(cfg.fillColor);this.setBorderColor(cfg.fillColor);this.setText(cfg.text);if(cfg.onMouseOver){label.addEventListener('mouseover',function(event){cfg.onMouseOver(event,_this9);event.preventDefault();});}if(cfg.onMouseLeave){label.addEventListener('mouseleave',function(event){cfg.onMouseLeave(event,_this9);event.preventDefault();});}if(cfg.onContextMenu){label.addEventListener('contextmenu',function(event){cfg.onContextMenu(event,_this9);event.preventDefault();});}}_createClass(Label,[{key:"setPos",value:function setPos(x,y){this._x=x;this._y=y;var style=this._label.style;style["left"]=Math.round(x)-20+'px';style["top"]=Math.round(y)-12+'px';}},{key:"setPosOnWire",value:function setPosOnWire(x1,y1,x2,y2){var x=x1+(x2-x1)*0.5;var y=y1+(y2-y1)*0.5;var style=this._label.style;style["left"]=Math.round(x)-20+'px';style["top"]=Math.round(y)-12+'px';}},{key:"setPosBetweenWires",value:function setPosBetweenWires(x1,y1,x2,y2,x3,y3){var x=(x1+x2+x3)/3;var y=(y1+y2+y3)/3;var style=this._label.style;style["left"]=Math.round(x)-20+'px';style["top"]=Math.round(y)-12+'px';}},{key:"setText",value:function setText(text){this._label.innerHTML=this._prefix+(text||"");}},{key:"setFillColor",value:function setFillColor(color){this._fillColor=color||"lightgreen";this._label.style.background=this._fillColor;}},{key:"setBorderColor",value:function setBorderColor(color){this._borderColor=color||"black";this._label.style.border="solid 1px "+this._borderColor;}},{key:"setOpacity",value:function setOpacity(opacity){this._label.style.opacity=opacity;}},{key:"setVisible",value:function setVisible(visible){if(this._visible===visible){return;}this._visible=!!visible;this._label.style.visibility=this._visible&&!this._culled?"visible":"hidden";}},{key:"setCulled",value:function setCulled(culled){if(this._culled===culled){return;}this._culled=!!culled;this._label.style.visibility=this._visible&&!this._culled?"visible":"hidden";}},{key:"setHighlighted",value:function setHighlighted(highlighted){if(this._highlighted===highlighted){return;}this._highlighted=!!highlighted;if(this._highlighted){this._label.classList.add(this._highlightClass);}else{this._label.classList.remove(this._highlightClass);}}},{key:"setClickable",value:function setClickable(clickable){this._label.style["pointer-events"]=!!clickable?"all":"none";}},{key:"destroy",value:function destroy(){this._label.parentElement.removeChild(this._label);}}]);return Label;}();var originVec=math.vec3();var targetVec=math.vec3();/**
2406
+ */},{key:"destroy",value:function destroy(){this.fire("destroyed",true);this.scene.camera.off(this._onCameraViewMatrix);this.scene.camera.off(this._onCameraProjMatrix);if(this._entity){if(this._onEntityDestroyed!==null){this._entity.off(this._onEntityDestroyed);}if(this._onEntityModelDestroyed!==null){this._entity.model.off(this._onEntityModelDestroyed);}}this._renderer.removeMarker(this);_get(_getPrototypeOf(Marker.prototype),"destroy",this).call(this);}}]);return Marker;}(Component);/** @private */var Wire=/*#__PURE__*/function(){function Wire(parentElement){var _this7=this;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Wire);this._color=cfg.color||"black";this._highlightClass="viewer-ruler-wire-highlighted";this._wire=document.createElement('div');this._wire.className+=this._wire.className?' viewer-ruler-wire':'viewer-ruler-wire';this._wireClickable=document.createElement('div');this._wireClickable.className+=this._wireClickable.className?' viewer-ruler-wire-clickable':'viewer-ruler-wire-clickable';this._thickness=cfg.thickness||1.0;this._thicknessClickable=cfg.thicknessClickable||6.0;var wire=this._wire;var wireStyle=wire.style;wireStyle.border="solid "+this._thickness+"px "+this._color;wireStyle.position="absolute";wireStyle["z-index"]=cfg.zIndex===undefined?"2000001":cfg.zIndex;wireStyle.width=0+"px";wireStyle.height=0+"px";wireStyle.visibility="visible";wireStyle.top=0+"px";wireStyle.left=0+"px";wireStyle['-webkit-transform-origin']="0 0";wireStyle['-moz-transform-origin']="0 0";wireStyle['-ms-transform-origin']="0 0";wireStyle['-o-transform-origin']="0 0";wireStyle['transform-origin']="0 0";wireStyle['-webkit-transform']='rotate(0deg)';wireStyle['-moz-transform']='rotate(0deg)';wireStyle['-ms-transform']='rotate(0deg)';wireStyle['-o-transform']='rotate(0deg)';wireStyle['transform']='rotate(0deg)';wireStyle["opacity"]=1.0;wireStyle["pointer-events"]="none";if(cfg.onContextMenu);parentElement.appendChild(wire);var wireClickable=this._wireClickable;var wireClickableStyle=wireClickable.style;wireClickableStyle.border="solid "+this._thicknessClickable+"px "+this._color;wireClickableStyle.position="absolute";wireClickableStyle["z-index"]=cfg.zIndex===undefined?"2000002":cfg.zIndex+1;wireClickableStyle.width=0+"px";wireClickableStyle.height=0+"px";wireClickableStyle.visibility="visible";wireClickableStyle.top=0+"px";wireClickableStyle.left=0+"px";// wireClickableStyle["pointer-events"] = "none";
2407
+ wireClickableStyle['-webkit-transform-origin']="0 0";wireClickableStyle['-moz-transform-origin']="0 0";wireClickableStyle['-ms-transform-origin']="0 0";wireClickableStyle['-o-transform-origin']="0 0";wireClickableStyle['transform-origin']="0 0";wireClickableStyle['-webkit-transform']='rotate(0deg)';wireClickableStyle['-moz-transform']='rotate(0deg)';wireClickableStyle['-ms-transform']='rotate(0deg)';wireClickableStyle['-o-transform']='rotate(0deg)';wireClickableStyle['transform']='rotate(0deg)';wireClickableStyle["opacity"]=0.0;wireClickableStyle["pointer-events"]="all";if(cfg.onContextMenu);parentElement.appendChild(wireClickable);if(cfg.onMouseOver){wireClickable.addEventListener('mouseover',function(event){cfg.onMouseOver(event,_this7);});}if(cfg.onMouseLeave){wireClickable.addEventListener('mouseleave',function(event){cfg.onMouseLeave(event,_this7);});}if(cfg.onContextMenu){wireClickable.addEventListener('contextmenu',function(event){cfg.onContextMenu(event,_this7);event.preventDefault();});}this._x1=0;this._y1=0;this._x2=0;this._y2=0;this._update();}_createClass(Wire,[{key:"_visible",get:function get(){return this._wire.style.visibility==="visible";}},{key:"_update",value:function _update(){var length=Math.abs(Math.sqrt((this._x1-this._x2)*(this._x1-this._x2)+(this._y1-this._y2)*(this._y1-this._y2)));var angle=Math.atan2(this._y2-this._y1,this._x2-this._x1)*180.0/Math.PI;var wireStyle=this._wire.style;wireStyle["width"]=Math.round(length)+'px';wireStyle["left"]=Math.round(this._x1)+'px';wireStyle["top"]=Math.round(this._y1)+'px';wireStyle['-webkit-transform']='rotate('+angle+'deg)';wireStyle['-moz-transform']='rotate('+angle+'deg)';wireStyle['-ms-transform']='rotate('+angle+'deg)';wireStyle['-o-transform']='rotate('+angle+'deg)';wireStyle['transform']='rotate('+angle+'deg)';var wireClickableStyle=this._wireClickable.style;wireClickableStyle["width"]=Math.round(length)+'px';wireClickableStyle["left"]=Math.round(this._x1)+'px';wireClickableStyle["top"]=Math.round(this._y1)+'px';wireClickableStyle['-webkit-transform']='rotate('+angle+'deg)';wireClickableStyle['-moz-transform']='rotate('+angle+'deg)';wireClickableStyle['-ms-transform']='rotate('+angle+'deg)';wireClickableStyle['-o-transform']='rotate('+angle+'deg)';wireClickableStyle['transform']='rotate('+angle+'deg)';}},{key:"setStartAndEnd",value:function setStartAndEnd(x1,y1,x2,y2){this._x1=x1;this._y1=y1;this._x2=x2;this._y2=y2;this._update();}},{key:"setColor",value:function setColor(color){this._color=color||"black";this._wire.style.border="solid "+this._thickness+"px "+this._color;}},{key:"setOpacity",value:function setOpacity(opacity){this._wire.style.opacity=opacity;}},{key:"setVisible",value:function setVisible(visible){visible=!!visible;if(this._visible===visible){return;}this._wire.style.visibility=visible?"visible":"hidden";}},{key:"setClickable",value:function setClickable(clickable){this._wireClickable.style["pointer-events"]=!!clickable?"all":"none";}},{key:"setHighlighted",value:function setHighlighted(highlighted){if(this._highlighted===highlighted){return;}this._highlighted=!!highlighted;if(this._highlighted){this._wire.classList.add(this._highlightClass);}else{this._wire.classList.remove(this._highlightClass);}}},{key:"destroy",value:function destroy(visible){this._wire.parentElement.removeChild(this._wire);this._wireClickable.parentElement.removeChild(this._wireClickable);}}]);return Wire;}();/** @private */var Dot=/*#__PURE__*/function(){function Dot(parentElement){var _this8=this;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Dot);this._highlightClass="viewer-ruler-dot-highlighted";this._x=0;this._y=0;this._visible=true;this._dot=document.createElement('div');this._dot.className+=this._dot.className?' viewer-ruler-dot':'viewer-ruler-dot';this._dotClickable=document.createElement('div');this._dotClickable.className+=this._dotClickable.className?' viewer-ruler-dot-clickable':'viewer-ruler-dot-clickable';var dot=this._dot;var dotStyle=dot.style;dotStyle["border-radius"]=25+"px";dotStyle.border="solid 2px white";dotStyle.background="lightgreen";dotStyle.position="absolute";dotStyle["z-index"]=cfg.zIndex===undefined?"40000005":cfg.zIndex;dotStyle.width=8+"px";dotStyle.height=8+"px";dotStyle.visibility=cfg.visible!==false?"visible":"hidden";dotStyle.top=0+"px";dotStyle.left=0+"px";dotStyle["box-shadow"]="0 2px 5px 0 #182A3D;";dotStyle["opacity"]=1.0;dotStyle["pointer-events"]="none";if(cfg.onContextMenu);parentElement.appendChild(dot);var dotClickable=this._dotClickable;var dotClickableStyle=dotClickable.style;dotClickableStyle["border-radius"]=35+"px";dotClickableStyle.border="solid 10px white";dotClickableStyle.position="absolute";dotClickableStyle["z-index"]=cfg.zIndex===undefined?"40000007":cfg.zIndex+1;dotClickableStyle.width=8+"px";dotClickableStyle.height=8+"px";dotClickableStyle.visibility="visible";dotClickableStyle.top=0+"px";dotClickableStyle.left=0+"px";dotClickableStyle["opacity"]=0.0;dotClickableStyle["pointer-events"]="none";if(cfg.onContextMenu);parentElement.appendChild(dotClickable);if(cfg.onMouseOver){dotClickable.addEventListener('mouseover',function(event){cfg.onMouseOver(event,_this8);});}if(cfg.onMouseLeave){dotClickable.addEventListener('mouseleave',function(event){cfg.onMouseLeave(event,_this8);});}if(cfg.onContextMenu){dotClickable.addEventListener('contextmenu',function(event){cfg.onContextMenu(event,_this8);event.preventDefault();});}this.setPos(cfg.x||0,cfg.y||0);this.setFillColor(cfg.fillColor);this.setBorderColor(cfg.borderColor);}_createClass(Dot,[{key:"setPos",value:function setPos(x,y){this._x=x;this._y=y;var dotStyle=this._dot.style;dotStyle["left"]=Math.round(x)-4+'px';dotStyle["top"]=Math.round(y)-4+'px';var dotClickableStyle=this._dotClickable.style;dotClickableStyle["left"]=Math.round(x)-9+'px';dotClickableStyle["top"]=Math.round(y)-9+'px';}},{key:"setFillColor",value:function setFillColor(color){this._dot.style.background=color||"lightgreen";}},{key:"setBorderColor",value:function setBorderColor(color){this._dot.style.border="solid 2px"+(color||"black");}},{key:"setOpacity",value:function setOpacity(opacity){this._dot.style.opacity=opacity;}},{key:"setVisible",value:function setVisible(visible){if(this._visible===visible){return;}this._visible=!!visible;this._dot.style.visibility=this._visible?"visible":"hidden";}},{key:"setClickable",value:function setClickable(clickable){this._dotClickable.style["pointer-events"]=!!clickable?"all":"none";}},{key:"setHighlighted",value:function setHighlighted(highlighted){if(this._highlighted===highlighted){return;}this._highlighted=!!highlighted;if(this._highlighted){this._dot.classList.add(this._highlightClass);}else{this._dot.classList.remove(this._highlightClass);}}},{key:"destroy",value:function destroy(){this.setVisible(false);this._dot.parentElement.removeChild(this._dot);this._dotClickable.parentElement.removeChild(this._dotClickable);}}]);return Dot;}();/** @private */var Label=/*#__PURE__*/function(){function Label(parentElement){var _this9=this;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Label);this._highlightClass="viewer-ruler-label-highlighted";this._prefix=cfg.prefix||"";this._x=0;this._y=0;this._visible=true;this._culled=false;this._label=document.createElement('div');this._label.className+=this._label.className?' viewer-ruler-label':'viewer-ruler-label';var label=this._label;var style=label.style;style["border-radius"]=5+"px";style.color="white";style.padding="4px";style.border="solid 1px";style.background="lightgreen";style.position="absolute";style["z-index"]=cfg.zIndex===undefined?"5000005":cfg.zIndex;style.width="auto";style.height="auto";style.visibility="visible";style.top=0+"px";style.left=0+"px";style["pointer-events"]="all";style["opacity"]=1.0;if(cfg.onContextMenu);label.innerText="";parentElement.appendChild(label);this.setPos(cfg.x||0,cfg.y||0);this.setFillColor(cfg.fillColor);this.setBorderColor(cfg.fillColor);this.setText(cfg.text);if(cfg.onMouseOver){label.addEventListener('mouseover',function(event){cfg.onMouseOver(event,_this9);event.preventDefault();});}if(cfg.onMouseLeave){label.addEventListener('mouseleave',function(event){cfg.onMouseLeave(event,_this9);event.preventDefault();});}if(cfg.onContextMenu){label.addEventListener('contextmenu',function(event){cfg.onContextMenu(event,_this9);event.preventDefault();});}}_createClass(Label,[{key:"setPos",value:function setPos(x,y){this._x=x;this._y=y;var style=this._label.style;style["left"]=Math.round(x)-20+'px';style["top"]=Math.round(y)-12+'px';}},{key:"setPosOnWire",value:function setPosOnWire(x1,y1,x2,y2){var x=x1+(x2-x1)*0.5;var y=y1+(y2-y1)*0.5;var style=this._label.style;style["left"]=Math.round(x)-20+'px';style["top"]=Math.round(y)-12+'px';}},{key:"setPosBetweenWires",value:function setPosBetweenWires(x1,y1,x2,y2,x3,y3){var x=(x1+x2+x3)/3;var y=(y1+y2+y3)/3;var style=this._label.style;style["left"]=Math.round(x)-20+'px';style["top"]=Math.round(y)-12+'px';}},{key:"setText",value:function setText(text){this._label.innerHTML=this._prefix+(text||"");}},{key:"setFillColor",value:function setFillColor(color){this._fillColor=color||"lightgreen";this._label.style.background=this._fillColor;}},{key:"setBorderColor",value:function setBorderColor(color){this._borderColor=color||"black";this._label.style.border="solid 1px "+this._borderColor;}},{key:"setOpacity",value:function setOpacity(opacity){this._label.style.opacity=opacity;}},{key:"setVisible",value:function setVisible(visible){if(this._visible===visible){return;}this._visible=!!visible;this._label.style.visibility=this._visible&&!this._culled?"visible":"hidden";}},{key:"setCulled",value:function setCulled(culled){if(this._culled===culled){return;}this._culled=!!culled;this._label.style.visibility=this._visible&&!this._culled?"visible":"hidden";}},{key:"setHighlighted",value:function setHighlighted(highlighted){if(this._highlighted===highlighted){return;}this._highlighted=!!highlighted;if(this._highlighted){this._label.classList.add(this._highlightClass);}else{this._label.classList.remove(this._highlightClass);}}},{key:"setClickable",value:function setClickable(clickable){this._label.style["pointer-events"]=!!clickable?"all":"none";}},{key:"destroy",value:function destroy(){this._label.parentElement.removeChild(this._label);}}]);return Label;}();var originVec=math.vec3();var targetVec=math.vec3();/**
2408
2408
  * @desc Measures the angle indicated by three 3D points.
2409
2409
  *
2410
2410
  * See {@link AngleMeasurementsPlugin} for more info.
@@ -4126,7 +4126,7 @@ math.decompressPosition(compa,positionsDecodeMatrix,a);math.decompressPosition(c
4126
4126
  if(edge.face2!==undefined){normal1=faces[edge.face1].normal;normal2=faces[edge.face2].normal;dot=math.dotVec3(normal1,normal2);if(dot>thresholdDot){continue;}}ia=indicesReverseLookup[edge.index1];ib=indicesReverseLookup[edge.index2];if(!largeIndex&&ia>65535||ib>65535){largeIndex=true;}edgeIndices.push(ia);edgeIndices.push(ib);}return largeIndex?new Uint32Array(edgeIndices):new Uint16Array(edgeIndices);};}();/**
4127
4127
  * @private
4128
4128
  * @implements Pickable
4129
- */var VBOSceneModelMesh$1=/*#__PURE__*/function(){function VBOSceneModelMesh$1(model,id,color,opacity){var layer=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var portionId=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;_classCallCheck(this,VBOSceneModelMesh$1);/**
4129
+ */var DataTextureSceneModelMesh=/*#__PURE__*/function(){function DataTextureSceneModelMesh(model,id,color,opacity){var layer=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var portionId=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;_classCallCheck(this,DataTextureSceneModelMesh);/**
4130
4130
  * The VBOSceneModel that contains this PerformanceModelMesh.
4131
4131
  *
4132
4132
  * A PerformanceModelMesh always belongs to exactly one VBOSceneModel.
@@ -4135,17 +4135,17 @@ if(edge.face2!==undefined){normal1=faces[edge.face1].normal;normal2=faces[edge.f
4135
4135
  * @type {VBOSceneModel}
4136
4136
  * @final
4137
4137
  */this.model=model;/**
4138
- * The VBOSceneModelNode that contains this PerformanceModelMesh.
4138
+ * The DataTextureSceneModelNode that contains this PerformanceModelMesh.
4139
4139
  *
4140
- * A PerformanceModelMesh always belongs to exactly one VBOSceneModelNode.
4140
+ * A PerformanceModelMesh always belongs to exactly one DataTextureSceneModelNode.
4141
4141
  *
4142
4142
  * @property object
4143
4143
  * @type {VBOSceneModelNode}
4144
4144
  * @final
4145
4145
  */this.object=null;/**
4146
- * The VBOSceneModelNode that contains this PerformanceModelMesh.
4146
+ * The DataTextureSceneModelNode that contains this PerformanceModelMesh.
4147
4147
  *
4148
- * A PerformanceModelMesh always belongs to exactly one VBOSceneModelNode.
4148
+ * A PerformanceModelMesh always belongs to exactly one DataTextureSceneModelNode.
4149
4149
  *
4150
4150
  * @property object
4151
4151
  * @type {VBOSceneModelNode}
@@ -4172,7 +4172,7 @@ if(edge.face2!==undefined){normal1=faces[edge.face1].normal;normal2=faces[edge.f
4172
4172
  */this.aabb=math.AABB3();this._layer=layer;this._portionId=portionId;this._color=[color[0],color[1],color[2],opacity];// [0..255]
4173
4173
  this._colorize=[color[0],color[1],color[2],opacity];// [0..255]
4174
4174
  this._colorizing=false;this._transparent=opacity<255;this.numTriangles=0;/**
4175
- * 3D origin of the VBOSceneModelMesh's vertex positions, if they are in relative-to-center (RTC) coordinates.
4175
+ * 3D origin of the DataTextureSceneModelMesh's vertex positions, if they are in relative-to-center (RTC) coordinates.
4176
4176
  *
4177
4177
  * When this is defined, then the positions are RTC, which means that they are relative to this position.
4178
4178
  *
@@ -4180,7 +4180,7 @@ this._colorizing=false;this._transparent=opacity<255;this.numTriangles=0;/**
4180
4180
  * @type {Float64Array}
4181
4181
  */this.origin=null;}/**
4182
4182
  * @private
4183
- */_createClass(VBOSceneModelMesh$1,[{key:"_finalize",value:function _finalize(entityFlags){this._layer.initFlags(this._portionId,entityFlags,this._transparent);}/**
4183
+ */_createClass(DataTextureSceneModelMesh,[{key:"_finalize",value:function _finalize(entityFlags){this._layer.initFlags(this._portionId,entityFlags,this._transparent);}/**
4184
4184
  * @private
4185
4185
  */},{key:"_finalize2",value:function _finalize2(){if(this._layer.flushInitFlags){this._layer.flushInitFlags();}}/**
4186
4186
  * @private
@@ -4211,32 +4211,32 @@ this._colorizing=false;this._transparent=opacity<255;this.numTriangles=0;/**
4211
4211
  * @returns {VBOSceneModelNode}
4212
4212
  */},{key:"delegatePickedEntity",value:function delegatePickedEntity(){return this.parent;}/**
4213
4213
  * @private
4214
- */},{key:"_destroy",value:function _destroy(){this.model.scene._renderer.putPickID(this.pickId);}}]);return VBOSceneModelMesh$1;}();/**
4214
+ */},{key:"_destroy",value:function _destroy(){this.model.scene._renderer.putPickID(this.pickId);}}]);return DataTextureSceneModelMesh;}();/**
4215
4215
  * @private
4216
4216
  * @type {{PICKABLE: number, CLIPPABLE: number, BACKFACES: number, VISIBLE: number, SELECTED: number, OUTLINED: number, CULLED: number, RECEIVE_SHADOW: number, COLLIDABLE: number, XRAYED: number, CAST_SHADOW: number, EDGES: number, HIGHLIGHTED: number}}
4217
4217
  */var ENTITY_FLAGS={VISIBLE:1,CULLED:1<<2,PICKABLE:1<<3,CLIPPABLE:1<<4,COLLIDABLE:1<<5,CAST_SHADOW:1<<6,RECEIVE_SHADOW:1<<7,XRAYED:1<<8,HIGHLIGHTED:1<<9,SELECTED:1<<10,EDGES:1<<11,BACKFACES:1<<12,TRANSPARENT:1<<13};var tempFloatRGB=new Float32Array([0,0,0]);var tempIntRGB=new Uint16Array([0,0,0]);/**
4218
4218
  * @private
4219
- */var VBOSceneModelNode=/*#__PURE__*/function(){/**
4219
+ */var DataTextureSceneModelNode=/*#__PURE__*/function(){/**
4220
4220
  * @private
4221
- */function VBOSceneModelNode(model,isObject,id,meshes,flags,aabb){_classCallCheck(this,VBOSceneModelNode);this._isObject=isObject;/**
4222
- * The {@link Scene} that contains this VBOSceneModelNode.
4221
+ */function DataTextureSceneModelNode(model,isObject,id,meshes,flags,aabb){_classCallCheck(this,DataTextureSceneModelNode);this._isObject=isObject;/**
4222
+ * The {@link Scene} that contains this DataTextureSceneModelNode.
4223
4223
  *
4224
4224
  * @property scene
4225
4225
  * @type {Scene}
4226
4226
  * @final
4227
4227
  */this.scene=model.scene;/**
4228
- * The VBOSceneModel that contains this VBOSceneModelNode.
4228
+ * The VBOSceneModel that contains this DataTextureSceneModelNode.
4229
4229
  * @property model
4230
4230
  * @type {VBOSceneModel}
4231
4231
  * @final
4232
4232
  */this.model=model;/**
4233
- * The PerformanceModelMesh instances contained by this VBOSceneModelNode
4233
+ * The PerformanceModelMesh instances contained by this DataTextureSceneModelNode
4234
4234
  * @property meshes
4235
4235
  * @type {{Array of PerformanceModelMesh}}
4236
4236
  * @final
4237
4237
  */this.meshes=meshes;this._numTriangles=0;for(var i=0,len=this.meshes.length;i<len;i++){// TODO: tidier way? Refactor?
4238
4238
  var _mesh2=this.meshes[i];_mesh2.parent=this;this._numTriangles+=_mesh2.numTriangles;}/**
4239
- * ID of this VBOSceneModelNode, unique within the {@link Scene}.
4239
+ * ID of this DataTextureSceneModelNode, unique within the {@link Scene}.
4240
4240
  * @property id
4241
4241
  * @type {String|Number}
4242
4242
  * @final
@@ -4249,154 +4249,154 @@ var _mesh2=this.meshes[i];_mesh2.parent=this;this._numTriangles+=_mesh2.numTrian
4249
4249
  // Entity members
4250
4250
  //------------------------------------------------------------------------------------------------------------------
4251
4251
  /**
4252
- * Returns true to indicate that VBOSceneModelNode is an {@link Entity}.
4252
+ * Returns true to indicate that DataTextureSceneModelNode is an {@link Entity}.
4253
4253
  * @type {Boolean}
4254
- */_createClass(VBOSceneModelNode,[{key:"isEntity",get:function get(){return true;}/**
4255
- * Always returns ````false```` because a VBOSceneModelNode can never represent a model.
4254
+ */_createClass(DataTextureSceneModelNode,[{key:"isEntity",get:function get(){return true;}/**
4255
+ * Always returns ````false```` because a DataTextureSceneModelNode can never represent a model.
4256
4256
  *
4257
4257
  * @type {Boolean}
4258
4258
  */},{key:"isModel",get:function get(){return false;}/**
4259
- * Returns ````true```` if this VBOSceneModelNode represents an object.
4259
+ * Returns ````true```` if this DataTextureSceneModelNode represents an object.
4260
4260
  *
4261
- * When ````true```` the VBOSceneModelNode will be registered by {@link VBOSceneModelNode#id} in
4261
+ * When ````true```` the DataTextureSceneModelNode will be registered by {@link DataTextureSceneModelNode#id} in
4262
4262
  * {@link Scene#objects} and may also have a {@link MetaObject} with matching {@link MetaObject#id}.
4263
4263
  *
4264
4264
  * @type {Boolean}
4265
4265
  */},{key:"isObject",get:function get(){return this._isObject;}/**
4266
- * World-space 3D axis-aligned bounding box (AABB) of this VBOSceneModelNode.
4266
+ * World-space 3D axis-aligned bounding box (AABB) of this DataTextureSceneModelNode.
4267
4267
  *
4268
4268
  * Represented by a six-element Float64Array containing the min/max extents of the
4269
4269
  * axis-aligned volume, ie. ````[xmin, ymin,zmin,xmax,ymax, zmax]````.
4270
4270
  *
4271
4271
  * @type {Float64Array}
4272
4272
  */},{key:"aabb",get:function get(){return this._offsetAABB;}/**
4273
- * The approximate number of triangles in this VBOSceneModelNode.
4273
+ * The approximate number of triangles in this DataTextureSceneModelNode.
4274
4274
  *
4275
4275
  * @type {Number}
4276
4276
  */},{key:"numTriangles",get:function get(){return this._numTriangles;}/**
4277
- * Gets if this VBOSceneModelNode is visible.
4277
+ * Gets if this DataTextureSceneModelNode is visible.
4278
4278
  *
4279
- * Only rendered when {@link VBOSceneModelNode#visible} is ````true```` and {@link VBOSceneModelNode#culled} is ````false````.
4279
+ * Only rendered when {@link DataTextureSceneModelNode#visible} is ````true```` and {@link DataTextureSceneModelNode#culled} is ````false````.
4280
4280
  *
4281
- * When both {@link VBOSceneModelNode#isObject} and {@link VBOSceneModelNode#visible} are ````true```` the VBOSceneModelNode will be
4282
- * registered by {@link VBOSceneModelNode#id} in {@link Scene#visibleObjects}.
4281
+ * When both {@link DataTextureSceneModelNode#isObject} and {@link DataTextureSceneModelNode#visible} are ````true```` the DataTextureSceneModelNode will be
4282
+ * registered by {@link DataTextureSceneModelNode#id} in {@link Scene#visibleObjects}.
4283
4283
  *
4284
4284
  * @type {Boolean}
4285
4285
  */},{key:"visible",get:function get(){return this._getFlag(ENTITY_FLAGS.VISIBLE);}/**
4286
- * Sets if this VBOSceneModelNode is visible.
4286
+ * Sets if this DataTextureSceneModelNode is visible.
4287
4287
  *
4288
- * Only rendered when {@link VBOSceneModelNode#visible} is ````true```` and {@link VBOSceneModelNode#culled} is ````false````.
4288
+ * Only rendered when {@link DataTextureSceneModelNode#visible} is ````true```` and {@link DataTextureSceneModelNode#culled} is ````false````.
4289
4289
  *
4290
- * When both {@link VBOSceneModelNode#isObject} and {@link VBOSceneModelNode#visible} are ````true```` the VBOSceneModelNode will be
4291
- * registered by {@link VBOSceneModelNode#id} in {@link Scene#visibleObjects}.
4290
+ * When both {@link DataTextureSceneModelNode#isObject} and {@link DataTextureSceneModelNode#visible} are ````true```` the DataTextureSceneModelNode will be
4291
+ * registered by {@link DataTextureSceneModelNode#id} in {@link Scene#visibleObjects}.
4292
4292
  *
4293
4293
  * @type {Boolean}
4294
4294
  */,set:function set(visible){if(!!(this._flags&ENTITY_FLAGS.VISIBLE)===visible){return;// Redundant update
4295
4295
  }if(visible){this._flags=this._flags|ENTITY_FLAGS.VISIBLE;}else{this._flags=this._flags&~ENTITY_FLAGS.VISIBLE;}for(var _i54=0,len=this.meshes.length;_i54<len;_i54++){this.meshes[_i54]._setVisible(this._flags);}if(this._isObject){this.model.scene._objectVisibilityUpdated(this);}this.model.glRedraw();}/**
4296
- * Gets if this VBOSceneModelNode is highlighted.
4296
+ * Gets if this DataTextureSceneModelNode is highlighted.
4297
4297
  *
4298
- * When both {@link VBOSceneModelNode#isObject} and {@link VBOSceneModelNode#highlighted} are ````true```` the VBOSceneModelNode will be
4299
- * registered by {@link VBOSceneModelNode#id} in {@link Scene#highlightedObjects}.
4298
+ * When both {@link DataTextureSceneModelNode#isObject} and {@link DataTextureSceneModelNode#highlighted} are ````true```` the DataTextureSceneModelNode will be
4299
+ * registered by {@link DataTextureSceneModelNode#id} in {@link Scene#highlightedObjects}.
4300
4300
  *
4301
4301
  * @type {Boolean}
4302
4302
  */},{key:"highlighted",get:function get(){return this._getFlag(ENTITY_FLAGS.HIGHLIGHTED);}/**
4303
- * Sets if this VBOSceneModelNode is highlighted.
4303
+ * Sets if this DataTextureSceneModelNode is highlighted.
4304
4304
  *
4305
- * When both {@link VBOSceneModelNode#isObject} and {@link VBOSceneModelNode#highlighted} are ````true```` the VBOSceneModelNode will be
4306
- * registered by {@link VBOSceneModelNode#id} in {@link Scene#highlightedObjects}.
4305
+ * When both {@link DataTextureSceneModelNode#isObject} and {@link DataTextureSceneModelNode#highlighted} are ````true```` the DataTextureSceneModelNode will be
4306
+ * registered by {@link DataTextureSceneModelNode#id} in {@link Scene#highlightedObjects}.
4307
4307
  *
4308
4308
  * @type {Boolean}
4309
4309
  */,set:function set(highlighted){if(!!(this._flags&ENTITY_FLAGS.HIGHLIGHTED)===highlighted){return;// Redundant update
4310
4310
  }if(highlighted){this._flags=this._flags|ENTITY_FLAGS.HIGHLIGHTED;}else{this._flags=this._flags&~ENTITY_FLAGS.HIGHLIGHTED;}for(var i=0,len=this.meshes.length;i<len;i++){this.meshes[i]._setHighlighted(this._flags);}if(this._isObject){this.model.scene._objectHighlightedUpdated(this);}this.model.glRedraw();}/**
4311
- * Gets if this VBOSceneModelNode is xrayed.
4311
+ * Gets if this DataTextureSceneModelNode is xrayed.
4312
4312
  *
4313
- * When both {@link VBOSceneModelNode#isObject} and {@link VBOSceneModelNode#xrayed} are ````true```` the VBOSceneModelNode will be
4314
- * registered by {@link VBOSceneModelNode#id} in {@link Scene#xrayedObjects}.
4313
+ * When both {@link DataTextureSceneModelNode#isObject} and {@link DataTextureSceneModelNode#xrayed} are ````true```` the DataTextureSceneModelNode will be
4314
+ * registered by {@link DataTextureSceneModelNode#id} in {@link Scene#xrayedObjects}.
4315
4315
  *
4316
4316
  * @type {Boolean}
4317
4317
  */},{key:"xrayed",get:function get(){return this._getFlag(ENTITY_FLAGS.XRAYED);}/**
4318
- * Sets if this VBOSceneModelNode is xrayed.
4318
+ * Sets if this DataTextureSceneModelNode is xrayed.
4319
4319
  *
4320
- * When both {@link VBOSceneModelNode#isObject} and {@link VBOSceneModelNode#xrayed} are ````true```` the VBOSceneModelNode will be
4321
- * registered by {@link VBOSceneModelNode#id} in {@link Scene#xrayedObjects}.
4320
+ * When both {@link DataTextureSceneModelNode#isObject} and {@link DataTextureSceneModelNode#xrayed} are ````true```` the DataTextureSceneModelNode will be
4321
+ * registered by {@link DataTextureSceneModelNode#id} in {@link Scene#xrayedObjects}.
4322
4322
  *
4323
4323
  * @type {Boolean}
4324
4324
  */,set:function set(xrayed){if(!!(this._flags&ENTITY_FLAGS.XRAYED)===xrayed){return;// Redundant update
4325
4325
  }if(xrayed){this._flags=this._flags|ENTITY_FLAGS.XRAYED;}else{this._flags=this._flags&~ENTITY_FLAGS.XRAYED;}for(var _i55=0,len=this.meshes.length;_i55<len;_i55++){this.meshes[_i55]._setXRayed(this._flags);}if(this._isObject){this.model.scene._objectXRayedUpdated(this);}this.model.glRedraw();}/**
4326
- * Sets if this VBOSceneModelNode is selected.
4326
+ * Sets if this DataTextureSceneModelNode is selected.
4327
4327
  *
4328
- * When both {@link VBOSceneModelNode#isObject} and {@link VBOSceneModelNode#selected} are ````true```` the VBOSceneModelNode will be
4329
- * registered by {@link VBOSceneModelNode#id} in {@link Scene#selectedObjects}.
4328
+ * When both {@link DataTextureSceneModelNode#isObject} and {@link DataTextureSceneModelNode#selected} are ````true```` the DataTextureSceneModelNode will be
4329
+ * registered by {@link DataTextureSceneModelNode#id} in {@link Scene#selectedObjects}.
4330
4330
  *
4331
4331
  * @type {Boolean}
4332
4332
  */},{key:"selected",get:function get(){return this._getFlag(ENTITY_FLAGS.SELECTED);}/**
4333
- * Gets if this VBOSceneModelNode is selected.
4333
+ * Gets if this DataTextureSceneModelNode is selected.
4334
4334
  *
4335
- * When both {@link VBOSceneModelNode#isObject} and {@link VBOSceneModelNode#selected} are ````true```` the VBOSceneModelNode will be
4336
- * registered by {@link VBOSceneModelNode#id} in {@link Scene#selectedObjects}.
4335
+ * When both {@link DataTextureSceneModelNode#isObject} and {@link DataTextureSceneModelNode#selected} are ````true```` the DataTextureSceneModelNode will be
4336
+ * registered by {@link DataTextureSceneModelNode#id} in {@link Scene#selectedObjects}.
4337
4337
  *
4338
4338
  * @type {Boolean}
4339
4339
  */,set:function set(selected){if(!!(this._flags&ENTITY_FLAGS.SELECTED)===selected){return;// Redundant update
4340
4340
  }if(selected){this._flags=this._flags|ENTITY_FLAGS.SELECTED;}else{this._flags=this._flags&~ENTITY_FLAGS.SELECTED;}for(var _i56=0,len=this.meshes.length;_i56<len;_i56++){this.meshes[_i56]._setSelected(this._flags);}if(this._isObject){this.model.scene._objectSelectedUpdated(this);}this.model.glRedraw();}/**
4341
- * Gets if this VBOSceneModelNode's edges are enhanced.
4341
+ * Gets if this DataTextureSceneModelNode's edges are enhanced.
4342
4342
  *
4343
4343
  * @type {Boolean}
4344
4344
  */},{key:"edges",get:function get(){return this._getFlag(ENTITY_FLAGS.EDGES);}/**
4345
- * Sets if this VBOSceneModelNode's edges are enhanced.
4345
+ * Sets if this DataTextureSceneModelNode's edges are enhanced.
4346
4346
  *
4347
4347
  * @type {Boolean}
4348
4348
  */,set:function set(edges){if(!!(this._flags&ENTITY_FLAGS.EDGES)===edges){return;// Redundant update
4349
4349
  }if(edges){this._flags=this._flags|ENTITY_FLAGS.EDGES;}else{this._flags=this._flags&~ENTITY_FLAGS.EDGES;}for(var i=0,len=this.meshes.length;i<len;i++){this.meshes[i]._setEdges(this._flags);}this.model.glRedraw();}},{key:"culledVFC",get:function get(){return!!this._culledVFC;},set:function set(culled){this._culledVFC=culled;this.internalSetCulled();}},{key:"culledLOD",get:function get(){return!!this._culledLOD;},set:function set(culled){this._culledLOD=culled;this.internalSetCulled();}/**
4350
- * Gets if this VBOSceneModelNode is culled.
4350
+ * Gets if this DataTextureSceneModelNode is culled.
4351
4351
  *
4352
- * Only rendered when {@link VBOSceneModelNode#visible} is ````true```` and {@link VBOSceneModelNode#culled} is ````false````.
4352
+ * Only rendered when {@link DataTextureSceneModelNode#visible} is ````true```` and {@link DataTextureSceneModelNode#culled} is ````false````.
4353
4353
  *
4354
4354
  * @type {Boolean}
4355
4355
  */},{key:"culled",get:function get(){return!!this._culled;// return this._getFlag(ENTITY_FLAGS.CULLED);
4356
4356
  }/**
4357
- * Sets if this VBOSceneModelNode is culled.
4357
+ * Sets if this DataTextureSceneModelNode is culled.
4358
4358
  *
4359
- * Only rendered when {@link VBOSceneModelNode#visible} is ````true```` and {@link VBOSceneModelNode#culled} is ````false````.
4359
+ * Only rendered when {@link DataTextureSceneModelNode#visible} is ````true```` and {@link DataTextureSceneModelNode#culled} is ````false````.
4360
4360
  *
4361
4361
  * @type {Boolean}
4362
4362
  */,set:function set(culled){this._culled=culled;this.internalSetCulled();}},{key:"internalSetCulled",value:function internalSetCulled(){var culled=!!this._culled||!!this._culledLOD||!!this._culledVFC;if(!!(this._flags&ENTITY_FLAGS.CULLED)===culled){return;// Redundant update
4363
4363
  }if(culled){this._flags=this._flags|ENTITY_FLAGS.CULLED;}else{this._flags=this._flags&~ENTITY_FLAGS.CULLED;}for(var i=0,len=this.meshes.length;i<len;i++){this.meshes[i]._setCulled(this._flags);}this.model.glRedraw();}/**
4364
- * Gets if this VBOSceneModelNode is clippable.
4364
+ * Gets if this DataTextureSceneModelNode is clippable.
4365
4365
  *
4366
4366
  * Clipping is done by the {@link SectionPlane}s in {@link Scene#sectionPlanes}.
4367
4367
  *
4368
4368
  * @type {Boolean}
4369
4369
  */},{key:"clippable",get:function get(){return this._getFlag(ENTITY_FLAGS.CLIPPABLE);}/**
4370
- * Sets if this VBOSceneModelNode is clippable.
4370
+ * Sets if this DataTextureSceneModelNode is clippable.
4371
4371
  *
4372
4372
  * Clipping is done by the {@link SectionPlane}s in {@link Scene#sectionPlanes}.
4373
4373
  *
4374
4374
  * @type {Boolean}
4375
4375
  */,set:function set(clippable){if(!!(this._flags&ENTITY_FLAGS.CLIPPABLE)===clippable){return;// Redundant update
4376
4376
  }if(clippable){this._flags=this._flags|ENTITY_FLAGS.CLIPPABLE;}else{this._flags=this._flags&~ENTITY_FLAGS.CLIPPABLE;}for(var i=0,len=this.meshes.length;i<len;i++){this.meshes[i]._setClippable(this._flags);}this.model.glRedraw();}/**
4377
- * Gets if this VBOSceneModelNode is included in boundary calculations.
4377
+ * Gets if this DataTextureSceneModelNode is included in boundary calculations.
4378
4378
  *
4379
4379
  * @type {Boolean}
4380
4380
  */},{key:"collidable",get:function get(){return this._getFlag(ENTITY_FLAGS.COLLIDABLE);}/**
4381
- * Sets if this VBOSceneModelNode is included in boundary calculations.
4381
+ * Sets if this DataTextureSceneModelNode is included in boundary calculations.
4382
4382
  *
4383
4383
  * @type {Boolean}
4384
4384
  */,set:function set(collidable){if(!!(this._flags&ENTITY_FLAGS.COLLIDABLE)===collidable){return;// Redundant update
4385
4385
  }if(collidable){this._flags=this._flags|ENTITY_FLAGS.COLLIDABLE;}else{this._flags=this._flags&~ENTITY_FLAGS.COLLIDABLE;}for(var i=0,len=this.meshes.length;i<len;i++){this.meshes[i]._setCollidable(this._flags);}}/**
4386
- * Gets if this VBOSceneModelNode is pickable.
4386
+ * Gets if this DataTextureSceneModelNode is pickable.
4387
4387
  *
4388
4388
  * Picking is done via calls to {@link Scene#pick}.
4389
4389
  *
4390
4390
  * @type {Boolean}
4391
4391
  */},{key:"pickable",get:function get(){return this._getFlag(ENTITY_FLAGS.PICKABLE);}/**
4392
- * Sets if this VBOSceneModelNode is pickable.
4392
+ * Sets if this DataTextureSceneModelNode is pickable.
4393
4393
  *
4394
4394
  * Picking is done via calls to {@link Scene#pick}.
4395
4395
  *
4396
4396
  * @type {Boolean}
4397
4397
  */,set:function set(pickable){if(!!(this._flags&ENTITY_FLAGS.PICKABLE)===pickable){return;// Redundant update
4398
4398
  }if(pickable){this._flags=this._flags|ENTITY_FLAGS.PICKABLE;}else{this._flags=this._flags&~ENTITY_FLAGS.PICKABLE;}for(var i=0,len=this.meshes.length;i<len;i++){this.meshes[i]._setPickable(this._flags);}}/**
4399
- * Gets the VBOSceneModelNode's RGB colorize color.
4399
+ * Gets the DataTextureSceneModelNode's RGB colorize color.
4400
4400
  *
4401
4401
  * Each element of the color is in range ````[0..1]````.
4402
4402
  *
@@ -4404,7 +4404,7 @@ var _mesh2=this.meshes[i];_mesh2.parent=this;this._numTriangles+=_mesh2.numTrian
4404
4404
  */},{key:"colorize",get:function get(){// [0..1, 0..1, 0..1]
4405
4405
  if(this.meshes.length===0){return null;}var colorize=this.meshes[0]._colorize;tempFloatRGB[0]=colorize[0]/255.0;// Unquantize
4406
4406
  tempFloatRGB[1]=colorize[1]/255.0;tempFloatRGB[2]=colorize[2]/255.0;return tempFloatRGB;}/**
4407
- * Sets the VBOSceneModelNode's RGB colorize color.
4407
+ * Sets the DataTextureSceneModelNode's RGB colorize color.
4408
4408
  *
4409
4409
  * Each element of the color is in range ````[0..1]````.
4410
4410
  *
@@ -4412,28 +4412,28 @@ tempFloatRGB[1]=colorize[1]/255.0;tempFloatRGB[2]=colorize[2]/255.0;return tempF
4412
4412
  */,set:function set(color){// [0..1, 0..1, 0..1]
4413
4413
  if(color){tempIntRGB[0]=Math.floor(color[0]*255.0);// Quantize
4414
4414
  tempIntRGB[1]=Math.floor(color[1]*255.0);tempIntRGB[2]=Math.floor(color[2]*255.0);for(var _i57=0,len=this.meshes.length;_i57<len;_i57++){this.meshes[_i57]._setColorize(tempIntRGB);}}else{for(var _i58=0,_len5=this.meshes.length;_i58<_len5;_i58++){this.meshes[_i58]._setColorize(null);}}if(this._isObject){var colorized=!!color;this.scene._objectColorizeUpdated(this,colorized);this._colorizeUpdated=colorized;}this.model.glRedraw();}/**
4415
- * Gets the VBOSceneModelNode's opacity factor.
4415
+ * Gets the DataTextureSceneModelNode's opacity factor.
4416
4416
  *
4417
4417
  * This is a factor in range ````[0..1]```` which multiplies by the rendered fragment alphas.
4418
4418
  *
4419
4419
  * @type {Number}
4420
4420
  */},{key:"opacity",get:function get(){if(this.meshes.length>0){return this.meshes[0]._colorize[3]/255.0;}else{return 1.0;}}/**
4421
- * Sets the VBOSceneModelNode's opacity factor, multiplies by the VBOSceneModelNode's rendered fragment alphas.
4421
+ * Sets the DataTextureSceneModelNode's opacity factor, multiplies by the DataTextureSceneModelNode's rendered fragment alphas.
4422
4422
  *
4423
4423
  * This is a factor in range ````[0..1]````.
4424
4424
  *
4425
4425
  * @type {Number}
4426
4426
  */,set:function set(opacity){if(this.meshes.length===0){return;}var opacityUpdated=opacity!==null&&opacity!==undefined;var lastOpacityQuantized=this.meshes[0]._colorize[3];var opacityQuantized=255;if(opacityUpdated){if(opacity<0){opacity=0;}else if(opacity>1){opacity=1;}opacityQuantized=Math.floor(opacity*255.0);// Quantize
4427
4427
  if(lastOpacityQuantized===opacityQuantized){return;}}else{opacityQuantized=255.0;if(lastOpacityQuantized===opacityQuantized){return;}}for(var _i59=0,len=this.meshes.length;_i59<len;_i59++){this.meshes[_i59]._setOpacity(opacityQuantized,this._flags);}if(this._isObject){this.scene._objectOpacityUpdated(this,opacityUpdated);this._opacityUpdated=opacityUpdated;}this.model.glRedraw();}/**
4428
- * Gets the VBOSceneModelNode's 3D World-space offset.
4428
+ * Gets the DataTextureSceneModelNode's 3D World-space offset.
4429
4429
  *
4430
4430
  * Default value is ````[0,0,0]````.
4431
4431
  *
4432
4432
  * @type {Number[]}
4433
4433
  */},{key:"offset",get:function get(){return this._offset;}/**
4434
- * Sets the VBOSceneModelNode's 3D World-space offset.
4434
+ * Sets the DataTextureSceneModelNode's 3D World-space offset.
4435
4435
  *
4436
- * The offset dynamically translates the VBOSceneModelNode in World-space.
4436
+ * The offset dynamically translates the DataTextureSceneModelNode in World-space.
4437
4437
  *
4438
4438
  * Default value is ````[0, 0, 0]````.
4439
4439
  *
@@ -4441,43 +4441,34 @@ if(lastOpacityQuantized===opacityQuantized){return;}}else{opacityQuantized=255.0
4441
4441
  *
4442
4442
  * @type {Number[]}
4443
4443
  */,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 _i60=0,len=this.meshes.length;_i60<len;_i60++){this.meshes[_i60]._setOffset(this._offset);}this._offsetAABB[0]=this._aabb[0]+this._offset[0];this._offsetAABB[1]=this._aabb[1]+this._offset[1];this._offsetAABB[2]=this._aabb[2]+this._offset[2];this._offsetAABB[3]=this._aabb[3]+this._offset[0];this._offsetAABB[4]=this._aabb[4]+this._offset[1];this._offsetAABB[5]=this._aabb[5]+this._offset[2];this.scene._aabbDirty=true;this.scene._objectOffsetUpdated(this,offset);this.model._aabbDirty=true;this.model.glRedraw();}/**
4444
- * Gets if this VBOSceneModelNode casts shadows.
4444
+ * Gets if this DataTextureSceneModelNode casts shadows.
4445
4445
  *
4446
4446
  * @type {Boolean}
4447
4447
  */},{key:"castsShadow",get:function get(){// TODO
4448
4448
  return false;}/**
4449
- * Sets if to this VBOSceneModelNode casts shadows.
4449
+ * Sets if to this DataTextureSceneModelNode casts shadows.
4450
4450
  *
4451
4451
  * @type {Boolean}
4452
4452
  */,set:function set(pickable){// TODO
4453
4453
  }/**
4454
- * Whether or not this VBOSceneModelNode can have shadows cast upon it
4454
+ * Whether or not this DataTextureSceneModelNode can have shadows cast upon it
4455
4455
  *
4456
4456
  * @type {Boolean}
4457
4457
  */},{key:"receivesShadow",get:function get(){// TODO
4458
4458
  return false;}/**
4459
- * Whether or not this VBOSceneModelNode can have shadows cast upon it
4459
+ * Whether or not this DataTextureSceneModelNode can have shadows cast upon it
4460
4460
  *
4461
4461
  * @type {Boolean}
4462
4462
  */,set:function set(pickable){// TODO
4463
4463
  }/**
4464
- * Gets if Scalable Ambient Obscurance (SAO) will apply to this VBOSceneModelNode.
4464
+ * Gets if Scalable Ambient Obscurance (SAO) will apply to this DataTextureSceneModelNode.
4465
4465
  *
4466
4466
  * SAO is configured by the Scene's {@link SAO} component.
4467
4467
  *
4468
4468
  * @type {Boolean}
4469
4469
  * @abstract
4470
4470
  */},{key:"saoEnabled",get:function get(){return this.model.saoEnabled;}},{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 _i61=0,len=this.meshes.length;_i61<len;_i61++){this.meshes[_i61]._finalize(this._flags);}}},{key:"_finalize2",value:function _finalize2(){for(var _i62=0,len=this.meshes.length;_i62<len;_i62++){this.meshes[_i62]._finalize2();}}},{key:"_destroy",value:function _destroy(){// Called by VBOSceneModel
4471
- var scene=this.model.scene;if(this._isObject){scene._deregisterObject(this);if(this.visible){scene._objectVisibilityUpdated(this,false);}if(this.xrayed){scene._objectXRayedUpdated(this);}if(this.selected){scene._objectSelectedUpdated(this);}if(this.highlighted){scene._objectHighlightedUpdated(this);}if(this._opacityUpdated){this.scene._objectColorizeUpdated(this,false);}if(this._opacityUpdated){this.scene._objectOpacityUpdated(this,false);}this.scene._objectOffsetUpdated(this,false);}for(var _i63=0,len=this.meshes.length;_i63<len;_i63++){this.meshes[_i63]._destroy();}scene._aabbDirty=true;}}]);return VBOSceneModelNode;}();/**
4472
- * Provides scratch memory for methods like TrianglesBatchingLayer setFlags() and setColors(),
4473
- * so they don't need to allocate temporary arrays that need garbage collection.
4474
- *
4475
- * @private
4476
- */var ScratchMemory$1=/*#__PURE__*/function(){function ScratchMemory$1(){_classCallCheck(this,ScratchMemory$1);this._uint8Arrays={};this._float32Arrays={};}_createClass(ScratchMemory$1,[{key:"_clear",value:function _clear(){this._uint8Arrays={};this._float32Arrays={};}},{key:"getUInt8Array",value:function getUInt8Array(len){var uint8Array=this._uint8Arrays[len];if(!uint8Array){uint8Array=new Uint8Array(len);this._uint8Arrays[len]=uint8Array;}return uint8Array;}},{key:"getFloat32Array",value:function getFloat32Array(len){var float32Array=this._float32Arrays[len];if(!float32Array){float32Array=new Float32Array(len);this._float32Arrays[len]=float32Array;}return float32Array;}}]);return ScratchMemory$1;}();var batchingLayerScratchMemory$1=new ScratchMemory$1();var countUsers$1=0;/**
4477
- * @private
4478
- */function getScratchMemory$1(){countUsers$1++;return batchingLayerScratchMemory$1;}/**
4479
- * @private
4480
- */function putScratchMemory$1(){if(countUsers$1===0){return;}countUsers$1--;if(countUsers$1===0){batchingLayerScratchMemory$1._clear();}}/**
4471
+ var scene=this.model.scene;if(this._isObject){scene._deregisterObject(this);if(this.visible){scene._objectVisibilityUpdated(this,false);}if(this.xrayed){scene._objectXRayedUpdated(this);}if(this.selected){scene._objectSelectedUpdated(this);}if(this.highlighted){scene._objectHighlightedUpdated(this);}if(this._opacityUpdated){this.scene._objectColorizeUpdated(this,false);}if(this._opacityUpdated){this.scene._objectOpacityUpdated(this,false);}this.scene._objectOffsetUpdated(this,false);}for(var _i63=0,len=this.meshes.length;_i63<len;_i63++){this.meshes[_i63]._destroy();}scene._aabbDirty=true;}}]);return DataTextureSceneModelNode;}();/**
4481
4472
  * @private
4482
4473
  */var RENDER_PASSES$1={// Skipped - suppress rendering
4483
4474
  NOT_RENDERED:0,// Normal rendering - mutually exclusive modes
@@ -5379,9 +5370,7 @@ src.push("uniform mediump usampler2D uTexturePerPolygonIdPortionIds;");// chipmu
5379
5370
  src.push("uniform highp sampler2D uTextureCameraMatrices;");// chipmunk
5380
5371
  src.push("uniform highp sampler2D uTextureModelMatrices;");// chipmunk
5381
5372
  src.push("uniform vec3 uCameraEyeRtc;");// chipmunk
5382
- src.push("vec3 positions[3];");if(scene.logarithmicDepthBufferEnabled){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("uniform vec4 lightAmbient;");for(var _i71=0,len=lightsState.lights.length;_i71<len;_i71++){light=lightsState.lights[_i71];if(light.type==="ambient"){continue;}src.push("uniform vec4 lightColor"+_i71+";");if(light.type==="dir"){src.push("uniform vec3 lightDir"+_i71+";");}if(light.type==="point"){src.push("uniform vec3 lightPos"+_i71+";");}if(light.type==="spot"){src.push("uniform vec3 lightPos"+_i71+";");src.push("uniform vec3 lightDir"+_i71+";");}}if(clipping){src.push("out vec4 vWorldPosition;");src.push("flat out uint vFlags2;");}src.push("out vec4 vColor;");src.push("void main(void) {");// camera matrices
5383
- src.push("mat4 viewMatrix = mat4 (texelFetch (uTextureCameraMatrices, ivec2(0, 0), 0), texelFetch (uTextureCameraMatrices, ivec2(1, 0), 0), texelFetch (uTextureCameraMatrices, ivec2(2, 0), 0), texelFetch (uTextureCameraMatrices, ivec2(3, 0), 0));");src.push("mat4 viewNormalMatrix = mat4 (texelFetch (uTextureCameraMatrices, ivec2(0, 1), 0), texelFetch (uTextureCameraMatrices, ivec2(1, 1), 0), texelFetch (uTextureCameraMatrices, ivec2(2, 1), 0), texelFetch (uTextureCameraMatrices, ivec2(3, 1), 0));");src.push("mat4 projMatrix = mat4 (texelFetch (uTextureCameraMatrices, ivec2(0, 2), 0), texelFetch (uTextureCameraMatrices, ivec2(1, 2), 0), texelFetch (uTextureCameraMatrices, ivec2(2, 2), 0), texelFetch (uTextureCameraMatrices, ivec2(3, 2), 0));");// model matrices
5384
- src.push("mat4 worldMatrix = mat4 (texelFetch (uTextureModelMatrices, ivec2(0, 0), 0), texelFetch (uTextureModelMatrices, ivec2(1, 0), 0), texelFetch (uTextureModelMatrices, ivec2(2, 0), 0), texelFetch (uTextureModelMatrices, ivec2(3, 0), 0));");src.push("mat4 worldNormalMatrix = mat4 (texelFetch (uTextureModelMatrices, ivec2(0, 1), 0), texelFetch (uTextureModelMatrices, ivec2(1, 1), 0), texelFetch (uTextureModelMatrices, ivec2(2, 1), 0), texelFetch (uTextureModelMatrices, ivec2(3, 1), 0));");// constants
5373
+ src.push("vec3 positions[3];");if(scene.logarithmicDepthBufferEnabled){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("uniform vec4 lightAmbient;");for(var _i71=0,len=lightsState.lights.length;_i71<len;_i71++){light=lightsState.lights[_i71];if(light.type==="ambient"){continue;}src.push("uniform vec4 lightColor"+_i71+";");if(light.type==="dir"){src.push("uniform vec3 lightDir"+_i71+";");}if(light.type==="point"){src.push("uniform vec3 lightPos"+_i71+";");}if(light.type==="spot"){src.push("uniform vec3 lightPos"+_i71+";");src.push("uniform vec3 lightDir"+_i71+";");}}if(clipping){src.push("out vec4 vWorldPosition;");src.push("flat out uint vFlags2;");}src.push("out vec4 vColor;");src.push("void main(void) {");// constants
5385
5374
  src.push("int polygonIndex = gl_VertexID / 3;");// get packed object-id
5386
5375
  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
5387
5376
  src.push("uvec4 flags = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+2, objectIndexCoords.y), 0);");// chipmunk
@@ -5390,7 +5379,9 @@ src.push("uvec4 flags2 = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(ob
5390
5379
  // renderPass = COLOR_OPAQUE
5391
5380
  src.push("if (int(flags.x) != renderPass) {");src.push(" gl_Position = vec4(3.0, 3.0, 3.0, 1.0);");// Cull vertex
5392
5381
  src.push(" return;");// Cull vertex
5393
- src.push("} else {");// get vertex base
5382
+ src.push("} else {");// camera matrices
5383
+ src.push("mat4 viewMatrix = mat4 (texelFetch (uTextureCameraMatrices, ivec2(0, 0), 0), texelFetch (uTextureCameraMatrices, ivec2(1, 0), 0), texelFetch (uTextureCameraMatrices, ivec2(2, 0), 0), texelFetch (uTextureCameraMatrices, ivec2(3, 0), 0));");src.push("mat4 viewNormalMatrix = mat4 (texelFetch (uTextureCameraMatrices, ivec2(0, 1), 0), texelFetch (uTextureCameraMatrices, ivec2(1, 1), 0), texelFetch (uTextureCameraMatrices, ivec2(2, 1), 0), texelFetch (uTextureCameraMatrices, ivec2(3, 1), 0));");src.push("mat4 projMatrix = mat4 (texelFetch (uTextureCameraMatrices, ivec2(0, 2), 0), texelFetch (uTextureCameraMatrices, ivec2(1, 2), 0), texelFetch (uTextureCameraMatrices, ivec2(2, 2), 0), texelFetch (uTextureCameraMatrices, ivec2(3, 2), 0));");// model matrices
5384
+ src.push("mat4 worldMatrix = mat4 (texelFetch (uTextureModelMatrices, ivec2(0, 0), 0), texelFetch (uTextureModelMatrices, ivec2(1, 0), 0), texelFetch (uTextureModelMatrices, ivec2(2, 0), 0), texelFetch (uTextureModelMatrices, ivec2(3, 0), 0));");src.push("mat4 worldNormalMatrix = mat4 (texelFetch (uTextureModelMatrices, ivec2(0, 1), 0), texelFetch (uTextureModelMatrices, ivec2(1, 1), 0), texelFetch (uTextureModelMatrices, ivec2(2, 1), 0), texelFetch (uTextureModelMatrices, ivec2(3, 1), 0));");// get vertex base
5394
5385
  src.push("ivec4 packedVertexBase = ivec4(texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+4, objectIndexCoords.y), 0));");// chipmunk
5395
5386
  src.push("ivec4 packedIndexBaseOffset = ivec4(texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+5, objectIndexCoords.y), 0));");// chipmunk
5396
5387
  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 positionsDecodeMatrix = mat4 (texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*8+0, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*8+1, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*8+2, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*8+3, objectIndexCoords.y), 0));");src.push("mat4 entityMatrix = mat4 (texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*8+4, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*8+5, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*8+6, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*8+7, objectIndexCoords.y), 0));");src.push("positionsDecodeMatrix = entityMatrix * positionsDecodeMatrix;");src.push("uint solid = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+7, objectIndexCoords.y), 0).r;");// chipmunk
@@ -5711,20 +5702,18 @@ src.push("uniform mediump usampler2D uTexturePerPolygonIdPortionIds;");// chipmu
5711
5702
  src.push("uniform highp sampler2D uTextureCameraMatrices;");// chipmunk
5712
5703
  src.push("uniform highp sampler2D uTextureModelMatrices;");// chipmunk
5713
5704
  src.push("uniform vec3 uCameraEyeRtc;");// chipmunk
5714
- src.push("vec3 positions[3];");if(scene.logarithmicDepthBufferEnabled){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("out highp vec2 vHighPrecisionZW;");if(clipping){src.push("out vec4 vWorldPosition;");src.push("flat out uint vFlags2;");}src.push("void main(void) {");// camera matrices
5715
- src.push("mat4 viewMatrix = mat4 (texelFetch (uTextureCameraMatrices, ivec2(0, 0), 0), texelFetch (uTextureCameraMatrices, ivec2(1, 0), 0), texelFetch (uTextureCameraMatrices, ivec2(2, 0), 0), texelFetch (uTextureCameraMatrices, ivec2(3, 0), 0));");src.push("mat4 viewNormalMatrix = mat4 (texelFetch (uTextureCameraMatrices, ivec2(0, 1), 0), texelFetch (uTextureCameraMatrices, ivec2(1, 1), 0), texelFetch (uTextureCameraMatrices, ivec2(2, 1), 0), texelFetch (uTextureCameraMatrices, ivec2(3, 1), 0));");src.push("mat4 projMatrix = mat4 (texelFetch (uTextureCameraMatrices, ivec2(0, 2), 0), texelFetch (uTextureCameraMatrices, ivec2(1, 2), 0), texelFetch (uTextureCameraMatrices, ivec2(2, 2), 0), texelFetch (uTextureCameraMatrices, ivec2(3, 2), 0));");// model matrices
5716
- src.push("mat4 worldMatrix = mat4 (texelFetch (uTextureModelMatrices, ivec2(0, 0), 0), texelFetch (uTextureModelMatrices, ivec2(1, 0), 0), texelFetch (uTextureModelMatrices, ivec2(2, 0), 0), texelFetch (uTextureModelMatrices, ivec2(3, 0), 0));");src.push("mat4 worldNormalMatrix = mat4 (texelFetch (uTextureModelMatrices, ivec2(0, 1), 0), texelFetch (uTextureModelMatrices, ivec2(1, 1), 0), texelFetch (uTextureModelMatrices, ivec2(2, 1), 0), texelFetch (uTextureModelMatrices, ivec2(3, 1), 0));");// constants
5705
+ src.push("vec3 positions[3];");if(scene.logarithmicDepthBufferEnabled){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("out highp vec2 vHighPrecisionZW;");if(clipping){src.push("out vec4 vWorldPosition;");src.push("flat out uint vFlags2;");}src.push("void main(void) {");// constants
5717
5706
  src.push("int polygonIndex = gl_VertexID / 3;");// get packed object-id
5718
5707
  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
5719
5708
  src.push("uvec4 flags = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+2, objectIndexCoords.y), 0);");// chipmunk
5720
5709
  src.push("uvec4 flags2 = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+3, objectIndexCoords.y), 0);");// chipmunk
5721
5710
  // flags.x = NOT_RENDERED | COLOR_OPAQUE | COLOR_TRANSPARENT
5722
5711
  // renderPass = COLOR_OPAQUE
5723
- // src.push(`if (int(flags.x) != renderPass) {`);
5724
- // src.push(" gl_Position = vec4(3.0, 3.0, 3.0, 1.0);"); // Cull vertex
5725
- // src.push(" return;"); // Cull vertex
5726
- // src.push("} else {");
5727
- src.push("{");// get vertex base
5712
+ src.push("if (int(flags.x) != renderPass) {");src.push(" gl_Position = vec4(3.0, 3.0, 3.0, 1.0);");// Cull vertex
5713
+ src.push(" return;");// Cull vertex
5714
+ src.push("} else {");// camera matrices
5715
+ src.push("mat4 viewMatrix = mat4 (texelFetch (uTextureCameraMatrices, ivec2(0, 0), 0), texelFetch (uTextureCameraMatrices, ivec2(1, 0), 0), texelFetch (uTextureCameraMatrices, ivec2(2, 0), 0), texelFetch (uTextureCameraMatrices, ivec2(3, 0), 0));");src.push("mat4 viewNormalMatrix = mat4 (texelFetch (uTextureCameraMatrices, ivec2(0, 1), 0), texelFetch (uTextureCameraMatrices, ivec2(1, 1), 0), texelFetch (uTextureCameraMatrices, ivec2(2, 1), 0), texelFetch (uTextureCameraMatrices, ivec2(3, 1), 0));");src.push("mat4 projMatrix = mat4 (texelFetch (uTextureCameraMatrices, ivec2(0, 2), 0), texelFetch (uTextureCameraMatrices, ivec2(1, 2), 0), texelFetch (uTextureCameraMatrices, ivec2(2, 2), 0), texelFetch (uTextureCameraMatrices, ivec2(3, 2), 0));");// model matrices
5716
+ src.push("mat4 worldMatrix = mat4 (texelFetch (uTextureModelMatrices, ivec2(0, 0), 0), texelFetch (uTextureModelMatrices, ivec2(1, 0), 0), texelFetch (uTextureModelMatrices, ivec2(2, 0), 0), texelFetch (uTextureModelMatrices, ivec2(3, 0), 0));");src.push("mat4 worldNormalMatrix = mat4 (texelFetch (uTextureModelMatrices, ivec2(0, 1), 0), texelFetch (uTextureModelMatrices, ivec2(1, 1), 0), texelFetch (uTextureModelMatrices, ivec2(2, 1), 0), texelFetch (uTextureModelMatrices, ivec2(3, 1), 0));");// get vertex base
5728
5717
  src.push("ivec4 packedVertexBase = ivec4(texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+4, objectIndexCoords.y), 0));");// chipmunk
5729
5718
  src.push("ivec4 packedIndexBaseOffset = ivec4(texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+5, objectIndexCoords.y), 0));");// chipmunk
5730
5719
  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 positionsDecodeMatrix = mat4 (texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*8+0, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*8+1, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*8+2, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*8+3, objectIndexCoords.y), 0));");src.push("mat4 entityMatrix = mat4 (texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*8+4, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*8+5, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*8+6, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*8+7, objectIndexCoords.y), 0));");src.push("positionsDecodeMatrix = entityMatrix * positionsDecodeMatrix;");src.push("uint solid = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+7, objectIndexCoords.y), 0).r;");// chipmunk
@@ -6249,14 +6238,13 @@ texArray.set(instanceMatrices[i],i*32+16);}var texture=gl.createTexture();gl.bin
6249
6238
  * @param cfg.layerIndex
6250
6239
  * @param cfg.positionsDecodeMatrix
6251
6240
  * @param cfg.origin
6252
- * @param cfg.scratchMemory
6253
6241
  */function TrianglesDataTextureLayer(model,cfg){_classCallCheck(this,TrianglesDataTextureLayer);this._layerNumber=_numberOfLayers++;dataTextureRamStats.numberOfLayers++;/**
6254
6242
  * State sorting key.
6255
6243
  * @type {string}
6256
6244
  */this.sortId="TrianglesDataTextureLayer-".concat(this._layerNumber);/**
6257
6245
  * Index of this TrianglesDataTextureLayer in {@link PerformanceModel#_layerList}.
6258
6246
  * @type {Number}
6259
- */this.layerIndex=cfg.layerIndex;this._dataTextureRenderers=getDataTextureRenderers(model.scene);this.model=model;this._buffer=new TrianglesDataTextureBuffer();this._scratchMemory=cfg.scratchMemory;/**
6247
+ */this.layerIndex=cfg.layerIndex;this._dataTextureRenderers=getDataTextureRenderers(model.scene);this.model=model;this._buffer=new TrianglesDataTextureBuffer();/**
6260
6248
  * @type {DataTextureState}
6261
6249
  */this._dataTextureState=new DataTextureState();/**
6262
6250
  * @type {DataTextureGenerator}
@@ -6647,7 +6635,7 @@ for(var _i134=0,len=_fpsTrackingManagers.length;_i134<len;_i134++){_fpsTrackingM
6647
6635
  * - key: the number of triangles allowed for the objects in the bucket.
6648
6636
  * - value: all PerformanceNodes that have the number of triangles or more.
6649
6637
  *
6650
- * @type {Map<number, Array<VBOSceneModelNode>>}
6638
+ * @type {Map<number, Array<DataTextureSceneModelNode>>}
6651
6639
  */this.nodesInLOD={};/**
6652
6640
  * A computed dictionary for `triangle-number-buckets` where:
6653
6641
  * - key: the number of triangles allowed for the objects in the bucket.
@@ -6816,7 +6804,7 @@ this._orderedMeshList=[];this._orderedEntityList=[];this.finalized=true;}/**
6816
6804
  */this._canvasElement=model.scene.canvas.canvas;}if(!this._camera){this._camera=model.scene.camera;}this._ensureFrustumPropsUpdated(model);this._initializeCullingDataIfNeeded(model);var visibleNodes=this._searchVisibleNodesWithFrustumCulling();// console.log (`visibleNodes: ${visibleNodes.length} / ${this._internalNodesList.length}`);
6817
6805
  this._cullFrame++;this._markVisibleFrameOfVisibleNodes(visibleNodes,this._cullFrame);this._cullNonVisibleNodes(model,this._cullFrame);// console.log (`${numIntersectionChecks} intersection checks`);
6818
6806
  }},{key:"_initializeCullingDataIfNeeded",value:function _initializeCullingDataIfNeeded(model){if(this._internalNodesList){return;}if(!this._aabbTree){return;}var allAabbNodes=this._aabbTree.all();var maxEntityId=0;allAabbNodes.forEach(function(aabbbNode){maxEntityId=Math.max(maxEntityId,aabbbNode.entity.id);});var internalNodesList=new Array(maxEntityId+1);allAabbNodes.forEach(function(aabbbNode){internalNodesList[aabbbNode.entity.id]=model._nodes[aabbbNode.entity.xeokitId];});/**
6819
- * @type {Array<VBOSceneModelNode>}
6807
+ * @type {Array<DataTextureSceneModelNode>}
6820
6808
  * @private
6821
6809
  */this._internalNodesList=internalNodesList;/**
6822
6810
  * @private
@@ -6936,13 +6924,13 @@ return retVal;}}]);return ViewFrustumCullingState;}();var ViewFrustumCullingMana
6936
6924
  */_this32._vfcManager=new ViewFrustumCullingManager(_assertThisInitialized(_this32));}_this32._aabb=math.collapseAABB3();_this32._aabbDirty=false;/**
6937
6925
  * @type {Array<TrianglesDataTextureLayer>}
6938
6926
  */_this32._layerList=[];/**
6939
- * @type {Array<VBOSceneModelNode>}
6927
+ * @type {Array<DataTextureSceneModelNode>}
6940
6928
  */_this32._nodeList=[];/**
6941
6929
  * @type {TrianglesDataTextureLayer}
6942
- */_this32._currentDataTextureLayer=null;_this32._instancingGeometries={};_this32._preparedInstancingGeometries={};_this32._scratchMemory=getScratchMemory$1();/**
6943
- * @type {Map<string, VBOSceneModelMesh>}
6930
+ */_this32._currentDataTextureLayer=null;_this32._instancingGeometries={};_this32._preparedInstancingGeometries={};/**
6931
+ * @type {Map<string, DataTextureSceneModelMesh>}
6944
6932
  */_this32._meshes={};/**
6945
- * @type {Map<string, VBOSceneModelNode>}
6933
+ * @type {Map<string, DataTextureSceneModelNode>}
6946
6934
  */_this32._nodes={};/**
6947
6935
  * @type {RenderFlags}
6948
6936
  * @private
@@ -7357,10 +7345,10 @@ _this32._origin=math.vec3(cfg.origin||[0,0,0]);_this32._position=math.vec3(cfg.p
7357
7345
  */},{key:"createMesh",value:function createMesh(cfg){if(cfg.positionsCompressed&&!cfg.positions){cfg.positions=cfg.positionsCompressed;}if(this._vfcManager&&!this._vfcManager.finalized){if(cfg.color){cfg.color=cfg.color.slice();}if(cfg.positionsDecodeMatrix){cfg.positionsDecodeMatrix=cfg.positionsDecodeMatrix.slice();}this._vfcManager.addMesh(cfg);return;}var id=cfg.id;if(id===undefined||id===null){this.error("Config missing: id");return;}if(this._meshes[id]){this.error("DataTextureSceneModel already has a Mesh with this ID: "+id+"");return;}var geometryId=cfg.geometryId;var instancing=geometryId!==undefined;var geometryCfg=null;if(instancing){geometryCfg=this._instancingGeometries[geometryId];}else{geometryCfg=cfg;}/**
7358
7346
  * This will be the prepared mesh geometry, with index rebucketting applied.
7359
7347
  */var preparedGeometryCfg=null;if(!instancing||!(geometryId in this._preparedInstancingGeometries)){var primitive=geometryCfg.primitive||"triangles";if(primitive!=="triangles"&&primitive!=="solid"&&primitive!=="surface"){this.error("Unsupported value for 'primitive': '".concat(primitive,"' - supported values are 'triangles', 'solid' and 'surface'. Defaulting to 'triangles'."));primitive="triangles";}var _positions3=geometryCfg.positions;if(!_positions3){this.error("Config missing: positions (no meshIds provided, so expecting geometry arrays instead)");return null;}var indices=geometryCfg.indices;var edgeIndices=geometryCfg.edgeIndices;if(!geometryCfg.indices&&primitive==="triangles"){this.error("Config missing for triangles primitive: indices (no meshIds provided, so expecting geometry arrays instead)");return null;}if(!edgeIndices){edgeIndices=buildEdgeIndices(_positions3,indices,null,this._edgeThreshold);}geometryCfg.edgeIndices=edgeIndices;preparedGeometryCfg=prepareMeshGeometry(geometryCfg,this._enableVertexWelding,this._enableIndexRebucketing);if(instancing){this._preparedInstancingGeometries[geometryId]=preparedGeometryCfg;}}else{preparedGeometryCfg=this._preparedInstancingGeometries[geometryId];}var layer=this._currentDataTextureLayer;if(null!==layer&&!layer.canCreatePortion(preparedGeometryCfg,instancing?geometryId:null)){layer.finalize();delete this._currentDataTextureLayer;layer=null;}if(!layer){layer=new TrianglesDataTextureLayer(this,{layerIndex:0,// This is set in #finalize()
7360
- scratchMemory:this._scratchMemory,// chipmunk
7348
+ // chipmunk
7361
7349
  // positionsDecodeMatrix: cfg.positionsDecodeMatrix, // Can be undefined
7362
7350
  // chipmunk: allow to have different origins per-mesh
7363
- origin:cfg.origin});this._layerList.push(layer);this._currentDataTextureLayer=layer;}var portionId;var color=cfg.color?new Uint8Array([Math.floor(cfg.color[0]*255),Math.floor(cfg.color[1]*255),Math.floor(cfg.color[2]*255)]):[255,255,255];var opacity=cfg.opacity!==undefined&&cfg.opacity!==null?Math.floor(cfg.opacity*255):255;var metallic=cfg.metallic!==undefined&&cfg.metallic!==null?Math.floor(cfg.metallic*255):0;var roughness=cfg.roughness!==undefined&&cfg.roughness!==null?Math.floor(cfg.roughness*255):255;var mesh=new VBOSceneModelMesh$1(this,id,color,opacity);var pickId=mesh.pickId;var a=pickId>>24&0xFF;var b=pickId>>16&0xFF;var g=pickId>>8&0xFF;var r=pickId&0xFF;var pickColor=new Uint8Array([r,g,b,a]);// Quantized pick color
7351
+ origin:cfg.origin});this._layerList.push(layer);this._currentDataTextureLayer=layer;}var portionId;var color=cfg.color?new Uint8Array([Math.floor(cfg.color[0]*255),Math.floor(cfg.color[1]*255),Math.floor(cfg.color[2]*255)]):[255,255,255];var opacity=cfg.opacity!==undefined&&cfg.opacity!==null?Math.floor(cfg.opacity*255):255;var metallic=cfg.metallic!==undefined&&cfg.metallic!==null?Math.floor(cfg.metallic*255):0;var roughness=cfg.roughness!==undefined&&cfg.roughness!==null?Math.floor(cfg.roughness*255):255;var mesh=new DataTextureSceneModelMesh(this,id,color,opacity);var pickId=mesh.pickId;var a=pickId>>24&0xFF;var b=pickId>>16&0xFF;var g=pickId>>8&0xFF;var r=pickId&0xFF;var pickColor=new Uint8Array([r,g,b,a]);// Quantized pick color
7364
7352
  var aabb=math.collapseAABB3();preparedGeometryCfg.solid=preparedGeometryCfg.primitive=="solid";if(instancing){var meshMatrix;var worldMatrix=this._worldMatrixNonIdentity?this._worldMatrix:null;if(cfg.matrix){meshMatrix=cfg.matrix;}else{var _scale=cfg.scale||defaultScale$1;var position=cfg.position||defaultPosition$1;var rotation=cfg.rotation||defaultRotation$1;math.eulerToQuaternion(rotation,"XYZ",defaultQuaternion$1);meshMatrix=math.composeMat4(position,defaultQuaternion$1,_scale,tempMat4$3);}portionId=layer.createPortion(preparedGeometryCfg,{origin:cfg.origin,geometryId:geometryId,color:color,metallic:metallic,roughness:roughness,opacity:opacity,meshMatrix:meshMatrix,worldMatrix:worldMatrix,aabb:aabb,pickColor:pickColor});math.expandAABB3(this._aabb,aabb);this._numTriangles+=preparedGeometryCfg.indices.length/3;mesh.numTriangles=preparedGeometryCfg.indices.length/3;mesh.origin=preparedGeometryCfg.origin;}else{// Batching
7365
7353
  var origin=null;if(!cfg.positionsDecodeMatrix){// TODO: Assumes we never quantize double-precision coordinates
7366
7354
  var rtcCenter=math.vec3();var rtcPositions=[];var rtcNeeded=worldToRTCPositions(positions,rtcPositions,rtcCenter);if(rtcNeeded){positions=rtcPositions;origin=math.addVec3(this._origin,rtcCenter,rtcCenter);}}var cfgOrigin=cfg.origin||cfg.rtcCenter;if(cfgOrigin){if(!origin){origin=cfgOrigin;}else{origin=math.addVec3(this._origin,cfgOrigin,tempVec3a$12);}}else{origin=this._origin;}// TODO: treat the possibility of different origins
@@ -7391,7 +7379,7 @@ mesh._layer=layer;mesh._portionId=portionId;mesh.aabb=aabb;this._meshes[id]=mesh
7391
7379
  var id=cfg.id;if(id===undefined){id=math.createUUID();}else if(this.scene.components[id]){this.error("Scene already has a Component with this ID: "+id+" - will assign random ID");id=math.createUUID();}// Collect PerformanceModelNode's PerformanceModelMeshes
7392
7380
  var meshIds=cfg.meshIds;if(meshIds===undefined){this.error("Config missing: meshIds");return;}var meshes=[];for(var _i159=0,len=meshIds.length;_i159<len;_i159++){var meshId=meshIds[_i159];var _mesh4=this._meshes[meshId];if(!_mesh4){this.error("Mesh with this ID not found: "+meshId+" - ignoring this mesh");continue;}if(_mesh4.parent){this.error("Mesh with ID "+meshId+" already belongs to object with ID "+_mesh4.parent.id+" - ignoring this mesh");continue;}meshes.push(_mesh4);}// Create PerformanceModelNode flags
7393
7381
  var flags=0;if(this._visible&&cfg.visible!==false){flags=flags|ENTITY_FLAGS.VISIBLE;}if(this._pickable&&cfg.pickable!==false){flags=flags|ENTITY_FLAGS.PICKABLE;}if(this._culled&&cfg.culled!==false){flags=flags|ENTITY_FLAGS.CULLED;}if(this._clippable&&cfg.clippable!==false){flags=flags|ENTITY_FLAGS.CLIPPABLE;}if(this._collidable&&cfg.collidable!==false){flags=flags|ENTITY_FLAGS.COLLIDABLE;}if(this._edges&&cfg.edges!==false){flags=flags|ENTITY_FLAGS.EDGES;}if(this._xrayed&&cfg.xrayed!==false){flags=flags|ENTITY_FLAGS.XRAYED;}if(this._highlighted&&cfg.highlighted!==false){flags=flags|ENTITY_FLAGS.HIGHLIGHTED;}if(this._selected&&cfg.selected!==false){flags=flags|ENTITY_FLAGS.SELECTED;}// Create PerformanceModelNode AABB
7394
- var aabb;if(meshes.length===1){aabb=meshes[0].aabb;}else{aabb=math.collapseAABB3();for(var _i160=0,_len32=meshes.length;_i160<_len32;_i160++){math.expandAABB3(aabb,meshes[_i160].aabb);}}var node=new VBOSceneModelNode(this,cfg.isObject,id,meshes,flags,aabb);// Internally sets PerformanceModelMesh#parent to this PerformanceModelNode
7382
+ var aabb;if(meshes.length===1){aabb=meshes[0].aabb;}else{aabb=math.collapseAABB3();for(var _i160=0,_len32=meshes.length;_i160<_len32;_i160++){math.expandAABB3(aabb,meshes[_i160].aabb);}}var node=new DataTextureSceneModelNode(this,cfg.isObject,id,meshes,flags,aabb);// Internally sets PerformanceModelMesh#parent to this PerformanceModelNode
7395
7383
  this._nodeList.push(node);this._nodes[id]=node;this.numEntities++;return node;}/**
7396
7384
  * Finalizes this DataTextureSceneModel.
7397
7385
  *
@@ -7414,17 +7402,17 @@ var renderFlags=this.renderFlags;for(var _i171=0,len=renderFlags.visibleLayers.l
7414
7402
  */},{key:"drawOcclusion",value:function drawOcclusion(frameCtx){if(this.numVisibleLayerPortions===0){return;}var renderFlags=this.renderFlags;for(var _i180=0,len=renderFlags.visibleLayers.length;_i180<len;_i180++){var layerIndex=renderFlags.visibleLayers[_i180];this._layerList[layerIndex].drawOcclusion(renderFlags,frameCtx);}}/**
7415
7403
  * @private
7416
7404
  */},{key:"drawShadow",value:function drawShadow(frameCtx){if(this.numVisibleLayerPortions===0){return;}var renderFlags=this.renderFlags;for(var _i181=0,len=renderFlags.visibleLayers.length;_i181<len;_i181++){var layerIndex=renderFlags.visibleLayers[_i181];this._layerList[layerIndex].drawShadow(renderFlags,frameCtx);}}/** @private */},{key:"drawPickMesh",value:function drawPickMesh(frameCtx){if(this.numVisibleLayerPortions===0){return;}var renderFlags=this.renderFlags;for(var _i182=0,len=renderFlags.visibleLayers.length;_i182<len;_i182++){var layerIndex=renderFlags.visibleLayers[_i182];this._layerList[layerIndex].drawPickMesh(renderFlags,frameCtx);}}/**
7417
- * Called by VBOSceneModelMesh.drawPickDepths()
7405
+ * Called by DataTextureSceneModelMesh.drawPickDepths()
7418
7406
  * @private
7419
7407
  */},{key:"drawPickDepths",value:function drawPickDepths(frameCtx){if(this.numVisibleLayerPortions===0){return;}var renderFlags=this.renderFlags;for(var _i183=0,len=renderFlags.visibleLayers.length;_i183<len;_i183++){var layerIndex=renderFlags.visibleLayers[_i183];this._layerList[layerIndex].drawPickDepths(renderFlags,frameCtx);}}/**
7420
- * Called by VBOSceneModelMesh.drawPickNormals()
7408
+ * Called by DataTextureSceneModelMesh.drawPickNormals()
7421
7409
  * @private
7422
7410
  */},{key:"drawPickNormals",value:function drawPickNormals(frameCtx){if(this.numVisibleLayerPortions===0){return;}var renderFlags=this.renderFlags;for(var _i184=0,len=renderFlags.visibleLayers.length;_i184<len;_i184++){var layerIndex=renderFlags.visibleLayers[_i184];this._layerList[layerIndex].drawPickNormals(renderFlags,frameCtx);}}//------------------------------------------------------------------------------------------------------------------
7423
7411
  // Component members
7424
7412
  //------------------------------------------------------------------------------------------------------------------
7425
7413
  /**
7426
7414
  * Destroys this DataTextureSceneModel.
7427
- */},{key:"destroy",value:function destroy(){this.scene.camera.off(this._onCameraViewMatrix);for(var _i185=0,len=this._layerList.length;_i185<len;_i185++){this._layerList[_i185].destroy();}for(var _i186=0,_len35=this._nodeList.length;_i186<_len35;_i186++){this._nodeList[_i186]._destroy();}this.scene._aabbDirty=true;if(this._isModel){this.scene._deregisterModel(this);}putScratchMemory$1();_get(_getPrototypeOf(DataTextureSceneModel.prototype),"destroy",this).call(this);}}]);return DataTextureSceneModel;}(Component);/**
7415
+ */},{key:"destroy",value:function destroy(){this.scene.camera.off(this._onCameraViewMatrix);for(var _i185=0,len=this._layerList.length;_i185<len;_i185++){this._layerList[_i185].destroy();}for(var _i186=0,_len35=this._nodeList.length;_i186<_len35;_i186++){this._nodeList[_i186]._destroy();}this.scene._aabbDirty=true;if(this._isModel){this.scene._deregisterModel(this);}_get(_getPrototypeOf(DataTextureSceneModel.prototype),"destroy",this).call(this);}}]);return DataTextureSceneModel;}(Component);/**
7428
7416
  * @private
7429
7417
  */var Renderer=function Renderer(scene,options){options=options||{};var frameCtx=new FrameContext(scene);var canvas=scene.canvas.canvas;var gl=scene.canvas.gl;var canvasTransparent=!!options.transparent;var alphaDepthMask=options.alphaDepthMask;var pickIDs=new Map$1({});var drawableTypeInfo={};var drawables={};var drawableListDirty=true;var stateSortDirty=true;var imageDirty=true;var transparentEnabled=true;var edgesEnabled=true;var saoEnabled=true;var pbrEnabled=true;var colorTextureEnabled=true;var renderBufferManager=new RenderBufferManager(scene);var snapshotBound=false;var saoOcclusionRenderer=new SAOOcclusionRenderer(scene);var saoDepthLimitedBlurRenderer=new SAODepthLimitedBlurRenderer(scene);this._occlusionTester=null;// Lazy-created in #addMarker()
7430
7418
  this.capabilities={astcSupported:!!getExtension(gl,'WEBGL_compressed_texture_astc'),etc1Supported:true,// WebGL2
@@ -16132,7 +16120,7 @@ this._originDot.setVisible(this._visible&&this._originVisible);this._targetDot.s
16132
16120
  * Sets if this DistanceMeasurement appears highlighted.
16133
16121
  * @param highlighted
16134
16122
  */,set:function set(value){value=value!==undefined?Boolean(value):this.plugin.defaultLabelsVisible;this._labelsVisible=value;var labelsVisible=this._visible&&this._labelsVisible;this._xAxisLabel.setVisible(labelsVisible&&!this._xAxisLabelCulled&&this._clickable&&this._axisEnabled);this._yAxisLabel.setVisible(labelsVisible&&!this._yAxisLabelCulled&&this._clickable&&this._axisEnabled);this._zAxisLabel.setVisible(labelsVisible&&!this._zAxisLabelCulled&&this._clickable&&this._axisEnabled);this._lengthLabel.setVisible(labelsVisible);this._cpDirty=true;this._needUpdate();}},{key:"setHighlighted",value:function setHighlighted(highlighted){this._originDot.setHighlighted(highlighted);this._targetDot.setHighlighted(highlighted);this._xAxisWire.setHighlighted(highlighted);this._yAxisWire.setHighlighted(highlighted);this._zAxisWire.setHighlighted(highlighted);this._xAxisLabel.setHighlighted(highlighted);this._yAxisLabel.setHighlighted(highlighted);this._zAxisLabel.setHighlighted(highlighted);this._lengthWire.setHighlighted(highlighted);this._lengthLabel.setHighlighted(highlighted);}/**
16135
- * Sets if the wires, dots ad labels will fire "mouseOver" "mouseLeave" and "contextMenu" events.
16123
+ * Sets if the wires, dots ad labels will fire "mouseOver" "mouseLeave" and "contextMenu" events, or ignore mouse events altogether.
16136
16124
  *
16137
16125
  * @type {Boolean}
16138
16126
  */},{key:"clickable",get:/**
@@ -21680,7 +21668,7 @@ mesh._layer=layer;mesh._portionId=portionId;mesh.aabb=aabb;this._meshes[id]=mesh
21680
21668
  var id=cfg.id;if(id===undefined){id=math.createUUID();}else if(this.scene.components[id]){this.error("Scene already has a Component with this ID: "+id+" - will assign random ID");id=math.createUUID();}// Collect PerformanceModelNode's PerformanceModelMeshes
21681
21669
  var meshIds=cfg.meshIds;if(meshIds===undefined){this.error("Config missing: meshIds");return;}var meshes=[];for(var _i493=0,len=meshIds.length;_i493<len;_i493++){var meshId=meshIds[_i493];var _mesh5=this._meshes[meshId];if(!_mesh5){this.error("Mesh with this ID not found: "+meshId+" - ignoring this mesh");continue;}if(_mesh5.parent){this.error("Mesh with ID "+meshId+" already belongs to object with ID "+_mesh5.parent.id+" - ignoring this mesh");continue;}meshes.push(_mesh5);}// Create PerformanceModelNode flags
21682
21670
  var flags=0;if(this._visible&&cfg.visible!==false){flags=flags|ENTITY_FLAGS$1.VISIBLE;}if(this._pickable&&cfg.pickable!==false){flags=flags|ENTITY_FLAGS$1.PICKABLE;}if(this._culled&&cfg.culled!==false){flags=flags|ENTITY_FLAGS$1.CULLED;}if(this._clippable&&cfg.clippable!==false){flags=flags|ENTITY_FLAGS$1.CLIPPABLE;}if(this._collidable&&cfg.collidable!==false){flags=flags|ENTITY_FLAGS$1.COLLIDABLE;}if(this._edges&&cfg.edges!==false){flags=flags|ENTITY_FLAGS$1.EDGES;}if(this._xrayed&&cfg.xrayed!==false){flags=flags|ENTITY_FLAGS$1.XRAYED;}if(this._highlighted&&cfg.highlighted!==false){flags=flags|ENTITY_FLAGS$1.HIGHLIGHTED;}if(this._selected&&cfg.selected!==false){flags=flags|ENTITY_FLAGS$1.SELECTED;}// Create PerformanceModelNode AABB
21683
- var aabb;if(meshes.length===1){aabb=meshes[0].aabb;}else{aabb=math.collapseAABB3();for(var _i494=0,_len111=meshes.length;_i494<_len111;_i494++){math.expandAABB3(aabb,meshes[_i494].aabb);}}var node=new VBOSceneModelNode$1(this,cfg.isObject,id,meshes,flags,aabb);// Internally sets PerformanceModelMesh#parent to this PerformanceModelNode
21671
+ var aabb;if(meshes.length===1){aabb=meshes[0].aabb;}else{aabb=math.collapseAABB3();for(var _i494=0,_len111=meshes.length;_i494<_len111;_i494++){math.expandAABB3(aabb,meshes[_i494].aabb);}}var node=new VBOSceneModelNode(this,cfg.isObject,id,meshes,flags,aabb);// Internally sets PerformanceModelMesh#parent to this PerformanceModelNode
21684
21672
  this._nodeList.push(node);this._nodes[id]=node;this.numEntities++;return node;}/**
21685
21673
  * Finalizes this VBOSceneModel.
21686
21674
  *