UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Chaos::FTriangleMesh Class Reference

#include <TriangleMesh.h>

Public Types

template<typename T >
using TBVHType = TAABBTree< int32, TAABBTreeLeafArray< int32, false, T >, true, T >
 
template<typename T >
using TSpatialHashType = THierarchicalSpatialHash< int32, T >
 

Public Member Functions

CHAOS_API FTriangleMesh ()
 
CHAOS_API FTriangleMesh (TArray< TVec3< int32 > > &&Elements, const int32 StartIdx=0, const int32 EndIdx=-1, const bool CullDegenerateElements=true)
 
 FTriangleMesh (const FTriangleMesh &Other)=delete
 
CHAOS_API FTriangleMesh (FTriangleMesh &&Other)
 
CHAOS_API ~FTriangleMesh ()
 
CHAOS_API void Init (TArray< TVec3< int32 > > &&Elements, const int32 StartIdx=0, const int32 EndIdx=-1, const bool CullDegenerateElements=true)
 
CHAOS_API void Init (const TConstArrayView< TVec3< int32 > > &Elements, const int32 StartIdx=0, const int32 EndIdx=-1, const bool CullDegenerateElements=true)
 
CHAOS_API void ResetAuxiliaryStructures ()
 
CHAOS_API void Serialize (FArchive &Ar)
 
CHAOS_API TVec2< int32GetVertexRange () const
 
int32 GetStartIndex () const
 
int32 GetNumIndices () const
 
CHAOS_API TSet< int32GetVertices () const
 
CHAOS_API void GetVertexSet (TSet< int32 > &VertexSet) const
 
CHAOS_API void GetVertexSetAsArray (TArray< int32 > &VertexSet) const
 
FORCEINLINE void ExpandVertexRange (const int32 StartIdx, const int32 EndIdx)
 
FORCEINLINE const TArray< TVec3< int32 > > & GetElements () const &
 
FORCEINLINE TArray< TVec3< int32 > > GetElements () &&
 
FORCEINLINE const TArray< TVec3< int32 > > & GetSurfaceElements () const &
 
FORCEINLINE TArray< TVec3< int32 > > GetSurfaceElements () &&
 
FORCEINLINE int32 GetNumElements () const
 
CHAOS_API const TMap< int32, TSet< int32 > > & GetPointToNeighborsMap () const
 
FORCEINLINE const TSet< int32 > & GetNeighbors (const int32 Element) const
 
CHAOS_API TConstArrayView< TArray< int32 > > GetPointToTriangleMap () const
 
FORCEINLINE const TArray< int32 > & GetCoincidentTriangles (const int32 Element) const
 
FORCEINLINE TSet< int32GetNRing (const int32 Element, const int32 N) const
 
CHAOS_API TArray< Chaos::TVec2< int32 > > GetUniqueAdjacentPoints () const
 
CHAOS_API TArray< Chaos::TVec4< int32 > > GetUniqueAdjacentElements () const
 
template<typename T >
CHAOS_API TArray< TVec3< T > > GetFaceNormals (const TConstArrayView< TVec3< T > > &Points, const bool ReturnEmptyOnError=true) const
 
template<typename T >
CHAOS_API void GetFaceNormals (TArray< TVec3< T > > &Normals, const TConstArrayView< TVec3< T > > &Points, const bool ReturnEmptyOnError=true) const
 
FORCEINLINE TArray< FVec3GetFaceNormals (const FParticles &InParticles, const bool ReturnEmptyOnError=true) const
 
CHAOS_API TArray< FVec3GetPointNormals (const TConstArrayView< FVec3 > &points, const bool ReturnEmptyOnError=true, const bool bUseGlobalArray=false)
 
FORCEINLINE TArray< FVec3GetPointNormals (const FParticles &InParticles, const bool ReturnEmptyOnError=true)
 
CHAOS_API void GetPointNormals (TArrayView< FVec3 > PointNormals, const TConstArrayView< FVec3 > &FaceNormals, const bool bUseGlobalArray)
 
template<typename T >
CHAOS_API void GetPointNormals (TArrayView< TVec3< T > > PointNormals, const TConstArrayView< TVec3< T > > &FaceNormals, const bool bUseGlobalArray) const
 Get per-point normals. This const version of this function requires GetPointToTriangleMap() to be called prior to invoking this function.
 
