FWaterQuadTree

Windows
MacOS
Linux

References

Module

Water

Header

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

Include

#include "WaterQuadTree.h"

Syntax

struct FWaterQuadTree

Functions

Name Description

Public function

void

 

AddLake

(
    const TArray< FVector2D >& InPoly,
    const FBox& InLakeBounds,
    uint32 InWaterBodyIndex
)

Add Lake by giving a closed spline that represents the lake

Public function

void

 

AddOcean

(
    const TArray< FVector2D >& InPoly,
    const FVector2D& InZBounds,
    uint32 InWaterBodyIndex
)

Add Ocean by giving a closed spline that represents the land mass for this ocean.

Public function

uint32

 

AddWaterBodyRenderData

(
    const FWaterBodyRenderData& InWate...
)

Add water body render data to this tree.

Public function

void

 

AddWaterTilesInsideBounds

(
    const FBox& InBounds,
    uint32 InWaterBodyIndex
)

Add tiles that intersect InBounds recursively from the root node.

Public function

int32

 

BuildMaterialIndices

(
    UMaterialInterface* FarDistanc...
)

Assign an index to each material and return the index of FarDistanceMaterial if not null.

Public function Const

void

 

BuildWaterTileInstanceData

(
    const FTraversalDesc& InTraversalD...,
    FTraversalOutput& Output
)

Build the instance data needed to render the water tiles from a given point of view.

Public function Const

FBox

 

GetBounds()

Get bounds of the root node if there is one, otherwise some default box

Public function Const

float

 

GetLeafSize()

Get cached leaf world size of one side of the tile (same applies for X and Y)

Public function Static

float

 

GetLODDistance

(
    int32 InLODLevel,
    float InLODScale
)

Calculate the world distance to a LOD

Public function Const

int32

 

GetMaxLeafCount()

Number of maximum leaf nodes on one side, same applies for X and Y.

Public function Const

int32

 

GetNodeCount()

Total node count in the tree, including inner nodes, root node and leaf nodes

Public function Const

FBox2D

 

GetTileRegion()

Return the 2D region containing water tiles. Tiles can not be generated outside of this region

Public function Const

int32

 

GetTreeDepth()

Max depth of the tree

Public function Const

const TArray...

 

GetWaterMaterials()

Public function

void

 

InitTree

(
    const FBox2D& InBounds,
    float InTileSize,
    FIntPoint InExtentInTiles
)

Initialize the tree.

Public function Const

bool

 

QueryInterpolatedTileBaseHeightAtLocation

(
    const FVector2D& InWorldLocationXY,
    float& OutHeight
)

Bilinear interpolation between four neighboring base height samples around InWorldLocationXY.

Public function Const

bool

 

QueryTileBaseHeightAtLocation

(
    const FVector2D& InWorldLocationXY,
    float& OutWorldHeight
)

Walks down the tree and returns the tile height at InWorldLocationXY in OutWorldHeight.

Public function Const

bool

 

QueryTileBoundsAtLocation

(
    const FVector2D& InWorldLocationXY,
    FBox& OutWorldBounds
)

Walks down the tree and returns the tile bounds at InWorldLocationXY in OutWorldBounds.

Public function

void

 

Unlock

(
    bool bPruneRedundantNodes
)

Unlock to make it read-only.

Classes

Name

Description

Public struct

FStagingInstanceData

Public struct

FTraversalDesc

Output of the quadtree when asking to traverse it for visible water tiles

Public struct

FTraversalOutput

Output of the quadtree when asking to traverse it for visible water tiles

Typedefs

Name

Description

FInstanceDataBuckets

Constants

Name

Description

INVALID_PARENT

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