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

Function appendNewMeshesToScene

code/PostProcessing/PretransformVertices.cpp:411–426  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

409
410// ------------------------------------------------------------------------------------------------
411static void appendNewMeshesToScene(aiScene *pScene, std::vector<aiMesh*> &apcOutMeshes) {
412 ai_assert(pScene != nullptr);
413
414 if (apcOutMeshes.empty()) {
415 return;
416 }
417
418 aiMesh **npp = new aiMesh *[pScene->mNumMeshes + apcOutMeshes.size()];
419
420 ::memcpy(npp, pScene->mMeshes, sizeof(aiMesh *) * pScene->mNumMeshes);
421 ::memcpy(npp + pScene->mNumMeshes, &apcOutMeshes[0], sizeof(aiMesh *) * apcOutMeshes.size());
422
423 pScene->mNumMeshes += static_cast<unsigned int>(apcOutMeshes.size());
424 delete[] pScene->mMeshes;
425 pScene->mMeshes = npp;
426}
427
428// ------------------------------------------------------------------------------------------------
429// Executes the post processing step on the given imported data.

Callers 1

ExecuteMethod · 0.85

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected