Navigation
API > API/Plugins > API/Plugins/Water
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- USceneComponent
- 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&40;Abstract,
HideCategories&61;&40;Tags, Activation, Cooking, Physics, Replication, Input, AssetUserData, Mesh&41;&41;
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 | |
| bool | bAlwaysGenerateWaterMeshTiles | When this is set to true, the water mesh will always generate tiles for this water body. | |
| 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 |
||
| 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 * | |||
| 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. | ||
| 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 | ||
| int32 | Returns overlap material priority | ||
| FPostProcessVolumeProperties | Returns post process properties | ||
| UMaterialInstanceDynamic * | Returns River to lake transition material instance (For internal use. Please use AWaterBodyRiver instead.) | ||
| 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 | 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 | OnPostEditChangeProperty
(
FOnWaterBodyChangedParams& InOutOnWaterBodyChangedParams |
||
| void | Called when the WaterBodyActor has had all its components registered. | ||
| void | OnUpdateBody
(
bool bWithExclusionVolumes |
||
| void | OnWaterBodyChanged
(
const FOnWaterBodyChangedParams& InParams |
||
| void | |||
| void | OnWaterSplineDataChanged
(
const FOnWaterSplineDataChangedParams& InParams |
||
| void | OnWaterSplineMetadataChanged
(
const FOnWaterSplineMetadataChangedParams& InParams |
||
| void | OnWavesDataUpdated
(
UWaterWavesBase* InWaterWaves, |
||
| 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 () |
||
| bool | Sets the dynamic parameters needed by the material instance for rendering. | ||
| bool | Sets the dynamic parameters needed by the underwater post process material instance for rendering. | ||
| bool | 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 |
Updates the bVisible/bHiddenInGame flags on the component and eventually the child renderable components (e.g. custom water body) | |
| void | |||
| void | |||
| void | Creates/Destroys/Updates necessary MIDS | ||
| void | |||
| 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. |
Overridden from UPrimitiveComponent
| Type | Name | Description | |
|---|---|---|---|
| void | OnComponentCollisionSettingsChanged
(
bool bUpdateOverlaps |
Called when the BodyInstance ResponseToChannels, CollisionEnabled or bNotifyRigidBodyCollision changes, in case subclasses want to use that information. | |
| void | Called when bGenerateOverlapEvents changes, in case subclasses want to use that information. |
Overridden from USceneComponent
| Type | Name | Description | |
|---|---|---|---|
| bool | MoveComponentImpl
(
const FVector& Delta, |
Override this method for custom behavior for MoveComponent | |
| void | Overridable internal function to respond to changes in the hidden in game value of the component. | ||
| void | Overridable internal function to respond to changes in the visibility of the component. |
Overridden from UActorComponent
| Type | Name | Description | |
|---|---|---|---|
| void | Validates this component's data | ||
| TSubclassOf< class UHLODBuilder > | Return the custom HLODBuilder class that should be used to generate HLODs for components of this type. | ||
| bool | Override to specify that a component is relevant to the HLOD generation. | ||
| void | OnComponentDestroyed
(
bool bDestroyingHierarchy |
Called when a component is destroyed | |
| void | OnRegister () |
Component interface | |
| void | OnUnregister () |
Called when a component is unregistered. |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| void | GetResourceSizeEx
(
FResourceSizeEx& CumulativeResourceSize |
Get the size of the object/resource for use in memory tools or to display to artists/LDs in the Editor This is the extended version which separates up the used memory into different memory regions (the actual definition of which may be platform specific). | |
| void | PostDuplicate
(
bool bDuplicateForPIE |
Called after duplication & serialization and before PostLoad. | |
| void | PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Called when a property on this object has been modified externally | |
| void | 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 | ||
| void | PostEditUndo () |
Called after applying a transaction to the object. | |
| void | PostLoad () |
Do any object-specific cleanup required immediately after loading an object. | |
| void | PreEditUndo () |
Called before applying a transaction to the object. | |
| void | Handles reading, writing, and reference collecting using FArchive. |
Overridden from INavRelevantInterface
| Type | Name | Description | |
|---|---|---|---|
| FBox | Get bounds for navigation octree | ||
| void | GetNavigationData
(
FNavigationRelevantData& Data |
INavRelevantInterface start. | |
| bool | Are modifiers active? |
Constants
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 | |
|---|---|---|---|
| bool | Please use CanEverAffectNavigation() instead. | ||
| bool | Renamed to CanEverAffectWaterMesh | ||
| AWaterZone * | This function is no longer called. Instead uses UWaterSubsystem::FindWaterZone to determine the right water zone when no override is provided. | ||
| UMaterialInterface * | Renamed to GetWaterStaticMeshMaterial | ||
| UMaterialInstanceDynamic * | GetWaterLODMaterialInstance has been renamed to GetWaterStaticMeshMaterialInstance. | ||
| void | OnPostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent, |
Use the version of the function taking FOnWaterBodyChangedParams | |
| void | Use OnWaterSplineDataChanged | ||
| void | OnWaterBodyChanged
(
bool bShapeOrPositionChanged, |
Use version which takes FOnWaterBodyChangedParams | |
| void | SetWaterLODMaterial
(
UMaterialInterface* InMaterial |
Renamed to SetWaterStaticMeshMaterial | |
| void | UpdateAll
(
bool bShapeOrPositionChanged |
Use the version of this function taking FOnWaterBodyChangedParams in parameter |