CHAOS_API void GetPointNormals (TArrayView< TVec3< FRealSingle > > PointNormals, const TConstArrayView< TVec3< FRealSingle > > &FaceNormals, const bool bUseGlobalArray) const
 
CHAOS_API const FSegmentMeshGetSegmentMesh () const
 Note that the SegmentMesh is lazily calculated (this method is not threadsafe unless it is known that the SegmentMesh is already up to date) @ret The connectivity of this mesh represented as a collection of unique segments.
 
CHAOS_API const TArray< TVec3< int32 > > & GetFaceToEdges () const
 Note that this data is lazily calculated with the SegmentMesh (this method is not threadsafe unless it is known that the SegmentMesh is already up to date) @ret A map from all face indices, to the indices of their associated edges.
 
CHAOS_API const TArray< TVec2< int32 > > & GetEdgeToFaces () const
 Note that this data is lazily calculated with the SegmentMesh (this method is not threadsafe unless it is known that the SegmentMesh is already up to date) @ret A map from all edge indices, to the indices of their containing faces.
 
CHAOS_API TArray< FRealGetCurvatureOnEdges (const TArray< FVec3 > &faceNormals)
 
CHAOS_API TArray< FRealGetCurvatureOnEdges (const TConstArrayView< FVec3 > &points)
 Helper that generates face normals on the fly.
 
CHAOS_API TArray< FRealGetCurvatureOnPoints (const TArray< FReal > &edgeCurvatures)
 
CHAOS_API TArray< FRealGetCurvatureOnPoints (const TConstArrayView< FVec3 > &points)
 Helper that generates edge curvatures on the fly.
 
CHAOS_API TSet< int32GetBoundaryPoints ()
 
CHAOS_API TMap< int32, int32FindCoincidentVertexRemappings (const TArray< int32 > &TestIndices, const TConstArrayView< FVec3 > &Points)
 
CHAOS_API TArray< int32GetVertexImportanceOrdering (const TConstArrayView< FVec3 > &Points, const TArray< FReal > &PointCurvatures, TArray< int32 > *CoincidentVertices=nullptr, const bool RestrictToLocalIndexRange=false)
 
CHAOS_API TArray< int32GetVertexImportanceOrdering (const TConstArrayView< FVec3 > &Points, TArray< int32 > *CoincidentVertices=nullptr, const bool RestrictToLocalIndexRange=false)
 Helper that generates point curvatures on the fly.
 
CHAOS_API void RemapVertices (const TArray< int32 > &Order)
 Reorder vertices according to.
 
CHAOS_API void RemapVertices (const TMap< int32, int32 > &Remapping)
 
CHAOS_API void RemoveDuplicateElements ()
 
CHAOS_API void RemoveDegenerateElements ()
 
template<typename T >
void BuildBVH (const TConstArrayView< TVec3< T > > &Points, TBVHType< T > &BVH) const
 
template<typename T >
bool PointProximityQuery (const TBVHType< T > &BVH, const TConstArrayView< TVec3< T > > &Points, const int32 PointIndex, const TVec3< T > &PointPosition, const T PointThickness, const T ThisThickness, TFunctionRef< bool(const int32 PointIndex, const int32 TriangleIndex)> BroadphaseTest, TArray< TTriangleCollisionPoint< T > > &Result) const
 
template<typename T >
bool EdgeIntersectionQuery (const TBVHType< T > &BVH, const TConstArrayView< TVec3< T > > &Points, const int32 EdgeIndex, const TVec3< T > &EdgePosition1, const TVec3< T > &EdgePosition2, TFunctionRef< bool(const int32 EdgeIndex, const int32 TriangleIndex)> BroadphaseTest, TArray< TTriangleCollisionPoint< T > > &Result) const
 
template<typename T >
bool SmoothProject (const TBVHType< T > &BVH, const TConstArrayView< FVec3 > &Points, const TArray< FVec3 > &PointNormals, const FVec3 &Point, int32 &TriangleIndex, FVec3 &Weights, const int32 MaxIters=10) const
 Returns false if Point is outside of the smooth normal cone, where a smooth projection doesn't exist.
 
template<typename T >
CHAOS_API void BuildSpatialHash (const TConstArrayView< TVec3< T > > &Points, TSpatialHashType< T > &SpatialHash, const T MinSpatialLodSize=(T) 0.) const
 
