Navigation
API > API/Runtime > API/Runtime/Chaos
Convex half-edge structure data. Uses indices rather than pointers. Supports different index sizes.
| Name | TConvexHalfEdgeStructureData |
| Type | class |
| Header File | /Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/ConvexHalfEdgeStructureData.h |
| Include Path | #include "Chaos/ConvexHalfEdgeStructureData.h" |
Syntax
template<typename T_INDEX>
class TConvexHalfEdgeStructureData
Structs
| Name | Remarks |
|---|---|
| FHalfEdgeData | Every plane is bounded by a sequence of edges, and every edge should be shared by two planes. |
| FPlaneData | A plane of a convex hull. |
| FVertexData | A vertex of a convex hull. |
| FVertexHalfEdges | List of 3 halfedges per vertex for regular convexes |
| FVertexPlanes | We cache 3 planes per vertex since this is the most common request and a major bottleneck in GJK (SupportCoreScaled -> GetMarginAdjustedVertexScaled -> FindVertexPlanes |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FConvexHalfEdgeStructureData | TConvexHalfEdgeStructureData< T_INDEX > | Chaos/ConvexHalfEdgeStructureData.h | |
| FIndex | T_INDEX | Chaos/ConvexHalfEdgeStructureData.h | |
| FIndexTraits | TConvexStructureIndexTraits< T_INDEX > | Chaos/ConvexHalfEdgeStructureData.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| InvalidIndex | const FIndex | Chaos/ConvexHalfEdgeStructureData.h | |
| MaxIndex | const int32 | Chaos/ConvexHalfEdgeStructureData.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Edges | TArray< FIndex > | Chaos/ConvexHalfEdgeStructureData.h | ||
| HalfEdges | TArray< FHalfEdgeData > | Chaos/ConvexHalfEdgeStructureData.h | ||
| Planes | TArray< FPlaneData > | Chaos/ConvexHalfEdgeStructureData.h | ||
| VertexPlanes | TArray< FVertexPlanes > | Chaos/ConvexHalfEdgeStructureData.h | ||
| Vertices | TArray< FVertexData > | Chaos/ConvexHalfEdgeStructureData.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Build half edge structure datas for regular convexes with exactly 3 faces per vertex. | Chaos/ConvexHalfEdgeStructureData.h | ||
int32 FindVertexPlanes
(
int32 VertexIndex, |
Fill an array with plane indices for the specified vertex. Return the number of planes found. | Chaos/ConvexHalfEdgeStructureData.h | |
int32 GetEdgePlane
(
int32 EdgeIndex, |
Get a plane for the specified Edge (NOTE: edge index, not half-edge index) EdgeIndex must be in range [0, NumEdges()) EdgePlaneIndex must be 0 or 1 return value is in range [0, NumPlanes()) | Chaos/ConvexHalfEdgeStructureData.h | |
int32 GetEdgeVertex
(
int32 EdgeIndex, |
Get a vertex in the specified Edge (NOTE: edge index, not half-edge index) EdgeIndex must be in range [0, NumEdges()) EdgeVertexIndex must be 0 or 1 return value is in range [0, NumVertices()) | Chaos/ConvexHalfEdgeStructureData.h | |
const FHalfEdgeData & GetHalfEdge
(
int32 HalfEdgeIndex |
Chaos/ConvexHalfEdgeStructureData.h | ||
FHalfEdgeData & GetHalfEdge
(
int32 HalfEdgeIndex |
Chaos/ConvexHalfEdgeStructureData.h | ||
int32 GetHalfEdgeIndex
(
int32 EdgeIndex |
Chaos/ConvexHalfEdgeStructureData.h | ||
int32 GetHalfEdgePlane
(
int32 HalfEdgeIndex |
HalfEdgeIndex must be in range [0, NumHalfEdges()) return value is in range [0, NumPlanes()) | Chaos/ConvexHalfEdgeStructureData.h | |
int32 GetHalfEdgeVertex
(
int32 HalfEdgeIndex |
HalfEdgeIndex must be in range [0, NumHalfEdges()) return value is in range [0, NumVertices()) | Chaos/ConvexHalfEdgeStructureData.h | |
int32 GetNextHalfEdge
(
int32 HalfEdgeIndex |
Get the next half edge on the same plane HalfEdgeIndex must be in range [0, NumHalfEdges()) return value is in range [0, NumHalfEdges()) | Chaos/ConvexHalfEdgeStructureData.h | |
const FPlaneData & GetPlane
(
int32 PlaneIndex |
Chaos/ConvexHalfEdgeStructureData.h | ||
FPlaneData & GetPlane
(
int32 PlaneIndex |
Chaos/ConvexHalfEdgeStructureData.h | ||
int32 GetPlaneHalfEdge
(
int32 PlaneIndex, |
The edge index of one of the bounding edges of a plane PlaneIndex must be in range [0, NumPlanes()) PlaneEdgeIndex must be in range [0, NumPlaneHalfEdges(PlaneIndex)) return value is in range [0, NumHalfEdges()) | Chaos/ConvexHalfEdgeStructureData.h | |
int32 GetPlaneVertex
(
int32 PlaneIndex, |
Get the index of one of the vertices bounding the specified plane PlaneIndex must be in range [0, NumPlanes()) PlaneVertexIndex must be in [0, NumPlaneVertices(PlaneIndex)) return value is in [0, NumVertices()) | Chaos/ConvexHalfEdgeStructureData.h | |
int32 GetPrevHalfEdge
(
int32 HalfEdgeIndex |
Get the previous half edge on the same plane HalfEdgeIndex must be in range [0, NumHalfEdges()) return value is in range [0, NumHalfEdges()) | Chaos/ConvexHalfEdgeStructureData.h | |
int32 GetTwinHalfEdge
(
int32 HalfEdgeIndex |
HalfEdgeIndex must be in range [0, NumHalfEdges()) return value is in range [0, NumHalfEdges()) | Chaos/ConvexHalfEdgeStructureData.h | |
const FVertexData & GetVertex
(
int32 VertexIndex |
Chaos/ConvexHalfEdgeStructureData.h | ||
FVertexData & GetVertex
(
int32 VertexIndex |
Chaos/ConvexHalfEdgeStructureData.h | ||
int32 GetVertexFirstHalfEdge
(
int32 VertexIndex |
VertexIndex must be in range [0, NumVertices()) return value is in range [0, NumHalfEdges()) | Chaos/ConvexHalfEdgeStructureData.h | |
int32 GetVertexPlanes3
(
int32 VertexIndex, |
Chaos/ConvexHalfEdgeStructureData.h | ||
bool IsValid() |
Chaos/ConvexHalfEdgeStructureData.h | ||
int32 NumEdges() |
Number of unique half-edges (no half edge's twin is in also the list). Should be NumHalfEdges/2. | Chaos/ConvexHalfEdgeStructureData.h | |
int32 NumHalfEdges() |
Chaos/ConvexHalfEdgeStructureData.h | ||
int32 NumPlaneHalfEdges
(
int32 PlaneIndex |
The number of edges bounding the specified plane. | Chaos/ConvexHalfEdgeStructureData.h | |
int32 NumPlanes() |
Chaos/ConvexHalfEdgeStructureData.h | ||
int32 NumPlaneVertices
(
int32 PlaneIndex |
The number of vertices that bound the specified plane (same as number of half edges) PlaneIndex must be in range [0, NumPlaneHalfEdges(PlaneIndex)) | Chaos/ConvexHalfEdgeStructureData.h | |
int32 NumVertices() |
Chaos/ConvexHalfEdgeStructureData.h | ||
void Serialize
(
FArchive& Ar |
Chaos/ConvexHalfEdgeStructureData.h | ||
bool SetPlaneVertices
(
const TArray< TArray< int32 > >& InPlaneVertices, |
Initialize the structure data from the set of vertices associated with each plane. | Chaos/ConvexHalfEdgeStructureData.h | |
void VisitPlaneEdges
(
int32 PlaneIndex, |
Iterate over the edges associated with a plane. | Chaos/ConvexHalfEdgeStructureData.h | |
void VisitVertexHalfEdges
(
int32 VertexIndex, |
Iterate over the half-edges associated with a vertex (leading out from the vertex, so all half edges have the vertex as the root). | Chaos/ConvexHalfEdgeStructureData.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Return true if we can support this convex, based on number of features and maximum index size. | Chaos/ConvexHalfEdgeStructureData.h | ||
| Initialize the structure data from the array of vertex indices per plane (in CW or CCW order - it is retained in structure) If this fails for some reason, the structure data will be invalid (check IsValid()) | Chaos/ConvexHalfEdgeStructureData.h |