TMeshSurfaceUVSampler

[TMeshSurfaceUVSampler](API\Plugins\DynamicMesh\Sampling\TMeshSurfaceUVSampler) computes point samples of the given SampleType at positions on the mesh based on UV-space positions.

Windows
MacOS
Linux

References

Module

DynamicMesh

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/DynamicMesh/Public/Sampling/MeshSurfaceSampler.h

Include

#include "Sampling/MeshSurfaceSampler.h"

Syntax

template<typename SampleType>
class TMeshSurfaceUVSampler

Remarks

TMeshSurfaceUVSampler computes point samples of the given SampleType at positions on the mesh based on UV-space positions. The standard use case for this class is to compute samples used in building Normal Maps, AO Maps, etc.

that for UVOnly sample type, an internal UV-space BVTree will be constructed, and each sample will query that to find the UV/3D correspondence. If you already know the TriangleID, you can use the TriangleAndUV type to avoid the BVTree construction and queries.

that if you need to sample multiple things, rather than building up an uber-SampleType, you can first compute a sample with SampleType=FMeshUVSampleInfo to find the correspondence information, and then construction additional samplers of type EMeshSurfaceSamplerQueryType::TriangleAndUV, and call CachedSampleUV(), to avoid expensive BVTree constructions and UV-to-3D recalculation.

Variables

Name Description

Protected variable

bool

 

bUVSpatialValid

Protected variable

const FDynamicM...

 

Mesh

Protected variable

EMeshSurfaceSam...

 

QueryType

Protected variable

TMeshAABBTree3<...

 

UVBVTree

Protected variable

FDynamicMeshUVM...

 

UVMeshAdapter

BV tree for finding triangle for a given UV. Not always initialized.

Protected variable

const FDynamicM...

 

UVOverlay

Protected variable

TUniqueFunction...

 

ValueFunction

Protected variable

SampleType

 

ZeroValue

Destructors

Name Description

Public function Virtual

~TMeshSurfaceUVSampler()

Functions

Name Description

Public function Virtual

bool

 

CachedSampleUV

(
    const FMeshUVSampleInfo& CachedSam...,
    SampleType& ResultOut
)

Compute a sample at the given UV/3D location specified by CachedSampleInfo, which presumably was produced by previous calls to SampleUV()

Public function Virtual

void

 

Initialize

(
    const FDynamicMesh3* MeshIn,
    const FDynamicMeshUVOverlay* U...,
    EMeshSurfaceSamplerQueryType QueryT...,
    SampleType ZeroValueIn,
    TUniqueFunction< void...
)

Configure the sampler.

Protected function

void

 

InitializeBVTree()

Public function Virtual

bool

 

SampleUV

(
    const FVector2d& UV,
    SampleType& ResultOut
)

Compute a sample at the given UV location

Public function Virtual

bool

 

SampleUV

(
    int32 UVTriangleID,
    const FVector2d& UV,
    SampleType& ResultOut
)

Compute a sample at the given UV location in the given Triangle

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