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
)

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
)

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback