@xeokit/xeokit-sdk 2.6.19 → 2.6.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 +111 -90
- package/dist/xeokit-sdk.es.js +111 -90
- package/dist/xeokit-sdk.es5.js +338 -338
- package/dist/xeokit-sdk.min.cjs.js +2 -2
- package/dist/xeokit-sdk.min.es.js +2 -2
- package/dist/xeokit-sdk.min.es5.js +2 -2
- package/package.json +1 -1
- package/src/viewer/metadata/MetaModel.js +27 -4
- package/src/viewer/metadata/PropertySet.js +5 -1
- package/src/viewer/scene/scene/Scene.js +0 -2
- package/src/viewer/scene/webgl/Renderer.js +78 -83
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -18735,9 +18735,6 @@ const Renderer$1 = function (scene, options) {
|
|
|
18735
18735
|
let drawableTypeInfo = {};
|
|
18736
18736
|
let drawables = {};
|
|
18737
18737
|
|
|
18738
|
-
let postSortDrawableList = [];
|
|
18739
|
-
let postCullDrawableList = [];
|
|
18740
|
-
|
|
18741
18738
|
let drawableListDirty = true;
|
|
18742
18739
|
let stateSortDirty = true;
|
|
18743
18740
|
let imageDirty = true;
|
|
@@ -18963,38 +18960,28 @@ const Renderer$1 = function (scene, options) {
|
|
|
18963
18960
|
const drawableInfo = drawableTypeInfo[type];
|
|
18964
18961
|
if (drawableInfo.isStateSortable) {
|
|
18965
18962
|
drawableInfo.drawableListPreCull.sort(drawableInfo.stateSortCompare);
|
|
18966
|
-
|
|
18967
|
-
drawableInfo.drawableList = drawableInfo.drawableListPreCull;
|
|
18968
18963
|
}
|
|
18969
18964
|
}
|
|
18970
18965
|
}
|
|
18971
|
-
|
|
18966
|
+
}
|
|
18967
|
+
|
|
18968
|
+
function cullDrawableList() {
|
|
18972
18969
|
for (let type in drawableTypeInfo) {
|
|
18973
18970
|
if (drawableTypeInfo.hasOwnProperty(type)) {
|
|
18974
18971
|
const drawableInfo = drawableTypeInfo[type];
|
|
18975
18972
|
const drawableListPreCull = drawableInfo.drawableListPreCull;
|
|
18973
|
+
const drawableList = drawableInfo.drawableList;
|
|
18974
|
+
let lenDrawableList = 0;
|
|
18976
18975
|
for (let i = 0, len = drawableListPreCull.length; i < len; i++) {
|
|
18977
18976
|
const drawable = drawableListPreCull[i];
|
|
18978
|
-
|
|
18977
|
+
drawable.rebuildRenderFlags();
|
|
18978
|
+
if (!drawable.renderFlags.culled) {
|
|
18979
|
+
drawableList[lenDrawableList++] = drawable;
|
|
18980
|
+
}
|
|
18979
18981
|
}
|
|
18982
|
+
drawableList.length = lenDrawableList;
|
|
18980
18983
|
}
|
|
18981
18984
|
}
|
|
18982
|
-
postSortDrawableList.length = lenDrawableList;
|
|
18983
|
-
postSortDrawableList.sort((a, b) => {
|
|
18984
|
-
return a.renderOrder - b.renderOrder;
|
|
18985
|
-
});
|
|
18986
|
-
}
|
|
18987
|
-
|
|
18988
|
-
function cullDrawableList() {
|
|
18989
|
-
let lenDrawableList = 0;
|
|
18990
|
-
for (let i = 0, len = postSortDrawableList.length; i < len; i++) {
|
|
18991
|
-
const drawable = postSortDrawableList[i];
|
|
18992
|
-
drawable.rebuildRenderFlags();
|
|
18993
|
-
if (!drawable.renderFlags.culled) {
|
|
18994
|
-
postCullDrawableList[lenDrawableList++] = drawable;
|
|
18995
|
-
}
|
|
18996
|
-
}
|
|
18997
|
-
postCullDrawableList.length = lenDrawableList;
|
|
18998
18985
|
}
|
|
18999
18986
|
|
|
19000
18987
|
function draw(params) {
|
|
@@ -19227,6 +19214,7 @@ const Renderer$1 = function (scene, options) {
|
|
|
19227
19214
|
}
|
|
19228
19215
|
|
|
19229
19216
|
let i;
|
|
19217
|
+
let len;
|
|
19230
19218
|
let drawable;
|
|
19231
19219
|
|
|
19232
19220
|
const startTime = Date.now();
|
|
@@ -19259,85 +19247,93 @@ const Renderer$1 = function (scene, options) {
|
|
|
19259
19247
|
// Render normal opaque solids, defer others to bins to render after
|
|
19260
19248
|
//------------------------------------------------------------------------------------------------------
|
|
19261
19249
|
|
|
19262
|
-
for (let
|
|
19250
|
+
for (let type in drawableTypeInfo) {
|
|
19251
|
+
if (drawableTypeInfo.hasOwnProperty(type)) {
|
|
19263
19252
|
|
|
19264
|
-
|
|
19253
|
+
const drawableInfo = drawableTypeInfo[type];
|
|
19254
|
+
const drawableList = drawableInfo.drawableList;
|
|
19265
19255
|
|
|
19266
|
-
|
|
19267
|
-
continue;
|
|
19268
|
-
}
|
|
19256
|
+
for (i = 0, len = drawableList.length; i < len; i++) {
|
|
19269
19257
|
|
|
19270
|
-
|
|
19258
|
+
drawable = drawableList[i];
|
|
19271
19259
|
|
|
19272
|
-
|
|
19273
|
-
|
|
19274
|
-
|
|
19275
|
-
} else {
|
|
19276
|
-
drawable.drawColorOpaque(frameCtx);
|
|
19277
|
-
}
|
|
19278
|
-
}
|
|
19260
|
+
if (drawable.culled === true || drawable.visible === false) {
|
|
19261
|
+
continue;
|
|
19262
|
+
}
|
|
19279
19263
|
|
|
19280
|
-
|
|
19281
|
-
if (renderFlags.colorTransparent) {
|
|
19282
|
-
normalFillTransparentBin[normalFillTransparentBinLen++] = drawable;
|
|
19283
|
-
}
|
|
19284
|
-
}
|
|
19264
|
+
const renderFlags = drawable.renderFlags;
|
|
19285
19265
|
|
|
19286
|
-
|
|
19287
|
-
|
|
19288
|
-
|
|
19266
|
+
if (renderFlags.colorOpaque) {
|
|
19267
|
+
if (saoEnabled && saoPossible && drawable.saoEnabled) {
|
|
19268
|
+
normalDrawSAOBin[normalDrawSAOBinLen++] = drawable;
|
|
19269
|
+
} else {
|
|
19270
|
+
drawable.drawColorOpaque(frameCtx);
|
|
19271
|
+
}
|
|
19272
|
+
}
|
|
19289
19273
|
|
|
19290
|
-
|
|
19291
|
-
|
|
19292
|
-
|
|
19274
|
+
if (transparentEnabled) {
|
|
19275
|
+
if (renderFlags.colorTransparent) {
|
|
19276
|
+
normalFillTransparentBin[normalFillTransparentBinLen++] = drawable;
|
|
19277
|
+
}
|
|
19278
|
+
}
|
|
19293
19279
|
|
|
19294
|
-
|
|
19295
|
-
|
|
19296
|
-
|
|
19280
|
+
if (renderFlags.xrayedSilhouetteTransparent) {
|
|
19281
|
+
xrayedFillTransparentBin[xrayedFillTransparentBinLen++] = drawable;
|
|
19282
|
+
}
|
|
19297
19283
|
|
|
19298
|
-
|
|
19299
|
-
|
|
19300
|
-
|
|
19284
|
+
if (renderFlags.xrayedSilhouetteOpaque) {
|
|
19285
|
+
xrayedFillOpaqueBin[xrayedFillOpaqueBinLen++] = drawable;
|
|
19286
|
+
}
|
|
19301
19287
|
|
|
19302
|
-
|
|
19303
|
-
|
|
19304
|
-
|
|
19288
|
+
if (renderFlags.highlightedSilhouetteTransparent) {
|
|
19289
|
+
highlightedFillTransparentBin[highlightedFillTransparentBinLen++] = drawable;
|
|
19290
|
+
}
|
|
19305
19291
|
|
|
19306
|
-
|
|
19307
|
-
|
|
19308
|
-
|
|
19292
|
+
if (renderFlags.highlightedSilhouetteOpaque) {
|
|
19293
|
+
highlightedFillOpaqueBin[highlightedFillOpaqueBinLen++] = drawable;
|
|
19294
|
+
}
|
|
19309
19295
|
|
|
19310
|
-
|
|
19311
|
-
|
|
19312
|
-
|
|
19313
|
-
}
|
|
19296
|
+
if (renderFlags.selectedSilhouetteTransparent) {
|
|
19297
|
+
selectedFillTransparentBin[selectedFillTransparentBinLen++] = drawable;
|
|
19298
|
+
}
|
|
19314
19299
|
|
|
19315
|
-
|
|
19316
|
-
|
|
19317
|
-
|
|
19300
|
+
if (renderFlags.selectedSilhouetteOpaque) {
|
|
19301
|
+
selectedFillOpaqueBin[selectedFillOpaqueBinLen++] = drawable;
|
|
19302
|
+
}
|
|
19318
19303
|
|
|
19319
|
-
|
|
19320
|
-
|
|
19321
|
-
|
|
19304
|
+
if (drawable.edges && edgesEnabled) {
|
|
19305
|
+
if (renderFlags.edgesOpaque) {
|
|
19306
|
+
normalEdgesOpaqueBin[normalEdgesOpaqueBinLen++] = drawable;
|
|
19307
|
+
}
|
|
19322
19308
|
|
|
19323
|
-
|
|
19324
|
-
|
|
19325
|
-
|
|
19309
|
+
if (renderFlags.edgesTransparent) {
|
|
19310
|
+
normalEdgesTransparentBin[normalEdgesTransparentBinLen++] = drawable;
|
|
19311
|
+
}
|
|
19326
19312
|
|
|
19327
|
-
|
|
19328
|
-
|
|
19329
|
-
|
|
19313
|
+
if (renderFlags.selectedEdgesTransparent) {
|
|
19314
|
+
selectedEdgesTransparentBin[selectedEdgesTransparentBinLen++] = drawable;
|
|
19315
|
+
}
|
|
19330
19316
|
|
|
19331
|
-
|
|
19332
|
-
|
|
19333
|
-
|
|
19317
|
+
if (renderFlags.selectedEdgesOpaque) {
|
|
19318
|
+
selectedEdgesOpaqueBin[selectedEdgesOpaqueBinLen++] = drawable;
|
|
19319
|
+
}
|
|
19334
19320
|
|
|
19335
|
-
|
|
19336
|
-
|
|
19337
|
-
|
|
19321
|
+
if (renderFlags.xrayedEdgesTransparent) {
|
|
19322
|
+
xrayEdgesTransparentBin[xrayEdgesTransparentBinLen++] = drawable;
|
|
19323
|
+
}
|
|
19324
|
+
|
|
19325
|
+
if (renderFlags.xrayedEdgesOpaque) {
|
|
19326
|
+
xrayEdgesOpaqueBin[xrayEdgesOpaqueBinLen++] = drawable;
|
|
19327
|
+
}
|
|
19338
19328
|
|
|
19339
|
-
|
|
19340
|
-
|
|
19329
|
+
if (renderFlags.highlightedEdgesTransparent) {
|
|
19330
|
+
highlightedEdgesTransparentBin[highlightedEdgesTransparentBinLen++] = drawable;
|
|
19331
|
+
}
|
|
19332
|
+
|
|
19333
|
+
if (renderFlags.highlightedEdgesOpaque) {
|
|
19334
|
+
highlightedEdgesOpaqueBin[highlightedEdgesOpaqueBinLen++] = drawable;
|
|
19335
|
+
}
|
|
19336
|
+
}
|
|
19341
19337
|
}
|
|
19342
19338
|
}
|
|
19343
19339
|
}
|
|
@@ -31603,8 +31599,6 @@ class Scene extends Component {
|
|
|
31603
31599
|
* @param {Number[]} [params.origin] World-space ray origin when ray-picking. Ignored when canvasPos given.
|
|
31604
31600
|
* @param {Number[]} [params.direction] World-space ray direction when ray-picking. Also indicates the length of the ray. Ignored when canvasPos given.
|
|
31605
31601
|
* @param {Number[]} [params.matrix] 4x4 transformation matrix to define the World-space ray origin and direction, as an alternative to ````origin```` and ````direction````.
|
|
31606
|
-
* @param {String[]} [params.includeEntities] IDs of {@link Entity}s to restrict picking to. When given, ignores {@link Entity}s whose IDs are not in this list.
|
|
31607
|
-
* @param {String[]} [params.excludeEntities] IDs of {@link Entity}s to ignore. When given, will pick *through* these {@link Entity}s, as if they were not there.
|
|
31608
31602
|
* @param {Number} [params.snapRadius=30] The snap radius, in canvas pixels.
|
|
31609
31603
|
* @param {boolean} [params.snapToVertex=true] Whether to snap to vertex. Only works when `canvasPos` given.
|
|
31610
31604
|
* @param {boolean} [params.snapToEdge=true] Whether to snap to edge. Only works when `canvasPos` given.
|
|
@@ -99463,7 +99457,11 @@ class PropertySet {
|
|
|
99463
99457
|
const properties = params.properties;
|
|
99464
99458
|
for (let i = 0, len = properties.length; i < len; i++) {
|
|
99465
99459
|
const property = properties[i];
|
|
99466
|
-
|
|
99460
|
+
if (Number.isInteger(property)) { // Will decompress in MetaModel.finalize();
|
|
99461
|
+
this.properties.push(property);
|
|
99462
|
+
} else {
|
|
99463
|
+
this.properties.push(new Property(property.name, property.value, property.type, property.valueType, property.description));
|
|
99464
|
+
}
|
|
99467
99465
|
}
|
|
99468
99466
|
}
|
|
99469
99467
|
}
|
|
@@ -99827,6 +99825,8 @@ class MetaModel {
|
|
|
99827
99825
|
|
|
99828
99826
|
this.metaScene.metaModels[this.id] = this;
|
|
99829
99827
|
|
|
99828
|
+
this._propertyLookup = [];
|
|
99829
|
+
|
|
99830
99830
|
/**
|
|
99831
99831
|
* True when this MetaModel has been finalized.
|
|
99832
99832
|
* @type {boolean}
|
|
@@ -99841,7 +99841,7 @@ class MetaModel {
|
|
|
99841
99841
|
* @type {MetaObject|null}
|
|
99842
99842
|
*/
|
|
99843
99843
|
get rootMetaObject() {
|
|
99844
|
-
if (this.rootMetaObjects.length
|
|
99844
|
+
if (this.rootMetaObjects.length === 1) {
|
|
99845
99845
|
return this.rootMetaObjects[0];
|
|
99846
99846
|
}
|
|
99847
99847
|
return null;
|
|
@@ -99862,6 +99862,12 @@ class MetaModel {
|
|
|
99862
99862
|
const metaScene = this.metaScene;
|
|
99863
99863
|
const propertyLookup = metaModelData.properties;
|
|
99864
99864
|
|
|
99865
|
+
if (propertyLookup) {
|
|
99866
|
+
for (let i = 0, len = propertyLookup.length; i < len; i++) {
|
|
99867
|
+
this._propertyLookup.push(propertyLookup[i]);
|
|
99868
|
+
}
|
|
99869
|
+
}
|
|
99870
|
+
|
|
99865
99871
|
// Create global Property Sets
|
|
99866
99872
|
|
|
99867
99873
|
if (metaModelData.propertySets) {
|
|
@@ -99872,9 +99878,6 @@ class MetaModel {
|
|
|
99872
99878
|
}
|
|
99873
99879
|
let propertySet = metaScene.propertySets[propertySetData.id];
|
|
99874
99880
|
if (!propertySet) {
|
|
99875
|
-
if (propertyLookup) {
|
|
99876
|
-
this._decompressProperties(propertyLookup, propertySetData.properties);
|
|
99877
|
-
}
|
|
99878
99881
|
propertySet = new PropertySet({
|
|
99879
99882
|
id: propertySetData.id,
|
|
99880
99883
|
originalSystemId: propertySetData.originalSystemId || propertySetData.id,
|
|
@@ -99921,15 +99924,21 @@ class MetaModel {
|
|
|
99921
99924
|
}
|
|
99922
99925
|
|
|
99923
99926
|
_decompressProperties(propertyLookup, properties) {
|
|
99927
|
+
const propsNotFound = [];
|
|
99924
99928
|
for (let i = 0, len = properties.length; i < len; i++) {
|
|
99925
99929
|
const property = properties[i];
|
|
99926
99930
|
if (Number.isInteger(property)) {
|
|
99927
99931
|
const lookupProperty = propertyLookup[property];
|
|
99928
99932
|
if (lookupProperty) {
|
|
99929
99933
|
properties[i] = lookupProperty;
|
|
99934
|
+
} else {
|
|
99935
|
+
propsNotFound.push(property);
|
|
99930
99936
|
}
|
|
99931
99937
|
}
|
|
99932
99938
|
}
|
|
99939
|
+
if (propsNotFound.length > 0) {
|
|
99940
|
+
console.error(`[MetaModel._decompressProperties] Properties not found: ${propsNotFound}`);
|
|
99941
|
+
}
|
|
99933
99942
|
}
|
|
99934
99943
|
|
|
99935
99944
|
finalize() {
|
|
@@ -99997,6 +100006,18 @@ class MetaModel {
|
|
|
99997
100006
|
(metaScene.metaObjectsByType[type] || (metaScene.metaObjectsByType[type] = {}))[objectId] = metaObject;
|
|
99998
100007
|
}
|
|
99999
100008
|
|
|
100009
|
+
// Decompress properties
|
|
100010
|
+
|
|
100011
|
+
if (this.propertySets) {
|
|
100012
|
+
for (let i = 0, len = this.propertySets.length; i < len; i++) {
|
|
100013
|
+
const propertySet = this.propertySets[i];
|
|
100014
|
+
this._decompressProperties(this._propertyLookup, propertySet.properties);
|
|
100015
|
+
}
|
|
100016
|
+
}
|
|
100017
|
+
|
|
100018
|
+
|
|
100019
|
+
this._propertyLookup = [];
|
|
100020
|
+
|
|
100000
100021
|
this.finalized = true;
|
|
100001
100022
|
|
|
100002
100023
|
this.metaScene.fire("metaModelCreated", this.id);
|
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -18731,9 +18731,6 @@ const Renderer$1 = function (scene, options) {
|
|
|
18731
18731
|
let drawableTypeInfo = {};
|
|
18732
18732
|
let drawables = {};
|
|
18733
18733
|
|
|
18734
|
-
let postSortDrawableList = [];
|
|
18735
|
-
let postCullDrawableList = [];
|
|
18736
|
-
|
|
18737
18734
|
let drawableListDirty = true;
|
|
18738
18735
|
let stateSortDirty = true;
|
|
18739
18736
|
let imageDirty = true;
|
|
@@ -18959,38 +18956,28 @@ const Renderer$1 = function (scene, options) {
|
|
|
18959
18956
|
const drawableInfo = drawableTypeInfo[type];
|
|
18960
18957
|
if (drawableInfo.isStateSortable) {
|
|
18961
18958
|
drawableInfo.drawableListPreCull.sort(drawableInfo.stateSortCompare);
|
|
18962
|
-
|
|
18963
|
-
drawableInfo.drawableList = drawableInfo.drawableListPreCull;
|
|
18964
18959
|
}
|
|
18965
18960
|
}
|
|
18966
18961
|
}
|
|
18967
|
-
|
|
18962
|
+
}
|
|
18963
|
+
|
|
18964
|
+
function cullDrawableList() {
|
|
18968
18965
|
for (let type in drawableTypeInfo) {
|
|
18969
18966
|
if (drawableTypeInfo.hasOwnProperty(type)) {
|
|
18970
18967
|
const drawableInfo = drawableTypeInfo[type];
|
|
18971
18968
|
const drawableListPreCull = drawableInfo.drawableListPreCull;
|
|
18969
|
+
const drawableList = drawableInfo.drawableList;
|
|
18970
|
+
let lenDrawableList = 0;
|
|
18972
18971
|
for (let i = 0, len = drawableListPreCull.length; i < len; i++) {
|
|
18973
18972
|
const drawable = drawableListPreCull[i];
|
|
18974
|
-
|
|
18973
|
+
drawable.rebuildRenderFlags();
|
|
18974
|
+
if (!drawable.renderFlags.culled) {
|
|
18975
|
+
drawableList[lenDrawableList++] = drawable;
|
|
18976
|
+
}
|
|
18975
18977
|
}
|
|
18978
|
+
drawableList.length = lenDrawableList;
|
|
18976
18979
|
}
|
|
18977
18980
|
}
|
|
18978
|
-
postSortDrawableList.length = lenDrawableList;
|
|
18979
|
-
postSortDrawableList.sort((a, b) => {
|
|
18980
|
-
return a.renderOrder - b.renderOrder;
|
|
18981
|
-
});
|
|
18982
|
-
}
|
|
18983
|
-
|
|
18984
|
-
function cullDrawableList() {
|
|
18985
|
-
let lenDrawableList = 0;
|
|
18986
|
-
for (let i = 0, len = postSortDrawableList.length; i < len; i++) {
|
|
18987
|
-
const drawable = postSortDrawableList[i];
|
|
18988
|
-
drawable.rebuildRenderFlags();
|
|
18989
|
-
if (!drawable.renderFlags.culled) {
|
|
18990
|
-
postCullDrawableList[lenDrawableList++] = drawable;
|
|
18991
|
-
}
|
|
18992
|
-
}
|
|
18993
|
-
postCullDrawableList.length = lenDrawableList;
|
|
18994
18981
|
}
|
|
18995
18982
|
|
|
18996
18983
|
function draw(params) {
|
|
@@ -19223,6 +19210,7 @@ const Renderer$1 = function (scene, options) {
|
|
|
19223
19210
|
}
|
|
19224
19211
|
|
|
19225
19212
|
let i;
|
|
19213
|
+
let len;
|
|
19226
19214
|
let drawable;
|
|
19227
19215
|
|
|
19228
19216
|
const startTime = Date.now();
|
|
@@ -19255,85 +19243,93 @@ const Renderer$1 = function (scene, options) {
|
|
|
19255
19243
|
// Render normal opaque solids, defer others to bins to render after
|
|
19256
19244
|
//------------------------------------------------------------------------------------------------------
|
|
19257
19245
|
|
|
19258
|
-
for (let
|
|
19246
|
+
for (let type in drawableTypeInfo) {
|
|
19247
|
+
if (drawableTypeInfo.hasOwnProperty(type)) {
|
|
19259
19248
|
|
|
19260
|
-
|
|
19249
|
+
const drawableInfo = drawableTypeInfo[type];
|
|
19250
|
+
const drawableList = drawableInfo.drawableList;
|
|
19261
19251
|
|
|
19262
|
-
|
|
19263
|
-
continue;
|
|
19264
|
-
}
|
|
19252
|
+
for (i = 0, len = drawableList.length; i < len; i++) {
|
|
19265
19253
|
|
|
19266
|
-
|
|
19254
|
+
drawable = drawableList[i];
|
|
19267
19255
|
|
|
19268
|
-
|
|
19269
|
-
|
|
19270
|
-
|
|
19271
|
-
} else {
|
|
19272
|
-
drawable.drawColorOpaque(frameCtx);
|
|
19273
|
-
}
|
|
19274
|
-
}
|
|
19256
|
+
if (drawable.culled === true || drawable.visible === false) {
|
|
19257
|
+
continue;
|
|
19258
|
+
}
|
|
19275
19259
|
|
|
19276
|
-
|
|
19277
|
-
if (renderFlags.colorTransparent) {
|
|
19278
|
-
normalFillTransparentBin[normalFillTransparentBinLen++] = drawable;
|
|
19279
|
-
}
|
|
19280
|
-
}
|
|
19260
|
+
const renderFlags = drawable.renderFlags;
|
|
19281
19261
|
|
|
19282
|
-
|
|
19283
|
-
|
|
19284
|
-
|
|
19262
|
+
if (renderFlags.colorOpaque) {
|
|
19263
|
+
if (saoEnabled && saoPossible && drawable.saoEnabled) {
|
|
19264
|
+
normalDrawSAOBin[normalDrawSAOBinLen++] = drawable;
|
|
19265
|
+
} else {
|
|
19266
|
+
drawable.drawColorOpaque(frameCtx);
|
|
19267
|
+
}
|
|
19268
|
+
}
|
|
19285
19269
|
|
|
19286
|
-
|
|
19287
|
-
|
|
19288
|
-
|
|
19270
|
+
if (transparentEnabled) {
|
|
19271
|
+
if (renderFlags.colorTransparent) {
|
|
19272
|
+
normalFillTransparentBin[normalFillTransparentBinLen++] = drawable;
|
|
19273
|
+
}
|
|
19274
|
+
}
|
|
19289
19275
|
|
|
19290
|
-
|
|
19291
|
-
|
|
19292
|
-
|
|
19276
|
+
if (renderFlags.xrayedSilhouetteTransparent) {
|
|
19277
|
+
xrayedFillTransparentBin[xrayedFillTransparentBinLen++] = drawable;
|
|
19278
|
+
}
|
|
19293
19279
|
|
|
19294
|
-
|
|
19295
|
-
|
|
19296
|
-
|
|
19280
|
+
if (renderFlags.xrayedSilhouetteOpaque) {
|
|
19281
|
+
xrayedFillOpaqueBin[xrayedFillOpaqueBinLen++] = drawable;
|
|
19282
|
+
}
|
|
19297
19283
|
|
|
19298
|
-
|
|
19299
|
-
|
|
19300
|
-
|
|
19284
|
+
if (renderFlags.highlightedSilhouetteTransparent) {
|
|
19285
|
+
highlightedFillTransparentBin[highlightedFillTransparentBinLen++] = drawable;
|
|
19286
|
+
}
|
|
19301
19287
|
|
|
19302
|
-
|
|
19303
|
-
|
|
19304
|
-
|
|
19288
|
+
if (renderFlags.highlightedSilhouetteOpaque) {
|
|
19289
|
+
highlightedFillOpaqueBin[highlightedFillOpaqueBinLen++] = drawable;
|
|
19290
|
+
}
|
|
19305
19291
|
|
|
19306
|
-
|
|
19307
|
-
|
|
19308
|
-
|
|
19309
|
-
}
|
|
19292
|
+
if (renderFlags.selectedSilhouetteTransparent) {
|
|
19293
|
+
selectedFillTransparentBin[selectedFillTransparentBinLen++] = drawable;
|
|
19294
|
+
}
|
|
19310
19295
|
|
|
19311
|
-
|
|
19312
|
-
|
|
19313
|
-
|
|
19296
|
+
if (renderFlags.selectedSilhouetteOpaque) {
|
|
19297
|
+
selectedFillOpaqueBin[selectedFillOpaqueBinLen++] = drawable;
|
|
19298
|
+
}
|
|
19314
19299
|
|
|
19315
|
-
|
|
19316
|
-
|
|
19317
|
-
|
|
19300
|
+
if (drawable.edges && edgesEnabled) {
|
|
19301
|
+
if (renderFlags.edgesOpaque) {
|
|
19302
|
+
normalEdgesOpaqueBin[normalEdgesOpaqueBinLen++] = drawable;
|
|
19303
|
+
}
|
|
19318
19304
|
|
|
19319
|
-
|
|
19320
|
-
|
|
19321
|
-
|
|
19305
|
+
if (renderFlags.edgesTransparent) {
|
|
19306
|
+
normalEdgesTransparentBin[normalEdgesTransparentBinLen++] = drawable;
|
|
19307
|
+
}
|
|
19322
19308
|
|
|
19323
|
-
|
|
19324
|
-
|
|
19325
|
-
|
|
19309
|
+
if (renderFlags.selectedEdgesTransparent) {
|
|
19310
|
+
selectedEdgesTransparentBin[selectedEdgesTransparentBinLen++] = drawable;
|
|
19311
|
+
}
|
|
19326
19312
|
|
|
19327
|
-
|
|
19328
|
-
|
|
19329
|
-
|
|
19313
|
+
if (renderFlags.selectedEdgesOpaque) {
|
|
19314
|
+
selectedEdgesOpaqueBin[selectedEdgesOpaqueBinLen++] = drawable;
|
|
19315
|
+
}
|
|
19330
19316
|
|
|
19331
|
-
|
|
19332
|
-
|
|
19333
|
-
|
|
19317
|
+
if (renderFlags.xrayedEdgesTransparent) {
|
|
19318
|
+
xrayEdgesTransparentBin[xrayEdgesTransparentBinLen++] = drawable;
|
|
19319
|
+
}
|
|
19320
|
+
|
|
19321
|
+
if (renderFlags.xrayedEdgesOpaque) {
|
|
19322
|
+
xrayEdgesOpaqueBin[xrayEdgesOpaqueBinLen++] = drawable;
|
|
19323
|
+
}
|
|
19334
19324
|
|
|
19335
|
-
|
|
19336
|
-
|
|
19325
|
+
if (renderFlags.highlightedEdgesTransparent) {
|
|
19326
|
+
highlightedEdgesTransparentBin[highlightedEdgesTransparentBinLen++] = drawable;
|
|
19327
|
+
}
|
|
19328
|
+
|
|
19329
|
+
if (renderFlags.highlightedEdgesOpaque) {
|
|
19330
|
+
highlightedEdgesOpaqueBin[highlightedEdgesOpaqueBinLen++] = drawable;
|
|
19331
|
+
}
|
|
19332
|
+
}
|
|
19337
19333
|
}
|
|
19338
19334
|
}
|
|
19339
19335
|
}
|
|
@@ -31599,8 +31595,6 @@ class Scene extends Component {
|
|
|
31599
31595
|
* @param {Number[]} [params.origin] World-space ray origin when ray-picking. Ignored when canvasPos given.
|
|
31600
31596
|
* @param {Number[]} [params.direction] World-space ray direction when ray-picking. Also indicates the length of the ray. Ignored when canvasPos given.
|
|
31601
31597
|
* @param {Number[]} [params.matrix] 4x4 transformation matrix to define the World-space ray origin and direction, as an alternative to ````origin```` and ````direction````.
|
|
31602
|
-
* @param {String[]} [params.includeEntities] IDs of {@link Entity}s to restrict picking to. When given, ignores {@link Entity}s whose IDs are not in this list.
|
|
31603
|
-
* @param {String[]} [params.excludeEntities] IDs of {@link Entity}s to ignore. When given, will pick *through* these {@link Entity}s, as if they were not there.
|
|
31604
31598
|
* @param {Number} [params.snapRadius=30] The snap radius, in canvas pixels.
|
|
31605
31599
|
* @param {boolean} [params.snapToVertex=true] Whether to snap to vertex. Only works when `canvasPos` given.
|
|
31606
31600
|
* @param {boolean} [params.snapToEdge=true] Whether to snap to edge. Only works when `canvasPos` given.
|
|
@@ -99459,7 +99453,11 @@ class PropertySet {
|
|
|
99459
99453
|
const properties = params.properties;
|
|
99460
99454
|
for (let i = 0, len = properties.length; i < len; i++) {
|
|
99461
99455
|
const property = properties[i];
|
|
99462
|
-
|
|
99456
|
+
if (Number.isInteger(property)) { // Will decompress in MetaModel.finalize();
|
|
99457
|
+
this.properties.push(property);
|
|
99458
|
+
} else {
|
|
99459
|
+
this.properties.push(new Property(property.name, property.value, property.type, property.valueType, property.description));
|
|
99460
|
+
}
|
|
99463
99461
|
}
|
|
99464
99462
|
}
|
|
99465
99463
|
}
|
|
@@ -99823,6 +99821,8 @@ class MetaModel {
|
|
|
99823
99821
|
|
|
99824
99822
|
this.metaScene.metaModels[this.id] = this;
|
|
99825
99823
|
|
|
99824
|
+
this._propertyLookup = [];
|
|
99825
|
+
|
|
99826
99826
|
/**
|
|
99827
99827
|
* True when this MetaModel has been finalized.
|
|
99828
99828
|
* @type {boolean}
|
|
@@ -99837,7 +99837,7 @@ class MetaModel {
|
|
|
99837
99837
|
* @type {MetaObject|null}
|
|
99838
99838
|
*/
|
|
99839
99839
|
get rootMetaObject() {
|
|
99840
|
-
if (this.rootMetaObjects.length
|
|
99840
|
+
if (this.rootMetaObjects.length === 1) {
|
|
99841
99841
|
return this.rootMetaObjects[0];
|
|
99842
99842
|
}
|
|
99843
99843
|
return null;
|
|
@@ -99858,6 +99858,12 @@ class MetaModel {
|
|
|
99858
99858
|
const metaScene = this.metaScene;
|
|
99859
99859
|
const propertyLookup = metaModelData.properties;
|
|
99860
99860
|
|
|
99861
|
+
if (propertyLookup) {
|
|
99862
|
+
for (let i = 0, len = propertyLookup.length; i < len; i++) {
|
|
99863
|
+
this._propertyLookup.push(propertyLookup[i]);
|
|
99864
|
+
}
|
|
99865
|
+
}
|
|
99866
|
+
|
|
99861
99867
|
// Create global Property Sets
|
|
99862
99868
|
|
|
99863
99869
|
if (metaModelData.propertySets) {
|
|
@@ -99868,9 +99874,6 @@ class MetaModel {
|
|
|
99868
99874
|
}
|
|
99869
99875
|
let propertySet = metaScene.propertySets[propertySetData.id];
|
|
99870
99876
|
if (!propertySet) {
|
|
99871
|
-
if (propertyLookup) {
|
|
99872
|
-
this._decompressProperties(propertyLookup, propertySetData.properties);
|
|
99873
|
-
}
|
|
99874
99877
|
propertySet = new PropertySet({
|
|
99875
99878
|
id: propertySetData.id,
|
|
99876
99879
|
originalSystemId: propertySetData.originalSystemId || propertySetData.id,
|
|
@@ -99917,15 +99920,21 @@ class MetaModel {
|
|
|
99917
99920
|
}
|
|
99918
99921
|
|
|
99919
99922
|
_decompressProperties(propertyLookup, properties) {
|
|
99923
|
+
const propsNotFound = [];
|
|
99920
99924
|
for (let i = 0, len = properties.length; i < len; i++) {
|
|
99921
99925
|
const property = properties[i];
|
|
99922
99926
|
if (Number.isInteger(property)) {
|
|
99923
99927
|
const lookupProperty = propertyLookup[property];
|
|
99924
99928
|
if (lookupProperty) {
|
|
99925
99929
|
properties[i] = lookupProperty;
|
|
99930
|
+
} else {
|
|
99931
|
+
propsNotFound.push(property);
|
|
99926
99932
|
}
|
|
99927
99933
|
}
|
|
99928
99934
|
}
|
|
99935
|
+
if (propsNotFound.length > 0) {
|
|
99936
|
+
console.error(`[MetaModel._decompressProperties] Properties not found: ${propsNotFound}`);
|
|
99937
|
+
}
|
|
99929
99938
|
}
|
|
99930
99939
|
|
|
99931
99940
|
finalize() {
|
|
@@ -99993,6 +100002,18 @@ class MetaModel {
|
|
|
99993
100002
|
(metaScene.metaObjectsByType[type] || (metaScene.metaObjectsByType[type] = {}))[objectId] = metaObject;
|
|
99994
100003
|
}
|
|
99995
100004
|
|
|
100005
|
+
// Decompress properties
|
|
100006
|
+
|
|
100007
|
+
if (this.propertySets) {
|
|
100008
|
+
for (let i = 0, len = this.propertySets.length; i < len; i++) {
|
|
100009
|
+
const propertySet = this.propertySets[i];
|
|
100010
|
+
this._decompressProperties(this._propertyLookup, propertySet.properties);
|
|
100011
|
+
}
|
|
100012
|
+
}
|
|
100013
|
+
|
|
100014
|
+
|
|
100015
|
+
this._propertyLookup = [];
|
|
100016
|
+
|
|
99996
100017
|
this.finalized = true;
|
|
99997
100018
|
|
|
99998
100019
|
this.metaScene.fire("metaModelCreated", this.id);
|