From 948556133829386dbc54b7830d65916894377ae1 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 24 Dec 2024 15:08:24 +1100 Subject: [PATCH] Add a little explanation of the index being a vertex or instance index. --- .../CesiumRuntime/Private/CesiumFeatureIdAttribute.cpp | 4 ++-- Source/CesiumRuntime/Public/CesiumFeatureIdAttribute.h | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Source/CesiumRuntime/Private/CesiumFeatureIdAttribute.cpp b/Source/CesiumRuntime/Private/CesiumFeatureIdAttribute.cpp index f1d7c5eec..60936b34e 100644 --- a/Source/CesiumRuntime/Private/CesiumFeatureIdAttribute.cpp +++ b/Source/CesiumRuntime/Private/CesiumFeatureIdAttribute.cpp @@ -82,8 +82,8 @@ int64 UCesiumFeatureIdAttributeBlueprintLibrary::GetCount( int64 UCesiumFeatureIdAttributeBlueprintLibrary::GetFeatureID( UPARAM(ref) const FCesiumFeatureIdAttribute& FeatureIDAttribute, - int64 VertexIndex) { + int64 Index) { return std::visit( - CesiumGltf::FeatureIdFromAccessor{VertexIndex}, + CesiumGltf::FeatureIdFromAccessor{Index}, FeatureIDAttribute._featureIdAccessor); } diff --git a/Source/CesiumRuntime/Public/CesiumFeatureIdAttribute.h b/Source/CesiumRuntime/Public/CesiumFeatureIdAttribute.h index 875914efe..7604a1239 100644 --- a/Source/CesiumRuntime/Public/CesiumFeatureIdAttribute.h +++ b/Source/CesiumRuntime/Public/CesiumFeatureIdAttribute.h @@ -29,7 +29,8 @@ enum class ECesiumFeatureIdAttributeStatus : uint8 { /** * @brief A blueprint-accessible wrapper for a feature ID attribute from a glTF * model. Provides access to feature IDs which can be used with the - * corresponding {@link FCesiumPropertyTable} to access metadata. + * corresponding {@link FCesiumPropertyTable} to access metadata. These feature + * IDs may be defined per-vertex or per-instance. */ USTRUCT(BlueprintType) struct CESIUMRUNTIME_API FCesiumFeatureIdAttribute { @@ -133,6 +134,9 @@ class CESIUMRUNTIME_API UCesiumFeatureIdAttributeBlueprintLibrary * Gets the number of elements in the attribute. This is distinct from the * number of unique feature IDs within the attribute. * + * For a feature ID attribute of a regular mesh, this is the number of + * vertices. For a per-instance feature ID, this is the number of instances. + * * If the feature ID attribute is invalid, this returns 0. */ UFUNCTION( @@ -146,6 +150,10 @@ class CESIUMRUNTIME_API UCesiumFeatureIdAttributeBlueprintLibrary * Gets the feature ID at the given index. A feature ID can be used with a * FCesiumPropertyTable to retrieve the metadata for that ID. If the feature * ID attribute is invalid, this returns -1. + * + * For a feature ID attribute of a regular mesh, the provided Index is the + * index of a vertex within the mesh. For a per-instance feature ID, the + * provided Index is the index of the instance. */ UFUNCTION( BlueprintCallable,