Fixed the mesh addition
This commit is contained in:
parent
b0038182e6
commit
714850c4f9
|
@ -257,6 +257,10 @@ namespace geom {
|
|||
return _indexes;
|
||||
}
|
||||
|
||||
size_t Mesh::GetIndexesNum() const {
|
||||
return _indexes.size();
|
||||
}
|
||||
|
||||
const std::vector<Mesh::uv_type> &Mesh::GetUVs() const {
|
||||
return _uvs;
|
||||
}
|
||||
|
@ -271,6 +275,7 @@ namespace geom {
|
|||
|
||||
Mesh &Mesh::operator+=(const Mesh &rhs) {
|
||||
const size_t v_num = GetVerticesNum();
|
||||
const size_t i_num = GetIndexesNum();
|
||||
|
||||
_vertices.insert(
|
||||
_vertices.end(),
|
||||
|
@ -298,8 +303,8 @@ namespace geom {
|
|||
rhs.GetMaterials().end(),
|
||||
std::back_inserter(_materials),
|
||||
[=](MeshMaterial mat) {
|
||||
mat.index_start += v_num;
|
||||
mat.index_end += v_num;
|
||||
mat.index_start += i_num;
|
||||
mat.index_end += i_num;
|
||||
return mat;
|
||||
});
|
||||
|
||||
|
|
|
@ -125,6 +125,8 @@ namespace geom {
|
|||
|
||||
const std::vector<index_type> &GetIndexes() const;
|
||||
|
||||
size_t GetIndexesNum() const;
|
||||
|
||||
const std::vector<uv_type> &GetUVs() const;
|
||||
|
||||
const std::vector<material_type> &GetMaterials() const;
|
||||
|
|
Loading…
Reference in New Issue