Skip to content

Commit

Permalink
Add a little explanation of the index being a vertex or instance index.
Browse files Browse the repository at this point in the history
  • Loading branch information
kring committed Dec 24, 2024
1 parent 83462a6 commit 9485561
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Source/CesiumRuntime/Private/CesiumFeatureIdAttribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
10 changes: 9 additions & 1 deletion Source/CesiumRuntime/Public/CesiumFeatureIdAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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(
Expand All @@ -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,
Expand Down

0 comments on commit 9485561

Please sign in to comment.