Skip to content

Commit

Permalink
Add constant for -1 tilesetId
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Jul 12, 2023
1 parent e43b512 commit 9a1346d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/core/include/cesium/omniverse/FabricUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ struct FabricStatistics {
uint64_t trianglesRendered{0};
};

// -1 means the prim is not yet associated with a tileset
const auto NO_TILESET_ID = int64_t(-1);

} // namespace cesium::omniverse

namespace cesium::omniverse::FabricUtil {
Expand Down
2 changes: 1 addition & 1 deletion src/core/src/FabricGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void FabricGeometry::reset() {
displayColorFabric[0] = DEFAULT_VERTEX_COLOR;
displayOpacityFabric[0] = DEFAULT_VERTEX_OPACITY;

FabricUtil::setTilesetId(_pathFabric, -1);
FabricUtil::setTilesetId(_pathFabric, NO_TILESET_ID);

srw.setArrayAttributeSize(_pathFabric, FabricTokens::material_binding, 0);
srw.setArrayAttributeSize(_pathFabric, FabricTokens::faceVertexCounts, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/core/src/FabricMaterial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void FabricMaterial::reset() {
auto srw = UsdUtil::getFabricStageReaderWriter();

setMaterialValues(GltfUtil::getDefaultMaterialInfo());
setTilesetId(-1);
setTilesetId(NO_TILESET_ID);

if (_materialDefinition.hasBaseColorTexture()) {
clearBaseColorTexture();
Expand Down
4 changes: 2 additions & 2 deletions src/core/src/FabricUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ FabricStatistics getStatistics() {
statistics.geometriesCapacity += paths.size();

for (size_t i = 0; i < paths.size(); i++) {
if (tilesetIdFabric[i] == -1) {
if (tilesetIdFabric[i] == NO_TILESET_ID) {
continue;
}

Expand All @@ -571,7 +571,7 @@ FabricStatistics getStatistics() {
statistics.materialsCapacity += paths.size();

for (size_t i = 0; i < paths.size(); i++) {
if (tilesetIdFabric[i] == -1) {
if (tilesetIdFabric[i] == NO_TILESET_ID) {
continue;
}

Expand Down

0 comments on commit 9a1346d

Please sign in to comment.