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

This commit is contained in:
2019-12-06 13:12:10 +00:00
parent fa5c3e9b3d
commit 9427d429c1
2 changed files with 14 additions and 0 deletions

View File

@@ -342,6 +342,19 @@ void Mesh::transformPoints(const QMatrix4x4 & mat) {
}
void Mesh::flipNormals() {
if (vertices_.isEmpty()) return;
for (int i = 0; i < triangles_.size(); ++i)
piSwap(triangles_[i].p1, triangles_[i].p2);
for (int i = 0; i < lines_.size(); ++i)
piSwap(lines_[i].p0, lines_[i].p1);
int ncnt = normals_.size();
for (int i = 0; i < ncnt; ++i)
normals_[i] = -normals_[i];
changed = hash_changed = true;
}
void Mesh::append(const Mesh * m) {
if (!m) return;
if (m->isEmpty()) return;