![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <ColliderMesh.h>
Classes | |
| struct | FBuildOptions |
Protected Attributes | |
| TArray< FVector3d > | Vertices |
| TArray< FIndex3i > | Triangles |
| TArray< int32 > | SourceVertexIDs |
| bool | bSourceWasCompactV |
| TArray< int32 > | SourceTriangleIDs |
| bool | bSourceWasCompactT |
| TMeshAABBTree3< FColliderMesh > | AABBTree |
FColliderMesh is a minimal representation of an Indexed Triangle Mesh suitable to use with a TMeshAABBTree3. This class is intended to be used in situations where a copy of a FDynamicMesh3 would be created/kept only to use with an AABBTree or FWNTree. In such situations, the FDynamicMesh3 copy is (relatively) heavy memory-wise, particularly if a large number of small mesh/AABBTree pairs are stored. In those cases a FColliderMesh can be used instead.
If FBuildOptions.bBuildAABBTree is true (default), then an AABBTree will automatically be built and available via GetAABBTree()
If the source FDynamicMesh3 is not compact, it will be compacted. ID mappings can optionally be stored if the FBuildOptions are configured to request it (default false), allowing hit-triangle/vertex IDs to be mapped back to IDs on the source mesh.
Currently there is no support for UVs or Vertex Normals.
FColliderMesh (effectively) implements the TTriangleMeshAdapter interface, and so can be used anywhere a TTriangleMeshAdapter could be used (eg with TMeshQueries functions).
| FColliderMesh::FColliderMesh | ( | ) |
| FColliderMesh::FColliderMesh | ( | const FDynamicMesh3 & | SourceMesh, |
| const FBuildOptions & | BuildOptions = FBuildOptions() |
||
| ) |
| bool FColliderMesh::FindNearestHitTriangle | ( | const FRay3d & | Ray, |
| double & | RayParameterOut, | ||
| int & | HitTriangleIDOut, | ||
| FVector3d & | BaryCoordsOut, | ||
| const IMeshSpatial::FQueryOptions & | Options = IMeshSpatial::FQueryOptions() |
||
| ) | const |
| HitTriangleIDOut | TriangleID on collider mesh - use GetSourceTriangleID() to map back to source mesh |
| int FColliderMesh::FindNearestTriangle | ( | const FVector3d & | Point, |
| double & | NearestDistSqrOut, | ||
| const IMeshSpatial::FQueryOptions & | Options = IMeshSpatial::FQueryOptions() |
||
| ) | const |
Find the TriangleID closest to P on the collider mesh, and distance to it, within distance MaxDist, or return InvalidID. Use GetSourceTriangleID() to map the TriangleID back to the source mesh. Use MeshQueries.TriangleDistance() to get more information.
|
inline |
| TMeshAABBTree3< FColliderMesh > * FColliderMesh::GetRawAABBTreeUnsafe | ( | ) |
Direct access to the AABBTree pointer inside the ColliderMesh.
|
inline |
|
inline |
|
inline |
| void FColliderMesh::Initialize | ( | const FDynamicMesh3 & | SourceMesh, |
| const FBuildOptions & | BuildOptions = FBuildOptions() |
||
| ) |
|
inline |
|
inline |
|
inline |
| void FColliderMesh::Reset | ( | EAllowShrinking | AllowShrinking | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |