Skip to content

Commit

Permalink
Rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Nov 27, 2023
1 parent 29de636 commit 224c829
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
8 changes: 8 additions & 0 deletions dist/xeokit-sdk.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -87491,13 +87491,16 @@ class PickController {

this._lastPickedEntityId = null;

this._lastHash = null;

this._needFireEvents = 0;
}

/**
* Immediately attempts a pick, if scheduled.
*/
update() {

if (!this._configs.pointerEnabled) {
return;
}
Expand All @@ -87506,6 +87509,11 @@ class PickController {
return;
}

const hash = `${~~this.pickCursorPos[0]}-${~~this.pickCursorPos[1]}-${this.scheduleSnapOrPick}-${this.schedulePickSurface}-${this.schedulePickEntity}`;
if (this._lastHash === hash) {
return;
}

this.picked = false;
this.pickedSurface = false;
this.snappedOrPicked = false;
Expand Down
8 changes: 8 additions & 0 deletions dist/xeokit-sdk.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -87487,13 +87487,16 @@ class PickController {

this._lastPickedEntityId = null;

this._lastHash = null;

this._needFireEvents = 0;
}

/**
* Immediately attempts a pick, if scheduled.
*/
update() {

if (!this._configs.pointerEnabled) {
return;
}
Expand All @@ -87502,6 +87505,11 @@ class PickController {
return;
}

const hash = `${~~this.pickCursorPos[0]}-${~~this.pickCursorPos[1]}-${this.scheduleSnapOrPick}-${this.schedulePickSurface}-${this.schedulePickEntity}`;
if (this._lastHash === hash) {
return;
}

this.picked = false;
this.pickedSurface = false;
this.snappedOrPicked = false;
Expand Down
4 changes: 2 additions & 2 deletions dist/xeokit-sdk.es5.js
Original file line number Diff line number Diff line change
Expand Up @@ -21285,9 +21285,9 @@ var eyeLookLen=math.lenVec3(math.subVec3(camera.look,camera.eye,math.vec3()));va
*/this.pickedSurface=false;/**
* Will hold the PickResult after after picking.
* @type {PickResult}
*/this.pickResult=null;this._lastPickedEntityId=null;this._needFireEvents=0;}/**
*/this.pickResult=null;this._lastPickedEntityId=null;this._lastHash=null;this._needFireEvents=0;}/**
* Immediately attempts a pick, if scheduled.
*/_createClass(PickController,[{key:"update",value:function update(){if(!this._configs.pointerEnabled){return;}if(!this.schedulePickEntity&&!this.schedulePickSurface){return;}this.picked=false;this.pickedSurface=false;this.snappedOrPicked=false;this.hoveredSnappedOrSurfaceOff=false;var hasHoverSurfaceSubs=this._cameraControl.hasSubs("hoverSurface");if(this.scheduleSnapOrPick){var snapPickResult=this._scene.pick({canvasPos:this.pickCursorPos,snapRadius:this._configs.snapRadius,snapToVertex:this._configs.snapToVertex,snapToEdge:this._configs.snapToEdge});if(snapPickResult&&(snapPickResult.snappedToEdge||snapPickResult.snappedToVertex)){this.snapPickResult=snapPickResult;this.snappedOrPicked=true;this._needFireEvents++;}else{this.schedulePickSurface=true;// Fallback
*/_createClass(PickController,[{key:"update",value:function update(){if(!this._configs.pointerEnabled){return;}if(!this.schedulePickEntity&&!this.schedulePickSurface){return;}var hash="".concat(~~this.pickCursorPos[0],"-").concat(~~this.pickCursorPos[1],"-").concat(this.scheduleSnapOrPick,"-").concat(this.schedulePickSurface,"-").concat(this.schedulePickEntity);if(this._lastHash===hash){return;}this.picked=false;this.pickedSurface=false;this.snappedOrPicked=false;this.hoveredSnappedOrSurfaceOff=false;var hasHoverSurfaceSubs=this._cameraControl.hasSubs("hoverSurface");if(this.scheduleSnapOrPick){var snapPickResult=this._scene.pick({canvasPos:this.pickCursorPos,snapRadius:this._configs.snapRadius,snapToVertex:this._configs.snapToVertex,snapToEdge:this._configs.snapToEdge});if(snapPickResult&&(snapPickResult.snappedToEdge||snapPickResult.snappedToVertex)){this.snapPickResult=snapPickResult;this.snappedOrPicked=true;this._needFireEvents++;}else{this.schedulePickSurface=true;// Fallback
this.snapPickResult=null;}}if(this.schedulePickSurface){if(this.pickResult&&this.pickResult.worldPos){var pickResultCanvasPos=this.pickResult.canvasPos;if(pickResultCanvasPos[0]===this.pickCursorPos[0]&&pickResultCanvasPos[1]===this.pickCursorPos[1]){this.picked=true;this.pickedSurface=true;this._needFireEvents+=hasHoverSurfaceSubs?1:0;this.schedulePickEntity=false;this.schedulePickSurface=false;if(this.scheduleSnapOrPick){this.snappedOrPicked=true;}else{this.hoveredSnappedOrSurfaceOff=true;}this.scheduleSnapOrPick=false;return;}}}if(this.schedulePickEntity){if(this.pickResult&&(this.pickResult.canvasPos||this.pickResult.snappedCanvasPos)){var _pickResultCanvasPos=this.pickResult.canvasPos||this.pickResult.snappedCanvasPos;if(_pickResultCanvasPos[0]===this.pickCursorPos[0]&&_pickResultCanvasPos[1]===this.pickCursorPos[1]){this.picked=true;this.pickedSurface=false;this.schedulePickEntity=false;this.schedulePickSurface=false;return;}}}if(this.schedulePickSurface||this.scheduleSnapOrPick&&!this.snapPickResult){this.pickResult=this._scene.pick({pickSurface:true,pickSurfaceNormal:false,canvasPos:this.pickCursorPos});if(this.pickResult){this.picked=true;if(this.scheduleSnapOrPick){this.snappedOrPicked=true;}else{this.pickedSurface=true;}this._needFireEvents++;}else if(this.scheduleSnapOrPick){this.hoveredSnappedOrSurfaceOff=true;this._needFireEvents++;}}else{// schedulePickEntity == true
this.pickResult=this._scene.pick({canvasPos:this.pickCursorPos});if(this.pickResult){this.picked=true;this.pickedSurface=false;this._needFireEvents++;}}this.scheduleSnapOrPick=false;this.schedulePickEntity=false;this.schedulePickSurface=false;}},{key:"fireEvents",value:function fireEvents(){if(this._needFireEvents===0){return;}if(this.hoveredSnappedOrSurfaceOff){this._cameraControl.fire("hoverSnapOrSurfaceOff",{canvasPos:this.pickCursorPos,pointerPos:this.pickCursorPos},true);}if(this.snappedOrPicked){if(this.snapPickResult){var pickResult=new PickResult();pickResult.snappedToVertex=this.snapPickResult.snappedToVertex;pickResult.snappedToEdge=this.snapPickResult.snappedToEdge;pickResult.worldPos=this.snapPickResult.worldPos;pickResult.canvasPos=this.pickCursorPos;pickResult.snappedCanvasPos=this.snapPickResult.snappedCanvasPos;this._cameraControl.fire("hoverSnapOrSurface",pickResult,true);this.snapPickResult=null;}else{this._cameraControl.fire("hoverSnapOrSurface",this.pickResult,true);}}if(this.picked&&this.pickResult&&(this.pickResult.entity||this.pickResult.worldPos)){if(this.pickResult.entity){var pickedEntityId=this.pickResult.entity.id;if(this._lastPickedEntityId!==pickedEntityId){if(this._lastPickedEntityId!==undefined){this._cameraControl.fire("hoverOut",{entity:this._scene.objects[this._lastPickedEntityId]},true);}this._cameraControl.fire("hoverEnter",this.pickResult,true);this._lastPickedEntityId=pickedEntityId;}}this._cameraControl.fire("hover",this.pickResult,true);if(this.pickResult.worldPos){this.pickedSurface=true;this._cameraControl.fire("hoverSurface",this.pickResult,true);}}else{if(this._lastPickedEntityId!==undefined){this._cameraControl.fire("hoverOut",{entity:this._scene.objects[this._lastPickedEntityId]},true);this._lastPickedEntityId=undefined;}this._cameraControl.fire("hoverOff",{canvasPos:this.pickCursorPos},true);}this.pickResult=null;this._needFireEvents=0;}}]);return PickController;}();/**
* @private
Expand Down
2 changes: 1 addition & 1 deletion dist/xeokit-sdk.min.cjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/xeokit-sdk.min.es.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/xeokit-sdk.min.es5.js

Large diffs are not rendered by default.

0 comments on commit 224c829

Please sign in to comment.