MCPcopy Create free account
hub / github.com/assimp/assimp / buildBacksideOfFace

Function buildBacksideOfFace

code/AssetLib/AC/ACLoader.cpp:143–156  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------ 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).

Source from the content-addressed store, hash-verified

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).
143static 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

Callers 1

ConvertObjectSectionMethod · 0.85

Calls 1

flipWindingOrderFunction · 0.85

Tested by

no test coverage detected