Navigation
API > API/Plugins > API/Plugins/Water
Inheritance Hierarchy
- UPrimitiveComponent
- UWaterBodyComponent
- UWaterBodyCustomComponent
- UWaterBodyLakeComponent
- UWaterBodyOceanComponent
- UWaterBodyRiverComponent
References
| Module | Water |
| Header | /Engine/Plugins/Experimental/Water/Source/Runtime/Public/WaterBodyComponent.h |
| Include | #include "WaterBodyComponent.h" |
Syntax
UCLASS (Abstract,
HideCategories=(Tags, Activation, Cooking, Physics, Replication, Input, AssetUserData, Mesh))
class UWaterBodyComponent : public UPrimitiveComponent
Variables
| Type | Name | Description | |
|---|---|---|---|
| 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 | |
| TWeakObjectPtr< UBakedShallowWaterSimulationComponent > | BakedShallowWaterSim | Baked simulation data for this water body, owned by a UShallowWaterRiverComponent | |
| bool | bAlwaysGenerateWaterMeshTiles | When this is set to true, the water mesh will always generate tiles for this water body. | |
| bool | bUseBakedSimForQueriesAndPhysics | Override to disable use of the baked shallow water simulation for collisons and other uses | |
| bool bool | bUserTriggeredChanged | ||
| bool | bWeightmapSettingsChanged | ||
| float | CollisionHeightOffset | The distance above the surface of the water where collision checks should still occur. | |
| FPostProcessSettings | CurrentPostProcessSettings | ||
| FWaterCurveSettings | CurveSettings | ||
| double | FixedWaterDepth | If the Water Material assigned to this component has Fixed Depth enabled, this is the depth that is passed. | |
| TWeakObjectPtr< ALandscapeProxy > | Landscape | ||
| TMap< FName, FWaterBodyWeightmapSettings > | LayerWeightmapSettings | ||
| float | MaxWaveHeightOffset | Offset added to the automatically calculated max wave height bounds. | |
| int32 | OverlapMaterialPriority | Higher number is higher priority. | |
| TSoftObjectPtr< AWaterZone > | OwningWaterZone | ||
| TObjectPtr< UPhysicalMaterial > | PhysicalMaterial | ||
| float | ShapeDilation | ||
| FWaterBodyStaticMeshSettings | StaticMeshSettings | ||
| float | TargetWaveMaskDepth | Water depth at which waves start being attenuated. | |
| TObjectPtr< UMaterialInterface > | 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). | |
| TObjectPtr< UMaterialInstanceDynamic > | UnderwaterPostProcessMID | ||
| FUnderwaterPostProcessSettings | 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). | |
| TArray< TSoftObjectPtr< AWaterBodyExclusionVolume > > | WaterBodyExclusionVolumes | ||
| int32 | WaterBodyIndex | Unique Id for accessing (wave, ... ) data in GPU buffers | |
| TArray< TSoftObjectPtr< AWaterBodyIsland > > | WaterBodyIslands | Islands in this water body | |
| FWaterBodyHeightmapSettings | WaterHeightmapSettings | ||
| TObjectPtr< UMaterialInterface > | WaterHLODMaterial | ||
| TObjectPtr< UMaterialInterface > | WaterInfoMaterial | ||
| TObjectPtr< UMaterialInstanceDynamic > | WaterInfoMID | ||
| TObjectPtr< UMaterialInterface > | WaterMaterial | ||
| TObjectPtr< UStaticMesh > | WaterMeshOverride | ||
| TObjectPtr< UMaterialInstanceDynamic > | WaterMID | ||
| TSubclassOf< UNavAreaBase > | WaterNavAreaClass | The navigation area class that will be generated on nav mesh. | |
| TObjectPtr< UWaterSplineMetadata > | WaterSplineMetadata | ||
| TObjectPtr< UMaterialInterface > | WaterStaticMeshMaterial | ||
| TObjectPtr< UMaterialInstanceDynamic > | WaterStaticMeshMID | ||
| TSoftObjectPtr< AWaterZone > | WaterZoneOverride |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UWaterBodyComponent
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddExclusionVolume
(
AWaterBodyExclusionVolume* InExclusionVolume |
Adds WaterBody exclusion volume | |
| void | AddIsland
(
AWaterBodyIsland* Island |
||
| bool | |||
| bool | |||
| bool | |||
| void | |||
| void | |||
| void | Called every time UpdateAll is called on WaterBody (prior to UpdateWaterBody) | ||
| bool | |||
| EWaterBodyQueryFlags | CheckAndAjustQueryFlags
(
EWaterBodyQueryFlags InQueryFlags |
||
| void | Validates this component's data | ||
| TArray< TSharedRef< FTokenizedMessage > > | |||
| bool | ContainsExclusionVolume
(
TSoftObjectPtr< AWaterBodyExclusionVolume > InExclusionVolume |
||
| bool | ContainsIsland
(
TSoftObjectPtr< AWaterBodyIsland > Island |
||
| void | CopySharedCollisionSettingsToComponent
(
UPrimitiveComponent* InComponent |
Copies the relevant collision settings from the water body component to the component passed in parameter (useful when using external components for collision) | |
| void | CopySharedNavigationSettingsToComponent
(
UPrimitiveComponent* InComponent |
Copies the relevant navigation settings from the water body component to the component passed in parameter (useful when using external components for navigation) | |
| void | |||
| void | |||
| void | |||
| void | |||
| void | |||
| void | |||
| float | FindInputKeyClosestToWorldLocation
(
const FVector& WorldLocation |
Spline query helper. | |
| ALandscapeProxy * | |||
| void | Fixup any invalid transformations made to the water body in the editor that may have been made through the transform gizmo or property changes. | ||
| bool | GenerateWaterBodyMesh
(
UE::Geometry::FDynamicMesh3& OutMesh, |
Generates the mesh representation of the water body | |
| float | GetAudioIntensityAtSplineInputKey
(
float InKey |
||
| TArray< UPrimitiveComponent * > | |||
| void | GetBrushRenderDependencies
(
TSet< UObject* >& OutDependencies |
||
| ETextureRenderTargetFormat | |||
| float | Returns channel depth | ||
| FBox | Returns the body's collision component bounds | ||
| TArray< UPrimitiveComponent * > | GetCollisionComponents
(
bool bInOnlyEnabledComponents |
Returns body's collision components | |
| FVector | Returns collision half-extents | ||
| float | Returns what can be considered the single water depth of the water surface. | ||
| float | Returns what can be considered the single base Z of the water surface. | ||
| FVector | Returns what can be considered the single water velocity of the water surface. | ||
| TSubclassOf< class UHLODBuilder > | |||
| UWaterBodyInfoMeshComponent * | |||
| TArray< AWaterBodyExclusionVolume * > | Gets the exclusion volume that influence this water body | ||
| float | Returns the additional water height added to the body (For internal use. Please use AWaterBodyOcean instead.) | ||
| UMaterialInterface * | |||
| FMeshDescription | |||
| TArray< AWaterBodyIsland * > | GetIslands () |
Gets the islands that influence this water body | |
| const TMap< FName, FWaterBodyWeightmapSettings > & | |||
| float | Returns the max height that this water body's waves can hit. | ||
| TSubclassOf< UNavAreaBase > | Returns navigation area class | ||
| FBox | |||
| void | GetNavigationData
(
FNavigationRelevantData& Data |
INavRelevantInterface start. | |
| int32 | Returns overlap material priority | ||
| FPostProcessVolumeProperties | Returns post process properties | ||
| void | GetResourceSizeEx
(
FResourceSizeEx& CumulativeResourceSize |
||
| UMaterialInterface * | Returns river to lake transition water material | ||
| UMaterialInstanceDynamic * | Returns River to lake transition material instance (For internal use. Please use AWaterBodyRiver instead.) | ||
| UMaterialInterface * | Returns river to ocean transition water material | ||
| UMaterialInstanceDynamic * | Returns River to ocean transition material instance (For internal use. Please use AWaterBodyRiver instead.) | ||
| float | GetSimpleWaveHeightAtPosition
(
const FVector& InPosition, |
Computes the raw wave perturbation of the water height only (simple version : faster computation) | |
| TArray< UPrimitiveComponent * > | Retrieves the list of primitive components that this water body uses when not being rendered by the water mesh (e.g. the static mesh component used when WaterMeshOverride is specified) | ||
| void | GetSurfaceMinMaxZ
(
float& OutMinZ, |
Returns the minimum and maximum Z of the water surface, including waves | |
| EObjectFlags | |||
| UMaterialInstanceDynamic * | Returns under water post process MID | ||
| AWaterBody * | Returns the WaterBodyActor who owns this component | ||
| int32 | Returns the unique id of this water body for accessing data in GPU buffers | ||
| const FWaterBodyStaticMeshSettings & | |||
| EWaterBodyType | Returns the type of body | ||
| const FWaterCurveSettings & | |||
| const FWaterBodyHeightmapSettings & | |||
| UMaterialInstanceDynamic * | Returns water info MID | ||
| UWaterBodyInfoMeshComponent * | |||
| UMaterialInterface * | Returns water material | ||
| UMaterialInstanceDynamic * | Returns water MID | ||
| UStaticMesh * | Returns water mesh override | ||
| FVector | Returns nav collision offset | ||
| UWaterSplineComponent * | Returns water spline component | ||
| const UWaterSplineMetadata * | Returns water spline metadata | ||
| UWaterSplineMetadata * | Returns water spline metadata | ||
| FVector | |||
| const TCHAR * | |||
| UMaterialInterface * | Returns material used to render the water as a static mesh | ||
| UMaterialInstanceDynamic * | Returns water static mesh MID | ||
| void | GetWaterSurfaceInfoAtLocation
(
const FVector& InLocation, |
||
| float | GetWaterVelocityAtSplineInputKey
(
float InKey |
Spline queries specific to metadata type | |
| FVector | GetWaterVelocityVectorAtSplineInputKey
(
float InKey |
||
| UWaterWavesBase * | |||
| AWaterZone * | GetWaterZone () |
Gets the water zone to which this component belongs | |
| float | GetWaveAttenuationFactor
(
const FVector& InPosition, |
Computes the attenuation factor to apply to the raw wave perturbation. | |
| float | GetWaveHeightAtPosition
(
const FVector& InPosition, |
Computes the raw wave perturbation of the water height/normal | |
| bool | GetWaveInfoAtPosition
(
const FVector& InPosition, |
Fills wave-related information at the given world position and for this water depth. | |
| float | Returns the time basis to use in waves computation (must be unique for all water bodies currently, to ensure proper transitions between water tiles) | ||
| bool | HasWaves () |
Returns true if there are valid water waves | |
| bool | Returns whether the body is baked (false) at save-time or needs to be dynamically regenerated at runtime (true) and is therefore transient. | ||
| bool | Returns whether the body has a flat surface or not | ||
| bool | Returns whether the body support a height offset | ||
| bool | |||
| bool | |||
| bool | |||
| bool | Returns whether the body's spline is closed | ||
| bool | Returns whether the body supports waves | ||
| bool | IsWorldLocationInExclusionVolume
(
const FVector& InWorldLocation |
Returns true if the location is within one of this water body's exclusion volumes | |
| void | OnComponentCollisionSettingsChanged
(
bool bUpdateOverlaps |
||
| void | OnComponentDestroyed
(
bool bDestroyingHierarchy |
||
| void | |||
| void | |||
| void | Called by the owning actor when it receives a PostActorCreated callback | ||
| void | OnPostEditChangeProperty
(
FOnWaterBodyChangedParams& InOutOnWaterBodyChangedParams |
Called by UWaterBodyComponent::PostEditChangeProperty. | |
| void | Called when the WaterBodyActor has had all its components registered. | ||
| void | OnRegister () |
Component interface | |
| void | OnUnregister () |
||
| void | OnUpdateBody
(
bool bWithExclusionVolumes |
||
| void | |||
| void | OnWaterBodyChanged
(
const FOnWaterBodyChangedParams& InParams |
||
| void | |||
| void | OnWaterSplineDataChanged
(
const FOnWaterSplineDataChangedParams& InParams |
||
| void | OnWaterSplineMetadataChanged
(
const FOnWaterSplineMetadataChangedParams& InParams |
||
| void | OnWavesDataUpdated
(
UWaterWavesBase* InWaterWaves, |
||
| void | PostDuplicate
(
bool bDuplicateForPie |
||
| void | PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
||
| void | |||
| void | PostEditUndo () |
||
| void | PostLoad () |
||
| void | PreEditUndo () |
||
| void | |||
| FWaterBodyQueryResult | QueryWaterInfoClosestToWorldLocation
(
const FVector& InWorldLocation, |
Returns the requested water info closest to this world location | |
| void | RegisterOnChangeWaterSplineData
(
bool bRegister |
||
| void | RegisterOnUpdateWavesData
(
UWaterWavesBase* InWaterWaves, |
||
| void | RemoveExclusionVolume
(
AWaterBodyExclusionVolume* InExclusionVolume |
Removes WaterBody exclusion volume | |
| void | RemoveIsland
(
AWaterBodyIsland* Island |
||
| void | |||
| void | Reset () |
||
| void | |||
| bool | SetDynamicParametersOnMID
(
UMaterialInstanceDynamic* InMID |
Sets the dynamic parameters needed by the material instance for rendering. | |
| bool | SetDynamicParametersOnUnderwaterPostProcessMID
(
UMaterialInstanceDynamic* InMID |
Sets the dynamic parameters needed by the underwater post process material instance for rendering. | |
| bool | SetDynamicParametersOnWaterInfoMID
(
UMaterialInstanceDynamic* InMID |
Sets the dynamic parameters needed by the material instance for rendering the water info texture. | |
| void | SetHeightOffset
(
float InHeightOffset |
Sets an additional water height (For internal use. Please use AWaterBodyOcean instead.) | |
| void | SetHLODMaterial
(
UMaterialInterface* InMaterial |
||
| void | SetNavAreaClass
(
TSubclassOf< UNavAreaBase > NewWaterNavAreaClass |
Set the navigation area class | |
| void | SetUnderwaterPostProcessMaterial
(
UMaterialInterface* InMaterial |
Sets under water post process material | |
| void | SetWaterAndUnderWaterPostProcessMaterial
(
UMaterialInterface* InWaterMaterial, |
||
| void | SetWaterBodyStaticMeshEnabled
(
bool bEnabled |
||
| void | SetWaterMaterial
(
UMaterialInterface* InMaterial |
Sets water material | |
| void | SetWaterMeshOverride
(
UStaticMesh* InMesh |
Sets a static mesh to use as a replacement for the water mesh (for water bodies that are being rendered by the water mesh) | |
| void | SetWaterStaticMeshMaterial
(
UMaterialInterface* InMaterial |
Sets water static mesh material | |
| void | SetWaterZoneOverride
(
const TSoftObjectPtr< AWaterZone >& InWaterZoneOverride |
Override the default behavior of water bodies finding their water zone based on bounds and set a specific water zone to which this water body should register. | |
| bool | Is this water body rendered with the WaterMeshComponent, with the quadtree-based water renderer? | ||
| void | UpdateAll
(
const FOnWaterBodyChangedParams& InParams |
||
| void | UpdateComponentVisibility
(
bool bAllowWaterZoneRebuild |
||
| void | |||
| void | |||
| void | Creates/Destroys/Updates necessary MIDS | ||
| void | |||
| void | Updates the bVisible/bHiddenInGame flags on the component and eventually the child renderable components (e.g. custom water body) | ||
| void | UpdateWaterBody
(
bool bWithExclusionVolumes |
Updates WaterBody (called 1st with bWithExclusionVolumes = false, then with true | |
| void | |||
| void | |||
| bool | |||
| void | |||
| void | |||
| void | UpdateWaterZones
(
bool bAllowChangesDuringCook |
Registers or this water body with corresponding overlapping water zones and unregisters it from any old zones if they are no longer overlapping. |
Constants
| Name | Description |
|---|---|
| GlobalOceanHeightName | |
| MaxFlowVelocityParamName | |
| WaterBodyIndexParamName | Public static constants : |
| WaterBodyZOffsetParamName | |
| WaterVelocityAndHeightName | |
| WaterZoneIndexParamName |
Deprecated Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bCanAffectNavigation_DEPRECATED | ||
| bool | bFillCollisionUnderWaterBodiesForNavmesh_DEPRECATED | ||
| bool | bGenerateCollisions_DEPRECATED | ||
| bool | bOverrideWaterMesh_DEPRECATED | ||
| FName | CollisionProfileName_DEPRECATED | ||
| TArray< TLazyObjectPtr< AWaterBodyExclusionVolume > > | ExclusionVolumes_DEPRECATED | ||
| TArray< TLazyObjectPtr< AWaterBodyIsland > > | Islands_DEPRECATED | ||
| TObjectPtr< UMaterialInterface > | WaterLODMaterial_DEPRECATED |
Deprecated Functions
| Type | Name | Description | |
|---|---|---|---|
UE_DEPRECATED
(
all, |
Returns water LOD MID | ||
UE_DEPRECATED
(
all, |