Cesium for Unreal 2.15.0
Loading...
Searching...
No Matches
CesiumTile.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
5#include "Components/PrimitiveComponent.h"
6#include "CoreMinimal.h"
7#include <Cesium3DTilesSelection/BoundingVolume.h>
8#include "CesiumTile.generated.h"
9
10/**
11 * A UObject representation of a Cesium Tile.
12 * This class provides an interface for accessing properties of a Cesium Tile
13 * from within Unreal Engine. It exposes the Bounds property, which can be
14 * accessed from Blueprints, and provides a helper function for testing
15 * intersection with a primitive component.
16 */
17UCLASS()
18class CESIUMRUNTIME_API UCesiumTile : public UPrimitiveComponent {
19 GENERATED_BODY()
20
21 glm::dmat4 _tileTransform;
22
24 CesiumGeometry::OrientedBoundingBox(glm::dvec3(0.0), glm::dmat3(1.0));
25
26public:
27 /**
28 * Tests whether a primitive component overlaps with this tile using a sphere
29 * and box comparison. This function provides a convenient way to test for
30 * intersection between a primitive component and this tile.
31 */
32 UFUNCTION(BlueprintCallable, Category = "Cesium")
33 bool TileBoundsOverlapsPrimitive(const UPrimitiveComponent* Other) const;
34
35 /**
36 * Checks if this tile is fully inside the given primitive component using a
37 * sphere and box comparison. It uses the FBox::IsInside function to compare
38 * the FBox of the component and the tile's bounds.
39 */
40 UFUNCTION(BlueprintCallable, Category = "Cesium")
41 bool
42 PrimitiveBoxFullyContainsTileBounds(const UPrimitiveComponent* Other) const;
43
44 virtual FBoxSphereBounds
45 CalcBounds(const FTransform& LocalToWorld) const override;
46
48};
A UObject representation of a Cesium Tile.
Definition CesiumTile.h:18
bool TileBoundsOverlapsPrimitive(const UPrimitiveComponent *Other) const
Tests whether a primitive component overlaps with this tile using a sphere and box comparison.
friend class CesiumTileExcluderAdapter
Definition CesiumTile.h:47
bool PrimitiveBoxFullyContainsTileBounds(const UPrimitiveComponent *Other) const
Checks if this tile is fully inside the given primitive component using a sphere and box comparison.
virtual FBoxSphereBounds CalcBounds(const FTransform &LocalToWorld) const override
std::variant< CesiumGeometry::BoundingSphere, CesiumGeometry::OrientedBoundingBox, CesiumGeospatial::BoundingRegion, CesiumGeospatial::BoundingRegionWithLooseFittingHeights, CesiumGeospatial::S2CellBoundingVolume > BoundingVolume