Sign 'o life: simple usdc cube loads

TODO: faces incorrect
pull/5522/head
Steve M 2024-03-30 09:36:29 -07:00
parent 847859e47d
commit 8e9f3f533e
1 changed files with 9 additions and 0 deletions

View File

@ -120,6 +120,15 @@ void USDImporterImplTinyusdz::verticesForMesh(
pScene->mMeshes[meshIdx]->mVertices[j].y = render_scene.meshes[meshIdx].points[j][1];
pScene->mMeshes[meshIdx]->mVertices[j].z = render_scene.meshes[meshIdx].points[j][2];
}
pScene->mMeshes[meshIdx]->mNumFaces = render_scene.meshes[meshIdx].faceVertexCounts.size();
pScene->mMeshes[meshIdx]->mFaces = new aiFace[pScene->mMeshes[meshIdx]->mNumFaces]();
for (size_t i = 0; i < pScene->mMeshes[meshIdx]->mNumFaces; ++i) {
pScene->mMeshes[meshIdx]->mFaces[i].mNumIndices = render_scene.meshes[meshIdx].faceVertexIndices.size();
pScene->mMeshes[meshIdx]->mFaces[i].mIndices = new unsigned int[pScene->mMeshes[meshIdx]->mFaces[i].mNumIndices];
for (size_t j = 0; j < pScene->mMeshes[meshIdx]->mFaces[i].mNumIndices; ++j) {
pScene->mMeshes[meshIdx]->mFaces[i].mIndices[j] = render_scene.meshes[meshIdx].faceVertexIndices[j];
}
}
}
} // namespace Assimp