ULandscapeComponent

Inheritance Hierarchy

Syntax

class ULandscapeComponent : public UPrimitiveComponent

Variables

Name Description

Public variable

FGuid

 

BakedTextureMaterialGuid

The Material Guid that used when baking, to detect material recompilations

Public variable

FBox

 

CachedLocalBox

Cached local-space bounding box, created at heightmap update time

Public variable

TLazyObjectPtr <...

 

CollisionComponent

Reference to associated collision component

Public variable

int32

 

CollisionMipLevel

Heightfield mipmap used to generate collision

Public variable

int32

 

ComponentSizeQuads

Total number of quads for this component, has to be >0

Public variable

FLandscapeEditT ...

 

EditToolRenderData

Pointer to data shared with the render thread, used by the editor tools

Public variable

int32

 

ForcedLOD

Forced LOD level to use when rendering

Public variable

UTexture2D *...

 

GIBakedBaseColorTexture

Pre-baked Base Color texture for use by distance field GI

Public variable

TSharedRef < FLa ...

 

GrassData

Grass data for generation

Public variable

FVector4

 

HeightmapScaleBias

UV offset to Heightmap data from component local coordinates

Public variable

UTexture2D *...

 

HeightmapTexture

Heightmap texture reference

Public variable

TArray < ULandsc ...

 

LayerWhitelist

List of layers allowed to be painted on this component.

Public variable

int32

 

LightingLODBias

LOD level Bias to use when lighting buidling via lightmass, -1 Means automatic LOD calculation based on ForcedLOD + LODBias

Public variable

int32

 

LODBias

LOD level Bias to use when rendering

Public variable

FGuid

 

MapBuildDataId

WITH_EDITORONLY_DATA.

Public variable

TArray < UMateri ...

 

MaterialInstances

Public variable

uint8

 

MobileBlendableLayerMask

For ES2

Public variable

FGuid

 

MobileDataSourceHash

Hash of source for ES2 generated data.

Public variable

UMaterialInterf ...

 

MobileMaterialInterface

Material interface used for ES2. Serialized only when cooking or loading cooked builds.

Public variable

UTexture2D *...

 

MobileWeightNormalmapTexture

Generated weight/normal map texture used for ES2.

Public variable

float

 

NegativeZBoundsExtension

Allows overriding the landscape bounds.

Public variable

int32

 

NumSubsections

Number of subsections in X or Y axis

Public variable

UMaterialInterf ...

 

OverrideHoleMaterial

Public variable

UMaterialInterf ...

 

OverrideMaterial

Public variable

FLandscapeCompo ...

 

PlatformData

Platform Data where don't support texture sampling in vertex buffer

Public variable

float

 

PositiveZBoundsExtension

Allows overriding the landscape bounds.

Public variable

int32

 

SectionBaseX

X offset from global components grid origin (in quads)

Public variable

int32

 

SectionBaseY

Y offset from global components grid origin (in quads)

Public variable

int32

 

SimpleCollisionMipLevel

Heightfield mipmap used to generate simple collision

Public variable

FGuid

 

StateId

Public variable

float

 

StaticLightingResolution

StaticLightingResolution overriding per component, default value 0 means no overriding

Public variable

int32

 

SubsectionSizeQuads

Number of quads for a subsection of the component. SubsectionSizeQuads+1 must be a power of two.

Public variable

TArray < FWeight ...

 

WeightmapLayerAllocations

List of layers, and the weightmap and channel they are stored

Public variable

FVector4

 

WeightmapScaleBias

UV offset to component's weightmap data from component local coordinates

Public variable

float

 

WeightmapSubsectionOffset

U or V offset into the weightmap for the first subsection, in texture UV space

Public variable

TArray < UTextur ...

 

WeightmapTextures

Weightmap texture reference

Public variable

UTexture2D *...

 

XYOffsetmapTexture

XYOffsetmap texture reference

Constructors

Name Description

Public function

ULandscapeComponent

(
    const FObjectInitializer & ObjectIn...
)

Functions

Name Description

Public function Static

void

 

AddReferencedObjects

(
    UObject * InThis,
    FReferenceCollector & Collector
)

Public function

bool

 

AreTexturesStreamedForGrassMapRender()

Are the textures we need to render a grassmap currently streamed in?

Public function

bool

 

CanRenderGrassMap()

Could a grassmap currently be generated, disregarding whether our textures are streamed in?

Public function

void

 

CheckGenerateLandscapePlatformData

(
    bool bIsCooking
)

Generate mobile data if it's missing or outdated

Public function

LANDSCAPE_AP...

 

ComponentHasVisibilityPainted()

Returns true if this component has visibility painted

Public function Static

LANDSCAPE_AP...

 

CreateEmptyTextureMips

