Skip to content

Commit

Permalink
make attributeOrTexture nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
bertt committed Jan 13, 2024
1 parent 0397790 commit f2eeecf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/SharpGLTF.Ext.3DTiles/Schema2/FeatureIDBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ namespace SharpGLTF.Schema2.Tiles3D
{
public sealed class FeatureIDBuilder : IMeshFeatureIDInfo, IEquatable<IMeshFeatureIDInfo>
{

public FeatureIDBuilder(int featureCount, OneOf<int, Texture>? attributeOrTexture, PropertyTable propertyTable = null, string label = null, int? nullFeatureId = null)
public FeatureIDBuilder(int featureCount, OneOf<int, Texture>? attributeOrTexture = null, PropertyTable propertyTable = null, IReadOnlyList<int> channels = null, string label = null, int? nullFeatureId = null)
{
Guard.MustBeGreaterThanOrEqualTo(featureCount, 1, nameof(featureCount));
FeatureCount = featureCount;
Expand All @@ -19,7 +18,7 @@ public FeatureIDBuilder(int featureCount, OneOf<int, Texture>? attributeOrTextur
texture =>
{
Texture = texture;
Channels = new[] { 0 };
Channels = channels ?? new[] { 0 };
}
);
}
Expand All @@ -40,7 +39,7 @@ public FeatureIDBuilder(int featureCount, OneOf<int, Texture>? attributeOrTextur

public int? PropertyTableIndex { get; set; }

public Texture Texture { get; set; }
public Texture Texture { get; set; }
public IReadOnlyList<int> Channels { get; set; }

public bool Equals(IMeshFeatureIDInfo other)
Expand Down
2 changes: 1 addition & 1 deletion tests/SharpGLTF.Cesium.Tests/ExtInstanceFeaturesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void AddExtGpuInstanceFeatures()


var featureId0 = new FeatureIDBuilder(2, 0, label: "Forests");
var featureId1 = new FeatureIDBuilder(9, 0, label: "Trees");
var featureId1 = new FeatureIDBuilder(9, label: "Trees");

var model = sceneBuilder.ToGltf2(settings);
model.LogicalNodes[0].AddInstanceFeatureIds(featureId0, featureId1);
Expand Down

0 comments on commit f2eeecf

Please sign in to comment.