![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <CachingMeshSDF.h>
Public Types | |
| enum | EInsideModes { CrossingCount = 0 , WindingCount = 1 } |
Public Member Functions | |
| TCachingMeshSDF (float CellSizeIn=10) | |
| TCachingMeshSDF (const TriangleMeshType *MeshIn, float CellSizeIn, const TMeshAABBTree3< TriangleMeshType > *SpatialIn, bool bAutoBuild) | |
| bool | Validate () |
| void | Initialize () |
| void | CleanupUnwanted () |
| float | GetValue (FVector3i Idx) |
| TTriLinearGridInterpolant< TCachingMeshSDF > | MakeInterpolant () |
| FVector3i | Dimensions () |
| const FDenseGrid3f & | GetGrid () const |
| const FVector3f & | GetGridOrigin () const |
| const FDenseGrid3i & | GetClosestTriGrid () const |
| const FDenseGrid3i & | GetIntersectionsGrid () const |
| float | At (int I, int J, int K) const |
| constexpr const float | operator[] (FVector3i Idx) const |
| FVector3f | CellCenter (int I, int J, int K) |
Static Public Member Functions | |
| static int | Orientation (double X1, double Y1, double X2, double Y2, double &TwiceSignedArea) |
| static bool | PointInTriangle2d (double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3, double &A, double &B, double &C) |
Public Attributes | |
| const TriangleMeshType * | Mesh |
| const TMeshAABBTree3< TriangleMeshType > * | Spatial |
| float | CellSize |
| FVector3d | ExpandBounds = FVector3d::Zero() |
| float | MaxOffsetDistance = 0 |
| bool | bUseParallel = true |
| bool | bComputeSigns = true |
| int | ApproxMaxCellsPerDimension = 4096 |
| EInsideModes | InsideMode = EInsideModes::WindingCount |
| bool | bWantClosestTriGrid = false |
| bool | bWantIntersectionsGrid = false |
| TFunction< bool(void)> | CancelF = []() { return false; } |
| FVector3f | GridOrigin |
| FDenseGrid3f | Grid |
| FDenseGrid3i | ClosestTriGrid |
| FDenseGrid3i | IntersectionsGrid |
Protected Attributes | |
| float | UpperBoundDistance |
| double | MaxDistQueryDist |
This is variant of TSweepingMeshSDF that does lazy evaluation of actual Distances, using mesh spatial data structure. This is much faster if we are doing continuation-method marching cubes as only values on surface will be computed!
Compute discretely-sampled (I.e. gridded) signed distance field for a mesh only within a narrow band of the surface (within MaxDistQueryDist = MaxOffsetDistance + (2 * CellSize * FMathf::Sqrt2))
This code is based on the implementation found at https://github.com/christopherbatty/SDFGen
| enum UE::Geometry::TCachingMeshSDF::EInsideModes |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
SDF Grid available after calling Compute()
|
inline |
Origin of the SDF Grid, in same coordinates as mesh
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineconstexpr |
|
inlinestatic |
|
inlinestatic |
|
inline |
| int UE::Geometry::TCachingMeshSDF< TriangleMeshType >::ApproxMaxCellsPerDimension = 4096 |
| bool UE::Geometry::TCachingMeshSDF< TriangleMeshType >::bComputeSigns = true |
| bool UE::Geometry::TCachingMeshSDF< TriangleMeshType >::bUseParallel = true |
| bool UE::Geometry::TCachingMeshSDF< TriangleMeshType >::bWantClosestTriGrid = false |
| bool UE::Geometry::TCachingMeshSDF< TriangleMeshType >::bWantIntersectionsGrid = false |
| TFunction<bool(void)> UE::Geometry::TCachingMeshSDF< TriangleMeshType >::CancelF = []() { return false; } |
if this function returns true, we should abort calculation
| float UE::Geometry::TCachingMeshSDF< TriangleMeshType >::CellSize |
| FDenseGrid3i UE::Geometry::TCachingMeshSDF< TriangleMeshType >::ClosestTriGrid |
| FVector3d UE::Geometry::TCachingMeshSDF< TriangleMeshType >::ExpandBounds = FVector3d::Zero() |
| FDenseGrid3f UE::Geometry::TCachingMeshSDF< TriangleMeshType >::Grid |
| FVector3f UE::Geometry::TCachingMeshSDF< TriangleMeshType >::GridOrigin |
| EInsideModes UE::Geometry::TCachingMeshSDF< TriangleMeshType >::InsideMode = EInsideModes::WindingCount |
| FDenseGrid3i UE::Geometry::TCachingMeshSDF< TriangleMeshType >::IntersectionsGrid |
|
protected |
| float UE::Geometry::TCachingMeshSDF< TriangleMeshType >::MaxOffsetDistance = 0 |
| const TriangleMeshType* UE::Geometry::TCachingMeshSDF< TriangleMeshType >::Mesh |
| const TMeshAABBTree3<TriangleMeshType>* UE::Geometry::TCachingMeshSDF< TriangleMeshType >::Spatial |
|
protected |