(
    UTexture2D * Texture,
    bool bClear
)

Generate empty mipmaps for weightmap

Public function

LANDSCAPE_AP...

 

DeleteLayer

(
    ULandscapeLayerInfoObject * Lay...,
    FLandscapeEditDataInterface & Lands...
)

Deletes a layer from this component, removing all its data

Public function

LANDSCAPE_AP...

 

FillLayer

(
    ULandscapeLayerInfoObject * Lay...,
    FLandscapeEditDataInterface & Lands...
)

Fills a layer to 100% on this component, adding it if needed and removing other layers that get painted away

Public function

LANDSCAPE_AP...

 

FixupWeightmaps()

Fix up component layers, weightmaps

Public function

void

 

GenerateHeightmapMips

(
    TArray < FColor * >& HeightmapT...,
    int32 ComponentX1,
    int32 ComponentY1,
    int32 ComponentX2,
    int32 ComponentY2,
    FLandscapeTextureDataInfo * Tex...
)

Generate mipmaps for height and tangent data.

Public function Static

void

 

GenerateMipsTempl

(
    int32 InNumSubsections,
    int32 InSubsectionSizeQuads,
    UTexture2D * WeightmapTexture,
    DataType* BaseMipData
)

Generate mipmaps for weightmap Assumes all weightmaps are unique to this component.

Public function

void

 

GeneratePlatformPixelData()

Public function

void

 

GeneratePlatformVertexData()

Generates mobile platform data for this component.

Public function Static

void

 

GenerateWeightmapMips

(
    int32 InNumSubsections,
    int32 InSubsectionSizeQuads,
    UTexture2D * WeightmapTexture,
    FColor * BaseMipData
)

Public function

UMaterialIns ...

 

GetCombinationMaterial

(
    bool bMobile
)

Helper function for UpdateMaterialInstance to get Material without set parameters

Public function

LANDSCAPE_AP...

 

GetComponentExtent

(
    int32 & MinX,
    int32 & MinY,
    int32 & MaxX,
    int32 & MaxY
)

Extends passed region with this component section size

Public function

LANDSCAPE_AP...

 

GetGeneratedTexturesAndMaterialInstances

(
    TArray < UObject * >& OutTextur...
)

Returns all generated textures and material instances used by this component.

Public function

ALandscape &...

 

GetLandscapeActor()

Get the landscape actor associated with this component.

Public function

LANDSCAPE_AP...

 

GetLandscapeHoleMaterial()

Returns the actor's LandscapeHoleMaterial, or the Component's OverrideLandscapeHoleMaterial if set

Public function

LANDSCAPE_AP...

 

GetLandscapeInfo()

Gets the landscape info object for this landscape

Public function

LANDSCAPE_AP...

 

GetLandscapeMaterial()

Returns the actor's LandscapeMaterial, or the Component's OverrideLandscapeMaterial if set

Public function

LANDSCAPE_AP...

 

GetLandscapeProxy()

Gets the landscape proxy actor which owns this component

Public function

FString

 

GetLayerAllocationKey

(
    UMaterialInterface * LandscapeM...,
    bool bMobile
)

Generate a key for this component's layer allocations to use with MaterialInstanceConstantMap.

Public function

void

 

GetLayerDebugColorKey

(
    int32 & R,
    int32 & G,
    int32 & B
)

Public function

LANDSCAPE_AP...

 

GetLayerWeightAtLocation

(
    const FVector & InLocation,
    ULandscapeLayerInfoObject * Lay...,
    TArray < uint8 >* LayerCache
)

Public function

ULevel *

 

GetLevel()

Get the level in which the owning actor resides

Public function

const FGuid ...

 

GetLightingGuid()

Public function

FGuid

 

GetMapBuildDataId()

Public function

LANDSCAPE_AP...

 

GetMeshMapBuildData()

Public function

LANDSCAPE_AP...

 

GetSectionBase()

Component section base as FIntPoint

Public function Virtual

void

 

GetStaticLightingInfo

(
    FStaticLightingPrimitiveInfo & OutP...,
    const TArray < ULightComponent *...,
    const FLightingBuildOptions & Optio...
)

Public function

LANDSCAPE_AP...

 

Init

(
    int32 InBaseX,
    int32 InBaseY,
    int32 InComponentSizeQuads,
    int32 InNumSubsections,
    int32 InSubsectionSizeQuads
)

Initialize the landscape component

Public function

LANDSCAPE_AP...

 

InitHeightmapData

(
    TArray < FColor >& Heights,
    bool bUpdateCollision
)

Public function

LANDSCAPE_AP...

 

InitWeightmapData

(
    TArray < ULandscapeLayerInfoObject &...,
    TArray < TArray < uint8 > >& Weights
)

Public function

bool

 

IsGrassMapOutdated()

Is the grassmap data outdated, eg by a material

Public function

bool

 

MaterialHasGrass()

True if the component's landscape material supports grass

Public function

void

 

ReallocateWeightmaps

(
    FLandscapeEditDataInterface * D...
)

Create weightmaps for this component for the layers specified in the WeightmapLayerAllocations array

Public function

void

 

RemoveGrassMap()

Public function

void

 

RemoveInvalidWeightmaps()

Public function

void

 

RenderGrassMap()

Creates and destroys cooked grass data stored in the map

Public function

TArray < uint ...

 

RenderWPOHeightmap

(
    int32 LOD
)

Renders the heightmap of this component (including material world-position-offset) at the specified LOD

Public function

LANDSCAPE_AP...

 

ReplaceLayer

(
    ULandscapeLayerInfoObject * Fro...,
    ULandscapeLayerInfoObject * ToL...,
    FLandscapeEditDataInterface & Lands...
)

Replaces one layerinfo on this component with another

Public function

void

 

SerializeStateHashes

(
    FArchive & Ar
)

Serialize all hashes/guids that record the current state of this component

Public function

void

 

SetLightingGuid()

Public function

void

 

SetLOD

(
    bool bForced,
    int32 InLODValue
)

Public function

LANDSCAPE_AP...

 

SetSectionBase

(
    FIntPoint InSectionBase
)

Public function

LANDSCAPE_AP...

 

UpdateCachedBounds()

Recalculate cached bounds using height values.

Public function

void

 

UpdateCollisionData

(
    bool bRebuild
)

Updates collision component height data for the entire component, locking and unlocking heightmap textures

Public function

void

 

UpdateCollisionHeightData

(
    const FColor * HeightmapTexture...,
    const FColor * SimpleCollisionH...,
    int32 ComponentX1,
    int32 ComponentY1,
    int32 ComponentX2,
    int32 ComponentY2,
    bool bUpdateBounds,
    const FColor * XYOffsetTextureM...
)

Create or updates collision component height data

Public function

LANDSCAPE_AP...

 

UpdateCollisionLayerData()

Update collision component dominant layer data for the whole component, locking and unlocking the weightmap textures.

Public function

void

 

UpdateCollisionLayerData

(
    const FColor *const* Weigh...,
    const FColor *const*const ...,
    int32 ComponentX1,
    int32 ComponentY1,
    int32 ComponentX2,
    int32 ComponentY2
)

Update collision component dominant layer data

Public function Static

void

 

UpdateDataMips

(
    int32 InNumSubsections,
    int32 InSubsectionSizeQuads,
    UTexture2D * Texture,
    TArray < uint8 * >& TextureMipD...,
    int32 ComponentX1,
    int32 ComponentY1,
    int32 ComponentX2,
    int32 ComponentY2,
    FLandscapeTextureDataInfo * Tex...
)

Public function

LANDSCAPE_AP...

 

UpdatedSharedPropertiesFromActor()

Updates the values of component-level properties exposed by the Landscape Actor

Public function

LANDSCAPE_AP...

 

UpdateEditToolRenderData()

Public function

LANDSCAPE_AP...

 

UpdateLayerWhitelistFromPaintedLayers()

Update layer whitelist to include the currently painted layers.

Public function

LANDSCAPE_AP...

 

UpdateMaterialInstances()

Update the MaterialInstance parameters to match the layer and weightmaps for this component Creates the MaterialInstance if it doesn't exist.

Public function

void

 

UpdateMaterialInstances_Internal

(
    FMaterialUpdateContext & Context
)

Internal implementation of UpdateMaterialInstances, not safe to call directly.

Public function Static

void

 

UpdateMipsTempl

(
    int32 InNumSubsections,
    int32 InSubsectionSizeQuads,
    UTexture2D * WeightmapTexture,
    TArray < DataType* >& Weightma...,
    int32 ComponentX1,
    int32 ComponentY1,
    int32 ComponentX2,
    int32 ComponentY2,
    FLandscapeTextureDataInfo * Tex...
)

Update mipmaps for existing weightmap texture

Public function

void

 

UpdateNavigationRelevance()

Updates navigation properties to match landscape's master switch

Public function Static

LANDSCAPE_AP...

 

UpdateWeightmapMips

(
    int32 InNumSubsections,
    int32 InSubsectionSizeQuads,
    UTexture2D * WeightmapTexture,
    TArray < FColor * >& WeightmapT...,
    int32 ComponentX1,
    int32 ComponentY1,
    int32 ComponentX2,
    int32 ComponentY2,
    FLandscapeTextureDataInfo * Tex...
)

Overridden from UPrimitiveComponent

Name Description

Public function Virtual

bool

 

