Merge pull request #413 from jdduke/fix_ns_obj_material

Support lowercase 'ns' and 'ni' obj material tokens
pull/415/head
Kim Kulling 2014-11-19 10:23:20 +01:00
commit 7be4badd76
1 changed files with 8 additions and 13 deletions

View File

@ -166,25 +166,27 @@ void ObjFileMtlImporter::load()
}
break;
case 'N': // Shineness
case 'N':
case 'n':
{
++m_DataIt;
switch(*m_DataIt)
switch(*m_DataIt)
{
case 's':
case 's': // Specular exponent
++m_DataIt;
getFloatValue(m_pModel->m_pCurrentMaterial->shineness);
break;
case 'i': //Index Of refraction
case 'i': // Index Of refraction
++m_DataIt;
getFloatValue(m_pModel->m_pCurrentMaterial->ior);
break;
case 'e': // New material
createMaterial();
break;
}
m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
break;
}
break;
case 'm': // Texture
case 'b': // quick'n'dirty - for 'bump' sections
@ -194,13 +196,6 @@ void ObjFileMtlImporter::load()
}
break;
case 'n': // New material name
{
createMaterial();
m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
}
break;
case 'i': // Illumination model
{
m_DataIt = getNextToken<DataArrayIt>(m_DataIt, m_DataItEnd);