Cesium for Unreal 2.13.2
Loading...
Searching...
No Matches
CesiumPrimitiveMetadata.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
5#include "Kismet/BlueprintFunctionLibrary.h"
6#include "UObject/ObjectMacros.h"
7
8#include "CesiumPrimitiveMetadata.generated.h"
9
10namespace CesiumGltf {
11struct Model;
12struct MeshPrimitive;
13struct ExtensionModelExtStructuralMetadata;
14struct ExtensionMeshPrimitiveExtStructuralMetadata;
15} // namespace CesiumGltf
16
17/**
18 * A Blueprint-accessible wrapper for a glTF Primitive's EXT_structural_metadata
19 * extension. It holds the indices of the property textures / attributes
20 * associated with this primitive, which index into the respective arrays in the
21 * model's EXT_structural_metadata extension.
22 */
23USTRUCT(BlueprintType)
24struct CESIUMRUNTIME_API FCesiumPrimitiveMetadata {
25 GENERATED_USTRUCT_BODY()
26
27public:
28 /**
29 * Construct an empty primitive metadata.
30 */
32
33 /**
34 * Constructs a primitive metadata instance.
35 *
36 * @param Primitive The mesh primitive containing the EXT_structural_metadata
37 * extension
38 * @param Metadata The EXT_structural_metadata of the glTF mesh primitive.
39 */
41 const CesiumGltf::MeshPrimitive& Primitive,
43
44private:
45 TArray<int64> _propertyTextureIndices;
46 TArray<int64> _propertyAttributeIndices;
47
49};
50
51UCLASS()
53 : public UBlueprintFunctionLibrary {
54 GENERATED_BODY()
55
56public:
57 /**
58 * Gets the primitive metadata of a glTF primitive component. If component is
59 * not a Cesium glTF primitive component, the returned metadata is empty.
60 */
61 UFUNCTION(
62 BlueprintCallable,
63 BlueprintPure,
64 Category = "Cesium|Primitive|Metadata")
65 static const FCesiumPrimitiveMetadata&
66 GetPrimitiveMetadata(const UPrimitiveComponent* component);
67
68 /**
69 * Get the indices of the property textures that are associated with the
70 * primitive. This can be used to retrieve the actual property textures from
71 * the model's FCesiumModelMetadata.
72 */
73 UFUNCTION(
74 BlueprintCallable,
75 BlueprintPure,
76 Category = "Cesium|Primitive|Metadata")
77 static const TArray<int64>& GetPropertyTextureIndices(
78 UPARAM(ref) const FCesiumPrimitiveMetadata& PrimitiveMetadata);
79
80 /**
81 * Get the indices of the property attributes that are associated with the
82 * primitive. This can be used to retrieve the actual property attributes from
83 * the model's FCesiumModelMetadata.
84 */
85 UFUNCTION(
86 BlueprintCallable,
87 BlueprintPure,
88 Category = "Cesium|Primitive|Metadata")
89 static const TArray<int64>& GetPropertyAttributeIndices(
90 UPARAM(ref) const FCesiumPrimitiveMetadata& PrimitiveMetadata);
91};
static const FCesiumPrimitiveMetadata & GetPrimitiveMetadata(const UPrimitiveComponent *component)
Gets the primitive metadata of a glTF primitive component.
static const TArray< int64 > & GetPropertyAttributeIndices(UPARAM(ref) const FCesiumPrimitiveMetadata &PrimitiveMetadata)
Get the indices of the property attributes that are associated with the primitive.
static const TArray< int64 > & GetPropertyTextureIndices(UPARAM(ref) const FCesiumPrimitiveMetadata &PrimitiveMetadata)
Get the indices of the property textures that are associated with the primitive.
A Blueprint-accessible wrapper for a glTF Primitive's EXT_structural_metadata extension.
FCesiumPrimitiveMetadata(const CesiumGltf::MeshPrimitive &Primitive, const CesiumGltf::ExtensionMeshPrimitiveExtStructuralMetadata &Metadata)
Constructs a primitive metadata instance.
FCesiumPrimitiveMetadata()
Construct an empty primitive metadata.