CHAOS_API void BuildSpatialHash (const TConstArrayView< TVec3< FRealSingle > > &Points, TSpatialHashType< FRealSingle > &SpatialHash, const Softs::FPBDFlatWeightMap &PointThicknesses, int32 ThicknessMapIndexOffset, const FRealSingle MinSpatialLodSize=0.f) const
 
template<typename T >
CHAOS_API bool PointProximityQuery (const TSpatialHashType< T > &SpatialHash, const TConstArrayView< TVec3< T > > &Points, const int32 PointIndex, const TVec3< T > &PointPosition, const T PointThickness, const T ThisThickness, TFunctionRef< bool(const int32 PointIndex, const int32 TriangleIndex)> BroadphaseTest, TArray< TTriangleCollisionPoint< T > > &Result) const
 
CHAOS_API bool PointProximityQuery (const TSpatialHashType< FRealSingle > &SpatialHash, const TConstArrayView< TVec3< FRealSingle > > &Points, const int32 PointIndex, const TVec3< FRealSingle > &PointPosition, const FRealSingle PointThickness, const Softs::FPBDFlatWeightMap &ThisThicknesses, const FRealSingle ThisThicknessExtraMultiplier, int32 ThicknessMapIndexOffset, TFunctionRef< bool(const int32 PointIndex, const int32 TriangleIndex)> BroadphaseTest, TArray< TTriangleCollisionPoint< FRealSingle > > &Result) const
 
template<typename T >
CHAOS_API bool PointClosestTriangleQuery (const TSpatialHashType< T > &SpatialHash, const TConstArrayView< TVec3< T > > &Points, const int32 PointIndex, const TVec3< T > &PointPosition, const T PointThickness, const T ThisThickness, TFunctionRef< bool(const int32 PointIndex, const int32 TriangleIndex)> BroadphaseTest, TArray< TTriangleCollisionPoint< T > > &Result) const
 
template<typename T >
bool EdgeIntersectionQuery (const TSpatialHashType< T > &SpatialHash, const TConstArrayView< TVec3< T > > &Points, const int32 EdgeIndex, const TVec3< T > &EdgePosition1, const TVec3< T > &EdgePosition2, TFunctionRef< bool(const int32 EdgeIndex, const int32 TriangleIndex)> BroadphaseTest, TArray< TTriangleCollisionPoint< T > > &Result) const
 
template<typename T >
void GetFaceNormals (TArray< TVec3< T > > &Normals, const TConstArrayView< TVec3< T > > &Points, const bool ReturnEmptyOnError) const
 
template<typename T >
TArray< TVec3< T > > GetFaceNormals (const TConstArrayView< TVec3< T > > &Points, const bool ReturnEmptyOnError) const
 
template<typename T >
void GetPointNormals (TArrayView< TVec3< T > > PointNormals, const TConstArrayView< TVec3< T > > &FaceNormals, const bool bUseGlobalArray) const
 
template<>
CHAOS_API void GetPointNormals (TArrayView< TVec3< FRealSingle > > PointNormals, const TConstArrayView< TVec3< FRealSingle > > &FaceNormals, const bool bUseGlobalArray) const
 
template<typename T >
void BuildSpatialHash (const TConstArrayView< TVec3< T > > &Points, TSpatialHashType< T > &SpatialHash, const T MinSpatialLodSize) const
 
template<typename T >
bool PointProximityQuery (const TSpatialHashType< T > &SpatialHash, const TConstArrayView< TVec3< T > > &Points, const int32 PointIndex, const TVec3< T > &PointPosition, const T PointThickness, const T ThisThickness, TFunctionRef< bool(const int32 PointIndex, const int32 TriangleIndex)> BroadphaseTest, TArray< TTriangleCollisionPoint< T > > &Result) const
 
template<typename T >
bool PointClosestTriangleQuery (const TSpatialHashType< T > &SpatialHash, const TConstArrayView< TVec3< T > > &Points, const int32 PointIndex, const TVec3< T > &PointPosition, const T PointThickness, const T ThisThickness, TFunctionRef< bool(const int32 PointIndex, const int32 TriangleIndex)> BroadphaseTest, TArray< TTriangleCollisionPoint< T > > &Result) const
 

Static Public Member Functions

static CHAOS_API FTriangleMesh GetConvexHullFromParticles (const TConstArrayView< FVec3 > &points)
 
static FORCEINLINE FTriangleMesh GetConvexHullFromParticles (const FParticles &InParticles)
 
