------------------------------------------------------------------------------------------------ Duplicates a face and inverts it. Also duplicates all vertices (so the new face gets its own set of normals and isn’t smoothed against the original).
| 141 | // Duplicates a face and inverts it. Also duplicates all vertices (so the new face gets its own |
| 142 | // set of normals and isn’t smoothed against the original). |
| 143 | static void buildBacksideOfFace(const aiFace &origFace, aiFace *&outFaces, aiVector3D *&outVertices, const aiVector3D *allVertices, |
| 144 | aiVector3D *&outUV, const aiVector3D *allUV, unsigned &curIdx) { |
| 145 | auto &newFace = *outFaces++; |
| 146 | newFace = origFace; |
| 147 | flipWindingOrder(newFace); |
| 148 | for (unsigned f = 0; f < newFace.mNumIndices; ++f) { |
| 149 | *outVertices++ = allVertices[newFace.mIndices[f]]; |
| 150 | if (outUV) { |
| 151 | *outUV = allUV[newFace.mIndices[f]]; |
| 152 | outUV++; |
| 153 | } |
| 154 | newFace.mIndices[f] = curIdx++; |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | // ------------------------------------------------------------------------------------------------ |
| 159 | // Constructor to be privately used by Importer |
no test coverage detected