UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
LandscapeGroup.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7
9class ULandscapeComponent;
11class UTexture2D;
13
14namespace UE::Landscape
15{
19}
20
22{
24
25 // read-write lock that protect access to XYToEdgeFixupMap, and registered ULandscapeHeightmapTextureEdgeFixup's Snapshots, EdgeModifiedFlags and GPUEdgeHashes
27
29
30 // Resolution, Origin and Size, defines the group coordinate system
31 // (the first component registered gets to be the origin)
33 FVector GroupCoordOrigin = FVector::ZeroVector; // world space position of the center of the origin component (render coord 0,0)
34 FVector GroupCoordXVector = FVector::ZeroVector; // world space vector in the direction of component local X
35 FVector GroupCoordYVector = FVector::ZeroVector; // world space vector in the direction of component local Y
36 FVector LandscapeGridScale = FVector::ZeroVector; // scale used to calculate normals, value set at the same time as above
37
38 // map of fixups (key is group coordinate)
40
41 // global map of heightmap textures to the landscape active component
42 // (this is used to detect and handle shared heightmaps)
44
45 // set of fixups that are registered with this group (some of which may not be mapped)
46 // this is only used to double check correct behavior
48
49 // set of fixups that were moved and may need to modify their mapped position (or if all are moved, we may need to reset the map grid)
51
52#if WITH_EDITOR
53 // fixups that need to capture new edge snapshots
55#endif // WITH_EDITOR
56
57 // fixups that may need to GPU edge patch their heightmap textures
59
60 // amortization state for amortized slow checks
62
67
69
70 void RegisterComponent(ULandscapeComponent* Component);
71 void UnregisterComponent(ULandscapeComponent* Component);
72 void OnTransformUpdated(ULandscapeComponent* Component);
73
77
79 {
81 if (Result != nullptr)
82 {
83 return Result->Get();
84 }
85 return nullptr;
86 }
87
93
95
96private:
97 void DisableAndUnmap(ULandscapeHeightmapTextureEdgeFixup* Fixup);
98 FIntPoint Map(ULandscapeHeightmapTextureEdgeFixup* Fixup, ULandscapeComponent* Component);
99 void Unmap(ULandscapeHeightmapTextureEdgeFixup* Fixup, const bool bRemoveFromLists = true);
100};
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition LandscapeStreamingProxy.h:20
Definition UObjectGlobals.h:2492
Definition SetUtilities.h:95
Definition UnrealString.h.inl:34
Definition CriticalSection.h:14
int32 Find(CharRangeType &&SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart, int32 StartPosition=INDEX_NONE) const
Definition UnrealString.h.inl:1116
Definition LandscapeEdgeFixup.h:205
Definition LandscapeSubsystem.h:103
Definition Texture2D.h:26
Definition Landscape.h:55
EDirectionIndex
Definition LandscapeEdgeFixup.h:22
bool ShouldPatchAllLandscapeComponentEdges(bool bResetForNext)
Definition LandscapeGroup.cpp:62
bool ShouldPatchStreamingMipEdges()
Definition LandscapeGroup.cpp:51
FIntPoint GetNeighborRelativePosition(ENeighborIndex NeighborIndex)
Definition LandscapeEdgeFixup.cpp:45
bool ShouldInstallEdgeFixup()
Definition LandscapeGroup.cpp:34
Definition LandscapeGroup.h:22
static void AddReferencedObjects(FLandscapeGroup *InThis, FReferenceCollector &Collector)
Definition LandscapeGroup.cpp:622
FLandscapeGroup(uint32 InLandscapeGroupKey)
Definition LandscapeGroup.h:63
uint32 LandscapeGroupKey
Definition LandscapeGroup.h:28
ULandscapeHeightmapTextureEdgeFixup * GetEdgeFixupAtCoord(FIntPoint Coord)
Definition LandscapeGroup.h:78
TMap< FIntPoint, TObjectPtr< ULandscapeHeightmapTextureEdgeFixup > > XYToEdgeFixupMap
Definition LandscapeGroup.h:39
TSet< TObjectPtr< ULandscapeHeightmapTextureEdgeFixup > > AllRegisteredFixups
Definition LandscapeGroup.h:47
TSet< TObjectPtr< ULandscapeHeightmapTextureEdgeFixup > > HeightmapsMoved
Definition LandscapeGroup.h:50
ULandscapeHeightmapTextureEdgeFixup * GetNeighborEdgeFixup(FIntPoint Coord, UE::Landscape::ENeighborIndex NeighborIndex)
Definition LandscapeGroup.h:88
static void RegisterAllComponentsOnStreamingProxy(ALandscapeStreamingProxy *StreamingProxy)
Definition LandscapeGroup.cpp:569
FVector GroupCoordXVector
Definition LandscapeGroup.h:34
int32 ComponentResolution
Definition LandscapeGroup.h:32
FVector GroupCoordOrigin
Definition LandscapeGroup.h:33
static void UnregisterAllComponentsOnStreamingProxy(ALandscapeStreamingProxy *StreamingProxy)
Definition LandscapeGroup.cpp:605
static TMap< TObjectPtr< UTexture2D >, TObjectPtr< ULandscapeComponent > > HeightmapTextureToActiveComponent
Definition LandscapeGroup.h:43
TSet< TObjectPtr< ULandscapeHeightmapTextureEdgeFixup > > HeightmapsNeedingEdgeTexturePatching
Definition LandscapeGroup.h:58
void TickEdgeFixup(ULandscapeSubsystem *LandscapeSubsystem, bool bForcePatchAll)
Definition LandscapeGroup.cpp:663
FSetElementId AmortizeIndex
Definition LandscapeGroup.h:61
~FLandscapeGroup()
Definition LandscapeGroup.cpp:893
FVector GroupCoordYVector
Definition LandscapeGroup.h:35
FRWLock RWLock
Definition LandscapeGroup.h:26
void OnTransformUpdated(ULandscapeComponent *Component)
Definition LandscapeGroup.cpp:294
void UnregisterComponent(ULandscapeComponent *Component)
Definition LandscapeGroup.cpp:220
void RegisterComponent(ULandscapeComponent *Component)
Definition LandscapeGroup.cpp:79
FVector LandscapeGridScale
Definition LandscapeGroup.h:36
Definition ObjectPtr.h:488
Definition IntPoint.h:25
static CORE_API const TVector< double > ZeroVector
Definition Vector.h:79