Navigation
API > API/Runtime > API/Runtime/GeometryCore
| Name | FConvexDecomposition3 |
| Type | class |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/CompGeom/ConvexDecomposition3.h |
| Include Path | #include "CompGeom/ConvexDecomposition3.h" |
Syntax
class FConvexDecomposition3
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FConvexDecomposition3
(
const FDynamicMesh3& SourceMesh, |
CompGeom/ConvexDecomposition3.h | ||
FConvexDecomposition3
(
const FDynamicMesh3& SourceMesh, |
CompGeom/ConvexDecomposition3.h | ||
| CompGeom/ConvexDecomposition3.h |
Structs
| Name | Remarks |
|---|---|
| FConvexPart | Representation of a convex hull in the decomposition + associated information to help further split or merge. |
| FMergeSettings | |
| FPreprocessMeshOptions | |
| FProximity | Edge in a graph of merge candidates, indicating which Decomposition parts could be merged together Note a proximity link does not guarantee that the geometry (or convex hulls) are touching |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| BiasToRemoveTooThinParts | double | A bias term to favor merging away 'too thin' parts before merging other parts, expressed as a volume in units s.t. | CompGeom/ConvexDecomposition3.h | |
| bSplitDisconnectedComponents | bool | Whether to, after each split, also detect whether a part is made up of disconnected pieces and further split them if so. | CompGeom/ConvexDecomposition3.h | |
| bTreatAsSolid | bool | Whether to treat the input mesh as a solid shape controls whether, e.g., a hole-fill is performed after splitting the mesh to close off the resulting parts. | CompGeom/ConvexDecomposition3.h | |
| ConnectedComponentTolerance | double | Threshold for considering two components to be touching. | CompGeom/ConvexDecomposition3.h | |
| ConvexEdgeAngleMoreSamplesThreshold | double | Angle at edge above which we take 5 sample planes instead of 3, to better cover the wider range (expressed in degrees) | CompGeom/ConvexDecomposition3.h | |
| ConvexEdgeAngleThreshold | double | Angle at edge above which we don't sample it as a convex edge (expressed in degrees) | CompGeom/ConvexDecomposition3.h | |
| CutLargestAxisErrorScale | double | Scale factor for error on the largest axis; slightly favoring cutting on the largest axis helps get more consistent result when no initial cut will reduce error (e.g. a torus) | CompGeom/ConvexDecomposition3.h | |
| Decomposition | TIndirectArray< FConvexPart > | All convex hulls parts in the convex decomposition Note this must be an indirect array, not a TArray, because FConvexPart holds an FDynamicMesh3 mesh, which is not trivially movable | CompGeom/ConvexDecomposition3.h | |
| DecompositionToProximity | TMultiMap< int32, int32 > | Mapping from Decomposition indices to Proximity indices. | CompGeom/ConvexDecomposition3.h | |
| MaxConvexEdgePlanes | int32 | Maximum number of convex edges to sample for possible cutting planes when calling SplitWorst() to generate an initial convex decomposition Larger values will cost more to run but can let the algorithm find a cleaner decomposition | CompGeom/ConvexDecomposition3.h | |
| OnPlaneTolerance | double | Maximum 'on plane' distance for points during planar cuts. | CompGeom/ConvexDecomposition3.h | |
| Proximities | TArray< FProximity > | All potential merge edges between Decomposition FConvexParts. | CompGeom/ConvexDecomposition3.h | |
| ProximityTolerance | double | Threshold for considering two convex parts close enough to consider merging. | CompGeom/ConvexDecomposition3.h | |
| RestrictMergeSearchToLocalAfterTestNumConnections | int32 | If > 0, search for best merges will be restricted to a greedy local search after testing this many connections. Helpful when there are many potential merges. | CompGeom/ConvexDecomposition3.h | |
| ResultTransform | FTransformSRT3d | Transform taking the result hull vertices back to the original space of the inputs; automatically applied by GetVertices() | CompGeom/ConvexDecomposition3.h | |
| ThickenAfterHullFailure | double | If greater than zero, we can 'inflate' the input shape by this amount along any degenerate axes in cases where the hull failed to construct due to the input being coplanar/colinear. | CompGeom/ConvexDecomposition3.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| NegativeSpace | FSphereCovering | Negative space to attempt to protect; can be referenced by the Decomposition parts. | CompGeom/ConvexDecomposition3.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Compact() |
Compact the decomposition representation to the minimal needed for output: Just the hull vertices and triangles, no internal geometry This will prevent some further processing on the representation; to ensure it is called only when the geometry is no longer needed, instead of calling this directly, call MergeBest with bAllowCompact=true | CompGeom/ConvexDecomposition3.h | |
void Compute
(
int32 NumOutputHulls, |
Compute a decomposition with the desired number of hulls Note: A future version of this function may replace NumOutputHulls with MaxOutputHulls, but this version keeps both parameters for compatibility / consistent behavior. | CompGeom/ConvexDecomposition3.h | |
double ConvertDistanceToleranceToLocalSpace
(
double DistTolerance |
Simple helper to convert an error tolerance expressed in world space to local space | CompGeom/ConvexDecomposition3.h | |
double ConvertDistanceToleranceToLocalVolumeTolerance
(
double DistTolerance |
Simple helper to convert an error tolerance expressed in world space to a local-space volume tolerance | CompGeom/ConvexDecomposition3.h | |
const int32 CountMergedParts() |
CompGeom/ConvexDecomposition3.h | ||
void DeleteProximity
(
TArray< int32 >&& ToRemove, |
Helper function to delete a proximity relationship, and fix index references to account for the new array ordering | CompGeom/ConvexDecomposition3.h | |
void FixHullOverlapsInNegativeSpace
(
double NegativeSpaceTolerance, |
Fix overlaps between current Decomposition and associated NegativeSpace, using the saved associations in the FConvexPart::OverlapsNegativeSpace Note the tolerance and min radius may not be the same as originally used to generate the negative space; they should just be large enough to avoid 'locking' the merge step for any hulls that still overlap negative space after splitting | CompGeom/ConvexDecomposition3.h | |
FDynamicMesh3 GetHullMesh
(
int32 HullIdx |
CompGeom/ConvexDecomposition3.h | ||
const int32 GetHullSourceID
(
int32 HullIdx |
CompGeom/ConvexDecomposition3.h | ||
const FDynamicMesh3 & GetInternalMesh
(
int32 HullIdx |
Get the non-hull geometry underlying a part of the convex decomposition. | CompGeom/ConvexDecomposition3.h | |
const FSphereCovering & GetNegativeSpace () |
Get the current negative space tracked by the convex decomposition Note: Does not include externally-managed negative space passed to MergeBest. | CompGeom/ConvexDecomposition3.h | |
| CompGeom/ConvexDecomposition3.h | |||
| CompGeom/ConvexDecomposition3.h | |||
void InitializeFromHulls
(
int32 NumHulls, |
Initialize from convex hulls allows the caller to only use the hull merging phase of the algorithm | CompGeom/ConvexDecomposition3.h | |
void InitializeFromIndexMesh
(
TArrayView< const FVector3f > Vertices, |
Initialize convex decomposition with a triangle index mesh | CompGeom/ConvexDecomposition3.h | |
void InitializeFromIndexMesh
(
TArrayView< const FVector3f > Vertices, |
Initialize convex decomposition with a triangle index mesh | CompGeom/ConvexDecomposition3.h | |
void InitializeFromMesh
(
const FDynamicMesh3& SourceMesh, |
CompGeom/ConvexDecomposition3.h | ||
void InitializeFromMesh
(
const FDynamicMesh3& SourceMesh, |
CompGeom/ConvexDecomposition3.h | ||
bool InitializeNegativeSpace
(
const FNegativeSpaceSampleSettings& Settings, |
Find negative space that should be protected. | CompGeom/ConvexDecomposition3.h | |
void InitializeProximityFromDecompositionBoundingBoxOverlaps
(
double BoundsExpandByMinDimFactor, |
Create the proximity graph from the current decomposition, using bounding box overlaps. | CompGeom/ConvexDecomposition3.h | |
bool IsInputSolid () |
Test whether the input mesh (after preprocessing) is solid. | CompGeom/ConvexDecomposition3.h | |
int32 MergeBest
(
const FMergeSettings& Settings |
Merge the pairs of convex hulls in the decomposition that will least increase the error. | CompGeom/ConvexDecomposition3.h | |
int32 MergeBest
(
int32 TargetNumParts, |
Merge the pairs of convex hulls in the decomposition that will least increase the error. | CompGeom/ConvexDecomposition3.h | |
int32 NumHulls() |
Results | CompGeom/ConvexDecomposition3.h | |
int32 SplitWorst
(
bool bCanSkipUnreliableGeoVolumes, |
Split the worst convex part, and return the increase in the total number of convex parts after splitting (can be more than 1 if result has multiple separate connected components) Note: could return 0 if no splits were possible | CompGeom/ConvexDecomposition3.h | |
void UpdateProximitiesAfterSplit
(
int32 SplitIdx, |
Helper function to update all proximity data after splitting an FConvexPart apart | CompGeom/ConvexDecomposition3.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool ConvexPartVsSphereOverlap
(
const FConvexPart& Part, |
Tests if a convex part overlaps a sphere | CompGeom/ConvexDecomposition3.h |