Skip to content

Commit

Permalink
Return first geometryBuffer if no best batch found
Browse files Browse the repository at this point in the history
- Check parent resource is defined
  • Loading branch information
ljowen committed Aug 19, 2024
1 parent 6545ff7 commit 5f2d6d8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- Added multiscattering terms to diffuse BRDF in image-based lighting. [#12118](https://github.com/CesiumGS/cesium/pull/12118)
- Fixed CallbackProperty type not being present on entity position. [#12120](https://github.com/CesiumGS/cesium/pull/12120)
- Additional TypeScript types export in package.json to assist some project configurations using Cesium. [#12122](https://github.com/CesiumGS/cesium/pull/12122)
- Use first geometryBuffer if no best match found in I3SNode [#12132](https://github.com/CesiumGS/cesium/pull/12132)

##### Breaking Changes :mega:

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,3 +394,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
- [Vladislav Yunev](https://github.com/YunVlad)
- [Levi Montgomery](https://github.com/Levi-Montgomery)
- [Brandon Berisford](https://github.com/BeyondBelief96)
- [Lawrence Owen](https://github.com/ljowen)
10 changes: 8 additions & 2 deletions packages/engine/Source/Scene/I3SLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,15 @@ I3SLayer.prototype._findBestGeometryBuffers = function (
};
}
}
// If no match found return first geometryBuffer
if (defined(geometryDefinition[0])) {
return {
bufferIndex: 0,
definition: geometryDefinition,
geometryBufferInfo: geometryDefinition[0],
};
}
}

return 0;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/Source/Scene/I3SNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ I3SNode.prototype.load = async function () {
const uriIndex = node.mesh.geometry.resource;
uri = `../${uriIndex}/`;
}
if (defined(uri)) {
if (defined(uri) && defined(that._parent.resource)) {
that._resource = that._parent.resource.getDerivedResource({ url: uri });
}

Expand Down

0 comments on commit 5f2d6d8

Please sign in to comment.