resolved conflict
This commit is contained in:
@@ -447,7 +447,7 @@ read(std::istream& _in, BaseImporter& _bi, Options& _opt)
|
|||||||
nCurrentTexcoords = 0,
|
nCurrentTexcoords = 0,
|
||||||
nCurrentNormals = 0;
|
nCurrentNormals = 0;
|
||||||
|
|
||||||
// pass 2: read vertices
|
// pass 2: read faces
|
||||||
while( _in && !_in.eof() )
|
while( _in && !_in.eof() )
|
||||||
{
|
{
|
||||||
std::getline(_in,line);
|
std::getline(_in,line);
|
||||||
@@ -616,8 +616,14 @@ read(std::istream& _in, BaseImporter& _bi, Options& _opt)
|
|||||||
// Obj counts from 1 and not zero .. array counts from zero therefore -1
|
// Obj counts from 1 and not zero .. array counts from zero therefore -1
|
||||||
vhandles.push_back(VertexHandle(value-1));
|
vhandles.push_back(VertexHandle(value-1));
|
||||||
faceVertices.push_back(VertexHandle(value-1));
|
faceVertices.push_back(VertexHandle(value-1));
|
||||||
if (fileOptions.vertex_has_color() )
|
if (fileOptions.vertex_has_color()) {
|
||||||
|
if ((unsigned int)(value - 1) < colors.size()) {
|
||||||
_bi.set_color(vhandles.back(), colors[value - 1]);
|
_bi.set_color(vhandles.back(), colors[value - 1]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
omerr() << "Error setting vertex color" << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1: // texture coord
|
case 1: // texture coord
|
||||||
@@ -668,9 +674,13 @@ read(std::istream& _in, BaseImporter& _bi, Options& _opt)
|
|||||||
// Obj counts from 1 and not zero .. array counts from zero therefore -1
|
// Obj counts from 1 and not zero .. array counts from zero therefore -1
|
||||||
if (fileOptions.vertex_has_normal() ) {
|
if (fileOptions.vertex_has_normal() ) {
|
||||||
assert(!vhandles.empty());
|
assert(!vhandles.empty());
|
||||||
assert((unsigned int)(value-1) < normals.size());
|
if ((unsigned int)(value - 1) < normals.size()) {
|
||||||
_bi.set_normal(vhandles.back(), normals[value - 1]);
|
_bi.set_normal(vhandles.back(), normals[value - 1]);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
omerr() << "Error setting vertex normal" << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user