Fix collada

pull/298/head
Madrich 2014-06-07 21:17:31 +02:00
parent ec2ce90654
commit 77cec96d74
1 changed files with 11 additions and 1 deletions

View File

@ -354,7 +354,8 @@ void ColladaExporter::WriteTextureColorEntry( const Surface& pSurface, const std
if( pSurface.texture.empty() ) if( pSurface.texture.empty() )
{ {
mOutput << startstr << "<color sid=\"" << pTypeName << "\">" << pSurface.color.r << " " << pSurface.color.g << " " << pSurface.color.b << " " << pSurface.color.a << "</color>" << endstr; mOutput << startstr << "<color sid=\"" << pTypeName << "\">" << pSurface.color.r << " " << pSurface.color.g << " " << pSurface.color.b << " " << pSurface.color.a << "</color>" << endstr;
} else }
else
{ {
mOutput << startstr << "<texture texture=\"" << pImageName << "\" texcoord=\"CHANNEL" << pSurface.channel << "\" />" << endstr; mOutput << startstr << "<texture texture=\"" << pImageName << "\" texcoord=\"CHANNEL" << pSurface.channel << "\" />" << endstr;
} }
@ -673,9 +674,18 @@ void ColladaExporter::WriteGeometry( size_t pIndex)
{ {
const aiFace& face = mesh->mFaces[a]; const aiFace& face = mesh->mFaces[a];
if (face.mNumIndices != 3) continue; if (face.mNumIndices != 3) continue;
// write vertix indices
for( size_t b = 0; b < face.mNumIndices; ++b ) for( size_t b = 0; b < face.mNumIndices; ++b )
{
mOutput << face.mIndices[b] << " "; mOutput << face.mIndices[b] << " ";
} }
// write normal indices
for( size_t b = 0; b < face.mNumIndices; ++b )
{
mOutput << face.mIndices[b] << " ";
}
}
mOutput << "</p>" << endstr; mOutput << "</p>" << endstr;
PopTag(); PopTag();
mOutput << startstr << "</triangles>" << endstr; mOutput << startstr << "</triangles>" << endstr;