Add calculation for nuber of Primitives for TriStrips

pull/414/head
Johannes Ebersold 2014-11-19 14:26:54 +01:00 committed by Wolfgang Herget
parent 7c4bf383d7
commit 0f40dcca7e
1 changed files with 5 additions and 0 deletions

View File

@ -2097,6 +2097,11 @@ void ColladaParser::ReadPrimitives( Mesh* pMesh, std::vector<InputChannel>& pPer
size_t numPrimitives = pNumPrimitives; size_t numPrimitives = pNumPrimitives;
if( pPrimType == Prim_TriFans || pPrimType == Prim_Polygon) if( pPrimType == Prim_TriFans || pPrimType == Prim_Polygon)
numPrimitives = 1; numPrimitives = 1;
// For continued primitives, the given count is actually the number of <p>'s inside the parent tag
if ( pPrimType == Prim_TriStrips){
size_t numberOfVertices = indices.size() / numOffsets;
numPrimitives = numberOfVertices - 2;
}
pMesh->mFaceSize.reserve( numPrimitives); pMesh->mFaceSize.reserve( numPrimitives);
pMesh->mFacePosIndices.reserve( indices.size() / numOffsets); pMesh->mFacePosIndices.reserve( indices.size() / numOffsets);