Navigation
API > API/Runtime > API/Runtime/GeometryCore
TDynamicMeshOverlay is an add-on to a FDynamicMesh3 that allows for per-triangle storage of an "element" (eg like a per-triangle UV or normal). However the elements can be shared between triangles at shared vertices because the elements are stored in a separate indexable list.
Each element has one vertex in the parent mesh as its parent, whereas each vertex may be the parent of multiple elements in cases where neighboring triangles are not sharing a single element for that vertex. This means that there may be "seam" boundary edges in the overlay topology that are not mesh boundary edges in the associated/parent mesh, but the overlay topology will not connect triangles that were not connected in the parent mesh or create any topologically degenerate triangles, since the parent vids of the elements of a triangle will have to match up to the vids of the triangle.
A "seam" edge is one where at least one of the elements of the triangles on either side of the edge is not shared between the two triangles.
The FDynamicMesh3 mesh topology operations (eg split/flip/collapse edge, poke face, etc) can be mirrored to the overlay via OnSplitEdge(), etc.
Note that although this is a template, many of the functions are defined in the .cpp file. As a result you need to explicitly instantiate and export the instance of the template that you wish to use in the block at the top of DynamicMeshOverlay.cpp
| Name | TDynamicMeshOverlay |
| Type | class |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/DynamicMesh/DynamicMeshOverlay.h |
| Include Path | #include "DynamicMesh/DynamicMeshOverlay.h" |
Syntax
template<typename RealType, int ElementSize>
class TDynamicMeshOverlay
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Create an empty overlay | DynamicMesh/DynamicMeshOverlay.h | ||
TDynamicMeshOverlay
(
FDynamicMesh3* ParentMeshIn |
Create an overlay for the given parent mesh | DynamicMesh/DynamicMeshOverlay.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| element_iterator | FRefCountVector::IndexEnumerable | DynamicMesh/DynamicMeshOverlay.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Append
(
const TDynamicMeshOverlay& ToAppend, |
DynamicMesh/DynamicMeshOverlay.h | ||
void AppendDefaulted
(
const FDynamicMesh3::FAppendInfo& AppendInfo |
DynamicMesh/DynamicMeshOverlay.h | ||
int AppendElement
(
const RealType* Value |
Allocate a new element with the given value | DynamicMesh/DynamicMeshOverlay.h | |
int AppendElement
(
RealType ConstantValue |
Allocate a new element with the given constant value | DynamicMesh/DynamicMeshOverlay.h | |
bool AreTrianglesConnected
(
int TriangleID0, |
DynamicMesh/DynamicMeshOverlay.h | ||
void BeginUnsafeElementsInsert () |
Support for inserting element at specific ID. | DynamicMesh/DynamicMeshOverlay.h | |
bool CheckValidity
(
bool bAllowNonManifoldVertices, |
Checks that the overlay mesh is well-formed, ie all internal data structures are consistent | DynamicMesh/DynamicMeshOverlay.h | |
void ClearElements () |
Discard all elements. | DynamicMesh/DynamicMeshOverlay.h | |
void ClearElements
(
const EnumerableIntType& Triangles |
Discard elements for given triangles. | DynamicMesh/DynamicMeshOverlay.h | |
void CompactCopy
(
const FCompactMaps& CompactMaps, |
Copy the Copy overlay to a compact rep, also updating parent references based on the CompactMaps | DynamicMesh/DynamicMeshOverlay.h | |
void CompactInPlace
(
const FCompactMaps& CompactMaps |
Compact overlay and update links to parent based on CompactMaps | DynamicMesh/DynamicMeshOverlay.h | |
void Copy
(
const TDynamicMeshOverlay< RealType, ElementSize >& Copy |
Set this overlay to contain the same arrays as the copy overlay | DynamicMesh/DynamicMeshOverlay.h | |
int CountVertexElements
(
int VertexID, |
Count the number of unique elements for a given parent-mesh vertex | DynamicMesh/DynamicMeshOverlay.h | |
void CreateFromPredicate
(
TFunctionRef< bool(int ParentVertexIdx, int TriIDA, int TriIDB)> TrisCanShareVertexPredicate, |
Build overlay topology from a predicate function, e.g. to build topology for sharp normals | DynamicMesh/DynamicMeshOverlay.h | |
void CreatePerVertex
(
RealType InitElementValue |
Build overlay topology with one element per vertex. | DynamicMesh/DynamicMeshOverlay.h | |
int ElementCount() |
DynamicMesh/DynamicMeshOverlay.h | ||
element_iterator ElementIndicesItr() |
DynamicMesh/DynamicMeshOverlay.h | ||
void EndUnsafeElementsInsert() |
Call after a set of unsafe InsertVertex() calls to rebuild free list | DynamicMesh/DynamicMeshOverlay.h | |
void FreeUnusedElements
(
const TSet< int >* ElementsToCheck |
Goes through elements and frees any whose reference counts indicate that they are not being used. | DynamicMesh/DynamicMeshOverlay.h | |
SIZE_T GetByteCount() |
DynamicMesh/DynamicMeshOverlay.h | ||
void GetElement
(
int ElementID, |
Get the element at a given index | DynamicMesh/DynamicMeshOverlay.h | |
void GetElement
(
int ElementID, |
Accessors/Queries Get the element at a given index | DynamicMesh/DynamicMeshOverlay.h | |
void GetElementAtVertex
(
int TriangleID, |
Get the Element value associated with a vertex of a triangle. | DynamicMesh/DynamicMeshOverlay.h | |
int GetElementIDAtVertex
(
int TriangleID, |
Find the element ID at a vertex of a triangle. | DynamicMesh/DynamicMeshOverlay.h | |
void GetElementTriangles
(
int ElementID, |
Find the triangles connected to an element | DynamicMesh/DynamicMeshOverlay.h | |
const FDynamicMesh3 * GetParentMesh () |
DynamicMesh/DynamicMeshOverlay.h | ||
| DynamicMesh/DynamicMeshOverlay.h | |||
int GetParentVertex
(
int ElementID |
Get the parent vertex id for the element at a given index | DynamicMesh/DynamicMeshOverlay.h | |
FIndex3i GetTriangle
(
int TriangleID |
Get the element index tuple for a triangle | DynamicMesh/DynamicMeshOverlay.h | |
bool GetTriangleIfValid
(
int TriangleID, |
If the triangle is set to valid element indices, return the indices in TriangleOut and return true, otherwise return false | DynamicMesh/DynamicMeshOverlay.h | |
void GetTriBaryInterpolate
(
int32 TriangleID, |
Compute interpolated parameter value inside triangle using barycentric coordinates | DynamicMesh/DynamicMeshOverlay.h | |
void GetVertexElements
(
int VertexID, |
Find the elements associated with a given parent-mesh vertex | DynamicMesh/DynamicMeshOverlay.h | |
bool HasInteriorSeamEdges() |
DynamicMesh/DynamicMeshOverlay.h | ||
void InitializeNewTriangle
(
int TriangleID |
Set a triangle's element indices to InvalidID | DynamicMesh/DynamicMeshOverlay.h | |
void InitializeTriangles
(
int MaxTriangleID |
Initialize the triangle list to the given size, and set all triangles to InvalidID | DynamicMesh/DynamicMeshOverlay.h | |
EMeshResult InsertElement
(
int ElementID, |
Insert element at given index, assuming it is unused. | DynamicMesh/DynamicMeshOverlay.h | |
bool IsBowtieInOverlay
(
int32 VertexID |
Determines whether the base-mesh vertex has "bowtie" topology in the Overlay. | DynamicMesh/DynamicMeshOverlay.h | |
bool IsCompact() |
DynamicMesh/DynamicMeshOverlay.h | ||
bool IsElement
(
int vID |
DynamicMesh/DynamicMeshOverlay.h | ||
bool IsSameAs
(
const TDynamicMeshOverlay< RealType, ElementSize >& Other, |
Returns true if this overlay is the same as Other. | DynamicMesh/DynamicMeshOverlay.h | |
bool IsSeamEdge
(
int EdgeID, |
Returns true if the parent-mesh edge is a "Seam" in this overlay. | DynamicMesh/DynamicMeshOverlay.h | |
bool IsSeamEndEdge
(
int EdgeID |
Returns true if the parent-mesh edge is a "Seam End" in this overlay, meaning the adjacent element triangles share one element, not two | DynamicMesh/DynamicMeshOverlay.h | |
bool IsSeamIntersectionVertex
(
int32 VertexID |
Returns true if the parent-mesh vertex is at a seam 'intersection' i.e., the end of a seam, or the intersection w/ another seam. | DynamicMesh/DynamicMeshOverlay.h | |
bool IsSeamVertex
(
int VertexID, |
Returns true if the parent-mesh vertex is connected to any seam edges | DynamicMesh/DynamicMeshOverlay.h | |
bool IsSetTriangle
(
int TID |
DynamicMesh/DynamicMeshOverlay.h | ||
int MaxElementID() |
DynamicMesh/DynamicMeshOverlay.h | ||
bool MergeElement
(
int SourceElementID, |
Collapse SourceElementID into TargetElementID, resulting in connecting any containing triangles and reducing the total elements in the overlay. | DynamicMesh/DynamicMeshOverlay.h | |
void OnCollapseEdge
(
const DynamicMeshInfo::FEdgeCollapseInfo& CollapseInfo |
Update the overlay to reflect an edge collapse in the parent mesh | DynamicMesh/DynamicMeshOverlay.h | |
void OnFlipEdge
(
const DynamicMeshInfo::FEdgeFlipInfo& FlipInfo |
Update the overlay to reflect an edge flip in the parent mesh | DynamicMesh/DynamicMeshOverlay.h | |
void OnMergeEdges
(
const DynamicMeshInfo::FMergeEdgesInfo& MergeInfo |
Update the overlay to reflect an edge merge in the parent mesh | DynamicMesh/DynamicMeshOverlay.h | |
void OnMergeVertices
(
const DynamicMeshInfo::FMergeVerticesInfo& MergeInfo |
Update the overlay to reflect a vertex merge in the parent mesh | DynamicMesh/DynamicMeshOverlay.h | |
void OnPokeTriangle
(
const DynamicMeshInfo::FPokeTriangleInfo& PokeInfo |
Update the overlay to reflect a face poke in the parent mesh | DynamicMesh/DynamicMeshOverlay.h | |
void OnRemoveTriangle
(
int TriangleID |
Remove a triangle from the overlay | DynamicMesh/DynamicMeshOverlay.h | |
void OnReverseTriOrientation
(
int TriangleID |
Reverse the orientation of a triangle's elements | DynamicMesh/DynamicMeshOverlay.h | |
void OnSplitEdge
(
const DynamicMeshInfo::FEdgeSplitInfo& SplitInfo |
Update the overlay to reflect an edge split in the parent mesh | DynamicMesh/DynamicMeshOverlay.h | |
void OnSplitVertex
(
const DynamicMeshInfo::FVertexSplitInfo& SplitInfo, |
Update the overlay to reflect a vertex split in the parent mesh | DynamicMesh/DynamicMeshOverlay.h | |
void Serialize
(
FArchive& Ar, |
Serialize to and from an archive. | DynamicMesh/DynamicMeshOverlay.h | |
void SetElement
(
int ElementID, |
Set the element at a given index | DynamicMesh/DynamicMeshOverlay.h | |
void SetElement
(
int ElementID, |
Set the element at a given index | DynamicMesh/DynamicMeshOverlay.h | |
void SetParentVertex
(
int ElementIndex, |
DynamicMesh/DynamicMeshOverlay.h | ||
EMeshResult SetTriangle
(
int TriangleID, |
Set the triangle to the given Element index tuple, and increment element reference counts | DynamicMesh/DynamicMeshOverlay.h | |
void SplitBowties
(
bool bParallel |
Refine an existing overlay topology by splitting any bowties | DynamicMesh/DynamicMeshOverlay.h | |
void SplitBowtiesAtVertex
(
int32 Vid, |
Split any bowties at given vertex. | DynamicMesh/DynamicMeshOverlay.h | |
int SplitElement
(
int ElementID, |
Create a new copy of ElementID, and update connected triangles in the TrianglesToUpdate array to reference the copy of ElementID where they used to reference ElementID (Note: This just calls "SplitElementWithNewParent" with the existing element's parent id.) | DynamicMesh/DynamicMeshOverlay.h | |
int SplitElementWithNewParent
(
int ElementID, |
Create a new copy of ElementID, and update connected triangles in the TrianglesToUpdate array to reference the copy of ElementID where they used to reference ElementID. | DynamicMesh/DynamicMeshOverlay.h | |
void SplitVerticesWithPredicate
(
TFunctionRef< bool(int ElementIdx, int TriID)> ShouldSplitOutVertex, |
Refine an existing overlay topology. | DynamicMesh/DynamicMeshOverlay.h | |
bool TriangleHasElement
(
int TriangleID, |
DynamicMesh/DynamicMeshOverlay.h | ||
void UnsetTriangle
(
int TriangleID, |
Set the triangle to have InvalidID element IDs, decrementing element reference counts if needed. | DynamicMesh/DynamicMeshOverlay.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void InternalSetTriangle
(
int TriangleID, |
Updates the triangles array and optionally the element reference counts | DynamicMesh/DynamicMeshOverlay.h | |
void SetElementFromBary
(
int SetElement, |
Set the value at an Element to be a barycentric interpolation of three other Elements | DynamicMesh/DynamicMeshOverlay.h | |
void SetElementFromLerp
(
int SetElement, |
Set the value at an Element to be a linear interpolation of two other Elements | DynamicMesh/DynamicMeshOverlay.h |