Skip to content

Commit

Permalink
Rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Feb 13, 2024
1 parent 655f12c commit adfc3bf
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
6 changes: 4 additions & 2 deletions dist/xeokit-sdk.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -82150,7 +82150,8 @@ class SceneModel extends Component {

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

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

Expand Down Expand Up @@ -82368,7 +82369,8 @@ class SceneModel extends Component {
const useDTX = (!!this._dtxEnabled
&& (cfg.geometry.primitive === "triangles"
|| cfg.geometry.primitive === "solid"
|| cfg.geometry.primitive === "surface"));
|| cfg.geometry.primitive === "surface"))
&& (!cfg.textureSetId);

if (useDTX) {

Expand Down
6 changes: 4 additions & 2 deletions dist/xeokit-sdk.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -82146,7 +82146,8 @@ class SceneModel extends Component {

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

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

Expand Down Expand Up @@ -82364,7 +82365,8 @@ class SceneModel extends Component {
const useDTX = (!!this._dtxEnabled
&& (cfg.geometry.primitive === "triangles"
|| cfg.geometry.primitive === "solid"
|| cfg.geometry.primitive === "surface"));
|| cfg.geometry.primitive === "surface"))
&& (!cfg.textureSetId);

if (useDTX) {

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 @@ -18190,7 +18190,7 @@ if(!this._textureTranscoder){this.error("[createTexture] Can't create texture fr
* @param {Number} [cfg.roughness=1] Roughness factor in range ````[0..1]````. Overridden by texture set ````metallicRoughnessTexture````.
* @returns {Boolean} True = successfully mesh was created. False = error during creation of a mesh.
*/},{key:"createMesh",value:function createMesh(cfg){if(cfg.id===undefined||cfg.id===null){this.error("[createMesh] SceneModel.createMesh() config missing: id");return false;}if(this._scheduledMeshes[cfg.id]){this.error("[createMesh] SceneModel already has a mesh with this ID: ".concat(cfg.id));return false;}var instancing=cfg.geometryId!==undefined;var batching=!instancing;if(batching){// Batched geometry
if(cfg.primitive===undefined||cfg.primitive===null){cfg.primitive="triangles";}if(cfg.primitive!=="points"&&cfg.primitive!=="lines"&&cfg.primitive!=="triangles"&&cfg.primitive!=="solid"&&cfg.primitive!=="surface"){this.error("Unsupported value for 'primitive': '".concat(primitive,"' ('geometryId' is absent) - supported values are 'points', 'lines', 'triangles', 'solid' and 'surface'."));return false;}if(!cfg.positions&&!cfg.positionsCompressed&&!cfg.buckets){this.error("Param expected: 'positions', 'positionsCompressed' or `buckets` ('geometryId' is absent)");return false;}if(cfg.positions&&(cfg.positionsDecodeMatrix||cfg.positionsDecodeBoundary)){this.error("Illegal params: 'positions' not expected with 'positionsDecodeMatrix'/'positionsDecodeBoundary' ('geometryId' is absent)");return false;}if(cfg.positionsCompressed&&!cfg.positionsDecodeMatrix&&!cfg.positionsDecodeBoundary){this.error("Param expected: 'positionsCompressed' should be accompanied by 'positionsDecodeMatrix'/'positionsDecodeBoundary' ('geometryId' is absent)");return false;}if(cfg.uvCompressed&&!cfg.uvDecodeMatrix){this.error("Param expected: 'uvCompressed' should be accompanied by `uvDecodeMatrix` ('geometryId' is absent)");return false;}if(!cfg.buckets&&!cfg.indices&&cfg.primitive!=="points"){this.error("Param expected: indices (required for '".concat(cfg.primitive,"' primitive type)"));return false;}if((cfg.matrix||cfg.position||cfg.rotation||cfg.scale)&&(cfg.positionsCompressed||cfg.positionsDecodeBoundary)){this.error("Unexpected params: 'matrix', 'rotation', 'scale', 'position' not allowed with 'positionsCompressed'");return false;}var 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;// MATRIX - optional for batching
if(cfg.primitive===undefined||cfg.primitive===null){cfg.primitive="triangles";}if(cfg.primitive!=="points"&&cfg.primitive!=="lines"&&cfg.primitive!=="triangles"&&cfg.primitive!=="solid"&&cfg.primitive!=="surface"){this.error("Unsupported value for 'primitive': '".concat(primitive,"' ('geometryId' is absent) - supported values are 'points', 'lines', 'triangles', 'solid' and 'surface'."));return false;}if(!cfg.positions&&!cfg.positionsCompressed&&!cfg.buckets){this.error("Param expected: 'positions', 'positionsCompressed' or `buckets` ('geometryId' is absent)");return false;}if(cfg.positions&&(cfg.positionsDecodeMatrix||cfg.positionsDecodeBoundary)){this.error("Illegal params: 'positions' not expected with 'positionsDecodeMatrix'/'positionsDecodeBoundary' ('geometryId' is absent)");return false;}if(cfg.positionsCompressed&&!cfg.positionsDecodeMatrix&&!cfg.positionsDecodeBoundary){this.error("Param expected: 'positionsCompressed' should be accompanied by 'positionsDecodeMatrix'/'positionsDecodeBoundary' ('geometryId' is absent)");return false;}if(cfg.uvCompressed&&!cfg.uvDecodeMatrix){this.error("Param expected: 'uvCompressed' should be accompanied by `uvDecodeMatrix` ('geometryId' is absent)");return false;}if(!cfg.buckets&&!cfg.indices&&cfg.primitive!=="points"){this.error("Param expected: indices (required for '".concat(cfg.primitive,"' primitive type)"));return false;}if((cfg.matrix||cfg.position||cfg.rotation||cfg.scale)&&(cfg.positionsCompressed||cfg.positionsDecodeBoundary)){this.error("Unexpected params: 'matrix', 'rotation', 'scale', 'position' not allowed with 'positionsCompressed'");return false;}var useDTX=!!this._dtxEnabled&&(cfg.primitive==="triangles"||cfg.primitive==="solid"||cfg.primitive==="surface")&&!cfg.textureSetId;cfg.origin=cfg.origin?math.addVec3(this._origin,cfg.origin,math.vec3()):this._origin;// MATRIX - optional for batching
if(cfg.matrix){cfg.meshMatrix=cfg.matrix;}else if(cfg.scale||cfg.rotation||cfg.position){var _scale3=cfg.scale||DEFAULT_SCALE;var _position=cfg.position||DEFAULT_POSITION;var rotation=cfg.rotation||DEFAULT_ROTATION;math.eulerToQuaternion(rotation,"XYZ",DEFAULT_QUATERNION);cfg.meshMatrix=math.composeMat4(_position,DEFAULT_QUATERNION,_scale3,math.mat4());}if(cfg.positionsDecodeBoundary){cfg.positionsDecodeMatrix=createPositionsDecodeMatrix(cfg.positionsDecodeBoundary,math.mat4());}if(useDTX){// DTX
cfg.type=DTX;// NPR
cfg.color=cfg.color?new Uint8Array([Math.floor(cfg.color[0]*255),Math.floor(cfg.color[1]*255),Math.floor(cfg.color[2]*255)]):defaultCompressedColor;cfg.opacity=cfg.opacity!==undefined&&cfg.opacity!==null?Math.floor(cfg.opacity*255):255;// RTC
Expand All @@ -18208,7 +18208,7 @@ if(!cfg.buckets&&!cfg.edgeIndices&&(cfg.primitive==="triangles"||cfg.primitive==
if(cfg.textureSetId){cfg.textureSet=this._textureSets[cfg.textureSetId];if(!cfg.textureSet){this.error("[createMesh] Texture set not found: ".concat(cfg.textureSetId," - ensure that you create it first with createTextureSet()"));return false;}}}}else{// INSTANCING
if(cfg.positions||cfg.positionsCompressed||cfg.indices||cfg.edgeIndices||cfg.normals||cfg.normalsCompressed||cfg.uv||cfg.uvCompressed||cfg.positionsDecodeMatrix){this.error("Mesh geometry parameters not expected when instancing a geometry (not expected: positions, positionsCompressed, indices, edgeIndices, normals, normalsCompressed, uv, uvCompressed, positionsDecodeMatrix)");return false;}cfg.geometry=this._geometries[cfg.geometryId];if(!cfg.geometry){this.error("[createMesh] Geometry not found: ".concat(cfg.geometryId," - ensure that you create it first with createGeometry()"));return false;}cfg.origin=cfg.origin?math.addVec3(this._origin,cfg.origin,math.vec3()):this._origin;cfg.positionsDecodeMatrix=cfg.geometry.positionsDecodeMatrix;if(cfg.transformId){// TRANSFORM
cfg.transform=this._transforms[cfg.transformId];if(!cfg.transform){this.error("[createMesh] Transform not found: ".concat(cfg.transformId," - ensure that you create it first with createTransform()"));return false;}cfg.aabb=cfg.geometry.aabb;}else{// MATRIX
if(cfg.matrix){cfg.meshMatrix=cfg.matrix.slice();}else{var _scale4=cfg.scale||DEFAULT_SCALE;var _position2=cfg.position||DEFAULT_POSITION;var _rotation=cfg.rotation||DEFAULT_ROTATION;math.eulerToQuaternion(_rotation,"XYZ",DEFAULT_QUATERNION);cfg.meshMatrix=math.composeMat4(_position2,DEFAULT_QUATERNION,_scale4,math.mat4());}math.AABB3ToOBB3(cfg.geometry.aabb,tempOBB3);math.transformOBB3(cfg.meshMatrix,tempOBB3);cfg.aabb=math.OBB3ToAABB3(tempOBB3,math.AABB3());}var _useDTX=!!this._dtxEnabled&&(cfg.geometry.primitive==="triangles"||cfg.geometry.primitive==="solid"||cfg.geometry.primitive==="surface");if(_useDTX){// DTX
if(cfg.matrix){cfg.meshMatrix=cfg.matrix.slice();}else{var _scale4=cfg.scale||DEFAULT_SCALE;var _position2=cfg.position||DEFAULT_POSITION;var _rotation=cfg.rotation||DEFAULT_ROTATION;math.eulerToQuaternion(_rotation,"XYZ",DEFAULT_QUATERNION);cfg.meshMatrix=math.composeMat4(_position2,DEFAULT_QUATERNION,_scale4,math.mat4());}math.AABB3ToOBB3(cfg.geometry.aabb,tempOBB3);math.transformOBB3(cfg.meshMatrix,tempOBB3);cfg.aabb=math.OBB3ToAABB3(tempOBB3,math.AABB3());}var _useDTX=!!this._dtxEnabled&&(cfg.geometry.primitive==="triangles"||cfg.geometry.primitive==="solid"||cfg.geometry.primitive==="surface")&&!cfg.textureSetId;if(_useDTX){// DTX
cfg.type=DTX;// NPR
cfg.color=cfg.color?new Uint8Array([Math.floor(cfg.color[0]*255),Math.floor(cfg.color[1]*255),Math.floor(cfg.color[2]*255)]):defaultCompressedColor;cfg.opacity=cfg.opacity!==undefined&&cfg.opacity!==null?Math.floor(cfg.opacity*255):255;// BUCKETING - lazy generated, reused
var buckets=this._dtxBuckets[cfg.geometryId];if(!buckets){buckets=createDTXBuckets(cfg.geometry,this._enableVertexWelding,this._enableIndexBucketing);this._dtxBuckets[cfg.geometryId]=buckets;}cfg.buckets=buckets;}else{// VBO
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 adfc3bf

Please sign in to comment.