template<typename T >
static FORCEINLINE void InitEquilateralTriangleXY (FTriangleMesh &TriMesh, TParticles< T, 3 > &Particles)
 
template<typename T >
static FORCEINLINE void InitEquilateralTriangleYZ (FTriangleMesh &TriMesh, TParticles< T, 3 > &Particles)
 

Member Typedef Documentation

◆ TBVHType

◆ TSpatialHashType

Constructor & Destructor Documentation

◆ FTriangleMesh() [1/4]

Chaos::FTriangleMesh::FTriangleMesh ( )

◆ FTriangleMesh() [2/4]

Chaos::FTriangleMesh::FTriangleMesh ( TArray< TVec3< int32 > > &&  Elements,
const int32  StartIdx = 0,
const int32  EndIdx = -1,
const bool  CullDegenerateElements = true 
)

◆ FTriangleMesh() [3/4]

Chaos::FTriangleMesh::FTriangleMesh ( const FTriangleMesh Other)
delete

◆ FTriangleMesh() [4/4]

Chaos::FTriangleMesh::FTriangleMesh ( FTriangleMesh &&  Other)

◆ ~FTriangleMesh()

Chaos::FTriangleMesh::~FTriangleMesh ( )

Member Function Documentation

◆ BuildBVH()

template<typename T >
template CHAOS_API void Chaos::FTriangleMesh::BuildBVH< FRealDouble > ( const TConstArrayView< TVec3< T > > &  Points,
TBVHType< T > &  BVH 
) const

◆ BuildSpatialHash() [1/3]

CHAOS_API void Chaos::FTriangleMesh::BuildSpatialHash ( const TConstArrayView< TVec3< FRealSingle > > &  Points,
TSpatialHashType< FRealSingle > &  SpatialHash,
const Softs::FPBDFlatWeightMap PointThicknesses,
int32  ThicknessMapIndexOffset,
const FRealSingle  MinSpatialLodSize = 0.f 
) const

◆ BuildSpatialHash() [2/3]

template<typename T >
void Chaos::FTriangleMesh::BuildSpatialHash ( const TConstArrayView< TVec3< T > > &  Points,
TSpatialHashType< T > &  SpatialHash,
const T  MinSpatialLodSize 
) const

◆ BuildSpatialHash() [3/3]

template<typename T >
CHAOS_API void Chaos::FTriangleMesh::BuildSpatialHash ( const TConstArrayView< TVec3< T > > &  Points,
TSpatialHashType< T > &  SpatialHash,
const T  MinSpatialLodSize = (T) 0. 
) const

◆ EdgeIntersectionQuery() [1/2]

template<typename T >
bool Chaos::FTriangleMesh::EdgeIntersectionQuery ( const TBVHType< T > &  BVH,
const TConstArrayView< TVec3< T > > &  Points,
const int32  EdgeIndex,
const TVec3< T > &  EdgePosition1,
const TVec3< T > &  EdgePosition2,
TFunctionRef< bool(const int32 EdgeIndex, const int32 TriangleIndex)>  BroadphaseTest,
TArray< TTriangleCollisionPoint< T > > &  Result 
) const

◆ EdgeIntersectionQuery() [2/2]

template<typename T >
bool Chaos::FTriangleMesh::EdgeIntersectionQuery ( const TSpatialHashType< T > &  SpatialHash,
const TConstArrayView< TVec3< T > > &  Points,
const int32  EdgeIndex,
const TVec3< T > &  EdgePosition1,
const TVec3< T > &  EdgePosition2,
TFunctionRef< bool(const int32 EdgeIndex, const int32 TriangleIndex)>  BroadphaseTest,
TArray< TTriangleCollisionPoint< T > > &  Result 
) const

◆ ExpandVertexRange()

FORCEINLINE void Chaos::FTriangleMesh::ExpandVertexRange ( const int32  StartIdx,
const int32  EndIdx 
)
inline

Extends the vertex range.

Since the vertex range is built from connectivity, it won't include any free vertices that either precede the first vertex, or follow the last.

◆ FindCoincidentVertexRemappings()

TMap< int32, int32 > Chaos::FTriangleMesh::FindCoincidentVertexRemappings ( const TArray< int32 > &  TestIndices,
const TConstArrayView< FVec3 > &  Points 
)

Find vertices that are coincident within the subset

Parameters
TestIndicesof given coordinates
Points,andreturn a correspondence mapping from redundant vertex index to consolidated vertex index.

◆ GetBoundaryPoints()

