Allow several spaces between numbers in OBJ files.
parent
3e9fab3bfc
commit
36c82fe5b0
|
@ -113,8 +113,8 @@ void ObjFileParser::parseFile()
|
||||||
getVector3(m_pModel->m_Vertices);
|
getVector3(m_pModel->m_Vertices);
|
||||||
} else if (*m_DataIt == 't') {
|
} else if (*m_DataIt == 't') {
|
||||||
// read in texture coordinate ( 2D or 3D )
|
// read in texture coordinate ( 2D or 3D )
|
||||||
++m_DataIt;
|
++m_DataIt;
|
||||||
getVector( m_pModel->m_TextureCoord );
|
getVector( m_pModel->m_TextureCoord );
|
||||||
} else if (*m_DataIt == 'n') {
|
} else if (*m_DataIt == 'n') {
|
||||||
// Read in normal vector definition
|
// Read in normal vector definition
|
||||||
++m_DataIt;
|
++m_DataIt;
|
||||||
|
@ -234,11 +234,17 @@ void ObjFileParser::copyNextLine(char *pBuffer, size_t length)
|
||||||
void ObjFileParser::getVector( std::vector<aiVector3D> &point3d_array ) {
|
void ObjFileParser::getVector( std::vector<aiVector3D> &point3d_array ) {
|
||||||
size_t numComponents( 0 );
|
size_t numComponents( 0 );
|
||||||
DataArrayIt tmp( m_DataIt );
|
DataArrayIt tmp( m_DataIt );
|
||||||
while( !IsLineEnd( *tmp ) ) {
|
while( true ) {
|
||||||
if( *tmp == ' ' ) {
|
while( isspace(*tmp) && !IsLineEnd(*tmp) ) {
|
||||||
++numComponents;
|
tmp++;
|
||||||
}
|
}
|
||||||
tmp++;
|
if( IsLineEnd(*tmp) ) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
while( !isspace(*tmp) ) {
|
||||||
|
tmp++;
|
||||||
|
}
|
||||||
|
++numComponents;
|
||||||
}
|
}
|
||||||
float x, y, z;
|
float x, y, z;
|
||||||
if( 2 == numComponents ) {
|
if( 2 == numComponents ) {
|
||||||
|
|
Loading…
Reference in New Issue