@xeokit/xeokit-sdk 2.3.0-beta-2 → 2.3.0-beta-5
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 +94 -51
- package/dist/xeokit-sdk.es.js +94 -51
- package/dist/xeokit-sdk.min.cjs.js +1 -1
- package/dist/xeokit-sdk.min.es.js +1 -1
- package/package.json +1 -1
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -8811,7 +8811,8 @@ const createRTCViewMat = (function () {
|
|
|
8811
8811
|
const rtcCenterWorld = new Float64Array(4);
|
|
8812
8812
|
const rtcCenterView = new Float64Array(4);
|
|
8813
8813
|
|
|
8814
|
-
return function (viewMat, rtcCenter, rtcViewMat
|
|
8814
|
+
return function (viewMat, rtcCenter, rtcViewMat) {
|
|
8815
|
+
rtcViewMat = rtcViewMat || tempMat;
|
|
8815
8816
|
rtcCenterWorld[0] = rtcCenter[0];
|
|
8816
8817
|
rtcCenterWorld[1] = rtcCenter[1];
|
|
8817
8818
|
rtcCenterWorld[2] = rtcCenter[2];
|
|
@@ -98887,10 +98888,8 @@ const ParserV9 = {
|
|
|
98887
98888
|
};
|
|
98888
98889
|
|
|
98889
98890
|
/*
|
|
98890
|
-
|
|
98891
98891
|
Parser for .XKT Format V10
|
|
98892
|
-
|
|
98893
|
-
*/
|
|
98892
|
+
*/
|
|
98894
98893
|
|
|
98895
98894
|
let pako = window.pako || p;
|
|
98896
98895
|
if (!pako.inflate) { // See https://github.com/nodeca/pako/issues/97
|
|
@@ -98906,30 +98905,31 @@ function extract(elements) {
|
|
|
98906
98905
|
metadata: elements[0],
|
|
98907
98906
|
textureData: elements[1],
|
|
98908
98907
|
eachTextureDataPortion: elements[2],
|
|
98909
|
-
|
|
98910
|
-
|
|
98911
|
-
|
|
98912
|
-
|
|
98913
|
-
|
|
98914
|
-
|
|
98915
|
-
|
|
98916
|
-
|
|
98917
|
-
|
|
98918
|
-
|
|
98919
|
-
|
|
98920
|
-
|
|
98921
|
-
|
|
98922
|
-
|
|
98923
|
-
|
|
98924
|
-
|
|
98925
|
-
|
|
98926
|
-
|
|
98927
|
-
|
|
98928
|
-
|
|
98929
|
-
|
|
98930
|
-
|
|
98931
|
-
|
|
98932
|
-
|
|
98908
|
+
eachTextureDimensions: elements[3],
|
|
98909
|
+
positions: elements[4],
|
|
98910
|
+
normals: elements[5],
|
|
98911
|
+
colors: elements[6],
|
|
98912
|
+
uvs: elements[7],
|
|
98913
|
+
indices: elements[8],
|
|
98914
|
+
edgeIndices: elements[9],
|
|
98915
|
+
eachTextureSetTextures: elements[10],
|
|
98916
|
+
matrices: elements[11],
|
|
98917
|
+
reusedGeometriesDecodeMatrix: elements[12],
|
|
98918
|
+
eachGeometryPrimitiveType: elements[13],
|
|
98919
|
+
eachGeometryPositionsPortion: elements[14],
|
|
98920
|
+
eachGeometryNormalsPortion: elements[15],
|
|
98921
|
+
eachGeometryColorsPortion: elements[16],
|
|
98922
|
+
eachGeometryUVsPortion: elements[17],
|
|
98923
|
+
eachGeometryIndicesPortion: elements[18],
|
|
98924
|
+
eachGeometryEdgeIndicesPortion: elements[19],
|
|
98925
|
+
eachMeshGeometriesPortion: elements[20],
|
|
98926
|
+
eachMeshMatricesPortion: elements[21],
|
|
98927
|
+
eachMeshTextureSet: elements[22],
|
|
98928
|
+
eachMeshMaterialAttributes: elements[23],
|
|
98929
|
+
eachEntityId: elements[24],
|
|
98930
|
+
eachEntityMeshesPortion: elements[25],
|
|
98931
|
+
eachTileAABB: elements[26],
|
|
98932
|
+
eachTileEntitiesPortion: elements[27]
|
|
98933
98933
|
};
|
|
98934
98934
|
}
|
|
98935
98935
|
|
|
@@ -98941,8 +98941,9 @@ function inflate(deflatedData) {
|
|
|
98941
98941
|
|
|
98942
98942
|
return {
|
|
98943
98943
|
metadata: JSON.parse(pako.inflate(deflatedData.metadata, {to: 'string'})),
|
|
98944
|
-
textureData: new
|
|
98944
|
+
textureData: new Uint8ClampedArray(inflate(deflatedData.textureData)),
|
|
98945
98945
|
eachTextureDataPortion: new Uint32Array(inflate(deflatedData.eachTextureDataPortion)),
|
|
98946
|
+
eachTextureDimensions: new Uint16Array(inflate(deflatedData.eachTextureDimensions)),
|
|
98946
98947
|
positions: new Uint16Array(inflate(deflatedData.positions)),
|
|
98947
98948
|
normals: new Int8Array(inflate(deflatedData.normals)),
|
|
98948
98949
|
colors: new Uint8Array(inflate(deflatedData.colors)),
|
|
@@ -98980,11 +98981,23 @@ const decompressColor = (function () {
|
|
|
98980
98981
|
};
|
|
98981
98982
|
})();
|
|
98982
98983
|
|
|
98984
|
+
const imagDataToImage = (function () {
|
|
98985
|
+
const canvas = document.createElement('canvas');
|
|
98986
|
+
const context = canvas.getContext('2d');
|
|
98987
|
+
return function (imagedata) {
|
|
98988
|
+
canvas.width = imagedata.width;
|
|
98989
|
+
canvas.height = imagedata.height;
|
|
98990
|
+
context.putImageData(imagedata, 0, 0);
|
|
98991
|
+
return canvas.toDataURL();
|
|
98992
|
+
};
|
|
98993
|
+
})();
|
|
98994
|
+
|
|
98983
98995
|
function load(viewer, options, inflatedData, performanceModel) {
|
|
98984
98996
|
|
|
98985
98997
|
const metadata = inflatedData.metadata;
|
|
98986
98998
|
const textureData = inflatedData.textureData;
|
|
98987
98999
|
const eachTextureDataPortion = inflatedData.eachTextureDataPortion;
|
|
99000
|
+
const eachTextureDimensions = inflatedData.eachTextureDimensions;
|
|
98988
99001
|
const positions = inflatedData.positions;
|
|
98989
99002
|
const normals = inflatedData.normals;
|
|
98990
99003
|
const colors = inflatedData.colors;
|
|
@@ -99041,16 +99054,23 @@ function load(viewer, options, inflatedData, performanceModel) {
|
|
|
99041
99054
|
for (let textureIndex = 0; textureIndex < numTextures; textureIndex++) {
|
|
99042
99055
|
const atLastTexture = (textureIndex === (numTextures - 1));
|
|
99043
99056
|
const textureDataPortionStart = eachTextureDataPortion[textureIndex];
|
|
99044
|
-
const textureDataPortionEnd = atLastTexture ? textureData.length : (eachTextureDataPortion[textureIndex + 1]
|
|
99057
|
+
const textureDataPortionEnd = atLastTexture ? textureData.length : (eachTextureDataPortion[textureIndex + 1]);
|
|
99045
99058
|
const textureDataPortionSize = textureDataPortionEnd - textureDataPortionStart;
|
|
99046
99059
|
const textureDataPortionExists = (textureDataPortionSize > 0);
|
|
99047
99060
|
if (textureDataPortionExists) {
|
|
99048
|
-
const
|
|
99049
|
-
const
|
|
99061
|
+
const imageDataSubarray = textureData.subarray(textureDataPortionStart, textureDataPortionEnd);
|
|
99062
|
+
const width = eachTextureDimensions[textureIndex * 2 + 0];
|
|
99063
|
+
const height = eachTextureDimensions[textureIndex * 2 + 1];
|
|
99064
|
+
const imageData = new ImageData(imageDataSubarray, width, height);
|
|
99065
|
+
|
|
99066
|
+
//////////////////////////////////////////////////////////////
|
|
99067
|
+
// TODO: This is super inefficient - replace with Basis:
|
|
99068
|
+
//////////////////////////////////////////////////////////////
|
|
99069
|
+
|
|
99070
|
+
const image = imagDataToImage(imageData);
|
|
99050
99071
|
performanceModel.createTexture({
|
|
99051
99072
|
id: `texture-${textureIndex}`,
|
|
99052
|
-
src:
|
|
99053
|
-
// flipY: true
|
|
99073
|
+
src: image
|
|
99054
99074
|
});
|
|
99055
99075
|
}
|
|
99056
99076
|
}
|
|
@@ -99197,15 +99217,10 @@ function load(viewer, options, inflatedData, performanceModel) {
|
|
|
99197
99217
|
const textureSetId = (textureSetIndex >= 0) ? `textureSet-${textureSetIndex}` : null;
|
|
99198
99218
|
|
|
99199
99219
|
const meshColor = decompressColor(eachMeshMaterialAttributes.subarray((meshIndex * 6), (meshIndex * 6) + 3));
|
|
99200
|
-
|
|
99220
|
+
const meshOpacity = eachMeshMaterialAttributes[(meshIndex * 6) + 3] / 255.0;
|
|
99201
99221
|
const meshMetallic = eachMeshMaterialAttributes[(meshIndex * 6) + 4] / 255.0;
|
|
99202
99222
|
const meshRoughness = eachMeshMaterialAttributes[(meshIndex * 6) + 5] / 255.0;
|
|
99203
99223
|
|
|
99204
|
-
// const meshColor = [.3, .3, .3];
|
|
99205
|
-
const meshOpacity = 1;
|
|
99206
|
-
// const meshMetallic = 0;
|
|
99207
|
-
// const meshRoughness = 1;
|
|
99208
|
-
|
|
99209
99224
|
const meshId = nextMeshId++;
|
|
99210
99225
|
|
|
99211
99226
|
if (isReusedGeometry) {
|
|
@@ -153870,23 +153885,26 @@ class MousePickHandler {
|
|
|
153870
153885
|
|
|
153871
153886
|
if (this._clicks === 1) { // First click
|
|
153872
153887
|
|
|
153873
|
-
|
|
153888
|
+
pickController.pickCursorPos = states.pointerCanvasPos;
|
|
153889
|
+
pickController.schedulePickEntity = configs.doublePickFlyTo;
|
|
153890
|
+
pickController.schedulePickSurface = pickedSurfaceSubs;
|
|
153891
|
+
pickController.update();
|
|
153874
153892
|
|
|
153875
|
-
|
|
153876
|
-
|
|
153877
|
-
pickController.schedulePickSurface = pickedSurfaceSubs;
|
|
153878
|
-
pickController.update();
|
|
153893
|
+
const firstClickPickResult = pickController.pickResult;
|
|
153894
|
+
const firstClickPickSurface = pickController.pickedSurface;
|
|
153879
153895
|
|
|
153880
|
-
|
|
153896
|
+
this._timeout = setTimeout(() => {
|
|
153881
153897
|
|
|
153882
|
-
|
|
153898
|
+
if (firstClickPickResult) {
|
|
153883
153899
|
|
|
153884
|
-
|
|
153900
|
+
cameraControl.fire("picked", firstClickPickResult, true);
|
|
153885
153901
|
|
|
153886
|
-
|
|
153902
|
+
if (firstClickPickSurface) {
|
|
153903
|
+
|
|
153904
|
+
cameraControl.fire("pickedSurface", firstClickPickResult, true);
|
|
153887
153905
|
|
|
153888
153906
|
if ((!configs.firstPerson) && configs.followPointer) {
|
|
153889
|
-
controllers.pivotController.setPivotPos(
|
|
153907
|
+
controllers.pivotController.setPivotPos(firstClickPickResult.worldPos);
|
|
153890
153908
|
if (controllers.pivotController.startPivot()) {
|
|
153891
153909
|
controllers.pivotController.showPivot();
|
|
153892
153910
|
}
|
|
@@ -153900,7 +153918,7 @@ class MousePickHandler {
|
|
|
153900
153918
|
|
|
153901
153919
|
this._clicks = 0;
|
|
153902
153920
|
|
|
153903
|
-
},
|
|
153921
|
+
}, configs.doubleClickTimeFrame);
|
|
153904
153922
|
|
|
153905
153923
|
} else { // Second click
|
|
153906
153924
|
|
|
@@ -155649,6 +155667,7 @@ class CameraControl extends Component {
|
|
|
155649
155667
|
pointerEnabled: true,
|
|
155650
155668
|
constrainVertical: false,
|
|
155651
155669
|
smartPivot: false,
|
|
155670
|
+
doubleClickTimeFrame: 250,
|
|
155652
155671
|
|
|
155653
155672
|
// Rotation
|
|
155654
155673
|
|
|
@@ -156612,6 +156631,30 @@ class CameraControl extends Component {
|
|
|
156612
156631
|
return this._configs.smartPivot;
|
|
156613
156632
|
}
|
|
156614
156633
|
|
|
156634
|
+
/**
|
|
156635
|
+
* Sets the double click time frame length in milliseconds.
|
|
156636
|
+
*
|
|
156637
|
+
* If two mouse click events occur within this time frame, it is considered a double click.
|
|
156638
|
+
*
|
|
156639
|
+
* Default is ````250````
|
|
156640
|
+
*
|
|
156641
|
+
* @param {Number} value New double click time frame.
|
|
156642
|
+
*/
|
|
156643
|
+
set doubleClickTimeFrame(value) {
|
|
156644
|
+
this._configs.doubleClickTimeFrame = (value !== undefined && value !== null) ? value : 250;
|
|
156645
|
+
}
|
|
156646
|
+
|
|
156647
|
+
/**
|
|
156648
|
+
* Gets the double click time frame length in milliseconds.
|
|
156649
|
+
*
|
|
156650
|
+
* Default is ````250````
|
|
156651
|
+
*
|
|
156652
|
+
* @param {Number} value Current double click time frame.
|
|
156653
|
+
*/
|
|
156654
|
+
get doubleClickTimeFrame() {
|
|
156655
|
+
return this._configs.doubleClickTimeFrame;
|
|
156656
|
+
}
|
|
156657
|
+
|
|
156615
156658
|
/**
|
|
156616
156659
|
* Destroys this ````CameraControl````.
|
|
156617
156660
|
* @private
|
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -8807,7 +8807,8 @@ const createRTCViewMat = (function () {
|
|
|
8807
8807
|
const rtcCenterWorld = new Float64Array(4);
|
|
8808
8808
|
const rtcCenterView = new Float64Array(4);
|
|
8809
8809
|
|
|
8810
|
-
return function (viewMat, rtcCenter, rtcViewMat
|
|
8810
|
+
return function (viewMat, rtcCenter, rtcViewMat) {
|
|
8811
|
+
rtcViewMat = rtcViewMat || tempMat;
|
|
8811
8812
|
rtcCenterWorld[0] = rtcCenter[0];
|
|
8812
8813
|
rtcCenterWorld[1] = rtcCenter[1];
|
|
8813
8814
|
rtcCenterWorld[2] = rtcCenter[2];
|
|
@@ -98883,10 +98884,8 @@ const ParserV9 = {
|
|
|
98883
98884
|
};
|
|
98884
98885
|
|
|
98885
98886
|
/*
|
|
98886
|
-
|
|
98887
98887
|
Parser for .XKT Format V10
|
|
98888
|
-
|
|
98889
|
-
*/
|
|
98888
|
+
*/
|
|
98890
98889
|
|
|
98891
98890
|
let pako = window.pako || p;
|
|
98892
98891
|
if (!pako.inflate) { // See https://github.com/nodeca/pako/issues/97
|
|
@@ -98902,30 +98901,31 @@ function extract(elements) {
|
|
|
98902
98901
|
metadata: elements[0],
|
|
98903
98902
|
textureData: elements[1],
|
|
98904
98903
|
eachTextureDataPortion: elements[2],
|
|
98905
|
-
|
|
98906
|
-
|
|
98907
|
-
|
|
98908
|
-
|
|
98909
|
-
|
|
98910
|
-
|
|
98911
|
-
|
|
98912
|
-
|
|
98913
|
-
|
|
98914
|
-
|
|
98915
|
-
|
|
98916
|
-
|
|
98917
|
-
|
|
98918
|
-
|
|
98919
|
-
|
|
98920
|
-
|
|
98921
|
-
|
|
98922
|
-
|
|
98923
|
-
|
|
98924
|
-
|
|
98925
|
-
|
|
98926
|
-
|
|
98927
|
-
|
|
98928
|
-
|
|
98904
|
+
eachTextureDimensions: elements[3],
|
|
98905
|
+
positions: elements[4],
|
|
98906
|
+
normals: elements[5],
|
|
98907
|
+
colors: elements[6],
|
|
98908
|
+
uvs: elements[7],
|
|
98909
|
+
indices: elements[8],
|
|
98910
|
+
edgeIndices: elements[9],
|
|
98911
|
+
eachTextureSetTextures: elements[10],
|
|
98912
|
+
matrices: elements[11],
|
|
98913
|
+
reusedGeometriesDecodeMatrix: elements[12],
|
|
98914
|
+
eachGeometryPrimitiveType: elements[13],
|
|
98915
|
+
eachGeometryPositionsPortion: elements[14],
|
|
98916
|
+
eachGeometryNormalsPortion: elements[15],
|
|
98917
|
+
eachGeometryColorsPortion: elements[16],
|
|
98918
|
+
eachGeometryUVsPortion: elements[17],
|
|
98919
|
+
eachGeometryIndicesPortion: elements[18],
|
|
98920
|
+
eachGeometryEdgeIndicesPortion: elements[19],
|
|
98921
|
+
eachMeshGeometriesPortion: elements[20],
|
|
98922
|
+
eachMeshMatricesPortion: elements[21],
|
|
98923
|
+
eachMeshTextureSet: elements[22],
|
|
98924
|
+
eachMeshMaterialAttributes: elements[23],
|
|
98925
|
+
eachEntityId: elements[24],
|
|
98926
|
+
eachEntityMeshesPortion: elements[25],
|
|
98927
|
+
eachTileAABB: elements[26],
|
|
98928
|
+
eachTileEntitiesPortion: elements[27]
|
|
98929
98929
|
};
|
|
98930
98930
|
}
|
|
98931
98931
|
|
|
@@ -98937,8 +98937,9 @@ function inflate(deflatedData) {
|
|
|
98937
98937
|
|
|
98938
98938
|
return {
|
|
98939
98939
|
metadata: JSON.parse(pako.inflate(deflatedData.metadata, {to: 'string'})),
|
|
98940
|
-
textureData: new
|
|
98940
|
+
textureData: new Uint8ClampedArray(inflate(deflatedData.textureData)),
|
|
98941
98941
|
eachTextureDataPortion: new Uint32Array(inflate(deflatedData.eachTextureDataPortion)),
|
|
98942
|
+
eachTextureDimensions: new Uint16Array(inflate(deflatedData.eachTextureDimensions)),
|
|
98942
98943
|
positions: new Uint16Array(inflate(deflatedData.positions)),
|
|
98943
98944
|
normals: new Int8Array(inflate(deflatedData.normals)),
|
|
98944
98945
|
colors: new Uint8Array(inflate(deflatedData.colors)),
|
|
@@ -98976,11 +98977,23 @@ const decompressColor = (function () {
|
|
|
98976
98977
|
};
|
|
98977
98978
|
})();
|
|
98978
98979
|
|
|
98980
|
+
const imagDataToImage = (function () {
|
|
98981
|
+
const canvas = document.createElement('canvas');
|
|
98982
|
+
const context = canvas.getContext('2d');
|
|
98983
|
+
return function (imagedata) {
|
|
98984
|
+
canvas.width = imagedata.width;
|
|
98985
|
+
canvas.height = imagedata.height;
|
|
98986
|
+
context.putImageData(imagedata, 0, 0);
|
|
98987
|
+
return canvas.toDataURL();
|
|
98988
|
+
};
|
|
98989
|
+
})();
|
|
98990
|
+
|
|
98979
98991
|
function load(viewer, options, inflatedData, performanceModel) {
|
|
98980
98992
|
|
|
98981
98993
|
const metadata = inflatedData.metadata;
|
|
98982
98994
|
const textureData = inflatedData.textureData;
|
|
98983
98995
|
const eachTextureDataPortion = inflatedData.eachTextureDataPortion;
|
|
98996
|
+
const eachTextureDimensions = inflatedData.eachTextureDimensions;
|
|
98984
98997
|
const positions = inflatedData.positions;
|
|
98985
98998
|
const normals = inflatedData.normals;
|
|
98986
98999
|
const colors = inflatedData.colors;
|
|
@@ -99037,16 +99050,23 @@ function load(viewer, options, inflatedData, performanceModel) {
|
|
|
99037
99050
|
for (let textureIndex = 0; textureIndex < numTextures; textureIndex++) {
|
|
99038
99051
|
const atLastTexture = (textureIndex === (numTextures - 1));
|
|
99039
99052
|
const textureDataPortionStart = eachTextureDataPortion[textureIndex];
|
|
99040
|
-
const textureDataPortionEnd = atLastTexture ? textureData.length : (eachTextureDataPortion[textureIndex + 1]
|
|
99053
|
+
const textureDataPortionEnd = atLastTexture ? textureData.length : (eachTextureDataPortion[textureIndex + 1]);
|
|
99041
99054
|
const textureDataPortionSize = textureDataPortionEnd - textureDataPortionStart;
|
|
99042
99055
|
const textureDataPortionExists = (textureDataPortionSize > 0);
|
|
99043
99056
|
if (textureDataPortionExists) {
|
|
99044
|
-
const
|
|
99045
|
-
const
|
|
99057
|
+
const imageDataSubarray = textureData.subarray(textureDataPortionStart, textureDataPortionEnd);
|
|
99058
|
+
const width = eachTextureDimensions[textureIndex * 2 + 0];
|
|
99059
|
+
const height = eachTextureDimensions[textureIndex * 2 + 1];
|
|
99060
|
+
const imageData = new ImageData(imageDataSubarray, width, height);
|
|
99061
|
+
|
|
99062
|
+
//////////////////////////////////////////////////////////////
|
|
99063
|
+
// TODO: This is super inefficient - replace with Basis:
|
|
99064
|
+
//////////////////////////////////////////////////////////////
|
|
99065
|
+
|
|
99066
|
+
const image = imagDataToImage(imageData);
|
|
99046
99067
|
performanceModel.createTexture({
|
|
99047
99068
|
id: `texture-${textureIndex}`,
|
|
99048
|
-
src:
|
|
99049
|
-
// flipY: true
|
|
99069
|
+
src: image
|
|
99050
99070
|
});
|
|
99051
99071
|
}
|
|
99052
99072
|
}
|
|
@@ -99193,15 +99213,10 @@ function load(viewer, options, inflatedData, performanceModel) {
|
|
|
99193
99213
|
const textureSetId = (textureSetIndex >= 0) ? `textureSet-${textureSetIndex}` : null;
|
|
99194
99214
|
|
|
99195
99215
|
const meshColor = decompressColor(eachMeshMaterialAttributes.subarray((meshIndex * 6), (meshIndex * 6) + 3));
|
|
99196
|
-
|
|
99216
|
+
const meshOpacity = eachMeshMaterialAttributes[(meshIndex * 6) + 3] / 255.0;
|
|
99197
99217
|
const meshMetallic = eachMeshMaterialAttributes[(meshIndex * 6) + 4] / 255.0;
|
|
99198
99218
|
const meshRoughness = eachMeshMaterialAttributes[(meshIndex * 6) + 5] / 255.0;
|
|
99199
99219
|
|
|
99200
|
-
// const meshColor = [.3, .3, .3];
|
|
99201
|
-
const meshOpacity = 1;
|
|
99202
|
-
// const meshMetallic = 0;
|
|
99203
|
-
// const meshRoughness = 1;
|
|
99204
|
-
|
|
99205
99220
|
const meshId = nextMeshId++;
|
|
99206
99221
|
|
|
99207
99222
|
if (isReusedGeometry) {
|
|
@@ -153866,23 +153881,26 @@ class MousePickHandler {
|
|
|
153866
153881
|
|
|
153867
153882
|
if (this._clicks === 1) { // First click
|
|
153868
153883
|
|
|
153869
|
-
|
|
153884
|
+
pickController.pickCursorPos = states.pointerCanvasPos;
|
|
153885
|
+
pickController.schedulePickEntity = configs.doublePickFlyTo;
|
|
153886
|
+
pickController.schedulePickSurface = pickedSurfaceSubs;
|
|
153887
|
+
pickController.update();
|
|
153870
153888
|
|
|
153871
|
-
|
|
153872
|
-
|
|
153873
|
-
pickController.schedulePickSurface = pickedSurfaceSubs;
|
|
153874
|
-
pickController.update();
|
|
153889
|
+
const firstClickPickResult = pickController.pickResult;
|
|
153890
|
+
const firstClickPickSurface = pickController.pickedSurface;
|
|
153875
153891
|
|
|
153876
|
-
|
|
153892
|
+
this._timeout = setTimeout(() => {
|
|
153877
153893
|
|
|
153878
|
-
|
|
153894
|
+
if (firstClickPickResult) {
|
|
153879
153895
|
|
|
153880
|
-
|
|
153896
|
+
cameraControl.fire("picked", firstClickPickResult, true);
|
|
153881
153897
|
|
|
153882
|
-
|
|
153898
|
+
if (firstClickPickSurface) {
|
|
153899
|
+
|
|
153900
|
+
cameraControl.fire("pickedSurface", firstClickPickResult, true);
|
|
153883
153901
|
|
|
153884
153902
|
if ((!configs.firstPerson) && configs.followPointer) {
|
|
153885
|
-
controllers.pivotController.setPivotPos(
|
|
153903
|
+
controllers.pivotController.setPivotPos(firstClickPickResult.worldPos);
|
|
153886
153904
|
if (controllers.pivotController.startPivot()) {
|
|
153887
153905
|
controllers.pivotController.showPivot();
|
|
153888
153906
|
}
|
|
@@ -153896,7 +153914,7 @@ class MousePickHandler {
|
|
|
153896
153914
|
|
|
153897
153915
|
this._clicks = 0;
|
|
153898
153916
|
|
|
153899
|
-
},
|
|
153917
|
+
}, configs.doubleClickTimeFrame);
|
|
153900
153918
|
|
|
153901
153919
|
} else { // Second click
|
|
153902
153920
|
|
|
@@ -155645,6 +155663,7 @@ class CameraControl extends Component {
|
|
|
155645
155663
|
pointerEnabled: true,
|
|
155646
155664
|
constrainVertical: false,
|
|
155647
155665
|
smartPivot: false,
|
|
155666
|
+
doubleClickTimeFrame: 250,
|
|
155648
155667
|
|
|
155649
155668
|
// Rotation
|
|
155650
155669
|
|
|
@@ -156608,6 +156627,30 @@ class CameraControl extends Component {
|
|
|
156608
156627
|
return this._configs.smartPivot;
|
|
156609
156628
|
}
|
|
156610
156629
|
|
|
156630
|
+
/**
|
|
156631
|
+
* Sets the double click time frame length in milliseconds.
|
|
156632
|
+
*
|
|
156633
|
+
* If two mouse click events occur within this time frame, it is considered a double click.
|
|
156634
|
+
*
|
|
156635
|
+
* Default is ````250````
|
|
156636
|
+
*
|
|
156637
|
+
* @param {Number} value New double click time frame.
|
|
156638
|
+
*/
|
|
156639
|
+
set doubleClickTimeFrame(value) {
|
|
156640
|
+
this._configs.doubleClickTimeFrame = (value !== undefined && value !== null) ? value : 250;
|
|
156641
|
+
}
|
|
156642
|
+
|
|
156643
|
+
/**
|
|
156644
|
+
* Gets the double click time frame length in milliseconds.
|
|
156645
|
+
*
|
|
156646
|
+
* Default is ````250````
|
|
156647
|
+
*
|
|
156648
|
+
* @param {Number} value Current double click time frame.
|
|
156649
|
+
*/
|
|
156650
|
+
get doubleClickTimeFrame() {
|
|
156651
|
+
return this._configs.doubleClickTimeFrame;
|
|
156652
|
+
}
|
|
156653
|
+
|
|
156611
156654
|
/**
|
|
156612
156655
|
* Destroys this ````CameraControl````.
|
|
156613
156656
|
* @private
|