TSet< int32 > Chaos::FTriangleMesh::GetBoundaryPoints ( )

Get the set of point indices that live on the boundary (an edge with only 1 coincident face).

◆ GetCoincidentTriangles()

FORCEINLINE const TArray< int32 > & Chaos::FTriangleMesh::GetCoincidentTriangles ( const int32  Element) const
inline

◆ GetConvexHullFromParticles() [1/2]

static FORCEINLINE FTriangleMesh Chaos::FTriangleMesh::GetConvexHullFromParticles ( const FParticles InParticles)
inlinestatic

Deprecated. Use TArrayView version.

◆ GetConvexHullFromParticles() [2/2]

FTriangleMesh Chaos::FTriangleMesh::GetConvexHullFromParticles ( const TConstArrayView< FVec3 > &  points)
static

◆ GetCurvatureOnEdges() [1/2]

TArray< FReal > Chaos::FTriangleMesh::GetCurvatureOnEdges ( const TArray< FVec3 > &  faceNormals)

@ret Curvature between adjacent faces, specified on edges in radians.

Parameters
faceNormals- a normal per face. Curvature between adjacent faces is measured by the angle between face normals, where a curvature of 0 means they're coplanar.

◆ GetCurvatureOnEdges() [2/2]

TArray< FReal > Chaos::FTriangleMesh::GetCurvatureOnEdges ( const TConstArrayView< FVec3 > &  points)

Helper that generates face normals on the fly.

◆ GetCurvatureOnPoints() [1/2]

TArray< FReal > Chaos::FTriangleMesh::GetCurvatureOnPoints ( const TArray< FReal > &  edgeCurvatures)

@ret The maximum curvature at points from connected edges, specified in radians.

Parameters
edgeCurvatures- a curvature per edge. The greater the number, the sharper the crease. -FLT_MAX denotes free particles.

◆ GetCurvatureOnPoints() [2/2]

TArray< FReal > Chaos::FTriangleMesh::GetCurvatureOnPoints ( const TConstArrayView< FVec3 > &  points)

Helper that generates edge curvatures on the fly.

◆ GetEdgeToFaces()

const TArray< TVec2< int32 > > & Chaos::FTriangleMesh::GetEdgeToFaces ( ) const

Note that this data is lazily calculated with the SegmentMesh (this method is not threadsafe unless it is known that the SegmentMesh is already up to date) @ret A map from all edge indices, to the indices of their containing faces.

◆ GetElements() [1/2]

FORCEINLINE TArray< TVec3< int32 > > Chaos::FTriangleMesh::GetElements ( ) &&
inline

Move accessor for topology array.

Use via:

FTriangleMesh TriMesh(Triangles); // steals Triangles to TriMesh::MElements
Triangles = MoveTemp(TriMesh).GetElements(); // steals TriMesh::MElements back to Triangles
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition TriangleMesh.h:24
Definition Array.h:670

◆ GetElements() [2/2]

FORCEINLINE const TArray< TVec3< int32 > > & Chaos::FTriangleMesh::GetElements ( ) const &
inline

◆ GetFaceNormals() [1/5]

FORCEINLINE TArray< FVec3 > Chaos::FTriangleMesh::GetFaceNormals ( const FParticles InParticles,
const bool  ReturnEmptyOnError = true 
) const
inline

◆ GetFaceNormals() [2/5]

template<typename T >
TArray< TVec3< T > > Chaos::FTriangleMesh::GetFaceNormals ( const TConstArrayView< TVec3< T > > &  Points,
const bool  ReturnEmptyOnError 
) const

◆ GetFaceNormals() [3/5]

template<typename T >
CHAOS_API TArray< TVec3< T > > Chaos::FTriangleMesh::GetFaceNormals ( const TConstArrayView< TVec3< T > > &  Points,
const bool  ReturnEmptyOnError = true 
) const

The GetFaceNormals functions assume Counter Clockwise triangle windings in a Left Handed coordinate system If this is not the case the returned face normals may be inverted

◆ GetFaceNormals() [4/5]

template<typename T >
void Chaos::FTriangleMesh::GetFaceNormals ( TArray< TVec3< T > > &  Normals,
const TConstArrayView< TVec3< T > > &  Points,
const bool  ReturnEmptyOnError 
) const

◆ GetFaceNormals() [5/5]

