-------------------------------------------------------------------------------
| 164 | |
| 165 | // ------------------------------------------------------------------------------- |
| 166 | unsigned int GetMeshVFormatUnique(const aiMesh *pcMesh) { |
| 167 | ai_assert(nullptr != pcMesh); |
| 168 | |
| 169 | // FIX: the hash may never be 0. Otherwise a comparison against |
| 170 | // nullptr could be successful |
| 171 | unsigned int iRet = 1; |
| 172 | |
| 173 | // normals |
| 174 | if (pcMesh->HasNormals()) iRet |= 0x2; |
| 175 | // tangents and bitangents |
| 176 | if (pcMesh->HasTangentsAndBitangents()) iRet |= 0x4; |
| 177 | |
| 178 | |
| 179 | static_assert(8 >= AI_MAX_NUMBER_OF_COLOR_SETS, "static_assert(8 >= AI_MAX_NUMBER_OF_COLOR_SETS)"); |
| 180 | static_assert(8 >= AI_MAX_NUMBER_OF_TEXTURECOORDS, "static_assert(8 >= AI_MAX_NUMBER_OF_TEXTURECOORDS)"); |
| 181 | |
| 182 | // texture coordinates |
| 183 | unsigned int p = 0; |
| 184 | while (pcMesh->HasTextureCoords(p)) { |
| 185 | iRet |= (0x100 << p); |
| 186 | if (3 == pcMesh->mNumUVComponents[p]) |
| 187 | iRet |= (0x10000 << p); |
| 188 | |
| 189 | ++p; |
| 190 | } |
| 191 | // vertex colors |
| 192 | p = 0; |
| 193 | while (pcMesh->HasVertexColors(p)) |
| 194 | iRet |= (0x1000000 << p++); |
| 195 | return iRet; |
| 196 | } |
| 197 | |
| 198 | // ------------------------------------------------------------------------------- |
| 199 | VertexWeightTable *ComputeVertexBoneWeightTable(const aiMesh *pMesh) { |
no test coverage detected