Check that positions exist before accessing them

pull/4211/head
Max Vollmer (Microsoft Havok) 2021-11-26 13:01:38 +00:00
parent 0015823bef
commit 5e1188c44e
1 changed files with 3 additions and 1 deletions

View File

@ -135,7 +135,9 @@ public:
/** Extract a particular vertex from a anim mesh and interleave all components */
explicit Vertex(const aiAnimMesh* msh, unsigned int idx) {
ai_assert(idx < msh->mNumVertices);
position = msh->mVertices[idx];
if (msh->HasPositions()) {
position = msh->mVertices[idx];
}
if (msh->HasNormals()) {
normal = msh->mNormals[idx];