ComponentIsTouchingSelectionBox

(
    const FBox & InSelBBox,
    const FEngineShowFlags & ShowFlags,
    const bool bConsiderOnlyBSP,
    const bool bMustEncompassEntireComp...
)

Determines whether the supplied bounding box intersects with the component.

Public function Virtual

bool

 

ComponentIsTouchingSelectionFrustum

(
    const FConvexVolume & InFrustum,
    const FEngineShowFlags & ShowFlags,
    const bool bConsiderOnlyBSP,
    const bool bMustEncompassEntireComp...
)

Determines whether the supplied frustum intersects with the component.

Public function Virtual

FPrimitiveSc ...

 

CreateSceneProxy()

Creates a proxy to represent the primitive to the scene manager in the rendering thread.

Public function Virtual

void

 

GetLightAndShadowMapMemoryUsage

(
    int32 & LightMapMemoryUsage,
    int32 & ShadowMapMemoryUsage
)

Returns the light and shadow map memory for this primitive in its out variables.

Public function Virtual

bool

 

GetLightMapResolution

(
    int32 & Width,
    int32 & Height
)

Returns the lightmap resolution used for this primitive instance in the case of it supporting texture light/ shadow maps.

Public function Virtual

UMaterialInt ...

 

GetMaterial

(
    int32 ElementIndex
)

Returns the material used by the element at the specified index

Public function Virtual

int32

 

GetNumMaterials()

Number of material elements in this primitive

Public function Virtual

ELightMapInt ...

 

GetStaticLightingType()

Requests whether the component will use texture, vertex or no lightmaps.

Public function Virtual

int32

 

GetStaticLightMapResolution()

Returns the static lightmap resolution used for this primitive.

Public function Virtual

void

 

GetStreamingTextureInfo

Enumerates the streaming textures used by the primitive.

Public function Virtual

void

 

GetUsedMaterials

(
    TArray < UMaterialInterface * > ...,
    bool bGetDebugMaterials
)

Retrieves the materials used in this component

Public function Virtual

void

 

SetMaterial

(
    int32 ElementIndex,
    UMaterialInterface * Material
)

Changes the material applied to an element of the mesh.

Protected function Virtual

bool

 

SupportsStaticLighting()

Whether the component type supports static lighting.

Overridden from USceneComponent

Name Description

Public function Virtual

FBoxSphereBo ...

 

CalcBounds

(
    const FTransform & LocalToWorld
)

Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size.

Public function Virtual

bool

 

IsPrecomputedLightingValid()

Public function Virtual

void

 

PreFeatureLevelChange

(
    ERHIFeatureLevel::Type PendingFeatu...
)

Public function Virtual

void

 

PropagateLightingScenarioChange()

Overridden from UActorComponent

Name Description

Public function Virtual

void

 

DestroyComponent

(
    bool bPromoteChildren
)

Unregister the component, remove it from its outer Actor's Components array and mark for pending kill.

Public function Virtual

void

 

InvalidateLightingCacheDetailed

(
    bool bInvalidateBuildEnqueuedLighti...,
    bool bTranslationOnly
)

Called when this actor component has moved, allowing it to discard statically cached lighting information.

Public function Virtual

void

 

OnRegister()

WITH_EDITOR.

Public function Virtual

void

 

OnUnregister()

Called when a component is unregistered.

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginCacheForCookedPlatformData

(
    const ITargetPlatform * TargetP...
)

Starts caching of platform specific data for the target platform Called when cooking before serialization so that object can prepare platform specific data Not called during normal loading of objects

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual

void

 

ExportCustomProperties

(
    FOutputDevice & Out,
    uint32 Indent
)

Exports the property values for the specified object as text to the output device.

Public function Virtual

void

 

GetResourceSizeEx

(
    FResourceSizeEx & CumulativeResourc...
)

Get the size of the object/resource for display to artists/LDs in the Editor.

Public function Virtual

void

 

ImportCustomProperties

(
    const TCHAR * SourceText,
    FFeedbackContext * Warn
)

Exports the property values for the specified object as text to the output device.

Public function Virtual

void

 

PostDuplicate

(
    bool bDuplicateForPIE
)

Called after duplication & serialization and before PostLoad.

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent & PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostEditUndo()

Called after applying a transaction to the object.

Public function Virtual

void

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Public function Virtual

void

 

PostLoad()

WITH_EDITOR.

Public function Virtual

void

 

PreEditChange

(
    UProperty * PropertyAboutToChan...
)

This is called when property is about to be modified by InterpPropertyTracks

Public function Virtual

void

 

Serialize

(
    FArchive & Ar
)

UObject serializer.

References

Module

Landscape

Header

Runtime/Landscape/Classes/LandscapeComponent.h