git-svn-id: svn://db.shs.com.ru/libs@657 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -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) {
|
void Mesh::append(const Mesh * m) {
|
||||||
if (!m) return;
|
if (!m) return;
|
||||||
if (m->isEmpty()) return;
|
if (m->isEmpty()) return;
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ public:
|
|||||||
void rotatePoints (const double & angle, const QVector3D & a);
|
void rotatePoints (const double & angle, const QVector3D & a);
|
||||||
void rotatePoints (const double & angle, const double & x, const double & y, const double & z) {rotatePoints(angle, QVector3D(x, y, z));}
|
void rotatePoints (const double & angle, const double & x, const double & y, const double & z) {rotatePoints(angle, QVector3D(x, y, z));}
|
||||||
void transformPoints(const QMatrix4x4 & mat);
|
void transformPoints(const QMatrix4x4 & mat);
|
||||||
|
void flipNormals();
|
||||||
void append(const Mesh * m);
|
void append(const Mesh * m);
|
||||||
|
|
||||||
bool saveToFile(const QString & filename);
|
bool saveToFile(const QString & filename);
|
||||||
|
|||||||
Reference in New Issue
Block a user