template<typename T >
CHAOS_API void Chaos::FTriangleMesh::GetFaceNormals ( TArray< TVec3< T > > &  Normals,
const TConstArrayView< TVec3< T > > &  Points,
const bool  ReturnEmptyOnError = true 
) const

◆ GetFaceToEdges()

const TArray< TVec3< int32 > > & Chaos::FTriangleMesh::GetFaceToEdges ( ) const

Note that this data is lazily calculated with the SegmentMesh (this method is not threadsafe unless it is known that the SegmentMesh is already up to date) @ret A map from all face indices, to the indices of their associated edges.

◆ GetNeighbors()

FORCEINLINE const TSet< int32 > & Chaos::FTriangleMesh::GetNeighbors ( const int32  Element) const
inline

◆ GetNRing()

FORCEINLINE TSet< int32 > Chaos::FTriangleMesh::GetNRing ( const int32  Element,
const int32  N 
) const
inline

◆ GetNumElements()

FORCEINLINE int32 Chaos::FTriangleMesh::GetNumElements ( ) const
inline

◆ GetNumIndices()

int32 Chaos::FTriangleMesh::GetNumIndices ( ) const
inline

◆ GetPointNormals() [1/7]

FORCEINLINE TArray< FVec3 > Chaos::FTriangleMesh::GetPointNormals ( const FParticles InParticles,
const bool  ReturnEmptyOnError = true 
)
inline

◆ GetPointNormals() [2/7]

TArray< FVec3 > Chaos::FTriangleMesh::GetPointNormals ( const TConstArrayView< FVec3 > &  points,
const bool  ReturnEmptyOnError = true,
const bool  bUseGlobalArray = false 
)

◆ GetPointNormals() [3/7]

void Chaos::FTriangleMesh::GetPointNormals ( TArrayView< FVec3 PointNormals,
const TConstArrayView< FVec3 > &  FaceNormals,
const bool  bUseGlobalArray 
)

◆ GetPointNormals() [4/7]

template<>
CHAOS_API void Chaos::FTriangleMesh::GetPointNormals ( TArrayView< TVec3< FRealSingle > >  PointNormals,
const TConstArrayView< TVec3< FRealSingle > > &  FaceNormals,
const bool  bUseGlobalArray 
) const

◆ GetPointNormals() [5/7]

CHAOS_API void Chaos::FTriangleMesh::GetPointNormals ( TArrayView< TVec3< FRealSingle > >  PointNormals,
const TConstArrayView< TVec3< FRealSingle > > &  FaceNormals,
const bool  bUseGlobalArray 
) const

◆ GetPointNormals() [6/7]

template<typename T >
void Chaos::FTriangleMesh::GetPointNormals ( TArrayView< TVec3< T > >  PointNormals,
const TConstArrayView< TVec3< T > > &  FaceNormals,
const bool  bUseGlobalArray 
) const

◆ GetPointNormals() [7/7]

template<typename T >
CHAOS_API void Chaos::FTriangleMesh::GetPointNormals ( TArrayView< TVec3< T > >  PointNormals,
const TConstArrayView< TVec3< T > > &  FaceNormals,
const bool  bUseGlobalArray 
) const

Get per-point normals. This const version of this function requires GetPointToTriangleMap() to be called prior to invoking this function.

Parameters
bUseGlobalArrayWhen true, fill the array from the StartIdx to StartIdx + NumIndices - 1 positions, otherwise fill the array from the 0 to NumIndices - 1 positions.

◆ GetPointToNeighborsMap()

const TMap< int32, TSet< int32 > > & Chaos::FTriangleMesh::GetPointToNeighborsMap ( ) const

◆ GetPointToTriangleMap()

TConstArrayView< TArray< int32 > > Chaos::FTriangleMesh::GetPointToTriangleMap ( ) const

◆ GetSegmentMesh()

const FSegmentMesh & Chaos::FTriangleMesh::GetSegmentMesh ( ) const

Note that the SegmentMesh is lazily calculated (this method is not threadsafe unless it is known that the SegmentMesh is already up to date) @ret The connectivity of this mesh represented as a collection of unique segments.

◆ GetStartIndex()

int32 Chaos::FTriangleMesh::GetStartIndex ( ) const
inline

◆ GetSurfaceElements() [1/2]

FORCEINLINE TArray< TVec3< int32 > > Chaos::FTriangleMesh::GetSurfaceElements ( ) &&
inline

Move accessor for topology array.

Use via:

FTriangleMesh TriMesh(Triangles); // steals Triangles to TriMesh::MElements
Triangles = MoveTemp(TriMesh).GetSurfaceElements(); // steals TriMesh::MElements back to Triangles

◆ GetSurfaceElements() [2/2]

FORCEINLINE const TArray< TVec3< int32 > > & Chaos::FTriangleMesh::GetSurfaceElements ( ) const &
inline

◆ GetUniqueAdjacentElements()

TArray< TVec4< int32 > > Chaos::FTriangleMesh::GetUniqueAdjacentElements ( ) const

Return the array of bending element indices {i0, i1, i2, i3}, with {i0, i1} the segment indices and {i2, i3} the cross segment indices.

◆ GetUniqueAdjacentPoints()

TArray< TVec2< int32 > > Chaos::FTriangleMesh::GetUniqueAdjacentPoints ( ) const

Return the array of all cross segment indices for all pairs of adjacent triangles.

◆ GetVertexImportanceOrdering() [1/2]

TArray< int32 > Chaos::FTriangleMesh::GetVertexImportanceOrdering ( const TConstArrayView< FVec3 > &  Points,
const TArray< FReal > &  PointCurvatures,
TArray< int32 > *  CoincidentVertices = nullptr,
const bool  RestrictToLocalIndexRange = false 
)

@ret An array of vertex indices ordered from most important to least.

Parameters
Points- point positions.
PointCurvatures- a per-point measure of curvature.
CoincidentVertices- indices of points that are coincident to another point.
RestrictToLocalIndexRange- ignores points outside of the index range used by this mesh.

◆ GetVertexImportanceOrdering() [2/2]

TArray< int32 > Chaos::FTriangleMesh::GetVertexImportanceOrdering ( const TConstArrayView< FVec3 > &  Points,
TArray< int32 > *  CoincidentVertices = nullptr,
const bool  RestrictToLocalIndexRange = false 
)

Helper that generates point curvatures on the fly.

◆ GetVertexRange()

TVec2< int32 > Chaos::FTriangleMesh::GetVertexRange ( ) const

Returns the closed interval of the smallest vertex index used by this class, to the largest.

If this mesh is empty, the second index of the range will be negative.

◆ GetVertexSet()

void Chaos::FTriangleMesh::GetVertexSet ( TSet< int32 > &  VertexSet) const

Returns the unique set of vertices used by this triangle mesh.

◆ GetVertexSetAsArray()

void Chaos::FTriangleMesh::GetVertexSetAsArray ( TArray< int32 > &  VertexSet) const

Returns the unique set of vertices used by this triangle mesh.

◆ GetVertices()

TSet< int32 > Chaos::FTriangleMesh::GetVertices ( ) const

Returns the set of vertices used by triangles.

◆ Init() [1/2]

void Chaos::FTriangleMesh::Init ( const TConstArrayView< TVec3< int32 > > &  Elements,
const int32  StartIdx = 0,
const int32  EndIdx = -1,
const bool  CullDegenerateElements = true 
)

◆ Init() [2/2]

void Chaos::FTriangleMesh::Init ( TArray< TVec3< int32 > > &&  Elements,
const int32  StartIdx = 0,
const int32  EndIdx = -1,
const bool  CullDegenerateElements = true 
)

Initialize the FTriangleMesh.

CullDegenerateElements removes faces with degenerate indices, and will change the order of MElements.

◆ InitEquilateralTriangleXY()

template<typename T >
static FORCEINLINE void Chaos::FTriangleMesh::InitEquilateralTriangleXY ( FTriangleMesh TriMesh,
TParticles< T, 3 > &  Particles 
)
inlinestatic

◆ InitEquilateralTriangleYZ()

template<typename T >
static FORCEINLINE void Chaos::FTriangleMesh::InitEquilateralTriangleYZ ( FTriangleMesh TriMesh,
TParticles< T, 3 > &  Particles 
)
inlinestatic

◆ PointClosestTriangleQuery() [1/2]

template<typename T >
bool Chaos::FTriangleMesh::PointClosestTriangleQuery ( const TSpatialHashType< T > &  SpatialHash,
const TConstArrayView< TVec3< T > > &  Points,
const int32  PointIndex,
const TVec3< T > &  PointPosition,
const T  PointThickness,
const T  ThisThickness,
TFunctionRef< bool(const int32 PointIndex, const int32 TriangleIndex)>  BroadphaseTest,
TArray< TTriangleCollisionPoint< T > > &  Result 
) const

