Navigation
API > API/Runtime > API/Runtime/GeometryCore > API/Runtime/GeometryCore/DynamicMesh
References
| Module | GeometryCore |
| Header | /Engine/Source/Runtime/GeometryCore/Public/DynamicMesh/ColliderMesh.h |
| Include | #include "DynamicMesh/ColliderMesh.h" |
Syntax
class FColliderMesh
Remarks
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).
Variables
| Type | Name | Description | |
|---|---|---|---|
| TMeshAABBTree3< FColliderMesh > | AABBTree | ||
| bool | bSourceWasCompactT | ||
| bool | bSourceWasCompactV | ||
| TArray< int32 > | SourceTriangleIDs | ||
| TArray< int32 > | SourceVertexIDs | ||
| TArray< FIndex3i > | Triangles | ||
| TArray< FVector3d > | Vertices | For large meshes it might be better to optionally use TDynamicVector here (but keeping the TArray for small meshes is still also desirable due to minimum-size). |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FColliderMesh
(
const FDynamicMesh3& SourceMesh, |
Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | FindNearestHitTriangle
(
const FRay3d& Ray, |
||
| int | FindNearestTriangle
(
const FVector3d& Point, |
Find the TriangleID closest to P on the collider mesh, and distance to it, within distance MaxDist, or return InvalidID. | |
| uint64 | |||
| TMeshAABBTree3< FColliderMesh > * | Direct access to the AABBTree pointer inside the ColliderMesh. | ||
| int32 | GetSourceTriangleID
(
int32 TriangleID |
||
| int32 | GetSourceVertexID
(
int32 VertexID |
||
| FIndex3i | GetTriangle
(
int32 TriangleID |
||
| FVector3d | GetTriNormal
(
int32 TriangleID |
||
| void | GetTriVertices
(
int32 TriangleID, |
||
| FVector3d | GetVertex
(
int32 VertexID |
||
| bool | |||
| bool | |||
| void | Initialize
(
const FDynamicMesh3& SourceMesh, |
||
| bool | IsTriangle
(
int32 TriangleID |
Mesh API required for TMeshAABBTree3 | |
| bool | IsVertex
(
int32 VertexID |
||
| int32 | |||
| int32 | MaxVertexID () |
||
| void | Reset
(
bool bReleaseMemory |
||
| bool | |||
| bool | |||
| int32 | |||
| int32 | VertexCount () |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FBuildOptions |