------------------------------------------------------------------------------- @brief Get a pseudo(!)-hash representing a mesh. * * The hash is built from number of vertices, faces, primitive types, * .... but *not* from the real mesh data. The funcction is not a perfect hash. * @param in Input mesh * @return Hash. */
| 61 | * @return Hash. |
| 62 | */ |
| 63 | inline uint64_t GetMeshHash(aiMesh* in) { |
| 64 | ai_assert(nullptr != in); |
| 65 | |
| 66 | // ... get an unique value representing the vertex format of the mesh |
| 67 | const unsigned int fhash = GetMeshVFormatUnique(in); |
| 68 | |
| 69 | // and bake it with number of vertices/faces/bones/matidx/ptypes |
| 70 | return ((uint64_t)fhash << 32u) | (( |
| 71 | (in->mNumBones << 16u) ^ (in->mNumVertices) ^ |
| 72 | (in->mNumFaces<<4u) ^ (in->mMaterialIndex<<15) ^ |
| 73 | (in->mPrimitiveTypes<<28)) & 0xffffffff ); |
| 74 | } |
| 75 | |
| 76 | // ------------------------------------------------------------------------------- |
| 77 | /** @brief Perform a component-wise comparison of two arrays |
no test coverage detected