From 0f40dcca7eca46e4e4c69acc75b3c80d5f91b9dd Mon Sep 17 00:00:00 2001 From: Johannes Ebersold Date: Wed, 19 Nov 2014 14:26:54 +0100 Subject: [PATCH] Add calculation for nuber of Primitives for TriStrips --- code/ColladaParser.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/ColladaParser.cpp b/code/ColladaParser.cpp index d92e5fc51..2cdebef21 100644 --- a/code/ColladaParser.cpp +++ b/code/ColladaParser.cpp @@ -2097,6 +2097,11 @@ void ColladaParser::ReadPrimitives( Mesh* pMesh, std::vector& pPer size_t numPrimitives = pNumPrimitives; if( pPrimType == Prim_TriFans || pPrimType == Prim_Polygon) numPrimitives = 1; + // For continued primitives, the given count is actually the number of

's inside the parent tag + if ( pPrimType == Prim_TriStrips){ + size_t numberOfVertices = indices.size() / numOffsets; + numPrimitives = numberOfVertices - 2; + } pMesh->mFaceSize.reserve( numPrimitives); pMesh->mFacePosIndices.reserve( indices.size() / numOffsets);