Cesium for Unreal 2.21.0
Loading...
Searching...
No Matches
CesiumLoadedTile.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
5#include "Cesium3DTilesSelection/Tile.h"
9
10#include "Math/Vector.h"
11#include "UObject/ObjectMacros.h"
12
13#include "CesiumLoadedTile.generated.h"
14
16class UStaticMeshComponent;
17
18UINTERFACE()
19class UCesiumLoadedTile : public UInterface {
20 GENERATED_BODY()
21};
22
23/**
24 * Provides access to the details of a tile loaded by the @ref Cesium3DTileset.
25 * This interface is implemented by the `USceneComponent` subclass that
26 * represents the tile.
27 */
29 GENERATED_BODY()
30public:
31 /**
32 * Gets the tile identifier: this is informational only, as there is no
33 * guarantee of uniqueness.
34 */
35 virtual const Cesium3DTilesSelection::TileID& GetTileID() const = 0;
36
37 /**
38 * Gets the glTF model from which the tile data was obtained.
39 */
40 virtual const CesiumGltf::Model* GetGltfModel() const = 0;
41
42 /**
43 * Gets the scaling factor that was applied (via component-wise
44 * multiplication) to the vertices of this tile's glTF model to obtain the
45 * values represented in the corresponding Unreal mesh components. See @ref
46 * ICesiumLoadedTilePrimitive::GetMeshComponent}.
47 */
49
50 /**
51 * Gets the tileset Actor that the tile belongs to.
52 */
54
55 /**
56 * Gets the blueprint-accessible wrapper for metadata contained in the tile's
57 * glTF model.
58 */
59 virtual const FCesiumModelMetadata& GetModelMetadata() const = 0;
60};
61
62// Not merged with ICesiumPrimitive because this is Public whereas
63// ICesiumPrimitive is Private
64UINTERFACE()
65class UCesiumLoadedTilePrimitive : public UInterface {
66 GENERATED_BODY()
67};
68
69/**
70 * Provides access to the details of a glTF `MeshPrimitive` loaded by the @ref
71 * Cesium3DTileset. This interface is implemented by the `USceneComponent`
72 * subclass that represents a single glTF primitive that is part of the tile's
73 * glTF model.
74 */
76 GENERATED_BODY()
77public:
78 /**
79 * Gets the loaded tile that this primitive belongs to.
80 */
82
83 /**
84 * Gets the Unreal static mesh component built to represent the glTF
85 * primitive.
86 */
87 virtual UStaticMeshComponent& GetMeshComponent() = 0;
88
89 /**
90 * Gets the Blueprint-accessible wrapper for the glTF Primitive's mesh
91 * features.
92 */
94
95 /**
96 * Gets the Blueprint-accessible wrapper for the glTF Primitive's
97 * `EXT_structural_metadata` extension.
98 */
100
101 /**
102 * Gets the glTF primitive.
103 */
104 virtual const CesiumGltf::MeshPrimitive* GetMeshPrimitive() const = 0;
105
106 /**
107 * Maps an accessor index in the glTF primitive to its corresponding texture
108 * coordinate index in the Unreal mesh. The -1 key is reserved for implicit
109 * feature IDs (in other words, the vertex index).
110 *
111 * @param AccessorIndex An accessor index in the glTF primitive
112 * @return A texture coordinate index in the Unreal mesh, or std::nullopt if
113 * none was found for the AccessorIndex passed.
114 */
115 virtual std::optional<uint32_t>
116 FindTextureCoordinateIndexForGltfAccessor(int32_t AccessorIndex) const = 0;
117};
Provides access to the details of a glTF MeshPrimitive loaded by the Cesium3DTileset.
virtual const FCesiumPrimitiveFeatures & GetPrimitiveFeatures() const =0
Gets the Blueprint-accessible wrapper for the glTF Primitive's mesh features.
virtual std::optional< uint32_t > FindTextureCoordinateIndexForGltfAccessor(int32_t AccessorIndex) const =0
Maps an accessor index in the glTF primitive to its corresponding texture coordinate index in the Unr...
virtual const FCesiumPrimitiveMetadata & GetPrimitiveMetadata() const =0
Gets the Blueprint-accessible wrapper for the glTF Primitive's EXT_structural_metadata extension.
virtual const CesiumGltf::MeshPrimitive * GetMeshPrimitive() const =0
Gets the glTF primitive.
virtual ICesiumLoadedTile & GetLoadedTile()=0
Gets the loaded tile that this primitive belongs to.
virtual UStaticMeshComponent & GetMeshComponent()=0
Gets the Unreal static mesh component built to represent the glTF primitive.
Provides access to the details of a tile loaded by the Cesium3DTileset.
virtual const Cesium3DTilesSelection::TileID & GetTileID() const =0
Gets the tile identifier: this is informational only, as there is no guarantee of uniqueness.
virtual const FCesiumModelMetadata & GetModelMetadata() const =0
Gets the blueprint-accessible wrapper for metadata contained in the tile's glTF model.
virtual ACesium3DTileset & GetTilesetActor()=0
Gets the tileset Actor that the tile belongs to.
virtual FVector GetGltfToUnrealLocalVertexPositionScaleFactor() const =0
Gets the scaling factor that was applied (via component-wise multiplication) to the vertices of this ...
virtual const CesiumGltf::Model * GetGltfModel() const =0
Gets the glTF model from which the tile data was obtained.
std::variant< std::string, CesiumGeometry::QuadtreeTileID, CesiumGeometry::OctreeTileID, CesiumGeometry::UpsampledQuadtreeNode > TileID
A blueprint-accessible wrapper for metadata contained in a glTF model.
A Blueprint-accessible wrapper for a glTF Primitive's mesh features.
A Blueprint-accessible wrapper for a glTF Primitive's EXT_structural_metadata extension.