AWaterBody

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Water

Header

/Engine/Plugins/Experimental/Water/Source/Runtime/Public/WaterBodyActor.h

Include

#include "WaterBodyActor.h"

Syntax

[UCLASS](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)(Blueprintable, Abstract,
       HideCategories=(Tags, Activation, Cooking, Replication, Input, Actor, AssetUserData))
class AWaterBody :
    public AActor,
    public INavRelevantInterface,
    public IWaterBrushActorInterface

Variables

Name Description

Protected variable UProperty Transient

UBillboardCompo...

 

ActorIcon

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

bool

 

bAffectsLandscape

If enabled, landscape will be deformed based on this water body placed on top of it and landscape height will be considered when determining water depth at runtime

Protected variable UProperty Category, EditAnywhere, Meta BlueprintReadWrite

bool

 

bCanAffectNavigation

Public variable UProperty Category, EditAnywhere, Meta

bool

 

bFillCollisionUnderWaterBodiesForNavmesh

Prevent navmesh generation under the water geometry

Public variable UProperty Category, EditAnywhere BlueprintReadOnly

bool

 

bGenerateCollisions

If true, one or more collision components associated with this water will be generated.

Protected variable UProperty Category BlueprintReadOnly

bool

 

bOverrideWaterMesh

TODO [jonathan.bard] : make sure override water mesh works for all types and remove the bool (WaterMeshOverride is already a pointer.

Protected variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

FName

 

CollisionProfileName

Protected variable UProperty Transient

FPostProcessSet...

 

CurrentPostProcessSettings

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

FWaterCurveSett...

 

CurveSettings

Protected variable UProperty Category, AdvancedDisplay editinstanceonly

TArray< TLazyOb...

 

ExclusionVolumes

Protected variable UProperty Category, AdvancedDisplay editinstanceonly

TArray< TLazyOb...

 

Islands

Islands in this water body

Protected variable UProperty Transient

TWeakObjectPtr<...

 

Landscape

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

TMap< FName, FW...

 

LayerWeightmapSettings

Public variable UProperty Category, EditAnywhere

float

 

MaxWaveHeightOffset

Offset added to the automatically calculated max wave height bounds.

Protected variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

int32

 

OverlapMaterialPriority

Higher number is higher priority.

Public variable UProperty Category, EditDefaultsOnly, Meta

UPhysicalMateri...

 

PhysicalMaterial

Protected variable UProperty Category, Meta BlueprintReadOnly visibleanywhere

UWaterSplineCom...

 

SplineComp

The spline data attached to this water type.

Public variable UProperty Category, EditAnywhere, Meta BlueprintReadWrite displayname

float

 

TargetWaveMaskDepth

Water depth at which waves start being attenuated.

Public variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

UMaterialInterf...

 

UnderwaterPostProcessMaterial

Post process material to apply when the camera goes underwater (only available when bGenerateCollisions is true because collisions are needed to detect if it's under water).

Protected variable UProperty Category, Meta Transient nonpieduplicatetransient, textexporttransient, visibleinstanceonly

UMaterialInstan...

 

UnderwaterPostProcessMID

Public variable UProperty Category, EditAnywhere, Meta BlueprintReadWrite

FUnderwaterPost...

 

UnderwaterPostProcessSettings

Post process settings to apply when the camera goes underwater (only available when bGenerateCollisions is true because collisions are needed to detect if it's under water).

Public variable UProperty Category BlueprintReadOnly Transient duplicatetransient, nontransactional, visibleanywhere

int32

 

WaterBodyIndex

Unique Id for accessing (wave, ... ) data in GPU buffers

Public variable UProperty Category, EditAnywhere, Meta BlueprintReadWrite

EWaterBodyType

 

WaterBodyType

: Remove and always use GetWaterBodyType()

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

FWaterBodyHeigh...

 

WaterHeightmapSettings

Public variable UProperty Category, EditAnywhere BlueprintReadOnly

UMaterialInterf...

 

WaterMaterial

Protected variable UProperty Category, EditAnywhere, AdvancedDisplay BlueprintReadOnly

UStaticMesh ...

 

WaterMeshOverride

Protected variable UProperty Category, Meta Transient nonpieduplicatetransient, textexporttransient, visibleinstanceonly

UMaterialInstan...

 

WaterMID

Protected variable UProperty Category, EditAnywhere, Meta BlueprintReadWrite

TSubclassOf< UN...

 

WaterNavAreaClass

The navigation area class that will be generated on nav mesh.

Protected variable UProperty instanced

UWaterSplineMet...

 

WaterSplineMetadata

Protected variable UProperty Category, EditAnywhere BlueprintReadOnly displayname, instanced

UWaterWavesBase...

 

WaterWaves

Constructors

Name Description

Public function

AWaterBody

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

void

 

AddExclusionVolume

(
    AWaterBodyExclusionVolume* InE...
)

Adds WaterBody exclusion volume

Public function

void

 

AddIsland

(
    AWaterBodyIsland* Island
)

Protected function Const

void

 

ApplyNavigationSettings()

Protected function Virtual

void

 

BeginUpdateWaterBody()

Called every time UpdateAll is called on WaterBody (prior to UpdateWaterBody)

Protected function Virtual Const

bool

 

CanAffectNavigation()

Returns whether the body affects navigation

Protected function Const

EWaterBodyQu...

 

CheckAndAjustQueryFlags

(
    EWaterBodyQueryFlags InQueryFlags
)

Protected function Const

EWaterBodySt...

 

CheckWaterBodyStatus()

Public function Const

bool

 

ContainsExclusionVolume

Public function Const

bool

 

ContainsIsland

(
    TLazyObjectPtr< AWaterBodyIsland > ...
)

Protected function

void

 

CreateOrUpdateUnderwaterPostProcessMID()

Protected function

void

 

CreateOrUpdateWaterMID()

Public function Const

float

 

FindInputKeyClosestToWorldLocation

(
    const FVector& WorldLocation
)

Spline query helper.

Public function Virtual Const

ALandscapePr...

 

FindLandscape()

Protected function Virtual

void

 

FixupOnPostRegisterAllComponents()

For internal use.

Public function Virtual Const

float

 

GetAudioIntensityAtSplineInputKey

(
    float InKey
)

Public function Const

float

 

GetChannelDepth()

Returns channel depth

Public function Virtual Const

TArray< UPri...

 

GetCollisionComponents()

Returns body's collision components

Public function Virtual Const

FVector

 

GetCollisionExtents()

Returns collision extents (For internal use. Please use AWaterBodyOcean instead.)

Public function Const

FName

 

GetCollisionProfileName()

Returns collision profile name

Protected function Virtual Const

float

 

GetConstantDepth()

Returns what can be considered the single water depth of the water surface.

Protected function Virtual Const

float

 

GetConstantSurfaceZ()

Returns what can be considered the single base Z of the water surface.

Public function Const UFunction BlueprintCallable, Category

TArray< AWat...

 

GetExclusionVolumes()

Gets the exclusion volume that influence this water body

Public function Virtual Const

float

 

GetHeightOffset()

Returns the additional water height added to the body (For internal use. Please use AWaterBodyOcean instead.)

Public function Const UFunction BlueprintCallable, Category

TArray< AWat...

 

GetIslands()

Gets the islands that influence this water body

Public function Const UFunction BlueprintCallable, Category

float

 

GetMaxWaveHeight()

Returns the max height that this water body's waves can hit.

Protected function Const

TSubclassOf<...

 

GetNavAreaClass()

Returns navigation area class

Public function Const

int32

 

GetOverlapMaterialPriority()

Returns overlap material priority

Public function Const

FPostProcess...

 

GetPostProcessProperties()

Returns post process properties

Public function Virtual UFunction BlueprintCallable, Category

UMaterialIns...

 

GetRiverToLakeTransitionMaterialInstance()

Returns River to lake transition material instance (For internal use. Please use AWaterBodyRiver instead.)

Public function Virtual UFunction BlueprintCallable, Category

UMaterialIns...

 

GetRiverToOceanTransitionMaterialInstance()

Returns River to ocean transition material instance (For internal use. Please use AWaterBodyRiver instead.)

Protected function Virtual Const

float

 

GetSimpleWaveHeightAtPosition

(
    const FVector& InPosition,
    float InWaterDepth,
    float InTime
)

Computes the raw wave perturbation of the water height only (simple version : faster computation)

Protected function Virtual Const

void

 

GetSurfaceMinMaxZ

(
    float& OutMinZ,
    float& OutMaxZ
)

Returns the minimum and maximum Z of the water surface, including waves

Protected function Const

EObjectFlags

 

GetTransientMIDFlags()

Public function UFunction BlueprintCallable, Category

UMaterialIns...

 

GetUnderwaterPostProcessMaterialInstance()

Returns under water post process MID

Public function Virtual Const

EWaterBodyTy...

 

GetWaterBodyType()

Returns the type of body

Public function Const UFunction BlueprintCallable, Category

UMaterialInt...

 

GetWaterMaterial()

Returns water material

Public function UFunction BlueprintCallable, Category

UMaterialIns...

 

GetWaterMaterialInstance()

Returns water MID

Public function Const

UStaticMesh ...

 

GetWaterMeshOverride()

Returns water mesh override

Public function Const

FVector

 

GetWaterNavCollisionOffset()

Returns nav collision offset

Public function Const UFunction BlueprintCallable, Category

UWaterSpline...

 

GetWaterSpline()

Returns water spline component

Public function

UWaterSpline...

 

GetWaterSplineMetadata()

Returns water spline metadata

Public function Const

const UWater...

 

GetWaterSplineMetadata()

Returns water spline metadata

Public function Virtual Const

float

 

GetWaterVelocityAtSplineInputKey

(
    float InKey
)

Spline queries specific to metadata type

Public function Virtual Const

FVector

 

GetWaterVelocityVectorAtSplineInputKey

(
    float InKey
)

Public function Const

const UWater...

 

GetWaterWaves()

Protected function Virtual Const

float

 

GetWaveAttenuationFactor

(
    const FVector& InPosition,
    float InWaterDepth
)

Computes the attenuation factor to apply to the raw wave perturbation.

Protected function Virtual Const

float

 

GetWaveHeightAtPosition

(
    const FVector& InPosition,
    float InWaterDepth,
    float InTime,
    FVector& OutNormal
)

Computes the raw wave perturbation of the water height/normal

Public function Const

bool

 

GetWaveInfoAtPosition

(
    const FVector& InPosition,
    float InWaterDepth,
    bool bInSimpleWaves,
    FWaveInfo& InOutWaveInfo
)

Fills wave-related information at the given world position and for this water depth.

Public function Virtual Const

float

 

GetWaveReferenceTime()

Returns the time basis to use in waves computation (must be unique for all water bodies currently, to ensure proper transitions between water tiles)

Public function Const

bool

 

HasWaves()

Returns true if there are valid water waves

Protected function Virtual

void

 

InitializeBody()

Initializes the water body

Protected function Virtual Const

bool

 

IsBodyDynamic()

Returns whether the body is baked (false) at save-time or needs to be dynamically regenerated at runtime (true) and is therefore transient.

Protected function Virtual Const

bool

 

IsBodyInitialized()

Returns whether the body was initialized

Protected function Virtual Const

bool

 

IsFlatSurface()

Returns whether the body has a flat surface or not

Protected function Virtual Const

bool

 

IsHeightOffsetSupported()

Returns whether the body support a height offset

Protected function Virtual Const

bool

 

IsIconVisible()

Returns whether icon billboard is visible.

Protected function Virtual Const

bool

 

IsWaterBodyTypeReadOnly()

For internal use.

Protected function Virtual Const

bool

 

IsWaterSplineClosedLoop()

Returns whether the body's spline is closed

Public function Virtual Const

bool

 

IsWaveSupported()

Returns whether the body supports waves

Public function Const

bool

 

IsWorldLocationInExclusionVolume

(
    const FVector& InWorldLocation
)

Returns true if the location is within one of this water body's exclusion volumes

Protected function Virtual

void

 

OnPostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...,
    bool& bShapeOrPositionChanged,
    bool& bWeightmapSettingsChanged
)

Called by AWaterBodyActor::PostEditChangeProperty.

Protected function

void

 

OnSplineDataChanged()

Public function UFunction BlueprintCallable, Category

void

 

OnWaterBodyChanged

(
    bool bShapeOrPositionChanged,
    bool bWeightmapSettingsChanged
)

Protected function

void

 

OnWaterSplineMetadataChanged

(
    UWaterSplineMetadata* InWaterS...,
    FPropertyChangedEvent& PropertyCha...
)

Protected function

void

 

OnWavesDataUpdated

(
    UWaterWavesBase* InWaterWaves,
    EPropertyChangeType::Type InChangeT...
)

Protected function

void

 

PrepareCurrentPostProcessSettings()

Public function Virtual Const

FWaterBodyQu...

 

QueryWaterInfoClosestToWorldLocation

(
    const FVector& InWorldLocation,
    EWaterBodyQueryFlags InQueryFlags,
    const TOptional< float >& InSpline...
)

Returns the requested water info closest to this world location

Protected function

void

 

RegisterOnChangeWaterSplineMetadata

(
    UWaterSplineMetadata* InWaterS...,
    bool bRegister
)

Protected function

void

 

RegisterOnUpdateWavesData

(
    UWaterWavesBase* InWaterWaves,
    bool bRegister
)

Public function

void

 

RemoveExclusionVolume

(
    AWaterBodyExclusionVolume* InE...
)

Removes WaterBody exclusion volume

Public function

void

 

RemoveIsland

(
    AWaterBodyIsland* Island
)

Protected function

void

 

RequestGPUWaveDataUpdate()

Public function Virtual

void

 

SetDynamicParametersOnMID

(
    UMaterialInstanceDynamic* InMI...
)

Sets the dynamic parameters needed by the material instance for rendering

Public function Virtual

void

 

SetDynamicParametersOnUnderwaterPostProcessMID

(
    UMaterialInstanceDynamic* InMI...
)

Sets the dynamic parameters needed by the underwater post process material instance for rendering

Public function Virtual

void

 

SetHeightOffset

(
    float InHeightOffset
)

Sets an additional water height (For internal use. Please use AWaterBodyOcean instead.)

Protected function

void

 

SetOceanOnWaterSubsystem()

Public function

void

 

SetUnderwaterPostProcessMaterial

(
    UMaterialInterface* InMaterial
)

Sets under water post process material

Public function

void

 

SetWaterMaterial

(
    UMaterialInterface* InMaterial
)

Sets water material

Public function

void

 

SetWaterMeshOverride

(
    UStaticMesh* InMesh
)

Sets the water mesh (when bOverrideWaterMesh is true of the for custom water body actors)

Public function UFunction BlueprintCallable, Category

void

 

SetWaterWaves

(
    UWaterWavesBase* InWaterWaves
)

Protected function

void

 

SetWaterWavesInternal

(
    UWaterWavesBase* InWaterWaves,
    bool bTriggerWaterBodyChanged
)

Public function Const

bool

 

ShouldGenerateWaterMeshTile()

Is this water body rendered with the WaterMeshComponent, with the quadtree-based water renderer?

Public function

void

 

UpdateActorIcon()

Protected function

void

 

UpdateAll

(
    bool bShapeOrPositionChanged
)

Protected function

void

 

UpdateExclusionVolumes()

Public function

void

 

UpdateIslands()

Public function Virtual

void

 

UpdateMaterialInstances()

Creates/Destroys/Updates necessary MIDS

Protected function

void

 

UpdateSplineComponent()

Protected function Virtual

void

 

UpdateWaterBody

(
    bool bWithExclusionVolumes
)

Updates WaterBody (called 1st with bWithExclusionVolumes = false, then with true

Public function

void

 

UpdateWaterComponentVisibility()

Protected function

bool

 

UpdateWaterHeight()

Overridden from AActor

Name Description

Public function Virtual

void

 

BeginPlay()

Overridable native event for when play begins for this actor.

Protected function Virtual

void

 

CheckForErrors()

Validates this actor's data

Protected function Virtual

void

 

Destroyed()

Called when this actor is explicitly being destroyed during gameplay or in the editor, not called during level streaming or gameplay ending

Public function Virtual

void

 

NotifyActorBeginOverlap

(
    AActor* OtherActor
)

Actor Interface

Public function Virtual

void

 

NotifyActorEndOverlap

(
    AActor* OtherActor
)

Event when an actor no longer overlaps another actor, and they have separated.

Public function Virtual

void

 

OnConstruction

(
    const FTransform& Transform
)

AActor interface

Protected function Virtual

void

 

PostEditMove

(
    bool bFinished
)

Called after an actor has been moved in the editor

Protected function Virtual

void

 

PostRegisterAllComponents()

Called after all the components in the Components array are registered, called both in editor and during gameplay

Protected function Virtual

void

 

PostUnregisterAllComponents()

Called after all currently registered components are cleared

Public function Virtual

void

 

PreInitializeComponents()

Called right before components are initialized, only called during gameplay

Overridden from UObject

Name Description

Protected function Virtual Const

bool

 

CanEditChange

(
    const FProperty* InProperty
)

Called by the editor to query whether a property of this object is allowed to be modified.

Public function Virtual

void

 

PostDuplicate

(
    bool bDuplicateForPIE
)

Called after duplication & serialization and before PostLoad.

Protected function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...
)

Called when a property on this object has been modified externally

Protected function Virtual

void

 

PostEditImport()

Called after importing property values for this object (paste, duplicate or .t3d import) Allow the object to perform any cleanup for properties which shouldn't be duplicated or are unsupported by the script serialization

Protected function Virtual

void

 

PostEditUndo()

Called after applying a transaction to the object.

Protected function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Protected function Virtual

void

 

PreEditChange

(
    FProperty* PropertyAboutToChan...
)

This is called when a property is about to be modified externally

Protected function Virtual

void

 

PreEditUndo()

Called before applying a transaction to the object.

Protected function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Overridden from INavRelevantInterface

Name Description

Public function Virtual Const

FBox

 

GetNavigationBounds()

Get bounds for navigation octree

Public function Virtual Const

void

 

GetNavigationData

(
    FNavigationRelevantData& Data
)

INavRelevantInterface start.

Public function Virtual Const

bool

 

IsNavigationRelevant()

Are modifiers active?

Overridden from IWaterBrushActorInterface

Name Description

Public function Virtual Const

bool

 

AffectsLandscape()

Returns true if this water actor is currently setup to modify the landscape :

Public function Virtual Const

bool

 

AffectsWaterMesh()

Returns true if this water actor is currently affecting (i.e. being rendered by) a AWaterMeshActor :

Public function Virtual Const

bool

 

CanAffectWaterMesh()

Returns true if this water actor could potentially be affecting (i.e. being rendered by) a AWaterMeshActor :

Public function Virtual Const

void

 

GetBrushRenderDependencies

(
    TSet< UObject* >& OutDependen...
)

Returns the list of objects this actor depends on to render its brush (textures, materials...)

Public function Virtual Const

ETextureRend...

 

GetBrushRenderTargetFormat()

Returns the format of the render target used to render this actor in the water brush

Public function Virtual Const

const TMap< ...

 

GetLayerWeightmapSettings()

Returns the landscape weightmap settings, per layer, for this water actor

Public function Virtual Const

const FWater...

 

GetWaterCurveSettings()

Returns the curve settings for this water actor

Public function Virtual Const

const FWater...

 

GetWaterHeightmapSettings()

Returns the landscape heightmap settings for this water actor

Enums

Name

Description

Protected enum

EWaterBodyStatus

Constants

Deprecated Variables

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss