60 static constexpr FReal InvalidNormalMarker = std::numeric_limits<FReal>::max();
65 , Normal(InvalidNormalMarker)
68 , NumFaceEdgeCollisions(0)
77 return (VertexIndices[0] == VertexIndex) || (VertexIndices[1] == VertexIndex) || (VertexIndices[2] == VertexIndex);
83 if (VertexID == VertexIndices[0])
88 else if (VertexID == VertexIndices[1])
93 else if (VertexID == VertexIndices[2])
103 if (VertexID == VertexIndices[0])
109 else if (VertexID == VertexIndices[1])
115 else if (VertexID == VertexIndices[2])
127 if (VertexID == VertexIndices[0])
133 else if (VertexID == VertexIndices[1])
139 else if (VertexID == VertexIndices[2])
183 return TriangleIndex;
188 return VertexIndices[LocalIndex];
193 if (Normal.X == InvalidNormalMarker)
227 ++NumFaceEdgeCollisions;
232 return NumFaceEdgeCollisions;
237 mutable FVec3 Normal;
239 int32 VertexIndices[3];
240 int8 NumFaceEdgeCollisions;
286 template<
typename TriangleContactGeneratorType>
313 struct FVertexContactIndex
315 FVertexContactIndex()
332 struct FEdgeTriangleIndices
341 int32 LocalTriangleIndices[2];
344 template<
typename TriangleContactGeneratorType>
355 template<
typename TriangleContactGeneratorType>
388 const FContactEdgeID EdgeID = FContactEdgeID(VertexIndex0, VertexIndex1);
400 bool IsSharedEdge(
const FContactEdgeID& EdgeID)
const
422 if (
const FVertexContactIndex* ContactIndex = VertexContactIndicesMap.
Find(VertexID))
424 return ContactIndex->bIsFaceContact;
454 return Triangles.Num();
472 void PruneAndCorrectContacts();
473 void FixContactNormal(
const int32 ContactIndex);
474 void RemoveDisabledContacts();
475 void SortContactByPhi();
476 void SortContactsForSolverConvergence();
495 struct FEdgeTriangleIndicesMapTraits
498 static FContactEdgeID GetElementID(
const FEdgeTriangleIndices& TriangleIndices) {
return TriangleIndices.ID; }
503 struct VertexContactIndicesMapTraits
508 THashMappedArray<FContactVertexID, FVertexContactIndex, VertexContactIndicesMapTraits> VertexContactIndicesMap;
constexpr auto MakeArrayView(OtherRangeType &&Other)
Definition ArrayView.h:873
@ INDEX_NONE
Definition CoreMiscDefines.h:150
uint64 MurmurFinalize64(uint64 Hash)
Definition HashTable.h:33
uint32 MurmurFinalize32(uint32 Hash)
Definition HashTable.h:23
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
const FElementType * Find(const FIDType ID) const
Definition HashMappedArray.h:164
FORCEINLINE const TVec3< T > & GetVertex(const int32 InIndex) const
Definition Triangle.h:114
FORCEINLINE TVec3< T > GetCentroid() const
Definition Triangle.h:143
FORCEINLINE TVec3< T > GetNormal() const
Definition Triangle.h:120
Definition ArrayView.h:139
Definition BodyInstance.h:90
EConvexFeatureType
Definition ConvexFeature.h:11
FRealDouble FReal
Definition Real.h:22
int32 FContactVertexID
Definition ContactTriangles.h:159
const FName VertexIndex("VertexIndex")
Definition MeshAttributes.h:28