| 71 | |
| 72 | template <typename VertexType, typename IndexType> |
| 73 | int SaveMeshAsOBJComplex(const FString& FilePath, const Chaos::TArrayCollectionArray<VertexType>& Vertices, |
| 74 | const TArray<Chaos::TVector<IndexType, 3>>& Indices, float Threshold = 0.05f) |
| 75 | { |
| 76 | CoACD_Mesh inputMesh = CoacdInterface::ConvertToCoACDMesh(Vertices, Indices); |
| 77 | |
| 78 | CoACD_MeshArray result = CoACD_run(inputMesh, Threshold, -1, preprocess_auto, 30, 1000, 20, 150, 3, false, true, false, 100, |
| 79 | false, 0.01, apx_ch, 0, false); |
| 80 | int MeshCount = result.meshes_count; |
| 81 | |
| 82 | UE_LOG(LogURLab, Log, TEXT("CoACD: %d convex hulls created (threshold=%.3f)"), result.meshes_count, Threshold); |
| 83 | |
| 84 | CoacdInterface::SaveCoACDMeshArrayAsOBJ(result, FilePath); |
| 85 | CoACD_freeMeshArray(result); |
| 86 | return MeshCount; |
| 87 | } |
| 88 | |
| 89 | template <typename VertexType, typename IndexType> |
| 90 | int SaveMesh(const FString& FilePath, const Chaos::TArrayCollectionArray<VertexType>& Vertices, |
no test coverage detected