MCPcopy Create free account
hub / github.com/URLab-Sim/UnrealRoboticsLab / ComputeMeshHash

Function ComputeMeshHash

Source/URLab/Public/Utils/IO.h:35–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33/** Compute an MD5 hash string from raw vertex + index data. */
34template <typename VertexType, typename IndexType>
35inline FString ComputeMeshHash(const TArray<VertexType>& Vertices, const TArray<IndexType>& Indices)
36{
37 FMD5 Md5;
38 if (Vertices.Num() > 0)
39 {
40 Md5.Update((const uint8*)Vertices.GetData(), Vertices.Num() * sizeof(VertexType));
41 }
42 if (Indices.Num() > 0)
43 {
44 Md5.Update((const uint8*)Indices.GetData(), Indices.Num() * sizeof(IndexType));
45 }
46 FMD5Hash Hash;
47 Hash.Set(Md5);
48 return LexToString(Hash);
49}
50
51/** Save a hash string to a .hash file alongside the OBJ. */
52inline void SaveMeshHash(const FString& ObjFilePath, const FString& Hash)

Callers 2

DecomposeMeshMethod · 0.85
PrepareMeshForMuJoCoMethod · 0.85

Calls 1

GetDataMethod · 0.80

Tested by 1

PrepareMeshForMuJoCoMethod · 0.68