Skip to content

Commit

Permalink
Rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Oct 17, 2023
1 parent c037d84 commit d1ce88f
Show file tree
Hide file tree
Showing 6 changed files with 395 additions and 397 deletions.
52 changes: 24 additions & 28 deletions dist/xeokit-sdk.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -26420,18 +26420,6 @@ class LinesMaterial extends Material {
* @private
*/


const neverCullTypes = {
"IfcWall": true,
"IfcSlab": true,
"IfcFloor": true,
"IfcRoof": true,
"IfcSpace": true,
"IfcBeam": true,
"IfcStair": true,
"IfcPlate":true
};

class LODState {

/**
Expand Down Expand Up @@ -26513,24 +26501,23 @@ class LODState {
if (entityList.length === 0) {
return;
}
const neverCullTypesMap = sceneModel.scene.lod.neverCullTypesMap;
const metaScene = sceneModel.scene.viewer.metaScene;
const entitiesInLOD = {};
const primCountInLOD = {};
const maxSize = 20;
const minComplexity = 25;

for (let i = 0, len = entityList.length; i < len; i++) {
const entity = entityList[i];
const metaObject = metaScene.metaObjects[entity.id];
if (metaObject && neverCullTypes[metaObject.type]) {
continue;
}
const entityComplexity = entity.numPrimitives;
const entitySize = math.getAABB3Diag(entity.aabb);
const isCullable = ((minComplexity <= entityComplexity) && (entitySize <= maxSize));
if (!isCullable) {
if (metaObject && neverCullTypesMap[metaObject.type]) {
continue;
}
entity.numPrimitives;
math.getAABB3Diag(entity.aabb);
// const isCullable = ((minComplexity <= entityComplexity) && (entitySize <= maxSize));
// if (!isCullable) {
// continue;
// }
let lodLevel = 0, len;
for (lodLevel = 0, len = this.primLODLevels.length; lodLevel < len; lodLevel++) {
if (entity.numPrimitives >= this.primLODLevels [lodLevel]) {
Expand Down Expand Up @@ -26610,12 +26597,12 @@ class LODCullingManager {
let lodState = this.lodState;
let retVal = false;
if (currentFPS < lodState.targetFps) {
if (++lodState.consecutiveFramesWithoutTargetFps > 5) {
if (++lodState.consecutiveFramesWithoutTargetFps > 2) {
lodState.consecutiveFramesWithoutTargetFps = 0;
retVal = this._increaseLODLevelIndex();
}
} else if (currentFPS > (lodState.targetFps + 4)) {
if (++lodState.consecutiveFramesWithTargetFps > 5) {
if (++lodState.consecutiveFramesWithTargetFps > 2) {
lodState.consecutiveFramesWithTargetFps = 0;
retVal = this._decreaseLODLevelIndex();
}
Expand Down Expand Up @@ -26645,6 +26632,8 @@ class LOD extends Component {

this._scene = scene;
this._lodLevels = [2000, 600, 150, 80, 20];
this._neverCullTypes = [];
this._neverCullTypesMap = {};
this._lodManagers = {};
this._lodManagerList = [];

Expand Down Expand Up @@ -26775,6 +26764,10 @@ class LOD extends Component {
value = [];
}
this._neverCullTypes = value;
this._neverCullTypesMap = {};
for (let i = 0, len = this._neverCullTypes.length; i < len; i++) {
this._neverCullTypesMap[this._neverCullTypes[i]] = true;
}
// this.glRedraw();
}

Expand All @@ -26788,6 +26781,14 @@ class LOD extends Component {
get neverCullTypes() {
return this._neverCullTypes;
}

/**
* @private
* @returns {*|{}}
*/
get neverCullTypesMap() {
return this._neverCullTypesMap;
}

/**
* Called within SceneModel constructors
Expand Down Expand Up @@ -60721,7 +60722,6 @@ class TrianglesBatchingColorTextureRenderer extends VBOSceneModelTriangleBatchin
src.push("vec4 colorTexel = color * sRGBToLinear(texture(uColorMap, vUV));");
} else {
src.push("vec4 colorTexel = color * texture(uColorMap, vUV);");

}
src.push("float opacity = color.a;");

Expand Down Expand Up @@ -85601,10 +85601,6 @@ class SceneModel extends Component {
return null;
}

if (cfg.normals) { // HACK
cfg.normals = null;
}

const useDTX = (!!this._dtxEnabled && (cfg.primitive === "triangles" || cfg.primitive === "solid" || cfg.primitive === "surface"));

cfg.origin = cfg.origin ? math.addVec3(this._origin, cfg.origin, math.vec3()) : this._origin;
Expand Down
52 changes: 24 additions & 28 deletions dist/xeokit-sdk.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -26416,18 +26416,6 @@ class LinesMaterial extends Material {
* @private
*/


const neverCullTypes = {
"IfcWall": true,
"IfcSlab": true,
"IfcFloor": true,
"IfcRoof": true,
"IfcSpace": true,
"IfcBeam": true,
"IfcStair": true,
"IfcPlate":true
};

class LODState {

/**
Expand Down Expand Up @@ -26509,24 +26497,23 @@ class LODState {
if (entityList.length === 0) {
return;
}
const neverCullTypesMap = sceneModel.scene.lod.neverCullTypesMap;
const metaScene = sceneModel.scene.viewer.metaScene;
const entitiesInLOD = {};
const primCountInLOD = {};
const maxSize = 20;
const minComplexity = 25;

for (let i = 0, len = entityList.length; i < len; i++) {
const entity = entityList[i];
const metaObject = metaScene.metaObjects[entity.id];
if (metaObject && neverCullTypes[metaObject.type]) {
continue;
}
const entityComplexity = entity.numPrimitives;
const entitySize = math.getAABB3Diag(entity.aabb);
const isCullable = ((minComplexity <= entityComplexity) && (entitySize <= maxSize));
if (!isCullable) {
if (metaObject && neverCullTypesMap[metaObject.type]) {
continue;
}
entity.numPrimitives;
math.getAABB3Diag(entity.aabb);
// const isCullable = ((minComplexity <= entityComplexity) && (entitySize <= maxSize));
// if (!isCullable) {
// continue;
// }
let lodLevel = 0, len;
for (lodLevel = 0, len = this.primLODLevels.length; lodLevel < len; lodLevel++) {
if (entity.numPrimitives >= this.primLODLevels [lodLevel]) {
Expand Down Expand Up @@ -26606,12 +26593,12 @@ class LODCullingManager {
let lodState = this.lodState;
let retVal = false;
if (currentFPS < lodState.targetFps) {
if (++lodState.consecutiveFramesWithoutTargetFps > 5) {
if (++lodState.consecutiveFramesWithoutTargetFps > 2) {
lodState.consecutiveFramesWithoutTargetFps = 0;
retVal = this._increaseLODLevelIndex();
}
} else if (currentFPS > (lodState.targetFps + 4)) {
if (++lodState.consecutiveFramesWithTargetFps > 5) {
if (++lodState.consecutiveFramesWithTargetFps > 2) {
lodState.consecutiveFramesWithTargetFps = 0;
retVal = this._decreaseLODLevelIndex();
}
Expand Down Expand Up @@ -26641,6 +26628,8 @@ class LOD extends Component {

this._scene = scene;
this._lodLevels = [2000, 600, 150, 80, 20];
this._neverCullTypes = [];
this._neverCullTypesMap = {};
this._lodManagers = {};
this._lodManagerList = [];

Expand Down Expand Up @@ -26771,6 +26760,10 @@ class LOD extends Component {
value = [];
}
this._neverCullTypes = value;
this._neverCullTypesMap = {};
for (let i = 0, len = this._neverCullTypes.length; i < len; i++) {
this._neverCullTypesMap[this._neverCullTypes[i]] = true;
}
// this.glRedraw();
}

Expand All @@ -26784,6 +26777,14 @@ class LOD extends Component {
get neverCullTypes() {
return this._neverCullTypes;
}

/**
* @private
* @returns {*|{}}
*/
get neverCullTypesMap() {
return this._neverCullTypesMap;
}

/**
* Called within SceneModel constructors
Expand Down Expand Up @@ -60717,7 +60718,6 @@ class TrianglesBatchingColorTextureRenderer extends VBOSceneModelTriangleBatchin
src.push("vec4 colorTexel = color * sRGBToLinear(texture(uColorMap, vUV));");
} else {
src.push("vec4 colorTexel = color * texture(uColorMap, vUV);");

}
src.push("float opacity = color.a;");

Expand Down Expand Up @@ -85597,10 +85597,6 @@ class SceneModel extends Component {
return null;
}

if (cfg.normals) { // HACK
cfg.normals = null;
}

const useDTX = (!!this._dtxEnabled && (cfg.primitive === "triangles" || cfg.primitive === "solid" || cfg.primitive === "surface"));

cfg.origin = cfg.origin ? math.addVec3(this._origin, cfg.origin, math.vec3()) : this._origin;
Expand Down
Loading

0 comments on commit d1ce88f

Please sign in to comment.