git-svn-id: svn://db.shs.com.ru/libs@624 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -214,11 +214,12 @@ GLObjectBase * loadFromOBJFile(const QString & filepath, float scale) {
|
||||
QVector<Vector3d> vertices, normals, texcoords;
|
||||
QVector<Material> materials;
|
||||
GLObjectBase * root = new GLObjectBase(), * co = nullptr;
|
||||
QString name;
|
||||
QString name, line, pline;
|
||||
root->setName(QFileInfo(f).baseName());
|
||||
int cnt = 0;
|
||||
while (!stream.atEnd()) {
|
||||
QString line = stream.readLine().trimmed();
|
||||
pline = line;
|
||||
line = stream.readLine().trimmed();
|
||||
if (line.startsWith("mtllib")) {
|
||||
materials = readMTL(filepath, line.mid(6).trimmed());
|
||||
continue;
|
||||
@@ -236,6 +237,7 @@ GLObjectBase * loadFromOBJFile(const QString & filepath, float scale) {
|
||||
continue;
|
||||
}
|
||||
if (line.startsWith("g ") || line.startsWith("o ")) {
|
||||
if (pline.mid(1) == line.mid(1)) continue;
|
||||
name = line.mid(1).trimmed();
|
||||
if (co != nullptr) {
|
||||
LoaderOBJ::initOBJMesh(co, vertices, normals, texcoords);
|
||||
|
||||
Reference in New Issue
Block a user