@xeokit/xeokit-sdk 2.4.0-alpha-32 → 2.4.0-alpha-33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -113445,7 +113445,7 @@ class FaceAlignedSectionPlanesControl {
|
|
|
113445
113445
|
}
|
|
113446
113446
|
|
|
113447
113447
|
if (deltaUpdate !== 0) {
|
|
113448
|
-
|
|
113448
|
+
moveSectionPlane(deltaUpdate);
|
|
113449
113449
|
deltaUpdate = 0;
|
|
113450
113450
|
}
|
|
113451
113451
|
});
|
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -113441,7 +113441,7 @@ class FaceAlignedSectionPlanesControl {
|
|
|
113441
113441
|
}
|
|
113442
113442
|
|
|
113443
113443
|
if (deltaUpdate !== 0) {
|
|
113444
|
-
|
|
113444
|
+
moveSectionPlane(deltaUpdate);
|
|
113445
113445
|
deltaUpdate = 0;
|
|
113446
113446
|
}
|
|
113447
113447
|
});
|
package/dist/xeokit-sdk.es5.js
CHANGED
|
@@ -24457,7 +24457,7 @@ edges:false,fill:true,fillColor:[1,0,0],fillAlpha:0.6})};this._displayMeshes={pl
|
|
|
24457
24457
|
-0.5,-0.5,-0.0,-0.5,0.5,-0.0// 3
|
|
24458
24458
|
],indices:[0,1,2,2,3,0]}),material:new PhongMaterial(rootNode,{emissive:[0,0.0,0],diffuse:[0,0,0],backfaces:true}),opacity:0.6,ghosted:true,pickable:false,collidable:true,clippable:false,visible:false,scale:[2.4,2.4,1]}),NO_STATE_INHERIT),planeFrame:rootNode.addChild(new Mesh(rootNode,{// Visible frame
|
|
24459
24459
|
geometry:new ReadableGeometry(rootNode,buildTorusGeometry({center:[0,0,0],radius:1.7,tube:tubeRadius*2,radialSegments:4,tubeSegments:4,arc:Math.PI*2.0})),material:new PhongMaterial(rootNode,{emissive:[0,0,0],diffuse:[0,0,0],specular:[0,0,0],shininess:0}),pickable:false,collidable:false,clippable:false,visible:false,scale:[1,1,.1],rotation:[0,0,45]}),NO_STATE_INHERIT),center:rootNode.addChild(new Mesh(rootNode,{geometry:new ReadableGeometry(rootNode,buildSphereGeometry({radius:0.05})),material:materials.center,pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),zAxisArrow:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.blue,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0.8,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),zShaft:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.axis,material:materials.blue,matrix:function(){var translate=math.translateMat4c(0,radius/2,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),clippable:false,pickable:false,collidable:true,visible:false}),NO_STATE_INHERIT)};this._affordanceMeshes={planeFrame:rootNode.addChild(new Mesh(rootNode,{geometry:new ReadableGeometry(rootNode,buildTorusGeometry({center:[0,0,0],radius:2,tube:tubeRadius,radialSegments:4,tubeSegments:4,arc:Math.PI*2.0})),material:new PhongMaterial(rootNode,{ambient:[1,1,1],diffuse:[0,0,0],emissive:[1,1,0]}),highlighted:true,highlightMaterial:new EmphasisMaterial(rootNode,{edges:false,filled:true,fillColor:[1,1,0],fillAlpha:1.0}),pickable:false,collidable:false,clippable:false,visible:false,scale:[1,1,1],rotation:[0,0,45]}),NO_STATE_INHERIT),zAxisArrow:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHeadBig,material:materials.blue,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0.8,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT)};}},{key:"_bindEvents",value:function _bindEvents(){var _this103=this;var rootNode=this._rootNode;var lastCanvasPos=math.vec2();var camera=this._viewer.camera;var scene=this._viewer.scene;var deltaUpdate=0;var waitForTick=false;{// Keep gizmo screen size constant
|
|
24460
|
-
var _tempVec3a=math.vec3([0,0,0]);var lastDist=-1;this._onCameraViewMatrix=scene.camera.on("viewMatrix",function(){});this._onCameraProjMatrix=scene.camera.on("projMatrix",function(){});this._onSceneTick=scene.on("tick",function(){waitForTick=false;var dist=Math.abs(math.lenVec3(math.subVec3(scene.camera.eye,_this103._pos,_tempVec3a)));if(dist!==lastDist){if(camera.projection==="perspective"){var worldSize=Math.tan(camera.perspective.fov*math.DEGTORAD)*dist;var size=0.07*worldSize;rootNode.scale=[size,size,size];lastDist=dist;}}if(camera.projection==="ortho"){var _worldSize=camera.ortho.scale/10;var _size=_worldSize;rootNode.scale=[_size,_size,_size];lastDist=dist;}if(deltaUpdate!==0){
|
|
24460
|
+
var _tempVec3a=math.vec3([0,0,0]);var lastDist=-1;this._onCameraViewMatrix=scene.camera.on("viewMatrix",function(){});this._onCameraProjMatrix=scene.camera.on("projMatrix",function(){});this._onSceneTick=scene.on("tick",function(){waitForTick=false;var dist=Math.abs(math.lenVec3(math.subVec3(scene.camera.eye,_this103._pos,_tempVec3a)));if(dist!==lastDist){if(camera.projection==="perspective"){var worldSize=Math.tan(camera.perspective.fov*math.DEGTORAD)*dist;var size=0.07*worldSize;rootNode.scale=[size,size,size];lastDist=dist;}}if(camera.projection==="ortho"){var _worldSize=camera.ortho.scale/10;var _size=_worldSize;rootNode.scale=[_size,_size,_size];lastDist=dist;}if(deltaUpdate!==0){moveSectionPlane(deltaUpdate);deltaUpdate=0;}});}var getClickCoordsWithinElement=function(){var canvasPos=new Float64Array(2);return function(event){if(!event){event=window.event;canvasPos[0]=event.x;canvasPos[1]=event.y;}else{var element=event.target;var totalOffsetLeft=0;var totalOffsetTop=0;while(element.offsetParent){totalOffsetLeft+=element.offsetLeft;totalOffsetTop+=element.offsetTop;element=element.offsetParent;}canvasPos[0]=event.pageX-totalOffsetLeft;canvasPos[1]=event.pageY-totalOffsetTop;}return canvasPos;};}();var moveSectionPlane=function moveSectionPlane(delta){var pos=_this103._sectionPlane.pos;var dir=_this103._sectionPlane.dir;math.addVec3(pos,math.mulVec3Scalar(dir,0.1*delta*_this103._plugin.getDragSensitivity(),math.vec3()));_this103._sectionPlane.pos=pos;};{var down=false;this._plugin._controlElement.addEventListener("mousedown",this._canvasMouseDownListener=function(e){e.preventDefault();if(!_this103._visible){return;}_this103._viewer.cameraControl.pointerEnabled=false;switch(e.which){case 1:// Left button
|
|
24461
24461
|
down=true;var canvasPos=getClickCoordsWithinElement(e);lastCanvasPos[0]=canvasPos[0];lastCanvasPos[1]=canvasPos[1];break;}});this._plugin._controlElement.addEventListener("mousemove",this._canvasMouseMoveListener=function(e){if(!_this103._visible){return;}if(!down){return;}if(waitForTick){// Limit changes detection to one per frame
|
|
24462
24462
|
return;}var canvasPos=getClickCoordsWithinElement(e);var x=canvasPos[0];var y=canvasPos[1];moveSectionPlane(y-lastCanvasPos[1]);lastCanvasPos[0]=x;lastCanvasPos[1]=y;});this._plugin._controlElement.addEventListener("mouseup",this._canvasMouseUpListener=function(e){if(!_this103._visible){return;}_this103._viewer.cameraControl.pointerEnabled=true;if(!down){return;}switch(e.which){}down=false;});this._plugin._controlElement.addEventListener("wheel",this._canvasWheelListener=function(e){if(!_this103._visible){return;}deltaUpdate+=Math.max(-1,Math.min(1,-e.deltaY*40));});}{var touchStartY,touchEndY;var lastTouchY=null;this._plugin._controlElement.addEventListener("touchstart",this._handleTouchStart=function(e){e.stopPropagation();e.preventDefault();if(!_this103._visible){return;}touchStartY=e.touches[0].clientY;lastTouchY=touchStartY;deltaUpdate=0;});this._plugin._controlElement.addEventListener("touchmove",this._handleTouchMove=function(e){e.stopPropagation();e.preventDefault();if(!_this103._visible){return;}if(waitForTick){// Limit changes detection to one per frame
|
|
24463
24463
|
return;}waitForTick=true;touchEndY=e.touches[0].clientY;if(lastTouchY!==null){deltaUpdate+=touchEndY-lastTouchY;}lastTouchY=touchEndY;});this._plugin._controlElement.addEventListener("touchend",this._handleTouchEnd=function(e){e.stopPropagation();e.preventDefault();if(!_this103._visible){return;}touchStartY=null;touchEndY=null;deltaUpdate=0;});}}},{key:"_destroy",value:function _destroy(){this._unbindEvents();this._destroyNodes();}},{key:"_unbindEvents",value:function _unbindEvents(){var viewer=this._viewer;var scene=viewer.scene;var canvas=scene.canvas.canvas;var camera=viewer.camera;var controlElement=this._plugin._controlElement;scene.off(this._onSceneTick);canvas.removeEventListener("mousedown",this._canvasMouseDownListener);canvas.removeEventListener("mousemove",this._canvasMouseMoveListener);canvas.removeEventListener("mouseup",this._canvasMouseUpListener);canvas.removeEventListener("wheel",this._canvasWheelListener);controlElement.removeEventListener("touchstart",this._handleTouchStart);controlElement.removeEventListener("touchmove",this._handleTouchMove);controlElement.removeEventListener("touchend",this._handleTouchEnd);camera.off(this._onCameraViewMatrix);camera.off(this._onCameraProjMatrix);}},{key:"_destroyNodes",value:function _destroyNodes(){this._setSectionPlane(null);this._rootNode.destroy();this._displayMeshes={};this._affordanceMeshes={};}}]);return FaceAlignedSectionPlanesControl;}();/**
|