Initial support of multi-materials per group.

Introduce material_id attribute per face.
This commit is contained in:
Syoyo Fujita
2014-09-13 23:49:25 +09:00
parent 33cd9a4768
commit cbba0a807e
3 changed files with 20 additions and 17 deletions

View File

@@ -229,7 +229,7 @@ exportFaceGroupToShape(
const std::vector<float> &in_normals,
const std::vector<float> &in_texcoords,
const std::vector<std::vector<vertex_index> >& faceGroup,
const int material,
const int material_id,
const std::string &name,
bool clearCache)
{
@@ -263,19 +263,14 @@ exportFaceGroupToShape(
shape.mesh.indices.push_back(v0);
shape.mesh.indices.push_back(v1);
shape.mesh.indices.push_back(v2);
shape.mesh.material_ids.push_back(material_id);
}
}
//
// Construct shape.
//
shape.submeshes.push_back(std::pair<int, int>(offset, shape.mesh.indices.size()-offset));
shape.name = name;
shape.materials.push_back(material);
if (clearCache)
vertexCache.clear();