git-svn-id: svn://db.shs.com.ru/libs@544 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2019-06-05 08:22:01 +00:00
parent e5e1cf2c24
commit 3044caff92
10 changed files with 112 additions and 84 deletions

View File

@@ -153,15 +153,11 @@ QVector<Material> LoaderDAE::readMaterials(QDomElement le, QDomElement li, bool
if (!text.isEmpty()) mat.map_normal.bitmap_path = text;
ret << mat;
/*
qDebug() << "** Material" << mat.name;
qDebug() << " emission" << mat.color_self_illumination;
qDebug() << " diffuse" << mat.color_diffuse;
qDebug() << " diffuse" << mat.diffuse.bitmap_path;
qDebug() << " specular" << mat.color_specular;
qDebug() << " bump" << mat.bump.bitmap_path;
qDebug() << " transparency" << mat.transparency;
*/
}
return ret;
}
@@ -318,7 +314,7 @@ GLObjectBase * loadFromDAEFile(const QString & filepath, float scale) {
co->setName(name + "_" + QString::number(j));
//co->setTransform(m);
co->material() = LoaderDAE::materialByName(materials, matname);
//qDebug() << " tri" << co->material().color_diffuse << matname;
qDebug() << " tri" << co->material().name << matname;
QVector<GLfloat> & vertices(co->VBO().vertices()), & normals(co->VBO().normals()), & uvs(co->VBO().texcoords());
for (int k = 0; k < einp.count(); ++k) {
QDomElement di = einp.at(k).toElement();
@@ -366,6 +362,7 @@ GLObjectBase * loadFromDAEFile(const QString & filepath, float scale) {
if (!ml.isEmpty()) lo->intensity = ml.at(0).firstChild().nodeValue().toFloat();
ml = dn.elementsByTagName("intensity");
if (!ml.isEmpty()) lo->intensity = ml.at(0).firstChild().nodeValue().toFloat();
lo->setColor(lo->color() / lo->intensity);
QString sv;
sv = dl.firstChildElement("constant_attenuation").firstChild().nodeValue(); if (!sv.isEmpty()) lo->decay_const = sv.toFloat();
sv = dl.firstChildElement("linear_attenuation").firstChild().nodeValue(); if (!sv.isEmpty()) lo->decay_linear = sv.toFloat();