@xeokit/xeokit-sdk 2.4.0-alpha-21 → 2.4.0-alpha-22
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
|
@@ -9965,11 +9965,16 @@ class AngleMeasurement extends Component {
|
|
|
9965
9965
|
cfg.onContextMenu(event, this);
|
|
9966
9966
|
} : null;
|
|
9967
9967
|
|
|
9968
|
+
const onMouseWheel = (event) => {
|
|
9969
|
+
this.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent('wheel', event));
|
|
9970
|
+
};
|
|
9971
|
+
|
|
9968
9972
|
this._originDot = new Dot(this._container, {
|
|
9969
9973
|
fillColor: this._color,
|
|
9970
9974
|
zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined,
|
|
9971
9975
|
onMouseOver,
|
|
9972
9976
|
onMouseLeave,
|
|
9977
|
+
onMouseWheel,
|
|
9973
9978
|
onContextMenu
|
|
9974
9979
|
});
|
|
9975
9980
|
this._cornerDot = new Dot(this._container, {
|
|
@@ -9977,6 +9982,7 @@ class AngleMeasurement extends Component {
|
|
|
9977
9982
|
zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined,
|
|
9978
9983
|
onMouseOver,
|
|
9979
9984
|
onMouseLeave,
|
|
9985
|
+
onMouseWheel,
|
|
9980
9986
|
onContextMenu
|
|
9981
9987
|
});
|
|
9982
9988
|
this._targetDot = new Dot(this._container, {
|
|
@@ -9984,6 +9990,7 @@ class AngleMeasurement extends Component {
|
|
|
9984
9990
|
zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined,
|
|
9985
9991
|
onMouseOver,
|
|
9986
9992
|
onMouseLeave,
|
|
9993
|
+
onMouseWheel,
|
|
9987
9994
|
onContextMenu
|
|
9988
9995
|
});
|
|
9989
9996
|
|
|
@@ -9993,6 +10000,7 @@ class AngleMeasurement extends Component {
|
|
|
9993
10000
|
zIndex: plugin.zIndex,
|
|
9994
10001
|
onMouseOver,
|
|
9995
10002
|
onMouseLeave,
|
|
10003
|
+
onMouseWheel,
|
|
9996
10004
|
onContextMenu
|
|
9997
10005
|
});
|
|
9998
10006
|
this._targetWire = new Wire(this._container, {
|
|
@@ -10001,6 +10009,7 @@ class AngleMeasurement extends Component {
|
|
|
10001
10009
|
zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined,
|
|
10002
10010
|
onMouseOver,
|
|
10003
10011
|
onMouseLeave,
|
|
10012
|
+
onMouseWheel,
|
|
10004
10013
|
onContextMenu
|
|
10005
10014
|
});
|
|
10006
10015
|
|
|
@@ -10011,6 +10020,7 @@ class AngleMeasurement extends Component {
|
|
|
10011
10020
|
zIndex: plugin.zIndex + 2,
|
|
10012
10021
|
onMouseOver,
|
|
10013
10022
|
onMouseLeave,
|
|
10023
|
+
onMouseWheel,
|
|
10014
10024
|
onContextMenu
|
|
10015
10025
|
});
|
|
10016
10026
|
|
|
@@ -99254,9 +99264,6 @@ class KeyboardPanRotateDollyHandler {
|
|
|
99254
99264
|
if (!(configs.active && configs.pointerEnabled) || (!scene.input.keyboardEnabled)) {
|
|
99255
99265
|
return;
|
|
99256
99266
|
}
|
|
99257
|
-
if (!states.mouseover) {
|
|
99258
|
-
return;
|
|
99259
|
-
}
|
|
99260
99267
|
keyDownMap[keyCode] = false;
|
|
99261
99268
|
|
|
99262
99269
|
if (keyCode === input.KEY_SHIFT) {
|
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -9961,11 +9961,16 @@ class AngleMeasurement extends Component {
|
|
|
9961
9961
|
cfg.onContextMenu(event, this);
|
|
9962
9962
|
} : null;
|
|
9963
9963
|
|
|
9964
|
+
const onMouseWheel = (event) => {
|
|
9965
|
+
this.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent('wheel', event));
|
|
9966
|
+
};
|
|
9967
|
+
|
|
9964
9968
|
this._originDot = new Dot(this._container, {
|
|
9965
9969
|
fillColor: this._color,
|
|
9966
9970
|
zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined,
|
|
9967
9971
|
onMouseOver,
|
|
9968
9972
|
onMouseLeave,
|
|
9973
|
+
onMouseWheel,
|
|
9969
9974
|
onContextMenu
|
|
9970
9975
|
});
|
|
9971
9976
|
this._cornerDot = new Dot(this._container, {
|
|
@@ -9973,6 +9978,7 @@ class AngleMeasurement extends Component {
|
|
|
9973
9978
|
zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined,
|
|
9974
9979
|
onMouseOver,
|
|
9975
9980
|
onMouseLeave,
|
|
9981
|
+
onMouseWheel,
|
|
9976
9982
|
onContextMenu
|
|
9977
9983
|
});
|
|
9978
9984
|
this._targetDot = new Dot(this._container, {
|
|
@@ -9980,6 +9986,7 @@ class AngleMeasurement extends Component {
|
|
|
9980
9986
|
zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined,
|
|
9981
9987
|
onMouseOver,
|
|
9982
9988
|
onMouseLeave,
|
|
9989
|
+
onMouseWheel,
|
|
9983
9990
|
onContextMenu
|
|
9984
9991
|
});
|
|
9985
9992
|
|
|
@@ -9989,6 +9996,7 @@ class AngleMeasurement extends Component {
|
|
|
9989
9996
|
zIndex: plugin.zIndex,
|
|
9990
9997
|
onMouseOver,
|
|
9991
9998
|
onMouseLeave,
|
|
9999
|
+
onMouseWheel,
|
|
9992
10000
|
onContextMenu
|
|
9993
10001
|
});
|
|
9994
10002
|
this._targetWire = new Wire(this._container, {
|
|
@@ -9997,6 +10005,7 @@ class AngleMeasurement extends Component {
|
|
|
9997
10005
|
zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined,
|
|
9998
10006
|
onMouseOver,
|
|
9999
10007
|
onMouseLeave,
|
|
10008
|
+
onMouseWheel,
|
|
10000
10009
|
onContextMenu
|
|
10001
10010
|
});
|
|
10002
10011
|
|
|
@@ -10007,6 +10016,7 @@ class AngleMeasurement extends Component {
|
|
|
10007
10016
|
zIndex: plugin.zIndex + 2,
|
|
10008
10017
|
onMouseOver,
|
|
10009
10018
|
onMouseLeave,
|
|
10019
|
+
onMouseWheel,
|
|
10010
10020
|
onContextMenu
|
|
10011
10021
|
});
|
|
10012
10022
|
|
|
@@ -99250,9 +99260,6 @@ class KeyboardPanRotateDollyHandler {
|
|
|
99250
99260
|
if (!(configs.active && configs.pointerEnabled) || (!scene.input.keyboardEnabled)) {
|
|
99251
99261
|
return;
|
|
99252
99262
|
}
|
|
99253
|
-
if (!states.mouseover) {
|
|
99254
|
-
return;
|
|
99255
|
-
}
|
|
99256
99263
|
keyDownMap[keyCode] = false;
|
|
99257
99264
|
|
|
99258
99265
|
if (keyCode === input.KEY_SHIFT) {
|
package/dist/xeokit-sdk.es5.js
CHANGED
|
@@ -2414,7 +2414,7 @@ wireClickableStyle['-webkit-transform-origin']="0 0";wireClickableStyle['-moz-tr
|
|
|
2414
2414
|
*/function AngleMeasurement(plugin){var _this11;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,AngleMeasurement);_this11=_super2.call(this,plugin.viewer.scene,cfg);/**
|
|
2415
2415
|
* The {@link AngleMeasurementsPlugin} that owns this AngleMeasurement.
|
|
2416
2416
|
* @type {AngleMeasurementsPlugin}
|
|
2417
|
-
*/_this11.plugin=plugin;_this11._container=cfg.container;if(!_this11._container){throw"config missing: container";}_this11._color=cfg.color||plugin.defaultColor;var scene=_this11.plugin.viewer.scene;_this11._originMarker=new Marker(scene,cfg.origin);_this11._cornerMarker=new Marker(scene,cfg.corner);_this11._targetMarker=new Marker(scene,cfg.target);_this11._originWorld=math.vec3();_this11._cornerWorld=math.vec3();_this11._targetWorld=math.vec3();_this11._wp=new Float64Array(12);_this11._vp=new Float64Array(12);_this11._pp=new Float64Array(12);_this11._cp=new Int16Array(6);var onMouseOver=cfg.onMouseOver?function(event){cfg.onMouseOver(event,_assertThisInitialized(_this11));}:null;var onMouseLeave=cfg.onMouseLeave?function(event){cfg.onMouseLeave(event,_assertThisInitialized(_this11));}:null;var onContextMenu=cfg.onContextMenu?function(event){cfg.onContextMenu(event,_assertThisInitialized(_this11));}:null;_this11._originDot=new Dot(_this11._container,{fillColor:_this11._color,zIndex:plugin.zIndex!==undefined?plugin.zIndex+2:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this11._cornerDot=new Dot(_this11._container,{fillColor:_this11._color,zIndex:plugin.zIndex!==undefined?plugin.zIndex+2:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this11._targetDot=new Dot(_this11._container,{fillColor:_this11._color,zIndex:plugin.zIndex!==undefined?plugin.zIndex+2:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this11._originWire=new Wire(_this11._container,{color:_this11._color||"blue",thickness:1,zIndex:plugin.zIndex,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this11._targetWire=new Wire(_this11._container,{color:_this11._color||"red",thickness:1,zIndex:plugin.zIndex!==undefined?plugin.zIndex+1:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this11._angleLabel=new Label(_this11._container,{fillColor:_this11._color||"#00BBFF",prefix:"",text:"",zIndex:plugin.zIndex+2,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this11._wpDirty=false;_this11._vpDirty=false;_this11._cpDirty=false;_this11._visible=false;_this11._originVisible=false;_this11._cornerVisible=false;_this11._targetVisible=false;_this11._originWireVisible=false;_this11._targetWireVisible=false;_this11._angleVisible=false;_this11._labelsVisible=false;_this11._clickable=false;_this11._originMarker.on("worldPos",function(value){_this11._originWorld.set(value||[0,0,0]);_this11._wpDirty=true;_this11._needUpdate(0);// No lag
|
|
2417
|
+
*/_this11.plugin=plugin;_this11._container=cfg.container;if(!_this11._container){throw"config missing: container";}_this11._color=cfg.color||plugin.defaultColor;var scene=_this11.plugin.viewer.scene;_this11._originMarker=new Marker(scene,cfg.origin);_this11._cornerMarker=new Marker(scene,cfg.corner);_this11._targetMarker=new Marker(scene,cfg.target);_this11._originWorld=math.vec3();_this11._cornerWorld=math.vec3();_this11._targetWorld=math.vec3();_this11._wp=new Float64Array(12);_this11._vp=new Float64Array(12);_this11._pp=new Float64Array(12);_this11._cp=new Int16Array(6);var onMouseOver=cfg.onMouseOver?function(event){cfg.onMouseOver(event,_assertThisInitialized(_this11));}:null;var onMouseLeave=cfg.onMouseLeave?function(event){cfg.onMouseLeave(event,_assertThisInitialized(_this11));}:null;var onContextMenu=cfg.onContextMenu?function(event){cfg.onContextMenu(event,_assertThisInitialized(_this11));}:null;var onMouseWheel=function onMouseWheel(event){_this11.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent('wheel',event));};_this11._originDot=new Dot(_this11._container,{fillColor:_this11._color,zIndex:plugin.zIndex!==undefined?plugin.zIndex+2:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this11._cornerDot=new Dot(_this11._container,{fillColor:_this11._color,zIndex:plugin.zIndex!==undefined?plugin.zIndex+2:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this11._targetDot=new Dot(_this11._container,{fillColor:_this11._color,zIndex:plugin.zIndex!==undefined?plugin.zIndex+2:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this11._originWire=new Wire(_this11._container,{color:_this11._color||"blue",thickness:1,zIndex:plugin.zIndex,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this11._targetWire=new Wire(_this11._container,{color:_this11._color||"red",thickness:1,zIndex:plugin.zIndex!==undefined?plugin.zIndex+1:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this11._angleLabel=new Label(_this11._container,{fillColor:_this11._color||"#00BBFF",prefix:"",text:"",zIndex:plugin.zIndex+2,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this11._wpDirty=false;_this11._vpDirty=false;_this11._cpDirty=false;_this11._visible=false;_this11._originVisible=false;_this11._cornerVisible=false;_this11._targetVisible=false;_this11._originWireVisible=false;_this11._targetWireVisible=false;_this11._angleVisible=false;_this11._labelsVisible=false;_this11._clickable=false;_this11._originMarker.on("worldPos",function(value){_this11._originWorld.set(value||[0,0,0]);_this11._wpDirty=true;_this11._needUpdate(0);// No lag
|
|
2418
2418
|
});_this11._cornerMarker.on("worldPos",function(value){_this11._cornerWorld.set(value||[0,0,0]);_this11._wpDirty=true;_this11._needUpdate(0);// No lag
|
|
2419
2419
|
});_this11._targetMarker.on("worldPos",function(value){_this11._targetWorld.set(value||[0,0,0]);_this11._wpDirty=true;_this11._needUpdate(0);// No lag
|
|
2420
2420
|
});_this11._onViewMatrix=scene.camera.on("viewMatrix",function(){_this11._vpDirty=true;_this11._needUpdate(0);// No lag
|
|
@@ -21911,7 +21911,7 @@ if(pickedSubs||pickedNothingSubs||pickedSurfaceSubs){pickController.pickCursorPo
|
|
|
21911
21911
|
pickController.pickCursorPos=states.pointerCanvasPos;pickController.schedulePickEntity=configs.doublePickFlyTo;pickController.schedulePickSurface=pickedSurfaceSubs;pickController.update();var firstClickPickResult=pickController.pickResult;var firstClickPickSurface=pickController.pickedSurface;_this93._timeout=setTimeout(function(){if(firstClickPickResult){cameraControl.fire("picked",firstClickPickResult,true);if(firstClickPickSurface){cameraControl.fire("pickedSurface",firstClickPickResult,true);if(!configs.firstPerson&&configs.followPointer){controllers.pivotController.setPivotPos(firstClickPickResult.worldPos);if(controllers.pivotController.startPivot()){controllers.pivotController.showPivot();}}}}else{cameraControl.fire("pickedNothing",{canvasPos:states.pointerCanvasPos},true);}_this93._clicks=0;},configs.doubleClickTimeFrame);}else{// Second click
|
|
21912
21912
|
if(_this93._timeout!==null){window.clearTimeout(_this93._timeout);_this93._timeout=null;}pickController.pickCursorPos=states.pointerCanvasPos;pickController.schedulePickEntity=configs.doublePickFlyTo||doublePickedSubs||doublePickedSurfaceSubs;pickController.schedulePickSurface=pickController.schedulePickEntity&&doublePickedSurfaceSubs;pickController.update();if(pickController.pickResult){cameraControl.fire("doublePicked",pickController.pickResult,true);if(pickController.pickedSurface){cameraControl.fire("doublePickedSurface",pickController.pickResult,true);}if(configs.doublePickFlyTo){flyCameraTo(pickController.pickResult);if(!configs.firstPerson&&configs.followPointer){var pickedEntityAABB=pickController.pickResult.entity.aabb;var pickedEntityCenterPos=math.getAABB3Center(pickedEntityAABB);controllers.pivotController.setPivotPos(pickedEntityCenterPos);if(controllers.pivotController.startPivot()){controllers.pivotController.showPivot();}}}}else{cameraControl.fire("doublePickedNothing",{canvasPos:states.pointerCanvasPos},true);if(configs.doublePickFlyTo){flyCameraTo();if(!configs.firstPerson&&configs.followPointer){var sceneAABB=scene.aabb;var sceneCenterPos=math.getAABB3Center(sceneAABB);controllers.pivotController.setPivotPos(sceneCenterPos);if(controllers.pivotController.startPivot()){controllers.pivotController.showPivot();}}}}_this93._clicks=0;}},false);}_createClass(MousePickHandler,[{key:"reset",value:function reset(){this._clicks=0;this._lastPickedEntityId=null;if(this._timeout){window.clearTimeout(this._timeout);this._timeout=null;}}},{key:"destroy",value:function destroy(){var canvas=this._scene.canvas.canvas;canvas.removeEventListener("mousemove",this._canvasMouseMoveHandler);canvas.removeEventListener("mousedown",this._canvasMouseDownHandler);document.removeEventListener("mouseup",this._documentMouseUpHandler);canvas.removeEventListener("mouseup",this._canvasMouseUpHandler);if(this._timeout){window.clearTimeout(this._timeout);this._timeout=null;}}}]);return MousePickHandler;}();/**
|
|
21913
21913
|
* @private
|
|
21914
|
-
*/var KeyboardPanRotateDollyHandler=/*#__PURE__*/function(){function KeyboardPanRotateDollyHandler(scene,controllers,configs,states,updates){_classCallCheck(this,KeyboardPanRotateDollyHandler);this._scene=scene;var input=scene.input;var keyDownMap=[];var canvas=scene.canvas.canvas;var mouseMovedSinceLastKeyboardDolly=true;this._onSceneMouseMove=input.on("mousemove",function(){mouseMovedSinceLastKeyboardDolly=true;});this._onSceneKeyDown=input.on("keydown",function(keyCode){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}if(!states.mouseover){return;}keyDownMap[keyCode]=true;if(keyCode===input.KEY_SHIFT){canvas.style.cursor="move";}});this._onSceneKeyUp=input.on("keyup",function(keyCode){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}
|
|
21914
|
+
*/var KeyboardPanRotateDollyHandler=/*#__PURE__*/function(){function KeyboardPanRotateDollyHandler(scene,controllers,configs,states,updates){_classCallCheck(this,KeyboardPanRotateDollyHandler);this._scene=scene;var input=scene.input;var keyDownMap=[];var canvas=scene.canvas.canvas;var mouseMovedSinceLastKeyboardDolly=true;this._onSceneMouseMove=input.on("mousemove",function(){mouseMovedSinceLastKeyboardDolly=true;});this._onSceneKeyDown=input.on("keydown",function(keyCode){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}if(!states.mouseover){return;}keyDownMap[keyCode]=true;if(keyCode===input.KEY_SHIFT){canvas.style.cursor="move";}});this._onSceneKeyUp=input.on("keyup",function(keyCode){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}keyDownMap[keyCode]=false;if(keyCode===input.KEY_SHIFT){canvas.style.cursor=null;}});this._onTick=scene.on("tick",function(e){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}if(!states.mouseover){return;}var cameraControl=controllers.cameraControl;var elapsedSecs=e.deltaTime/1000.0;//-------------------------------------------------------------------------------------------------
|
|
21915
21915
|
// Keyboard rotation
|
|
21916
21916
|
//-------------------------------------------------------------------------------------------------
|
|
21917
21917
|
if(!configs.planView){var rotateYPos=cameraControl._isKeyDownForAction(cameraControl.ROTATE_Y_POS,keyDownMap);var rotateYNeg=cameraControl._isKeyDownForAction(cameraControl.ROTATE_Y_NEG,keyDownMap);var rotateXPos=cameraControl._isKeyDownForAction(cameraControl.ROTATE_X_POS,keyDownMap);var rotateXNeg=cameraControl._isKeyDownForAction(cameraControl.ROTATE_X_NEG,keyDownMap);var orbitDelta=elapsedSecs*configs.keyboardRotationRate;if(rotateYPos||rotateYNeg||rotateXPos||rotateXNeg){if(!configs.firstPerson&&configs.followPointer){controllers.pivotController.startPivot();}if(rotateYPos){updates.rotateDeltaY+=orbitDelta;}else if(rotateYNeg){updates.rotateDeltaY-=orbitDelta;}if(rotateXPos){updates.rotateDeltaX+=orbitDelta;}else if(rotateXNeg){updates.rotateDeltaX-=orbitDelta;}if(!configs.firstPerson&&configs.followPointer){controllers.pivotController.startPivot();}}}//-------------------------------------------------------------------------------------------------
|