# Water Meshes

* **UWaterSubsystem**
  * Handles all the intersections and such through **FWaterBodyManager**
* **AWaterZoneActor**
  * Actor that holds the meshes
  * Adds all the new actors and uses them to separate the rendering into the transition pieces and such
  * A big volume covering the level
* **UWaterMeshComponent**
  * UWaterMeshComponent::PostEditComponentMove
    * Marks the mesh as needs rebuild (bNeedsRebuild) via the AWaterZoneActor Owner of *this* component
  * UWaterMeshComponent::Update: Gets called on tick by the UWaterSubsystem
    * If bNeedsRebuild, calls UWaterMeshComponent::RebuildWaterMesh
  * UWaterMeshComponent::RebuildWaterMesh
    * Builds the geometry for this water mesh component
    * Gets the Dynamic Material Instance from the Water Body (UWaterBodyComponent::CreateOrUpdateWaterMID)
      * Also calls UWaterBodyComponent::SetDynamicParametersOnMID which sets global values from the UWaterSubsystem and UWaterBodyComponent and AWaterZone
      * Also gets the River to Lake and River to Ocean Transition Material Instances from the Water Body Component (which are again Dynamic Material Instances)
    * Uses a **HActor** as a hit proxy for the mesh in the viewport
    * Water Body Component also stores collision components
      * River: SplineMeshComponents
    * **FWaterQuadTree** stores the mesh data
* **FWaterMeshSceneProxy**
  * The primitive that is drawn in the scene
  * Created by the WaterMeshComponent
* **TWaterVertexFactory**
  * Constucts and handles the RHI data including the vertex buffer
* **FWaterMeshVertexBuffer**
  * Vertex buffer for drawing the water mesh
* **TWaterInstanceDataBuffers**
  * Collection of vertex buffers used by the factory


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.oserosuite.com/technical-notes/unreal-engine-notes/water-plugin/water-meshes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