◆ PointClosestTriangleQuery() [2/2]

template<typename T >
CHAOS_API bool Chaos::FTriangleMesh::PointClosestTriangleQuery ( const TSpatialHashType< T > &  SpatialHash,
const TConstArrayView< TVec3< T > > &  Points,
const int32  PointIndex,
const TVec3< T > &  PointPosition,
const T  PointThickness,
const T  ThisThickness,
TFunctionRef< bool(const int32 PointIndex, const int32 TriangleIndex)>  BroadphaseTest,
TArray< TTriangleCollisionPoint< T > > &  Result 
) const

◆ PointProximityQuery() [1/4]

template<typename T >
bool Chaos::FTriangleMesh::PointProximityQuery ( const TBVHType< T > &  BVH,
const TConstArrayView< TVec3< T > > &  Points,
const int32  PointIndex,
const TVec3< T > &  PointPosition,
const T  PointThickness,
const T  ThisThickness,
TFunctionRef< bool(const int32 PointIndex, const int32 TriangleIndex)>  BroadphaseTest,
TArray< TTriangleCollisionPoint< T > > &  Result 
) const

◆ PointProximityQuery() [2/4]

CHAOS_API bool Chaos::FTriangleMesh::PointProximityQuery ( const TSpatialHashType< FRealSingle > &  SpatialHash,
const TConstArrayView< TVec3< FRealSingle > > &  Points,
const int32  PointIndex,
const TVec3< FRealSingle > &  PointPosition,
const FRealSingle  PointThickness,
const Softs::FPBDFlatWeightMap ThisThicknesses,
const FRealSingle  ThisThicknessExtraMultiplier,
int32  ThicknessMapIndexOffset,
TFunctionRef< bool(const int32 PointIndex, const int32 TriangleIndex)>  BroadphaseTest,
TArray< TTriangleCollisionPoint< FRealSingle > > &  Result 
) const

◆ PointProximityQuery() [3/4]

template<typename T >
bool Chaos::FTriangleMesh::PointProximityQuery ( const TSpatialHashType< T > &  SpatialHash,
const TConstArrayView< TVec3< T > > &  Points,
const int32  PointIndex,
const TVec3< T > &  PointPosition,
const T  PointThickness,
const T  ThisThickness,
TFunctionRef< bool(const int32 PointIndex, const int32 TriangleIndex)>  BroadphaseTest,
TArray< TTriangleCollisionPoint< T > > &  Result 
) const

◆ PointProximityQuery() [4/4]

template<typename T >
CHAOS_API bool Chaos::FTriangleMesh::PointProximityQuery ( const TSpatialHashType< T > &  SpatialHash,
const TConstArrayView< TVec3< T > > &  Points,
const int32  PointIndex,
const TVec3< T > &  PointPosition,
const T  PointThickness,
const T  ThisThickness,
TFunctionRef< bool(const int32 PointIndex, const int32 TriangleIndex)>  BroadphaseTest,
TArray< TTriangleCollisionPoint< T > > &  Result 
) const

◆ RemapVertices() [1/2]

void Chaos::FTriangleMesh::RemapVertices ( const TArray< int32 > &  Order)

Reorder vertices according to.

Parameters
Order.

◆ RemapVertices() [2/2]

void Chaos::FTriangleMesh::RemapVertices ( const TMap< int32, int32 > &  Remapping)

◆ RemoveDegenerateElements()

void Chaos::FTriangleMesh::RemoveDegenerateElements ( )

◆ RemoveDuplicateElements()

void Chaos::FTriangleMesh::RemoveDuplicateElements ( )

◆ ResetAuxiliaryStructures()

void Chaos::FTriangleMesh::ResetAuxiliaryStructures ( )

◆ Serialize()

void Chaos::FTriangleMesh::Serialize ( FArchive Ar)

◆ SmoothProject()

template<typename T >
template CHAOS_API bool Chaos::FTriangleMesh::SmoothProject< FRealDouble > ( const TBVHType< T > &  BVH,
const TConstArrayView< FVec3 > &  Points,
const TArray< FVec3 > &  PointNormals,
const FVec3 Point,
int32 TriangleIndex,
FVec3 Weights,
const int32  MaxIters = 10 
) const

Returns false if Point is outside of the smooth normal cone, where a smooth projection doesn't exist.


The documentation for this class was generated from the following files: