FDynamicMeshBuilder

A utility used to construct dynamically generated meshes, and render them to a [FPrimitiveDrawInterface](API\Runtime\Engine\FPrimitiveDrawInterface).

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Public/DynamicMeshBuilder.h

Include

#include "DynamicMeshBuilder.h"

Syntax

class FDynamicMeshBuilder

Remarks

A utility used to construct dynamically generated meshes, and render them to a FPrimitiveDrawInterface. Note: This is meant to be easy to use, not fast. It moves the data around more than necessary, and requires dynamically allocating RHI resources. Exercise caution.

Constructors

Name Description

Public function

FDynamicMeshBuilder

(
    ERHIFeatureLevel::Type InFeatureLev...,
    uint32 InNumTexCoords,
    uint32 InLightmapCoordinateIndex,
    bool InUse16bitTexCoord,
    FDynamicMeshBufferAllocator* I...
)

Initialization constructor.

Destructors

Name Description

Public function

~FDynamicMeshBuilder()

Destructor.

Functions

Name Description

Public function

void

 

AddTriangle

(
    int32 V0,
    int32 V1,
    int32 V2
)

Adds a triangle to the mesh.

Public function

void

 

AddTriangles

(
    const TArray< uint32 >& InIndices
)

Add many indices to the mesh.

Public function

int32

 

AddVertex

(
    const FDynamicMeshVertex& InVertex
)

Adds a vertex to the mesh.

Public function

int32

 

AddVertex

(
    const FVector& InPosition,
    const FVector2D& InTextureCoordina...,
    const FVector& InTangentX,
    const FVector& InTangentY,
    const FVector& InTangentZ,
    const FColor& InColor
)

Adds a vertex to the mesh.

Public function

int32

 

AddVertices

(
    const TArray< FDynamicMeshVertex > ...
)

Adds many vertices to the mesh.

Public function

void

 

Draw

(
    FPrimitiveDrawInterface* PDI,
    const FMatrix& LocalToWorld,
    const FMaterialRenderProxy* Ma...,
    uint8 DepthPriorityGroup,
    bool bDisableBackfaceCulling,
    bool bReceivesDecals,
    const FHitProxyId HitProxyId
)

Draws the mesh to the given primitive draw interface.

Public function

void

 

GetMesh

(
    const FMatrix& LocalToWorld,
    const FMaterialRenderProxy* Ma...,
    uint8 DepthPriorityGroup,
    bool bDisableBackfaceCulling,
    bool bReceivesDecals,
    int32 ViewIndex,
    FMeshElementCollector& Collector
)

Adds a mesh of what's been built so far to the collector.

Public function

void

 

GetMesh

(
    const FMatrix& LocalToWorld,
    const FMaterialRenderProxy* Ma...,
    uint8 DepthPriorityGroup,
    const FDynamicMeshBuilderSettings&...,
    FDynamicMeshDrawOffset const*c...,
    int32 ViewIndex,
    FMeshElementCollector& Collector,
    const FHitProxyId HitProxyId
)

Public function

void

 

GetMesh

(
    const FMatrix& LocalToWorld,
    const FMaterialRenderProxy* Ma...,
    uint8 DepthPriorityGroup,
    bool bDisableBackfaceCulling,
    bool bReceivesDecals,
    bool bUseSelectionOutline,
    int32 ViewIndex,
    FMeshElementCollector& Collector,
    HHitProxy* HitProxy
)

Public function

void

 

GetMesh

(
    const FMatrix& LocalToWorld,
    const FMaterialRenderProxy* Ma...,
    uint8 DepthPriorityGroup,
    bool bDisableBackfaceCulling,
    bool bReceivesDecals,
    bool bUseSelectionOutline,
    int32 ViewIndex,
    FMeshElementCollector& Collector,
    const FHitProxyId HitProxyId
)

Public function

void

 

GetMesh

(
    const FMatrix& LocalToWorld,
    const FMatrix& PrevLocalToWorld,
    const FMaterialRenderProxy* Ma...,
    uint8 DepthPriorityGroup,
    const FDynamicMeshBuilderSettings&...,
    FDynamicMeshDrawOffset const*c...,
    int32 ViewIndex,
    FMeshElementCollector& Collector,
    const FHitProxyId HitProxyId
)

Public function

void

 

GetMeshElement

(
    const FMatrix& LocalToWorld,
    const FMaterialRenderProxy* Ma...,
    uint8 DepthPriorityGroup,
    bool bDisableBackfaceCulling,
    bool bReceivesDecals,
    int32 ViewIndex,
    FMeshBuilderOneFrameResources& One...,
    FMeshBatch& Mesh
)

Public function

void

 

ReserveTriangles

(
    int32 InNumTriangles
)

Pre-allocate space for the given number of triangles.

Public function

void

 

ReserveVertices

(
    int32 InNumVertices
)

Pre-allocate space for the given number of vertices.

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